summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* man: move examples out of sd_journal_get_fd into separate filesZbigniew Jędrzejewski-Szmek2018-03-244-63/+79
| | | | | | | | | | | | man/.dir-locals is to keep indentation under control. This makes it much easier to compile and run those examples, c.f. #7578. v2: - copy more of .dir-locals.el from the root to man/.dir-locals.el (I though emacs would inherit from the one in the parent dir, but it seems it just uses its own broken defaults, including indent-tabs-mode by default.)
* man: add a note that nspawn gives access to network by defaultZbigniew Jędrzejewski-Szmek2018-03-221-2/+4
| | | | Fixes #6546.
* ac-power: add simple getopt() argument parsing to systemd-ac-power (#8516)Lennart Poettering2018-03-211-2/+74
| | | | We should probably do that for all our tools, hence fill in this gap here.
* Merge pull request #8508 from poettering/more-cocciZbigniew Jędrzejewski-Szmek2018-03-2111-13/+37
|\ | | | | two new coccinelle rules files and their results
| * coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)Lennart Poettering2018-03-202-2/+7
| | | | | | | | Let's avoid fds 0…2 for safety reasons.
| * coccinelle: make use of DIV_ROUND_UP() wherever appropriateLennart Poettering2018-03-209-11/+30
| | | | | | | | Let's use our macros where we can
* | time-sync-wait: add service (#8494)Peter A. Bigot2018-03-216-0/+319
| | | | | | | | This one-shot service waits until the kernel time has been set to synchronized.
* | Merge pull request #8313 from alexgartrell/compression-thresholdLennart Poettering2018-03-2116-39/+273
|\ \ | | | | | | Compression threshold
| * | journal: make the compression threshold tunableAlex Gartrell2018-03-206-10/+135
| | | | | | | | | | | | | | | Allow a user to set a number of bytes as Compress to use as the compression threshold.
| * | journal: provide compress_threshold_bytes parameterAlex Gartrell2018-03-2011-32/+141
| |/ | | | | | | | | | | Previously the compression threshold was hardcoded to 512, which meant that smaller values wouldn't be compressed. This left some storage savings on the table, so instead, we make that number tunable.
* | Merge pull request #8368 from yuwata/nss-systemd-getpwentLennart Poettering2018-03-217-77/+452
|\ \ | | | | | | nss-systemd: make dynamic users enumerable by `getent`
| * | doc: update TODOYu Watanabe2018-03-211-3/+0
| | |
| * | nss-systemd: make dynamic users enumerable by `getent`Yu Watanabe2018-03-212-0/+338
| | | | | | | | | | | | | | | | | | This adds `setpwent()`, `getpwent_r()`, `endpwent()`, `setgrent()`, `getgrent_r()`, and `endgrent()` interfaces to nss-systemd library. Thus, dynamic users can be enumerated by e.g. `getent passwd` command.
| * | nss-systemd: define dynamic user propertiesYu Watanabe2018-03-211-10/+15
| | |
| * | nss-systemd: cleanup bypassing dbus logicYu Watanabe2018-03-211-63/+48
| | |
| * | core: add new dbus method GetDynamicUsersYu Watanabe2018-03-214-1/+51
| |/ | | | | | | | | This intruduces a new dbus method GetDynamicUsers for systemd1.Manager, which enumerates all dynamic users realized in the system.
* | dissect: add dissect_image_and_warn() that unifies error message generation ↵Lennart Poettering2018-03-215-47/+62
| | | | | | | | for dissect_image() (#8517)
* | move MANAGER_IS_RELOADING() check into manager_recheck_{dbus|journal}() (#8510)Lennart Poettering2018-03-212-7/+12
| | | | | | | | | | | | | | | | | | | | | | Let's better check this inside of the call than before it, so that we never issue this while reloading, even should these calls be called due to other reasons than just the unit notify. This makes sure the reload state is unset a bit earlier in manager_reload() so that we can safely call this function from there and they do the right thing. Follow-up for e63ebf71edd7947f29389c72e851d8df5c7bedda.
* | fileio: port parse_env_file_internal() to use _cleanup_free_ (#8511)Lennart Poettering2018-03-211-46/+26
| |
* | v3: Properly parsing SCSI Hyperv devices (#8509)Long Li2018-03-211-5/+8
| | | | | | | | | | | | | | Since 2016, Hyperv devices moved to using standard way to expose UUID to sysfs. Fix the parsing function to work with the newer format. Change log: v2: changed code to work with both old and new path format v3: changed guid_str_len type to size_t, fixed length in char guid[] in handle_scsi_hyperv()
* | Merge pull request #8487 from keszybz/oss-fuzz-fixesLennart Poettering2018-03-216-6/+28
|\ \ | | | | | | Oss fuzz fixes, another batch
| * | Restore naming of IOPRIO_PRIO defines from linux/ioprio.hZbigniew Jędrzejewski-Szmek2018-03-211-2/+2
| | | | | | | | | | | | This undoes part of 10062bbc35a28e95897f66fa5f4991b9b1f9df5d.
| * | core/load-fragment: reject overly long paths earlyZbigniew Jędrzejewski-Szmek2018-03-213-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to go through the specifier_printf() if the path is already too long in the unexpanded form (since specifiers increase the length of the string in all practical cases). In the oss-fuzz test case, valgrind reports: total heap usage: 179,044 allocs, 179,044 frees, 72,687,755,703 bytes allocated and the original config file is ~500kb. This isn't really a security issue, since the config file has to be trusted any way, but just a matter of preventing accidental resource exhaustion. https://oss-fuzz.com/v2/issue/4651449704251392/6977 While at it, fix order of arguments in the neighbouring log_syntax() call.
| * | basic/calendarspec: add check for repeat values that would overflowZbigniew Jędrzejewski-Szmek2018-03-213-0/+10
| | | | | | | | | | | | https://oss-fuzz.com/v2/issue/4651449704251392/7004
* | | selinux: let's fully (and statically) initialize log callback union (#8512)Lennart Poettering2018-03-211-2/+4
| | | | | | | | | | | | We can make this const and static, and initialize this ahead of time and fully, hence let's do that.
* | | Merge pull request #8513 from poettering/journal-minifixesZbigniew Jędrzejewski-Szmek2018-03-213-8/+1
|\ \ \ | | | | | | | | two minor journal fixes
| * | | journal: don't insist that the journal file header's boot ID matches the ↵Lennart Poettering2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | last entry We update the boot ID whenever the file is opened for writing (i.e. set to ONLINE stat), even if we never write a single entry to it. Hence, don't insist that the last entry's boot ID matches the file header. As pointed out by Matthijs van Duin: https://lists.freedesktop.org/archives/systemd-devel/2018-March/040499.html
| * | | journal-file: drop unused tail_entry_monotonic_valid field.Lennart Poettering2018-03-202-7/+0
| | |/ | |/| | | | | | | | | | | | | As pointed out by Matthijs van Duin: https://lists.freedesktop.org/archives/systemd-devel/2018-March/040499.html
* | | sd-bus: drop fd_nonblock() calls that are implied by rearrange_stdio() (#8514)Lennart Poettering2018-03-211-3/+0
| | |
* | | coredumpctl: drop unnecessary NULL initialization, and use const where ↵Lennart Poettering2018-03-211-2/+2
|/ / | | | | | | possible (#8515)
* | basic/fs-util: skip fsync_directory_of_file() if /proc/self/fd/ is not ↵Zbigniew Jędrzejewski-Szmek2018-03-202-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available (#8386) When systemd is running under lorax (in Fedora compose process), it'd think that it failed to write /etc/machine-id, even though the write succeeded, because fsync_directory_of_file() would fail, because /proc/self/fd/ is not available. fsync_directory_of_file() is mostly an additional safety net, so I think it's best to just silently ignore the error. Strace of pid1: 35791 stat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 35791 openat(AT_FDCWD, "/etc/machine-id", O_RDWR|O_CREAT|O_NOCTTY|O_CLOEXEC, 0444) = 3 35791 umask(022) = 000 35791 read(3, "", 38) = 0 35791 openat(AT_FDCWD, "/var/lib/dbus/machine-id", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file o r directory) 35791 openat(AT_FDCWD, "/sys/class/dmi/id/product_name", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 openat(AT_FDCWD, "/sys/class/dmi/id/sys_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 openat(AT_FDCWD, "/sys/class/dmi/id/board_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 openat(AT_FDCWD, "/sys/class/dmi/id/bios_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 access("/proc/xen", F_OK) = -1 ENOENT (No such file or directory) 35791 openat(AT_FDCWD, "/sys/hypervisor/type", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 35791 getrandom("\xb8\x82\xed\xd4\x35\x11\xd0\xeb\xa6\x79\xd7\x31\x6e\x7b\x99\xce", 16, GRND_NONBLOCK) = 16 35791 writev(2, [{iov_base="Initializing machine ID from random generator.", iov_len=46}, {iov_base="\n", iov_len=1}], 2) = 47 35791 lseek(3, 0, SEEK_SET) = 0 35791 ftruncate(3, 0) = 0 35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33 35791 fsync(3) = 0 35791 fstat(3, {st_mode=S_IFREG|0444, st_size=33, ...}) = 0 35791 readlinkat(AT_FDCWD, "/proc/self/fd/3", 0x564df8c694c0, 99) = -1 ENOENT (No such file or directory) 35791 close(3) = 0 35791 umask(022) = 022 35791 openat(AT_FDCWD, "/run/machine-id", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0444) = 3 35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33 35791 close(3) = 0 35791 umask(022) = 022 35791 mount("/run/machine-id", "/etc/machine-id", NULL, MS_BIND, NULL) = 0 35791 writev(2, [{iov_base="Installed transient /etc/machine-id file.", iov_len=41}, {iov_base="\n", iov_len=1}], 2) = 42 35791 mount(NULL, "/etc/machine-id", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0 https://bugzilla.redhat.com/show_bug.cgi?id=1552843
* | Merge pull request #8440 from keszybz/use-cleanup-in-efiLennart Poettering2018-03-209-173/+114
|\ \ | | | | | | Use cleanup in sd-boot
| * | boot: also use _cleanup_freepool_ in util.cZbigniew Jędrzejewski-Szmek2018-03-131-18/+14
| | | | | | | | | | | | efivar_get() was leaking memory on success, afaict.
| * | sd-boot: introduce _cleanup_freepool_Zbigniew Jędrzejewski-Szmek2018-03-137-154/+99
| | |
| * | basic: trivial indentation fixZbigniew Jędrzejewski-Szmek2018-03-131-1/+1
| | |
* | | nspawn: move network namespace creation to a separate step (#8430)Zbigniew Jędrzejewski-Szmek2018-03-201-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #8427. Unsharing the namespace in a separate step changes the ownership of /proc/net/ip_tables_names (and related files) from nobody:nobody to root:root. See [1] and [2] for all the details. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f13f2aeed154da8e48f90b85e720f8ba39b1e881 [2] https://bugzilla.netfilter.org/show_bug.cgi?id=1064#c9
* | | Merge pull request #8106 from dqminh/route-expires-kernelLennart Poettering2018-03-206-3/+41
|\ \ \ | | | | | | | | move route expiration to kernel
| * | | setup route expiration in kernel if supportedDaniel Dao2018-03-126-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel >= 4.5 (with commit https://github.com/torvalds/linux/commit/32bc201e1974976b7d3fea9a9b17bb7392ca6394) supports RTA_EXPIRES netlink attribute to set router lifetime. This simply detect the kernel version (>=4.5) and set the lifetime properly, fallback to expiring route in userspace for kernel that doesnt support it. Signed-off-by: Daniel Dao <dqminh89@gmail.com>
* | | | mkosi: set file permissions in copy of source tree (#8370)Filipe Brandenburger2018-03-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson keeps permissions around during the build, so details of how umask was set when cloning the original git tree will leak all the way to the installed files in the mkosi image. So reset the permissions of the files in the copy of the tree before starting the build. Also set the umask explicitly. Tested by creating a mkosi image and booting it on a tree that was cloned with a umask of 027, confirmed that the *.target files were not created as world-unreadable anymore.
* | | | seccomp: enable RestrictAddressFamilies on ppc (#8505)Mathieu Malaterre2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | In commit da1921a5c3 ppc64/ppc64el were added as supported architectures for socketcall() for the POWER family. Extend the support for the 32bits architectures.
* | | | Merge pull request #8499 from fbuihuu/shadow-support-nisLennart Poettering2018-03-201-2/+27
|\ \ \ \ | | | | | | | | | | sysusers: also add support for NIS entries in /etc/shadow
| * | | | sysusers: make sure to reset errno before calling fget*ent()Franck Bui2018-03-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Due to the glibc interface we have to test errno in various places to detect if an error occured after calling fget*ent() helpers.
| * | | | sysusers: also add support for NIS entries in /etc/shadowFranck Bui2018-03-201-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 563dc6f8e2cda4114dd20f32655890ed378c3740 added support for /etc/{passwd,group} only but since nsswitch.conf(5) appears to document the NIS entries also for shadow, let's support this case too.
* | | | | v4l_id: check mplane video capture and output capailities (#8464)Jui-Chi Ricky Liang2018-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Video devices using mplane buffer API declare capture and output capabilities with V4L2_CAP_VIDEO_CAPTURE_MPLANE and V4L2_CAP_VIDEO_OUTPUT_MPLANE.
* | | | | man: use unicode ellipsis in one more place (#8496)Zbigniew Jędrzejewski-Szmek2018-03-202-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Also add note where it should *not* be used. https://github.com/systemd/systemd/pull/8408#discussion_r175606771
* | | | | Merge pull request #8452 from keszybz/use-libmount-moreLennart Poettering2018-03-2011-153/+261
|\ \ \ \ \ | | | | | | | | | | | | Use libmount in systemd-shutdown, add tests
| * | | | | core/umount: use libmount to enumerate /proc/swapsZbigniew Jędrzejewski-Szmek2018-03-162-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | example.swaps with "(deleted)" does not cause bogus entries in the list now, but a memleak in libmount instead. The memleaks is not very important since this code is run just once. Reported as https://github.com/karelzak/util-linux/issues/596. $ build/test-umount ... /* test_swap_list("/proc/swaps") */ path=/var/tmp/swap o= f=0x0 try-ro=no dev=0:0 path=/dev/dm-2 o= f=0x0 try-ro=no dev=0:0 /* test_swap_list("/home/zbyszek/src/systemd/test/test-umount/example.swaps") */ path=/some/swapfile o= f=0x0 try-ro=no dev=0:0 path=/dev/dm-2 o= f=0x0 try-ro=no dev=0:0 ==26912== ==26912== HEAP SUMMARY: ==26912== in use at exit: 16 bytes in 1 blocks ==26912== total heap usage: 1,546 allocs, 1,545 frees, 149,008 bytes allocated ==26912== ==26912== 16 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==26912== at 0x4C31C15: realloc (vg_replace_malloc.c:785) ==26912== by 0x55C5D8C: _IO_vfscanf (in /usr/lib64/libc-2.26.so) ==26912== by 0x55D8AEC: vsscanf (in /usr/lib64/libc-2.26.so) ==26912== by 0x55D25C3: sscanf (in /usr/lib64/libc-2.26.so) ==26912== by 0x53236D0: mnt_table_parse_stream (in /usr/lib64/libmount.so.1.1.0) ==26912== by 0x53249B6: mnt_table_parse_file (in /usr/lib64/libmount.so.1.1.0) ==26912== by 0x10D157: swap_list_get (umount.c:194) ==26912== by 0x10B06E: test_swap_list (test-umount.c:34) ==26912== by 0x10B24B: main (test-umount.c:56) ==26912== ==26912== LEAK SUMMARY: ==26912== definitely lost: 16 bytes in 1 blocks ==26912== indirectly lost: 0 bytes in 0 blocks ==26912== possibly lost: 0 bytes in 0 blocks ==26912== still reachable: 0 bytes in 0 blocks ==26912== suppressed: 0 bytes in 0 blocks
| * | | | | test-umount: add a simple test for swap_list_get()Zbigniew Jędrzejewski-Szmek2018-03-165-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation seems buggy: /* test_swap_list("/home/zbyszek/src/systemd/test/test-umount/example.swaps") */ path=0 o= f=0x0 try-ro=no dev=0:0 path=/some/swapfile2 o= f=0x0 try-ro=no dev=0:0 path=/some/swapfile o= f=0x0 try-ro=no dev=0:0 path=/dev/dm-2 o= f=0x0 try-ro=no dev=0:0
| * | | | | core/umount: use _cleanup_Zbigniew Jędrzejewski-Szmek2018-03-162-55/+27
| | | | | |
| * | | | | tests: add a simple test for the mountinfo parsing logicZbigniew Jędrzejewski-Szmek2018-03-168-16/+122
| | | | | |