summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* test-sizeof: also add uid_tZbigniew Jędrzejewski-Szmek2018-05-30
| | | | We had gid_t, and pid_t, but not uid_t. Add for completeness.
* fix machinectl shell (in machined) (#7785)Shawn Landden2018-05-30
| | | | | | | | | | 4c253ed broke machined $machinectl shell arch Failed to get shell PTY: Input/output error Closes: #7779 v2: do not drop DEATHSIG flag
* nsflags: add namespace_flag_to_string_many_with_check()Yu Watanabe2018-05-30
| | | | The function will be used in later commits.
* basic: introduce *_to_string_with_check() functionsYu Watanabe2018-05-30
| | | | They are used in later commits.
* socket-util: introduce parse_socket_address_bind_ipv6_only_or_bool()Yu Watanabe2018-05-30
|
* core: add dbus-util.[ch] to simplify creating transient unitsYu Watanabe2018-05-30
| | | | The functions and macros introduced by them will be used in later commits.
* meson: rename libudev_internal to libudev_static and link into libudevZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | | | This reduces the meson man=false target count to 1281. v2: - link test-engine with libshared instead of libsystemd_static Previous version built fine on F27, but fails on F26 with the following error: /usr/bin/ld: /tmp/ccr8HRGw.ltrans6.ltrans.o: undefined reference to symbol '__start_BUS_ERROR_MAP@@SD_SHARED' /home/zbyszek/fedora/systemd/systemd-9d5aae75c64f5583a110f03b94816aacc03bbf4d/x86_64-redhat-linux-gnu/src/shared/libsystemd-shared-236.so: error adding symbols: DSO missing from command line v3: - add libudev_basic
* 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.
* basic: detect_vm_cpuid: fix hypervisor detectionMike Gilbert2018-05-30
| | | | | | | | | | | | | The __get_cpuid() function only calls __cpuid() if __get_cpuid_max() returns a value that is less than or equal to the leaf value. In QEMU/KVM, I found that the special hypervisor leaf value (0x40000000U) is always larger than the value retured by __get_cpuid_max(). Avoid this problem by calling the __cpuid() macro directly once we have checked the hypervisor bit from leaf 1. Fixes: d31b0033b7743393562a2e9d3c1e74afea981c13
* fileio: write_string_stream_ts: check for file errors immediatelyMike Gilbert2018-05-30
|
* fileio: write_string_stream_ts: return errors from fputs and fputcMike Gilbert2018-05-30
| | | | | | | Ignoring errors from these functions may mask errors returned by the kernel. Fixes: https://github.com/systemd/systemd/issues/7744
* basic: detect_vm_cpuid: use gcc's __get_cpuid() function (#7758)Mike Gilbert2018-05-30
| | | | | | | | | The __get_cpuid() function includes a safety check to ensure that executing the cpuid instruction is valid/safe. This method also works with clang. https://lists.freedesktop.org/archives/systemd-devel/2017-December/040054.html
* sd-daemon: use sockaddr_port() helperLennart Poettering2018-05-30
|
* socket-util: clarify why sockaddr_port returns unsigned rather than uint16_tLennart Poettering2018-05-30
|
* condition: extend ConditionKernelVersion= with relative version checksLennart Poettering2018-05-30
| | | | | Now that we have str_verscmp() in our source tree anyway, let's make it generic and reuse it for ConditionKernelVersion=.
* process-util: debug log if PR_SET_NAME fails.Lennart Poettering2018-05-30
|
* process-util: allow rename_process() only in the main threadLennart Poettering2018-05-30
| | | | | | | | | We make assumptions about the comm name we set via PR_SET_NAME: that it would reflect the process name, but that's only the case for the main thread. Moreover, we cache the mmap() region without locking. Let's hence be safe rather than sorry and support all this only in the main thread.
* basic: split out blockdev-util.[ch] from util.hLennart Poettering2018-05-30
| | | | With three functions it makes sense to split this out now.
* 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: use EXIT_SUCCESS/EXIT_FAILURE in exit() where we canLennart Poettering2018-05-30
|
* 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.
* terminal-util: open /dev/null with O_CLOEXEC in make_stdio_null()Lennart Poettering2018-05-30
| | | | | | | | | | Ultimately, O_CLOEXEC should be off in fd 0, 1, 2, but when we open /dev/null here it's unlikely to be < 0, and after dupping the fd to 0, 1, 2 we turn off O_CLOEXEC explicitly anyway. Unless we know that what we are about to open will return 0, 1 or 2 we should always set O_CLOEXEC in order to be safe to other threads forking of subprocesses at the wrong moment.
* terminal-util: return first error, not last in make_stdio()Lennart Poettering2018-05-30
| | | | | | | | Just a minor tweak, making sure we execute as much as we can of the funciton, but return the first error instead of the last we encounter. This is usuelly how we do things when we have functions that continue on the first error, so let's do it like that here too.
* fd-util: use close_nointr() return value instead of errnoLennart Poettering2018-05-30
| | | | | Our own calls return errors in their return values, hence use that rather than errno when checking errors.
* fd-util: add some (void) castsLennart Poettering2018-05-30
|
* separate flags from shebangbleep_blop2018-05-30
|
* Move mkdir_label() to mkdir-label.cZbigniew Jędrzejewski-Szmek2018-05-30
| | | | It just seems strange to have it in a different file if mkdir-label.c exists.
* smack-util: remove unneeded initalizationZbigniew Jędrzejewski-Szmek2018-05-30
|
* Add mkdir_errno_wrapper() and use instead of mkdir() in various placesZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | We'd pass pointers to mkdir and mkdir_label to call in various places. mkdir returns the error in errno while mkdir_label returns the error directly.
* basic: introduce socket_protocol_{from,to}_name()Yu Watanabe2018-05-30
| | | | And use them where they can be applicable.
* socket-util: add socket_address_type_{from,to}_string()Yu Watanabe2018-05-30
|
* networkd: Add support for ipvlan L3s and flags (#7726)Susant Sahani2018-05-30
| | | | | This works supports to configure L3S mode and flags such as bridge, private and vepa
* sd-bus: drop check for selinux before calling getsockopt(SO_PEERSEC)Zbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting Lennart Poettering in https://github.com/systemd/systemd/pull/6464#issuecomment-319029293: > If the kernel allows us to query that data we should also be Ok with passing > it on to our own caller, regardless if selinux is technically on or off... The advantage is that this allows gcc to be smarter and reduce linkage: (before)$ ldd build/libnss_systemd.so.2 linux-vdso.so.1 (0x00007ffeb46ff000) librt.so.1 => /lib64/librt.so.1 (0x00007f2f60da6000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f2f60ba1000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f2f60978000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2f60759000) libc.so.6 => /lib64/libc.so.6 (0x00007f2f60374000) /lib64/ld-linux-x86-64.so.2 (0x00007f2f61294000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f2f600f0000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f2f5feec000) (after )$ ldd build/libnss_systemd.so.2 linux-vdso.so.1 (0x00007ffe5f543000) librt.so.1 => /lib64/librt.so.1 (0x00007f427dcaa000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f427daa5000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f427d886000) libc.so.6 => /lib64/libc.so.6 (0x00007f427d4a1000) /lib64/ld-linux-x86-64.so.2 (0x00007f427e196000) Note that this only works in conjuction with the previous commit: either of the two commits alone does not have the desired effect on linkage. Replaces #6464.
* Move selinux-related stuff from btrfs-util.c to label.cZbigniew Jędrzejewski-Szmek2018-05-30
| | | | In preparation for future changes.
* missing: Add DM_DEFERRED_REMOVEHenrik Grindal Bakken2018-05-30
| | | | Also include missing.h in dissect-image.c to pick it up.
* missing: Define SMACK_MAGIC if it's missingHenrik Grindal Bakken2018-05-30
|
* missing: Define EFIVARFS_MAGIC if missingHenrik Grindal Bakken2018-05-30
|
* missing: Add MAX_HANDLE_SZHenrik Grindal Bakken2018-05-30
|
* missing: Add PR_SET_MM_{ARG,ENV}_{START,END}Henrik Grindal Bakken2018-05-30
|
* missing: Add some more btrfs structs and constantsHenrik Grindal Bakken2018-05-30
|
* mount-setup: fix MNT_CHECK_WRITABLE error handling, and log about the issueLennart Poettering2018-05-30
| | | | | Let's correct the error handling (the error is in errno, not r), and let's add logging like the rest of the function has it.
* logind: use free_and_replace in one spotZbigniew Jędrzejewski-Szmek2018-05-30
| | | | No functional change.
* tree-wide: use SPECIAL_ROOT_SLICEZbigniew Jędrzejewski-Szmek2018-05-30
|
* logind: fix misleading messageZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | This message would also be emitted at boot for any user with linger enabled, so "logged in" is the wrong term to use.
* logind: simplify one conditionalZbigniew Jędrzejewski-Szmek2018-05-30
| | | | Don't bother with removing the directory if we didn't create it.