summaryrefslogtreecommitdiff
path: root/src/shared
Commit message (Collapse)AuthorAge
...
* nsflags: add namespace_flag_to_string_many_with_check()Yu Watanabe2018-05-30
| | | | The function will be used in later commits.
* meson: use a convenience lib for journal user sourcesZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | Instead of compiling those files twice, once for libsystemd and once for libshared, compile once as a static archive and then link into both. This reduce the meson target for man=no compile to 1291.
* meson: link libsystemd_static in libshared instead of recompilingZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | This is similar to the great-grandpa commit. This time the number of meson targets compilation without man is reduced from 1347 to 1302.
* Move gcrypt-util to basic/Zbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | We were including gcrypt-util.[ch] by hand in the few places where it was used. Create a convenience library to avoid compiling the same files multiple times. v2: - use a separate static library instead of mergin into libbasic
* meson: link libbasic and libshared_static into libsharedZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | | | | gcrypt_util_sources had to be moved because otherwise they appeared twice in libshared.so halfproducts, causing an error. -fvisibility=default is added to libbasic, libshared_static so that the symbols appear properly in the exported symbol list in libshared. The advantage is that files are not compiled twice. When configured with -Dman=false, the ninja target list is reduced from 1588 to 1347 targets. The difference in compilation time is small (<10%). I think this is because of -O0 and ccache and multiple cores, and in different settings the compilation time could be reduced. The main advantage is that errors and warnings are not reported twice.
* meson: rename libsystemd_internal to libsystem_staticZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | We already use the "_static" suffix for libshared_static ("shared" is the name of the library, "static" is the format) and other libs, so let's rename for consistency. Also change libsystemd_static_sources to libsystemd_sources, since the same list is used for both and shorter is better.
* agents: use kill_and_sigcont() where appropriateLennart Poettering2018-05-30
|
* process-util: move fork_agent() to process-util.[ch]Lennart Poettering2018-05-30
| | | | | | It's a relatively small wrapper around safe_fork() now, hence let's move it over, and make its signature even more alike. Also, set a different process name for the polkit and askpw agents.
* tree-wide: introduce new safe_fork() helper and port everything overLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new safe_fork() wrapper around fork() and makes use of it everywhere. The new wrapper does a couple of things we previously did manually and separately in a safer, more correct and automatic way: 1. Optionally resets signal handlers/mask in the child 2. Sets a name on all processes we fork off right after forking off (and the patch assigns useful names for all processes we fork off now, following a systematic naming scheme: always enclosed in () – in order to indicate that these are not proper, exec()ed processes, but only forked off children, and if the process is long-running with only our own code, without execve()'ing something else, it gets am "sd-" prefix.) 3. Optionally closes all file descriptors in the child 4. Optionally sets a PR_SET_DEATHSIG to SIGTERM in the child, in a safe way so that the parent dying before this happens being handled safely. 5. Optionally reopens the logs 6. Optionally connects stdin/stdout/stderr to /dev/null 7. Debug logs about the forked off processes.
* musl_missing.h: add FTW_* macros missing from musl libc.maxice82018-04-27
|
* Prep v236 : Add missing SPDX-License-Identifier (6/9) src/sharedSven Eden2018-03-26
|
* Prep v236: Apply missing upstream updates to the build systemSven Eden2018-03-13
|
* acl: fix typo in comment (#7580)Yu Watanabe2017-12-08
|
* *: fix some inconsistent control statement styleVito Caputo2017-12-01
|
* Add set/hashmap helpers for non-trivial freeing and use where straighforwardZbigniew Jędrzejewski-Szmek2017-11-28
| | | | | | A macro is needed because otherwise we couldn't ensure type safety. Some simple tests are included. No functional change intended.
* core: implement /run/elogind/units/-based path for passing unit info from ↵Lennart Poettering2017-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PID 1 to journald And let's make use of it to implement two new unit settings with it: 1. LogLevelMax= is a new per-unit setting that may be used to configure log priority filtering: set it to LogLevelMax=notice and only messages of level "notice" and lower (i.e. more important) will be processed, all others are dropped. 2. LogExtraFields= is a new per-unit setting for configuring per-unit journal fields, that are implicitly included in every log record generated by the unit's processes. It takes field/value pairs in the form of FOO=BAR. Also, related to this, one exisiting unit setting is ported to this new facility: 3. The invocation ID is now pulled from /run/elogind/units/ instead of cgroupfs xattrs. This substantially relaxes requirements of elogind on the kernel version and the privileges it runs with (specifically, cgroupfs xattrs are not available in containers, since they are stored in kernel memory, and hence are unsafe to permit to lesser privileged code). /run/elogind/units/ is a new directory, which contains a number of files and symlinks encoding the above information. PID 1 creates and manages these files, and journald reads them from there. Note that this is supposed to be a direct path between PID 1 and the journal only, due to the special runtime environment the journal runs in. Normally, today we shouldn't introduce new interfaces that (mis-)use a file system as IPC framework, and instead just an IPC system, but this is very hard to do between the journal and PID 1, as long as the IPC system is a subject PID 1 manages, and itself a client to the journal. This patch cleans up a couple of types used in journal code: specifically we switch to size_t for a couple of memory-sizing values, as size_t is the right choice for everything that is memory. Fixes: #4089 Fixes: #3041 Fixes: #4441
* conf-parser: simplify things a bit by using strextend()Lennart Poettering2017-11-08
|
* pager: cache not only number of columns but also of lines before we open pagerLennart Poettering2017-11-10
| | | | Not that we need it, but let's do this as matter of completeness.
* Meson build system: Add missing '#' in masked blocksSven Eden2018-03-07
|
* Fix build on muslBjorn Pagen2018-03-07
| | | Before this fix, elogind did not compile on musl, as the header "musl-missing.h" tries to include a nonexistant header: "config.h". This patch fixes that. Musl compiles with no issues once this patch is administered.
* test/test-hexdecoct.c: Add include for musl_missin.h for strndupa().Sven Eden2018-01-25
| | | | | | shared/musl_missing.h: Rewrite strndupa() define to use x_ prefixed variables, so they won't shadow surronding variables of the same name.
* work-around usage of glibc-specific __register_atfork for musl systemsmaxice82018-01-24
| | | | | | | __register_atfork is glibc-specific but is roughly equivalent to pthread_atfork, add a definition of it on musl_missing.h and guard against the definition of __register_atfork on src/basic/process-util.c using #ifdef __GLIBC__
* shared/musl_missing.h: replace ifdef with if on HAVE_[__]SECURE_GETENVmaxice82018-01-24
| | | | | | | now meson defines itself on config.h HAVE_[__]SECURE_GETENV, instead of checking if it is defined, check if it set to false value. also undefine before redefining it to true.
* shared/musl_missing.h: replace ifdef HAVE_UTMP with if ENABLE_UTMPmaxice82018-01-24
| | | | | now meson defines if the feature is enabled or not, check if the feature is enabled
* Prep 235: Removed orphaned headerSven Eden2018-01-11
|
* Cleaned up orphaned filesSven Eden2017-12-11
|
* Fix various build failures with the latest systemd updates.Sven Eden2017-12-08
|
* Apply missing updates from upstreamSven Eden2017-12-08
|
* dynamic-user: don't use a UID that currently owns IPC objects (#6962)Lennart Poettering2017-12-08
| | | | | | | | | | | This fixes a mostly theoretical potential security hole: if for some reason we failed to remove IPC objects created for a dynamic user (maybe because a MAC/SElinux erronously prohibited), then we should not hand out the same UID again until they are successfully removed. With this commit we'll enumerate the IPC objects currently existing, and step away from using a UID for the dynamic UID logic if there are any matching it.
* Apply updates from upstreamSven Eden2017-12-07
|
* build-sys: use #if Y instead of #ifdef Y everywhereZbigniew Jędrzejewski-Szmek2017-11-23
| | | | | | | | | | | | | | | The advantage is that is the name is mispellt, cpp will warn us. $ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/" $ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;' $ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g' $ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g' + manual changes to meson.build squash! build-sys: use #if Y instead of #ifdef Y everywhere v2: - fix incorrect setting of HAVE_LIBIDN2
* tree-wide: use IN_SET where possibleAndreas Rammhold2017-09-29
| | | | | In addition to the changes from #6933 this handles cases that could be matched with the included cocci file.
* shared/bus-util: format uid==-1 and gid==-1 as [not set]Zbigniew Jędrzejewski-Szmek2017-09-25
| | | | | | | | | | | | | | | | $ systemctl show elogind-journald -p UID,GID UID=4294967295 GID=4294967295 ↓ $ systemctl show elogind-journald -p UID,GID UID=[not set] GID=[not set] Just seeing the number is very misleading. Fixes #6511.
* cgroup, unit, fragment parser: make use of new firewall functionsDaniel Mack2017-11-21
|
* Add abstraction model for BPF programsDaniel Mack2017-11-20
| | | | | This object takes a number of bpf_insn members and wraps them together with the in-kernel reference id. Will be needed by the firewall code.
* conf-parse: remove 4K line length limitLennart Poettering2017-09-22
| | | | | | Let's use read_line() to solve our long line limitation. Fixes #3302.
* conf-parser: when the empty string assigned to Personality= reset itLennart Poettering2017-09-14
| | | | | Let's support assigning the empty string to reset things in one more place.
* core: don't synthesize empty list when empty string is read in ↵Lennart Poettering2017-09-14
| | | | | | | | | config_parse_strv() This was added to make https://bugs.freedesktop.org/show_bug.cgi?id=62558 work, which has long been removed, hence let's revert to the original behaviour and fully flush out the list when an empty string is assigned.
* exec-util,conf-files: skip non-executable files in execute_directories()Lennart Poettering2017-09-25
| | | | Fixes: #6787
* pager: let's create pager fds with O_CLOEXEC firstLennart Poettering2017-09-13
| | | | | | | | We make copies (without O_CLOEXEC) of the fds anyway before using them, hence let's be safe and create them with O_CLOEXEC first, so that we don't run into issues should pager_open() be called in a threaded environment where another thread fork()s at the wrong time and ends up with fds not marked O_CLOEXEC.
* shared: allow to input empty string to config_parse_path()Yu Watanabe2017-09-05
| | | | Fixes #6633.
* bus-util: remove unnecessary initializationsYu Watanabe2017-08-31
|
* systemctl: show capabilities in human readable formatYu Watanabe2017-08-31
| | | | Follow-up for 21771f338d268e06dc9a10b9b08b14ff8217d4be.
* Prep 235: add missing libshared.sym and remove obsolete kdbus.hSven Eden2017-08-30
|
* shared: Add a linker script so that all functions are tagget @SD_SHARED ↵Felipe Sateler2017-08-29
| | | | | | | | | | | | instead of @Base (#6669) This helps prevent symbol collisions with other programs and libraries. In particular, because PAM modules are loaded into the process that is creating the session, and elogind creates PAM sessions, the potential for collisions is high. Disambiguate all elogind calls by tagging a 'version' SD_SHARED. Fixes #6624
* Prep v235: Update build system to fit elogindSven Eden2017-08-16
| | | | | | - Update man/rules/meson.build with elogind set of xml files. - Update documentation generating tools to fit elogind. - Follow upstream and link against libelogind-shared-<version>.so
* Prep v235: Add missing includes and dependencies.Sven Eden2017-08-14
|
* Prep v235: Apply upstream fixes (7/10) [src/shared]Sven Eden2017-08-14
|
* treewide: fix typos (#6566)Torstein Husebø2017-08-10
|
* bus-util: do not print (uint64_t) -1 as is (#6522)Yu Watanabe2017-08-10
| | | | Closes #4295 and #6511.