From 5f122cea440d7187faf0148f5ffac2ed1d03ae0f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 6 Mar 2018 16:02:44 +0900 Subject: rpm: add missing '-p ' in trigger script (#8367) Follow-up for 32a00a9c097cf04ec2b0fcbf9b73eba188318424 (#8090). (cherry picked from commit 694d57655cbf11864bb9e202a901021c7e568ba7) --- src/core/triggers.systemd.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/triggers.systemd.in b/src/core/triggers.systemd.in index c582d40977..4ebb4e7795 100644 --- a/src/core/triggers.systemd.in +++ b/src/core/triggers.systemd.in @@ -84,7 +84,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -P 100500 -- @tmpfilesdir@ +%transfiletriggerin -P 100500 -p -- @tmpfilesdir@ -- This script will process files installed in @tmpfilesdir@ to create -- tmpfiles automatically. The priority is set such that it will run -- after the sysusers file trigger, but before any other triggers. @@ -97,7 +97,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -- @udevhwdbdir@ +%transfiletriggerin -p -- @udevhwdbdir@ -- This script will automatically invoke hwdb update if files have been -- installed or updated in @udevhwdbdir@. if posix.access("/run/systemd/system") then @@ -109,7 +109,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -- @catalogdir@ +%transfiletriggerin -p -- @catalogdir@ -- This script will automatically invoke journal catalog update if files -- have been installed or updated in @catalogdir@. if posix.access("/run/systemd/system") then @@ -121,7 +121,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -- @udevrulesdir@ +%transfiletriggerin -p -- @udevrulesdir@ -- This script will automatically update udev with new rules if files -- have been installed or updated in @udevrulesdir@. if posix.access("/run/systemd/system") then @@ -133,7 +133,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -- @sysctldir@ +%transfiletriggerin -p -- @sysctldir@ -- This script will automatically apply sysctl rules if files have been -- installed or updated in @sysctldir@. if posix.access("/run/systemd/system") then @@ -145,7 +145,7 @@ if posix.access("/run/systemd/system") then end end -%transfiletriggerin -- @binfmtdir@ +%transfiletriggerin -p -- @binfmtdir@ -- This script will automatically apply binfmt rules if files have been -- installed or updated in @binfmtdir@. if posix.access("/run/systemd/system") then -- cgit v1.2.2 From 29caf9b1160106c998dd0dab2f6a32d1fc632acd Mon Sep 17 00:00:00 2001 From: Tomasz Torcz Date: Tue, 6 Mar 2018 09:35:47 +0100 Subject: NEWS: fix typos in v238 section (#8369) (cherry picked from commit 07a35e846b7986d3c02eca99fa291f6869035c58) --- NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 9ea239cc6c..52724587ed 100644 --- a/NEWS +++ b/NEWS @@ -11,7 +11,7 @@ CHANGES WITH 238: other forms of resource accounting (CPU, IO, IP) remain off for now, because it's not clear yet that their impact is small enough to move from opt-in to opt-out. We recommend downstreams to leave memory - accounting on by default if kernel 4.14 or higher is are primarily + accounting on by default if kernel 4.14 or higher is primarily used. On very resource constrained systems or when support for old kernels is a necessity, -Dmemory-accounting-default=false can be used to revert this change. @@ -35,12 +35,12 @@ CHANGES WITH 238: disk (in case some of those files are owned by that user), while still allowing local admin overrides. - This functionality is exposed to rpm scriplets through a new + This functionality is exposed to rpm scriptlets through a new %sysusers_create_package macro. Old %sysusers_create and %sysusers_create_inline macros are deprecated. A transfiletrigger for sysusers.d configuration is now installed, - which means that it should be uncessary to call systemd-sysusers from + which means that it should be unnecessary to call systemd-sysusers from package installation scripts, unless the package installs any files owned by those newly-created users, in which case %sysusers_create_package should be used. -- cgit v1.2.2 From d2adc475bcc17985b05bd219a74d5d5a0bd624a1 Mon Sep 17 00:00:00 2001 From: Evegeny Vereshchagin Date: Mon, 5 Mar 2018 21:23:33 +0000 Subject: tests: stop using `freopen` in `test-fileio` This helps get around a bug confusing `glibc` and making the test bail out with the following error under `asan` on `x86`: Fatal error: glibc detected an invalid stdio handle Aborted (core dumped) The bug has been reported in https://github.com/google/sanitizers/issues/778, but it is unlikely to be fixed anytime soon. (cherry picked from commit 362973902ca8501cad5e32db3820d7c66486b7a7) --- src/test/test-fileio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index 286867d2dc..3b4ee4b92a 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -406,7 +406,7 @@ static void test_capeff(void) { static void test_write_string_stream(void) { char fn[] = "/tmp/test-write_string_stream-XXXXXX"; - _cleanup_fclose_ FILE *f = NULL; + FILE *f = NULL; int fd; char buf[64]; @@ -416,8 +416,9 @@ static void test_write_string_stream(void) { f = fdopen(fd, "r"); assert_se(f); assert_se(write_string_stream(f, "boohoo", 0) < 0); + f = safe_fclose(f); - f = freopen(fn, "r+", f); + f = fopen(fn, "r+"); assert_se(f); assert_se(write_string_stream(f, "boohoo", 0) == 0); @@ -425,8 +426,9 @@ static void test_write_string_stream(void) { assert_se(fgets(buf, sizeof(buf), f)); assert_se(streq(buf, "boohoo\n")); + f = safe_fclose(f); - f = freopen(fn, "w+", f); + f = fopen(fn, "w+"); assert_se(f); assert_se(write_string_stream(f, "boohoo", WRITE_STRING_FILE_AVOID_NEWLINE) == 0); @@ -435,6 +437,7 @@ static void test_write_string_stream(void) { assert_se(fgets(buf, sizeof(buf), f)); printf(">%s<", buf); assert_se(streq(buf, "boohoo")); + f = safe_fclose(f); unlink(fn); } -- cgit v1.2.2 From 5419477b418fedebb776cb3284aeff3b4c95915e Mon Sep 17 00:00:00 2001 From: Evegeny Vereshchagin Date: Mon, 5 Mar 2018 22:05:46 +0000 Subject: tests: close a leftover file descriptor in `test-fileio` This should make it a bit easier to search for real file descriptor leaks. ``` $ valgrind --leak-check=full --track-fds=yes ./build/test-fileio ... ==29457== ==29457== FILE DESCRIPTORS: 4 open at exit. ==29457== Open file descriptor 3: /tmp/test-systemd_writing_tmpfile.lyV5Rc ==29457== at 0x4B9AD9E: open (open.c:43) ==29457== by 0x4B19B24: __gen_tempname (tempname.c:261) ==29457== by 0x4BA5CC3: mkostemp64 (mkostemp64.c:32) ==29457== by 0x48F739B: mkostemp_safe (fileio.c:1206) ==29457== by 0x10D968: test_writing_tmpfile (test-fileio.c:620) ==29457== by 0x10E930: main (test-fileio.c:767) ==29457== ``` (cherry picked from commit 9a92e25545210a5f4eddacbf52a3eeeadb062313) --- src/test/test-fileio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index 3b4ee4b92a..c6128c9091 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -610,7 +610,8 @@ static void test_writing_tmpfile(void) { char name[] = "/tmp/test-systemd_writing_tmpfile.XXXXXX"; _cleanup_free_ char *contents = NULL; size_t size; - int fd, r; + int r; + _cleanup_close_ int fd = -1; struct iovec iov[3]; iov[0] = IOVEC_MAKE_STRING("abc\n"); -- cgit v1.2.2 From 0c093fadb5fa90f55f3a7b8ee86a594327a100c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 7 Mar 2018 22:41:25 +0100 Subject: test-cgroup-util: bail out when running under mock (#8365) The builds were failing in Fedora koji, where something strange is mounted on /sys/fs/cgroup. Also closes https://github.com/systemd/systemd/issues/8383. (cherry picked from commit 18ce247c4cd0238de3425923ddab2309990c263a) --- src/test/test-cgroup-util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index c4163fc3a9..9ef7c97c74 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -408,9 +408,15 @@ static void test_cg_tests(void) { static void test_cg_get_keyed_attribute(void) { _cleanup_free_ char *val = NULL; char *vals3[3] = {}, *vals3a[3] = {}; - int i; + int i, r; - assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val) == -ENOENT); + r = cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val); + if (r == -ENOMEDIUM) { + log_info_errno(r, "Skipping most of %s, /sys/fs/cgroup not accessible: %m", __func__); + return; + } + + assert_se(r == -ENOENT); assert_se(val == NULL); if (access("/sys/fs/cgroup/init.scope/cpu.stat", R_OK) < 0) { -- cgit v1.2.2 From 8b734a0dea7d48b27ea7f21ac2bef4c336fe303d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Mar 2018 17:41:33 +1000 Subject: hwdb: add Dell Inspiron 3537 axis overrides (#8388) PS/2 and RMI4 entries https://bugs.freedesktop.org/show_bug.cgi?id=105370 (cherry picked from commit 2b5f20a99d4e94be90ee0b2cfa602b3ed3c1ea94) --- hwdb/60-evdev.hwdb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index 2c6fdb1b69..718befaaba 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -144,6 +144,20 @@ evdev:name:AlpsPS/2 ALPS GlidePoint*:dmi:bvn*:bvr*:bd*:svnDellInc.:pnVostro1510* EVDEV_ABS_00=::14 EVDEV_ABS_01=::18 +# Dell Inspiron 3537 - PS/2 +evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:pnInspiron3537* + EVDEV_ABS_00=1268:5675:41 + EVDEV_ABS_01=1101:4792:61 + EVDEV_ABS_35=1268:5675:41 + EVDEV_ABS_36=1101:4792:61 + +# Dell Inspiron 3537 - RMI4 +evdev:name:Synaptics TM2382-001:dmi:*svnDellInc.:pnInspiron3537* + EVDEV_ABS_00=::24 + EVDEV_ABS_01=::34 + EVDEV_ABS_35=::24 + EVDEV_ABS_36=::34 + # Dell Inspiron N5040 evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnInspironN5040* EVDEV_ABS_00=25:2000:22 -- cgit v1.2.2 From d620595dac516cce112e604a295989b18bda07fc Mon Sep 17 00:00:00 2001 From: Daniel Lin Date: Thu, 8 Mar 2018 02:44:11 -0500 Subject: hwdb: add accelerometer mount matrix for Eve V (#8382) (cherry picked from commit fc17f194ded93b51899aa0bbd4e66870d975fe5a) --- hwdb/60-sensor.hwdb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb index 77de5d21ba..2c8c4467ec 100644 --- a/hwdb/60-sensor.hwdb +++ b/hwdb/60-sensor.hwdb @@ -147,6 +147,12 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnCube:pni16:* sensor:modalias:acpi:ACCE0001*:dmi:*svnEndless*:*pnELT-NL3* ACCEL_MOUNT_MATRIX=0, 1, 0; 0, 0, -1; -1, 0, 0 +######################################### +# Eve Technology +######################################### +sensor:modalias:acpi:KIOX000A*:dmi:*:svnEVE*:pnEveV:* + ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1 + ######################################### # GP-electronic ######################################### -- cgit v1.2.2 From 42ae2624942412fff6bc84bfa9d50bb0033e5b9c Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 8 Mar 2018 22:19:35 +0900 Subject: sd-bus: do not try to close already closed fd (#8392) Fixes #8376, which is introduced by 2b33ab0957f453a06b58e4bee482f2c2d4e100c1. (cherry picked from commit 280029d18f470a64403d68717eef1be5274ff8af) --- src/libsystemd/sd-bus/bus-socket.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index b5160cff6a..166fba1579 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -960,8 +960,6 @@ int bus_socket_exec(sd_bus *b) { if (r == 0) { /* Child */ - safe_close(s[0]); - if (rearrange_stdio(s[1], s[1], STDERR_FILENO) < 0) _exit(EXIT_FAILURE); -- cgit v1.2.2 From be13871a844cbbe0e7d21bb15ec5b6cf14392090 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 8 Mar 2018 22:21:54 +0900 Subject: core: do not free heap-allocated strings (#8391) Fixes #8387. (cherry picked from commit 5cbaad2f6795088db56063d20695c6444595822f) --- src/core/mount-setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c index 536c17b4d5..9c27972aff 100644 --- a/src/core/mount-setup.c +++ b/src/core/mount-setup.c @@ -248,6 +248,7 @@ int mount_setup_early(void) { int mount_cgroup_controllers(char ***join_controllers) { _cleanup_set_free_free_ Set *controllers = NULL; + bool has_argument = !!join_controllers; int r; if (!cg_is_legacy_wanted()) @@ -255,7 +256,7 @@ int mount_cgroup_controllers(char ***join_controllers) { /* Mount all available cgroup controllers that are built into the kernel. */ - if (!join_controllers) + if (!has_argument) /* The defaults: * mount "cpu" + "cpuacct" together, and "net_cls" + "net_prio". * @@ -300,7 +301,8 @@ int mount_cgroup_controllers(char ***join_controllers) { t = set_remove(controllers, *i); if (!t) { - free(*i); + if (has_argument) + free(*i); continue; } } -- cgit v1.2.2 From 1394c16f3617697e059bd1405bb358611554e317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 6 Mar 2018 09:37:11 +0100 Subject: basic/cgroup-util: remove unused variable (cherry picked from commit eef03d70c1bedb3aabd4e2bcf10ab1f2678443bf) --- src/basic/cgroup-util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 9a4dd72270..c0962f288f 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2038,7 +2038,6 @@ int cg_get_keyed_attribute( char **ret_values) { _cleanup_free_ char *filename = NULL, *contents = NULL; - _cleanup_fclose_ FILE *f = NULL; const char *p; size_t n, i, n_done = 0; char **v; -- cgit v1.2.2 From 767bbbc6169639eab9881762b82f641d4fe66f83 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 9 Mar 2018 19:54:28 +1000 Subject: hwdb: add axis overrides for HP Pavilion 15 (#8404) https://bugzilla.redhat.com/show_bug.cgi?id=1551188 (cherry picked from commit fc6f94500ea525361b5357b4b09940e97c9f022a) --- hwdb/60-evdev.hwdb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index 718befaaba..f56be36877 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -255,6 +255,13 @@ evdev:name:SynPS/2 Synaptics TouchPad*:dmi:*svnHewlett-Packard:pnHPPaviliondv7* EVDEV_ABS_35=1068:5805:44 EVDEV_ABS_36=1197:4890:57 +# HP Pavilion 15 +evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnHP:pnHPLaptop15-bs0xx:* + EVDEV_ABS_00=1272:5689:38 + EVDEV_ABS_01=1029:4916:78 + EVDEV_ABS_35=1272:5689:38 + EVDEV_ABS_36=1029:4916:78 + # HP Spectre evdev:name:SynPS/2 Synaptics TouchPad:dmi:i*svnHP:pnHPSpectreNotebook* EVDEV_ABS_00=1205:5691:47 -- cgit v1.2.2 From e439584ff90e8e1f47d2fc6f46e78ed8c8027feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 14:15:39 +0100 Subject: meson: use triple-quote delimition in one more place (cherry picked from commit f83f8c70bd518e2b7a0011d82a2fb7074fb3a19a) --- src/journal-remote/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build index 5fdc4cccd7..cbe2be19c7 100644 --- a/src/journal-remote/meson.build +++ b/src/journal-remote/meson.build @@ -61,6 +61,6 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1 meson.add_install_script('sh', '-c', mkdir_p.format('/var/log/journal/remote')) meson.add_install_script('sh', '-c', - 'chown 0:0 $DESTDIR/var/log/journal/remote && - chmod 755 $DESTDIR/var/log/journal/remote || :') + '''chown 0:0 $DESTDIR/var/log/journal/remote && + chmod 755 $DESTDIR/var/log/journal/remote || :''') endif -- cgit v1.2.2 From e101b22e43c13f73e6cbfeadb6c4bf12bd45e432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 14:21:08 +0100 Subject: meson: avoid warning about comparison of bool and string meson.build:2907: WARNING: Trying to compare values of different types (bool, str) using ==. The result of this is undefined and will become a hard error in a future Meson release. (cherry picked from commit af4d7860c4e757f34a02ca73a0b14c73c18f8b30) --- meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 30b7f1bafa..e152226ead 100644 --- a/meson.build +++ b/meson.build @@ -2903,8 +2903,9 @@ foreach tuple : [ ['debug mmap cache'], ] - cond = tuple.get(1, '') - if cond == '' + if tuple.length() >= 2 + cond = tuple[1] + else ident1 = 'HAVE_' + tuple[0].underscorify().to_upper() ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper() cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1 -- cgit v1.2.2 From dab644722e9af19273da3d3086c365f0df6115f1 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Fri, 9 Mar 2018 23:30:32 +0100 Subject: core: ignore errors from cg_create_and_attach() in test mode (#8401) Reproducer: $ meson build && cd build $ ninja $ sudo useradd test $ sudo su test $ ./systemd --system --test ... Failed to create /user.slice/user-1000.slice/session-6.scope/init.scope control group: Permission denied Failed to allocate manager object: Permission denied Above error message is caused by the fact that user test didn't have its own session and we tried to set up init.scope already running as user test in the directory owned by different user. Let's try to setup cgroup hierarchy, but if that fails return error only when not running in the test mode. Fixes #8072 (cherry picked from commit aa77e234fce7413b7dd64f99ea51450f2e2e9dbd) --- src/core/cgroup.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 3c0ff09639..65ed86580f 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2272,19 +2272,20 @@ int manager_setup_cgroup(Manager *m) { /* 5. Make sure we are in the special "init.scope" unit in the root slice. */ scope_path = strjoina(m->cgroup_root, "/" SPECIAL_INIT_SCOPE); r = cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, scope_path, 0); - if (r < 0) - return log_error_errno(r, "Failed to create %s control group: %m", scope_path); + if (r >= 0) { + /* Also, move all other userspace processes remaining in the root cgroup into that scope. */ + r = cg_migrate(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, SYSTEMD_CGROUP_CONTROLLER, scope_path, 0); + if (r < 0) + log_warning_errno(r, "Couldn't move remaining userspace processes, ignoring: %m"); - /* Also, move all other userspace processes remaining in the root cgroup into that scope. */ - r = cg_migrate(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, SYSTEMD_CGROUP_CONTROLLER, scope_path, 0); - if (r < 0) - log_warning_errno(r, "Couldn't move remaining userspace processes, ignoring: %m"); + /* 6. And pin it, so that it cannot be unmounted */ + safe_close(m->pin_cgroupfs_fd); + m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK); + if (m->pin_cgroupfs_fd < 0) + return log_error_errno(errno, "Failed to open pin file: %m"); - /* 6. And pin it, so that it cannot be unmounted */ - safe_close(m->pin_cgroupfs_fd); - m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK); - if (m->pin_cgroupfs_fd < 0) - return log_error_errno(errno, "Failed to open pin file: %m"); + } else if (r < 0 && !m->test_run_flags) + return log_error_errno(r, "Failed to create %s control group: %m", scope_path); /* 7. Always enable hierarchical support if it exists... */ if (!all_unified && m->test_run_flags == 0) -- cgit v1.2.2 From c87b8c5dd21c97d6a8786c76c1073f6b91948814 Mon Sep 17 00:00:00 2001 From: Evegeny Vereshchagin Date: Fri, 9 Mar 2018 00:44:57 +0000 Subject: tests: skip the rest of test_mnt_id after getting any error This mainly gets around a kernel bug making it possible to have non-existent paths in /proc/self/mountinfo, but it should also prevent flaky failures that can happen if something changes immediately after or during reading /proc/self/mountinfo. Closes https://github.com/systemd/systemd/issues/8286. (cherry picked from commit 112cc3b5b2f61475afed6b082e917001710470bf) --- src/test/test-mount-util.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/test/test-mount-util.c b/src/test/test-mount-util.c index c95baa81a7..5f2ad7c719 100644 --- a/src/test/test-mount-util.c +++ b/src/test/test-mount-util.c @@ -80,12 +80,8 @@ static void test_mnt_id(void) { int mnt_id = PTR_TO_INT(k), mnt_id2; r = path_get_mnt_id(p, &mnt_id2); - if (r == -EOPNOTSUPP) { /* kernel or file system too old? */ - log_debug("%s doesn't support mount IDs\n", p); - continue; - } - if (IN_SET(r, -EACCES, -EPERM)) { - log_debug("Can't access %s\n", p); + if (r < 0) { + log_debug_errno(r, "Failed to get the mnt id of %s: %m\n", p); continue; } -- cgit v1.2.2 From d4802de173a856bd0ba1c452bb35df1e537b7726 Mon Sep 17 00:00:00 2001 From: Evegeny Vereshchagin Date: Fri, 9 Mar 2018 01:10:42 +0000 Subject: tests: make / private after creating a mount namespace so that the test never affects the root namespace. (cherry picked from commit c58fd466a313a1f93df1792822e358c67990bcdf) --- src/test/test-process-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c index 0e5a9d811d..1a0164e601 100644 --- a/src/test/test-process-util.c +++ b/src/test/test-process-util.c @@ -193,6 +193,8 @@ static void test_get_process_cmdline_harder(void) { assert_se(pid == 0); assert_se(unshare(CLONE_NEWNS) >= 0); + assert_se(mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) >= 0); + fd = mkostemp(path, O_CLOEXEC); assert_se(fd >= 0); -- cgit v1.2.2 From cb8a6583ba317db49057c1c710dd19e415f3eb5f Mon Sep 17 00:00:00 2001 From: Doug Christman Date: Tue, 13 Mar 2018 16:41:07 +0800 Subject: zsh-completion: add calendar to systemd-analyze (#8438) (cherry picked from commit ce21568dc34494f125bb70f6c51f80a5232b9020) --- shell-completion/zsh/_systemd-analyze | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze index bccdb951f1..56982e3d11 100644 --- a/shell-completion/zsh/_systemd-analyze +++ b/shell-completion/zsh/_systemd-analyze @@ -33,12 +33,13 @@ _systemd_analyze_command(){ 'plot:Output SVG graphic showing service initialization' 'dot:Dump dependency graph (in dot(1) format)' 'dump:Dump server status' - 'unit-paths':List unit load paths' + 'unit-paths:List unit load paths' 'log-level:Get/set systemd log threshold' 'log-target:Get/set systemd log target' 'service-watchdogs:Get/set service watchdog status' 'syscall-filter:List syscalls in seccomp filter' 'verify:Check unit files for correctness' + 'calendar:Validate repetitive calendar time events' ) if (( CURRENT == 1 )); then -- cgit v1.2.2 From 38f9d78afd2b6632ce1733791532345b0d404324 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 8 Mar 2018 16:44:17 +0100 Subject: umount: Fix memory leak (cherry picked from commit 659b15313b9ca8c7f3f6e523e0d3fd696243ff8b) --- src/core/umount.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/umount.c b/src/core/umount.c index ff3e63710c..8ba4179a0f 100644 --- a/src/core/umount.c +++ b/src/core/umount.c @@ -61,6 +61,8 @@ static void mount_point_free(MountPoint **head, MountPoint *m) { LIST_REMOVE(mount_point, *head, m); free(m->path); + free(m->options); + free(m->type); free(m); } -- cgit v1.2.2 From d555d4cf8e1cf1d065e49e6eba88e7f8c780449e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Mar 2018 06:36:29 +1000 Subject: hwdb: add axis override for the Razer Blade Stealth (#8436) This touchpad has heavy jitter, set a fuzz of 8 to work around this. From https://bugs.freedesktop.org/show_bug.cgi?id=105409 (cherry picked from commit 539ad37f18543d436ef9839e6bec20319ada53a2) --- hwdb/60-evdev.hwdb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index f56be36877..7e4ae61ea6 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -410,6 +410,17 @@ evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO*:pn*02173BG*:*pvrThinkPadEd EVDEV_ABS_35=916:6077:55 EVDEV_ABS_36=653:5395:116 +######################################### +# Razer +######################################### + +# Razer Blade Stealth +evdev:name:1A586753:00 06CB:8323 Touchpad:dmi:*svnRazer:pnBladeStealth:* + EVDEV_ABS_00=::12:8 + EVDEV_ABS_01=::11:8 + EVDEV_ABS_35=::12:8 + EVDEV_ABS_36=::11:8 + ######################################### # Samsung ######################################### -- cgit v1.2.2 From 49a5d09a402d23815275282a89526869fc1c39f5 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 15 Mar 2018 06:23:46 +0100 Subject: basic/macros: rename noreturn into _noreturn_ (#8456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "noreturn" is reserved and can be used in other header files we include: [ 16s] In file included from /usr/include/gcrypt.h:30:0, [ 16s] from ../src/journal/journal-file.h:26, [ 16s] from ../src/journal/journal-vacuum.c:31: [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); Here we include grcrypt.h (which in turns include gpg-error.h) *after* we "noreturn" was defined in macro.h. (cherry picked from commit 848e863acc51ecfb0f3955c498874588201d9130) --- src/basic/log.c | 4 ++-- src/basic/log.h | 4 ++-- src/basic/macro.h | 19 +++++++++---------- src/basic/process-util.c | 2 +- src/basic/process-util.h | 2 +- src/core/main.c | 4 ++-- src/journal/test-journal-interleaving.c | 2 +- src/shared/pager.c | 2 +- src/udev/collect/collect.c | 2 +- 9 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/basic/log.c b/src/basic/log.c index 7a7f2cbec1..16a2431c54 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -814,7 +814,7 @@ static void log_assert( log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer); } -noreturn void log_assert_failed_realm( +_noreturn_ void log_assert_failed_realm( LogRealm realm, const char *text, const char *file, @@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm( abort(); } -noreturn void log_assert_failed_unreachable_realm( +_noreturn_ void log_assert_failed_unreachable_realm( LogRealm realm, const char *text, const char *file, diff --git a/src/basic/log.h b/src/basic/log.h index efcf0f1bfc..314be128a2 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -186,7 +186,7 @@ int log_dump_internal( char *buffer); /* Logging for various assertions */ -noreturn void log_assert_failed_realm( +_noreturn_ void log_assert_failed_realm( LogRealm realm, const char *text, const char *file, @@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm( #define log_assert_failed(text, ...) \ log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__) -noreturn void log_assert_failed_unreachable_realm( +_noreturn_ void log_assert_failed_unreachable_realm( LogRealm realm, const char *text, const char *file, diff --git a/src/basic/macro.h b/src/basic/macro.h index 89bdd852a9..3a6fc6f585 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -53,6 +53,15 @@ #else #define _fallthrough_ #endif +/* Define C11 noreturn without and even on older gcc + * compiler versions */ +#ifndef _noreturn_ +#if __STDC_VERSION__ >= 201112L +#define _noreturn_ _Noreturn +#else +#define _noreturn_ __attribute__((noreturn)) +#endif +#endif /* Temporarily disable some warnings */ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \ @@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { #endif #endif -/* Define C11 noreturn without and even on older gcc - * compiler versions */ -#ifndef noreturn -#if __STDC_VERSION__ >= 201112L -#define noreturn _Noreturn -#else -#define noreturn __attribute__((noreturn)) -#endif -#endif - #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \ static inline void func##p(type *p) { \ if (*p) \ diff --git a/src/basic/process-util.c b/src/basic/process-util.c index aa9846db5d..e6120af5b6 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -987,7 +987,7 @@ bool is_main_thread(void) { return cached > 0; } -noreturn void freeze(void) { +_noreturn_ void freeze(void) { log_close(); diff --git a/src/basic/process-util.h b/src/basic/process-util.h index 93029e36e5..5170adec7b 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid); bool is_main_thread(void); -noreturn void freeze(void); +_noreturn_ void freeze(void); bool oom_score_adjust_is_valid(int oa); diff --git a/src/core/main.c b/src/core/main.c index 076846a41c..4b2d149237 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX; static sd_id128_t arg_machine_id = {}; static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE; -noreturn static void freeze_or_reboot(void) { +_noreturn_ static void freeze_or_reboot(void) { if (arg_crash_reboot) { log_notice("Rebooting in 10s..."); @@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) { freeze(); } -noreturn static void crash(int sig) { +_noreturn_ static void crash(int sig) { struct sigaction sa; pid_t pid; diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c index 5a88b2774f..d87bdbdd32 100644 --- a/src/journal/test-journal-interleaving.c +++ b/src/journal/test-journal-interleaving.c @@ -37,7 +37,7 @@ static bool arg_keep = false; -noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) { +_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) { log_internal(LOG_CRIT, error, file, line, func, "'%s' failed at %s:%u (%s): %m", text, file, line, func); abort(); diff --git a/src/shared/pager.c b/src/shared/pager.c index 75db3c985b..681af9c40e 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -47,7 +47,7 @@ static int stored_stderr = -1; static bool stdout_redirected = false; static bool stderr_redirected = false; -noreturn static void pager_fallback(void) { +_noreturn_ static void pager_fallback(void) { int r; r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0); diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c index 2821640e93..c8fa47b3d7 100644 --- a/src/udev/collect/collect.c +++ b/src/udev/collect/collect.c @@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node) return container_of(node, struct _mate, node); } -noreturn static void sig_alrm(int signo) +_noreturn_ static void sig_alrm(int signo) { exit(4); } -- cgit v1.2.2 From 7171b895bc1f339cf77627b19c9cf0785f823640 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Thu, 15 Mar 2018 10:42:38 -0700 Subject: udev/net-id: Fix check for address to keep interface names stable (#8458) This was a bug inadvertently added by commit 73fc96c8ac0aa9. The intent of the check is to "match slot address with device by stripping the function" (as the comment above states it), for example match network device PCI address 0000:05:00.0 (including a .0 for function) to PCI slot address 0000:05:00, but changing that to a streq() call prevented the match. Change that to startswith(), which should both fix the bug and make the intent of the check more clear and prevent unintentional bugs from being introduced by future refactorings. (cherry picked from commit 8eebb6a9e5e74ec0ef40902e2da53d24559b94a4) --- src/udev/udev-builtin-net_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 36994360c7..6efa712930 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -297,7 +297,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) { if (snprintf_ok(str, sizeof str, "%s/%s/address", slots, dent->d_name) && read_one_line_file(str, &address) >= 0) /* match slot address with device by stripping the function */ - if (streq(address, udev_device_get_sysname(names->pcidev))) + if (startswith(udev_device_get_sysname(names->pcidev), address)) hotplug_slot = i; if (hotplug_slot > 0) -- cgit v1.2.2 From fc50fa43e7bc93bef84dd6ac9adf7389ce370531 Mon Sep 17 00:00:00 2001 From: futpib Date: Fri, 16 Mar 2018 17:25:14 +0300 Subject: hwdb: fix comment suggested `udevadm trigger` command (#8465) (cherry picked from commit d24e70fe8b6bebd9abe4c1578d22cb5536044cc2) --- hwdb/60-sensor.hwdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb index 2c8c4467ec..616c390134 100644 --- a/hwdb/60-sensor.hwdb +++ b/hwdb/60-sensor.hwdb @@ -15,7 +15,7 @@ # /etc/udev/hwdb.d/61-sensor-local.hwdb # and add your rules there. To load the new rules execute (as root): # systemd-hwdb update -# udevadm trigger -y `dirname $(udevadm info -n "/dev/iio:deviceXXX" -q path)` +# udevadm trigger -v -p DEVNAME=/dev/iio:deviceXXX # where /dev/iio:deviceXXX is the device in question. # # If your changes are generally applicable, preferably send them as a pull -- cgit v1.2.2 From 2b1a1ebd8951a2fca8fd3154d5a319fa01bbacaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 16 Mar 2018 23:01:05 +0100 Subject: core: when reloading, delay any actions on journal and dbus connections manager_recheck_journal() and manager_recheck_dbus() would be called to early while we were deserialiazing units, before the systemd-journald.service and dbus.service have been deserialized. In effect we'd disable logging to the journald and close the bus connection. The first is not very noticable, it mostly means that logs emitted during deserialization are lost. The second is more noticeable, because manager_recheck_dbus() would call bus_done_api() and bus_done_system() and close dbus connections. Logging and bus connection would then be restored later after the respective units have been deserialized. This is easily reproduced by calling: $ sudo gdbus call --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 --method "org.freedesktop.systemd1.Manager.Reload" which works fine before 8559b3b75cb, and then starts failing with: Error: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected None of this should happen, and we should delay changing state until after deserialization is complete when reloading. manager_reload() already included the calls to manager_recheck_journal() and manager_recheck_dbus(), so the connection state will be updated after deserialization during reloading is done. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1554578. (cherry picked from commit e63ebf71edd7947f29389c72e851d8df5c7bedda) --- src/core/unit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c index c3056624ef..ce15b8e088 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2502,8 +2502,11 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su } } - manager_recheck_journal(m); - manager_recheck_dbus(m); + if (!MANAGER_IS_RELOADING(u->manager)) { + manager_recheck_journal(m); + manager_recheck_dbus(m); + } + unit_trigger_notify(u); if (!MANAGER_IS_RELOADING(u->manager)) { -- cgit v1.2.2 From 5637563bb58aba8ba4a1600afc44c586b96eadfa Mon Sep 17 00:00:00 2001 From: Karol Augustin Date: Sun, 18 Mar 2018 10:40:07 +0000 Subject: units: Fix SuccessAction that belongs to [Unit] section not [Service] section (#8478) (cherry picked from commit 94a1d03e27811e06045cdfba2e0fc7180964dc0e) --- units/system-update-cleanup.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/system-update-cleanup.service.in b/units/system-update-cleanup.service.in index 84d16f608e..58baab3023 100644 --- a/units/system-update-cleanup.service.in +++ b/units/system-update-cleanup.service.in @@ -14,6 +14,7 @@ After=system-update.target DefaultDependencies=no Conflicts=shutdown.target Before=shutdown.target +SuccessAction=reboot # system-update-generator uses laccess("/system-update"), while a plain # ConditionPathExists=/system-update uses access("/system-update"), so @@ -32,4 +33,3 @@ ConditionPathIsSymbolicLink=|/system-update [Service] Type=oneshot ExecStart=/bin/rm -fv /system-update -SuccessAction=reboot -- cgit v1.2.2 From 9f294d0d0fd18bc6b7544ba755f061972db74df3 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 15 Mar 2018 18:46:28 +0100 Subject: sysusers: do not append entries after the NIS ones The NIS-catchall entry switches from files to NIS lookup and never goes back, so it must be the last entry in /etc/passwd (the other +/-{user,@netgroup} entries don't have to be). That's how the nss_compat mode for /etc/passwd (and /etc/group) traditionally works. It's age-old historic behaviour that the NIS entry must be the last one. It doesn't seem to be specified somewhere, but it worked like this since very early SunOS when NIS was first included. Fixes: #8467 (cherry picked from commit 563dc6f8e2cda4114dd20f32655890ed378c3740) --- src/sysusers/sysusers.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index cd273ef2c9..5dcc213b17 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -396,6 +396,7 @@ static const char* default_shell(uid_t uid) { static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char **tmpfile_path) { _cleanup_fclose_ FILE *original = NULL, *passwd = NULL; _cleanup_(unlink_and_freep) char *passwd_tmp = NULL; + struct passwd *pw = NULL; Iterator iterator; Item *i; int r; @@ -409,7 +410,6 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char original = fopen(passwd_path, "re"); if (original) { - struct passwd *pw; r = sync_rights(original, passwd); if (r < 0) @@ -429,6 +429,10 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char return -EEXIST; } + /* Make sure we keep the NIS entries (if any) at the end. */ + if (IN_SET(pw->pw_name[0], '+', '-')) + break; + errno = 0; if (putpwent(pw, passwd) < 0) return errno ? -errno : -EIO; @@ -468,6 +472,17 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char return errno ? -errno : -EIO; } + /* Append the remaining NIS entries if any */ + while (pw) { + errno = 0; + if (putpwent(pw, passwd) < 0) + return errno ? -errno : -EIO; + + pw = fgetpwent(original); + } + if (!IN_SET(errno, 0, ENOENT)) + return -errno; + r = fflush_and_check(passwd); if (r < 0) return r; @@ -567,6 +582,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** _cleanup_fclose_ FILE *original = NULL, *group = NULL; _cleanup_(unlink_and_freep) char *group_tmp = NULL; bool group_changed = false; + struct group *gr = NULL; Iterator iterator; Item *i; int r; @@ -580,7 +596,6 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** original = fopen(group_path, "re"); if (original) { - struct group *gr; r = sync_rights(original, group); if (r < 0) @@ -604,6 +619,10 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** return -EEXIST; } + /* Make sure we keep the NIS entries (if any) at the end. */ + if (IN_SET(gr->gr_name[0], '+', '-')) + break; + r = putgrent_with_members(gr, group); if (r < 0) return r; @@ -636,6 +655,17 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** group_changed = true; } + /* Append the remaining NIS entries if any */ + while (gr) { + errno = 0; + if (putgrent(gr, group) != 0) + return errno > 0 ? -errno : -EIO; + + gr = fgetgrent(original); + } + if (!IN_SET(errno, 0, ENOENT)) + return -errno; + r = fflush_sync_and_check(group); if (r < 0) return r; -- cgit v1.2.2 From 62618a6ef199e2691804c69f76ca52ff470ac538 Mon Sep 17 00:00:00 2001 From: Elia Geretto Date: Mon, 19 Mar 2018 08:00:28 +0100 Subject: hwdb: Split touchpad rules for X550CC and S550C (cherry picked from commit 80188d5bf6e3a97b5faff3a868ecd2627d94e352) --- hwdb/60-evdev.hwdb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index 7e4ae61ea6..69bd09c7bf 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -115,7 +115,8 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:bvn*:bvr*:bd*:svnASUSTeKComputerInc.:pnK EVDEV_ABS_36=::16 # Asus X550CC and S550CB -evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pn?550C?:* +evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnX550CC:* +evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnS550CB:* EVDEV_ABS_00=::31 EVDEV_ABS_01=::30 EVDEV_ABS_35=::31 -- cgit v1.2.2 From 493ea04a9ac5fb8fd8c986e35937c0cd287f6072 Mon Sep 17 00:00:00 2001 From: Elia Geretto Date: Mon, 19 Mar 2018 08:02:40 +0100 Subject: hwdb: Correct touchpad resolution for Asus N550JV (cherry picked from commit 26d0c809a504b6aa4781fbb158623e19862d156f) --- hwdb/60-evdev.hwdb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb index 69bd09c7bf..e8e650cde6 100644 --- a/hwdb/60-evdev.hwdb +++ b/hwdb/60-evdev.hwdb @@ -114,9 +114,10 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:bvn*:bvr*:bd*:svnASUSTeKComputerInc.:pnK EVDEV_ABS_35=::18 EVDEV_ABS_36=::16 -# Asus X550CC and S550CB +# Asus X550CC, S550CB and N550JV evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnX550CC:* evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnS550CB:* +evdev:name:ETPS/2 Elantech Touchpad:dmi:*:svnASUSTeKCOMPUTERINC.:pnN550JV:* EVDEV_ABS_00=::31 EVDEV_ABS_01=::30 EVDEV_ABS_35=::31 -- cgit v1.2.2 From b3e9aedfd1fa426cc5ee8fbab4a4861ad1e8ad41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 19 Mar 2018 09:07:44 +0100 Subject: macros: use here-docs instead of echo (#8480) It's common for sysusers files to contain quotes (in particular around the comment/GECOS field), and using echo "..." is very likely to not work properly in that case. Let's use </dev/null 2>&1 || : \ %{nil} %sysusers_create_inline() \ -echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \ +systemd-sysusers - </dev/null 2>&1 || : \ +%(cat %2) \ +SYSTEMD_INLINE_EOF \ %{nil} # This should be used by package installation scripts which require users or @@ -118,7 +120,9 @@ echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \ # %files # %{_sysusersdir}/%{name}.conf %sysusers_create_package() \ -echo "%(cat %2)" | systemd-sysusers --replace=%_sysusersdir/%1.conf - >/dev/null 2>&1 || : \ +systemd-sysusers --replace=%_sysusersdir/%1.conf - </dev/null 2>&1 || : \ +%(cat %2) \ +SYSTEMD_INLINE_EOF \ %{nil} # This may be used by package installation scripts to create files according to @@ -135,7 +139,9 @@ echo "%(cat %2)" | systemd-sysusers --replace=%_sysusersdir/%1.conf - >/dev/null # %files # %{_tmpfilesdir}/%{name}.conf %tmpfiles_create_package() \ -echo "%(cat %2)" | systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - >/dev/null 2>&1 || : \ +systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - </dev/null 2>&1 || : \ +%(cat %2) \ +SYSTEMD_INLINE_EOF \ %{nil} %sysctl_apply() \ -- cgit v1.2.2 From eca85ae139397305b43eceeb9887e4810af6add1 Mon Sep 17 00:00:00 2001 From: futpib Date: Mon, 19 Mar 2018 12:25:07 +0300 Subject: hwdb: fix accelerometer mount matrix for Asus TP300LD (#8327) (#8463) (cherry picked from commit e9ee721abdefc69f581e46bb3b4ed1471f6fd8af) --- hwdb/60-sensor.hwdb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb index 616c390134..8385efd28d 100644 --- a/hwdb/60-sensor.hwdb +++ b/hwdb/60-sensor.hwdb @@ -82,7 +82,7 @@ sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP500LB* ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP300LD* - ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 + ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1 ######################################### # Axxo -- cgit v1.2.2 From 228bf05dc9fe2efb0b65a2ca81b800f6309d6672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 9 Mar 2018 08:56:23 +0100 Subject: meson: add note about coreutils version with ln --relative https://bugs.freedesktop.org/show_bug.cgi?id=90799 (cherry picked from commit cd001016a166bb849c454e7b5cdb58053f34935b) --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e152226ead..358b41b9d1 100644 --- a/meson.build +++ b/meson.build @@ -604,7 +604,7 @@ endforeach conf.set_quoted('TELINIT', get_option('telinit-path')) if run_command('ln', '--relative', '--help').returncode() != 0 - error('ln does not support --relative') + error('ln does not support --relative (added in coreutils 8.16)') endif ############################################################ -- cgit v1.2.2 From c388e15df60237f870df3fd49ef36a4363ee335c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Mar 2018 10:19:26 +0100 Subject: systemctl: raise level of log line about kernel loading It's pretty important after all. Also include the actual kexecuted command in the log message, that's useful to debug if something goes wrong. (cherry picked from commit cd086a014b0f07b1d6cb5fa3881d6a14cb10fd76) --- src/systemctl/systemctl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 1e975a5f2f..e00cbb2b12 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3511,9 +3511,12 @@ static int load_kexec_kernel(void) { if (!options) return log_oom(); - log_debug("%s kexec kernel %s initrd %s options \"%s\".", - arg_dry_run ? "Would load" : "loading", - kernel, initrd, options); + log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, + "%s "KEXEC" --load \"%s\" --append \"%s\"%s%s%s", + arg_dry_run ? "Would run" : "Running", + kernel, + options, + initrd ? " --initrd \"" : NULL, strempty(initrd), initrd ? "\"" : ""); if (arg_dry_run) return 0; -- cgit v1.2.2 From 0ee731f325935b791e8ff58ae5a43e32700c9d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Mar 2018 10:57:44 +0100 Subject: systemctl: propagate the error from kexec (cherry picked from commit df685d5784e0cfdd89b6153bde886b071afff388) --- src/systemctl/systemctl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index e00cbb2b12..3be01321b6 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3524,7 +3524,6 @@ static int load_kexec_kernel(void) { if (r < 0) return r; if (r == 0) { - const char* const args[] = { KEXEC, "--load", kernel, @@ -3537,7 +3536,13 @@ static int load_kexec_kernel(void) { _exit(EXIT_FAILURE); } - return wait_for_terminate_and_check("kexec", pid, WAIT_LOG); + r = wait_for_terminate_and_check("kexec", pid, WAIT_LOG); + if (r < 0) + return r; + if (r > 0) + /* Command failed */ + return -EPROTO; + return 0; } static int set_exit_code(uint8_t code) { -- cgit v1.2.2 From 7a1d67470a47a3bf8c11ef80804e3a3fc2176cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Mar 2018 11:00:26 +0100 Subject: systemctl: if kexec is missing, do not try to kexec (cherry picked from commit c0d73214986ca006949b86b74c583878a562be53) --- src/systemctl/systemctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 3be01321b6..dfc9630f55 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3483,6 +3483,9 @@ static int load_kexec_kernel(void) { return 0; } + if (access(KEXEC, X_OK) < 0) + return log_error_errno(errno, KEXEC" is not available: %m"); + r = find_esp_and_warn(arg_esp_path, false, &where, NULL, NULL, NULL, NULL); if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */ return log_error_errno(r, "Cannot find the ESP partition mount point."); -- cgit v1.2.2 From b1fea1c9baf7390a43320ae3f3602d77bafa6868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Mar 2018 11:27:15 +0100 Subject: systemctl: if kexec fails with --force, continue to reboot normally When we are in late shutdown, and for whatever reason kexec fails, we should proceed with a normal reboot. Network is down and sessions have been terminated when we attempt to do the kexec, so rebooting normally is a better solution. Logs from the case where the kexec kernel is not usable: Mar 08 11:23:10 fuefi systemd[1]: Reached target Final Step. Mar 08 11:23:10 fuefi systemd[1]: Starting Reboot via kexec... Mar 08 11:23:10 fuefi systemctl[1480]: Cannot find the ESP partition mount point. Mar 08 11:23:10 fuefi systemctl[1480]: Failed to load kexec kernel, continuing without. Mar 08 11:23:10 fuefi systemd[1]: Shutting down. ... and then we proceed to do a normal reboot Related to #7730. (cherry picked from commit d23b5ce2b6026eaa532feb9b669f217aee2782ea) --- src/systemctl/systemctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index dfc9630f55..393c35c60f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3603,7 +3603,9 @@ static int start_special(int argc, char *argv[], void *userdata) { } else if (a == ACTION_KEXEC) { r = load_kexec_kernel(); - if (r < 0) + if (r < 0 && arg_force >= 1) + log_notice("Failed to load kexec kernel, continuing without."); + else if (r < 0) return r; } else if (a == ACTION_EXIT && argc > 1) { -- cgit v1.2.2 From e1459aefdc1d043cb3734aa324795b146e09e144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 8 Mar 2018 11:57:59 +0100 Subject: systemctl: honour --dry-run also on logind calls Fixes #7670. (cherry picked from commit dbc9830cde21afb585e4e28eafc0230cc0933563) --- src/systemctl/systemctl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 393c35c60f..6ae97cf107 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -2915,8 +2915,8 @@ static int start_unit_one( return log_error_errno(r, "Failed to request match for PropertiesChanged signal: %m"); } - log_debug("%s manager for %s on %s, %s", - arg_dry_run ? "Would call" : "Calling", + log_debug("%s dbus call org.freedesktop.systemd1.Manager %s(%s, %s)", + arg_dry_run ? "Would execute" : "Executing", method, name, mode); if (arg_dry_run) return 0; @@ -3215,6 +3215,10 @@ static int logind_set_wall_message(void) { if (!m) return log_oom(); + log_debug("%s wall message \"%s\".", arg_dry_run ? "Would set" : "Setting", m); + if (arg_dry_run) + return 0; + r = sd_bus_call_method( bus, "org.freedesktop.login1", @@ -3285,6 +3289,10 @@ static int logind_reboot(enum action a) { polkit_agent_open_maybe(); (void) logind_set_wall_message(); + log_debug("%s org.freedesktop.login1.Manager %s dbus call.", arg_dry_run ? "Would execute" : "Executing", method); + if (arg_dry_run) + return 0; + r = sd_bus_call_method( bus, "org.freedesktop.login1", -- cgit v1.2.2 From f02abd834904351307ebded912067b3df9442b35 Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Mon, 19 Mar 2018 15:56:11 +0100 Subject: hwdb: ThinkPad T450s doesn't have a caps lock led (#8433) (cherry picked from commit 16bed3afa1b916ace5e927392a1baab9dd9ff963) --- hwdb/60-keyboard.hwdb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb index 6406a7dbf9..e05b1d10c2 100644 --- a/hwdb/60-keyboard.hwdb +++ b/hwdb/60-keyboard.hwdb @@ -1421,3 +1421,7 @@ evdev:input:b0003v05FEp1010* evdev:input:b0003v046Dp4002* KEYBOARD_LED_NUMLOCK=0 KEYBOARD_LED_CAPSLOCK=0 + +# Lenovo ThinkPad T450s +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT450s + KEYBOARD_LED_CAPSLOCK=0 -- cgit v1.2.2 From 6079d9da0cd351e49e774fe9bf1609caec6b4067 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 12 Mar 2018 17:45:42 +0900 Subject: busctl: add missing oom check (cherry picked from commit cb05d2a5149517ed524f859aa219e27c601d74ad) --- src/busctl/busctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index f8c43b5079..b4ab0d12de 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -112,6 +112,9 @@ static int list_bus_names(sd_bus *bus, char **argv) { } merged = new(char*, hashmap_size(names) + 1); + if (!merged) + return log_oom(); + HASHMAP_FOREACH_KEY(v, k, names, iterator) merged[n++] = k; -- cgit v1.2.2 From f619f8a2ff409d20821a54c7faae97cfda30c6c9 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 12 Mar 2018 17:47:16 +0900 Subject: busctl: drop redundant pager_open() (cherry picked from commit 548866015467d82c0688730807bd1b704be21c38) --- src/busctl/busctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index b4ab0d12de..ae132dffbe 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -286,8 +286,6 @@ static void print_subtree(const char *prefix, const char *path, char **l) { static void print_tree(const char *prefix, char **l) { - pager_open(arg_no_pager, false); - prefix = strempty(prefix); if (arg_list) { -- cgit v1.2.2 From 64eafeaf75c2953e1ed136e4c69e14cb392d2f05 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 14 Mar 2018 14:06:50 +0900 Subject: man: mention that 'status' is the default command for `hostnamectl` (cherry picked from commit a456324fefec12ac929fd844bcec243b657d7b1f) --- man/hostnamectl.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml index fa70d5cc6c..9bfead6d21 100644 --- a/man/hostnamectl.xml +++ b/man/hostnamectl.xml @@ -121,6 +121,10 @@ + + + + Commands The following commands are understood: @@ -128,9 +132,8 @@ status - Show current system - hostname and related - information. + Show current system hostname and related information. If no command is specified, + this is the implied default. -- cgit v1.2.2 From 0f61b3b0ded362b81f79b541545c46e49133f4bb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 14 Mar 2018 14:52:45 +0900 Subject: man: mention 'status' is the default command for localectl (cherry picked from commit d4e0773b4da6146f64947360ae6f8c971d459372) --- man/localectl.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/man/localectl.xml b/man/localectl.xml index 89a7ab2855..eff8bc3c9e 100644 --- a/man/localectl.xml +++ b/man/localectl.xml @@ -118,6 +118,10 @@ + + + + Commands The following commands are understood: @@ -125,8 +129,8 @@ status - Show current settings of the system locale and - keyboard mapping. + Show current settings of the system locale and keyboard mapping. + If no command is specified, this is the implied default. -- cgit v1.2.2 From 597b5c3b782b6cf24096a75259f7d405dec77fca Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 14 Mar 2018 15:10:46 +0900 Subject: man: mention 'status' is the default command for timedatectl (cherry picked from commit 24fcd009c3eb89f590bef96dd5495fd4ef796fd0) --- man/timedatectl.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/timedatectl.xml b/man/timedatectl.xml index dba94d8831..f24ec2d4c8 100644 --- a/man/timedatectl.xml +++ b/man/timedatectl.xml @@ -98,6 +98,10 @@ + + + + Commands The following commands are understood: @@ -109,6 +113,7 @@ including whether network time synchronization through systemd-timesyncd.service is active. Even if it is inactive, a different service might still synchronize the clock. + If no command is specified, this is the implied default. -- cgit v1.2.2 From ea930139eabb18b2e7acf814d9ee696748e2831a Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Mon, 19 Mar 2018 10:05:49 -0700 Subject: macros: fix sysusers_create_inline (#8489) This typo was introduced in commit dd2490ae12ad1e when using here-documents for the macro values. (cherry picked from commit c2887d565f35a6b512bd4571d11322027a8c05bb) --- src/core/macros.systemd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index 8307712ffe..6a162a0ec8 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -102,7 +102,7 @@ systemd-sysusers %{?*} >/dev/null 2>&1 || : \ %sysusers_create_inline() \ systemd-sysusers - </dev/null 2>&1 || : \ -%(cat %2) \ +%{?*} \ SYSTEMD_INLINE_EOF \ %{nil} -- cgit v1.2.2 From 3015f90bd906fa05339ad25d6c1af4855c4f1536 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Mon, 19 Mar 2018 19:19:53 +0100 Subject: hwdb: ThinkPad T560 doesn't have a caps lock led (#8490) Similar to 16bed3afa1b916ace5e927392a1baab9dd9ff963, this model also doesn't have the LED. ``` cat /sys/class/dmi/id/modalias dmi:bvnLENOVO:bvrN1KET16W(1.03):bd01/20/2016:svnLENOVO:pn20FH001AMX:pvrThinkPadT560:rvnLENOVO:rn20FH001AMX:rvrSDK0J40705WIN:cvnLENOVO:ct10:cvrNone: ``` (cherry picked from commit bc33509ea0d688428f809712f67c9536a34b6356) --- hwdb/60-keyboard.hwdb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb index e05b1d10c2..f0976a6d48 100644 --- a/hwdb/60-keyboard.hwdb +++ b/hwdb/60-keyboard.hwdb @@ -1425,3 +1425,8 @@ evdev:input:b0003v046Dp4002* # Lenovo ThinkPad T450s evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT450s KEYBOARD_LED_CAPSLOCK=0 + +# Lenovo ThinkPad T560s +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT560s + KEYBOARD_LED_CAPSLOCK=0 + KEYBOARD_LED_NUMLOCK=0 -- cgit v1.2.2 From b4467b2fb6a8e140700752a906ca4f98d5f75c74 Mon Sep 17 00:00:00 2001 From: "Matteo F. Vescovi" Date: Tue, 20 Mar 2018 07:41:19 +0100 Subject: hwdb: ThinkPad 4x0s and X1 Carbon 3rd gen LEDs (#8492) (cherry picked from commit c72102edd503cabfb7abeee009e06b823a9717c4) --- hwdb/60-keyboard.hwdb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb index f0976a6d48..808ed54a77 100644 --- a/hwdb/60-keyboard.hwdb +++ b/hwdb/60-keyboard.hwdb @@ -1422,6 +1422,14 @@ evdev:input:b0003v046Dp4002* KEYBOARD_LED_NUMLOCK=0 KEYBOARD_LED_CAPSLOCK=0 +# Lenovo ThinkPad T430s +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT430s + KEYBOARD_LED_CAPSLOCK=0 + +# Lenovo ThinkPad T440s +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT440s + KEYBOARD_LED_CAPSLOCK=0 + # Lenovo ThinkPad T450s evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT450s KEYBOARD_LED_CAPSLOCK=0 @@ -1430,3 +1438,7 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT450s evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT560s KEYBOARD_LED_CAPSLOCK=0 KEYBOARD_LED_NUMLOCK=0 + +# Lenovo ThinkPad X1 Carbon 3rd Gen +evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX1Carbon3rd + KEYBOARD_LED_CAPSLOCK=0 -- cgit v1.2.2 From ff47896b4866c3b8a90012e113e1cf0a13bdcddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 14 Mar 2018 12:37:19 +0100 Subject: core/umount: fix unitialized fields in MountPoint in dm_list_get() This one might actually might cause a crash. (cherry picked from commit b93618644bf24bc0cd87adb1346955d783f6f9b8) --- src/core/umount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/umount.c b/src/core/umount.c index 8ba4179a0f..de826edd4d 100644 --- a/src/core/umount.c +++ b/src/core/umount.c @@ -315,7 +315,7 @@ static int dm_list_get(MountPoint **head) { if (!node) return -ENOMEM; - m = new(MountPoint, 1); + m = new0(MountPoint, 1); if (!m) { free(node); return -ENOMEM; -- cgit v1.2.2 From f9e4beb2690f7b6848cf1f3c146190a28782a66a Mon Sep 17 00:00:00 2001 From: Jui-Chi Ricky Liang Date: Tue, 20 Mar 2018 16:54:18 +0800 Subject: v4l_id: check mplane video capture and output capailities (#8464) Video devices using mplane buffer API declare capture and output capabilities with V4L2_CAP_VIDEO_CAPTURE_MPLANE and V4L2_CAP_VIDEO_OUTPUT_MPLANE. (cherry picked from commit 27b6cb1f59e1e7a5cc0e70d293dbb1607f754a99) --- src/udev/v4l_id/v4l_id.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c index 05f31d479e..8c525c1139 100644 --- a/src/udev/v4l_id/v4l_id.c +++ b/src/udev/v4l_id/v4l_id.c @@ -68,9 +68,11 @@ int main(int argc, char *argv[]) { printf("ID_V4L_VERSION=2\n"); printf("ID_V4L_PRODUCT=%s\n", v2cap.card); printf("ID_V4L_CAPABILITIES=:"); - if ((v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0) + if ((v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0 || + (v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) > 0) printf("capture:"); - if ((v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) > 0) + if ((v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) > 0 || + (v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE) > 0) printf("video_output:"); if ((v2cap.capabilities & V4L2_CAP_VIDEO_OVERLAY) > 0) printf("video_overlay:"); -- cgit v1.2.2 From 1ea48092d3fbb3d3a02226898a5837ccc4d917fd Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 20 Mar 2018 09:32:05 +0100 Subject: sysusers: also add support for NIS entries in /etc/shadow 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. (cherry picked from commit 19ec7de2d65ad01a76a2f8672363e72c43607934) --- src/sysusers/sysusers.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 5dcc213b17..0af4af06aa 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -497,6 +497,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char **tmpfile_path) { _cleanup_fclose_ FILE *original = NULL, *shadow = NULL; _cleanup_(unlink_and_freep) char *shadow_tmp = NULL; + struct spwd *sp = NULL; Iterator iterator; long lstchg; Item *i; @@ -513,7 +514,6 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char original = fopen(shadow_path, "re"); if (original) { - struct spwd *sp; r = sync_rights(original, shadow); if (r < 0) @@ -534,6 +534,11 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char } errno = 0; + + /* Make sure we keep the NIS entries (if any) at the end. */ + if (IN_SET(sp->sp_namp[0], '+', '-')) + break; + if (putspent(sp, shadow) < 0) return errno ? -errno : -EIO; @@ -566,6 +571,19 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char if (putspent(&n, shadow) != 0) return errno ? -errno : -EIO; } + errno = 0; + + /* Append the remaining NIS entries if any */ + while (sp) { + errno = 0; + if (putspent(sp, shadow) < 0) + return errno ? -errno : -EIO; + + errno = 0; + sp = fgetspent(original); + } + if (!IN_SET(errno, 0, ENOENT)) + return -errno; r = fflush_sync_and_check(shadow); if (r < 0) -- cgit v1.2.2 From 59e913549aa4a340f809cadf0bb35809156d76e8 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 20 Mar 2018 11:38:00 +0100 Subject: sysusers: make sure to reset errno before calling fget*ent() Due to the glibc interface we have to test errno in various places to detect if an error occured after calling fget*ent() helpers. (cherry picked from commit 8c1b45aa9cc0241bdf2c143df493ddf2596ae8b1) --- src/sysusers/sysusers.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 0af4af06aa..43952e5f19 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -429,11 +429,12 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char return -EEXIST; } + errno = 0; + /* Make sure we keep the NIS entries (if any) at the end. */ if (IN_SET(pw->pw_name[0], '+', '-')) break; - errno = 0; if (putpwent(pw, passwd) < 0) return errno ? -errno : -EIO; @@ -471,6 +472,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char if (putpwent(&n, passwd) != 0) return errno ? -errno : -EIO; } + errno = 0; /* Append the remaining NIS entries if any */ while (pw) { @@ -478,6 +480,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char if (putpwent(pw, passwd) < 0) return errno ? -errno : -EIO; + errno = 0; pw = fgetpwent(original); } if (!IN_SET(errno, 0, ENOENT)) @@ -637,6 +640,8 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** return -EEXIST; } + errno = 0; + /* Make sure we keep the NIS entries (if any) at the end. */ if (IN_SET(gr->gr_name[0], '+', '-')) break; @@ -672,6 +677,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** group_changed = true; } + errno = 0; /* Append the remaining NIS entries if any */ while (gr) { @@ -679,6 +685,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** if (putgrent(gr, group) != 0) return errno > 0 ? -errno : -EIO; + errno = 0; gr = fgetgrent(original); } if (!IN_SET(errno, 0, ENOENT)) -- cgit v1.2.2 From 649030e8cb00b2a9f1767cb8f77f7edb522b1dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 20 Mar 2018 18:07:17 +0100 Subject: nspawn: move network namespace creation to a separate step (#8430) 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 (cherry picked from commit 0441378080489e4ab6704cd0a2d78cb1ceaca899) --- src/nspawn/nspawn.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 90f1c4184f..4b941edaea 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2323,10 +2323,15 @@ static int inner_child( arg_uid_shift, arg_uid_range, arg_selinux_apifs_context); - if (r < 0) return r; + if (!arg_network_namespace_path && arg_private_network) { + r = unshare(CLONE_NEWNET); + if (r < 0) + return log_error_errno(errno, "Failed to unshare network namespace: %m"); + } + r = mount_sysfs(NULL, arg_mount_settings); if (r < 0) return r; @@ -2341,7 +2346,7 @@ static int inner_child( if (arg_use_cgns && cg_ns_supported()) { r = unshare(CLONE_NEWCGROUP); if (r < 0) - return log_error_errno(errno, "Failed to unshare cgroup namespace"); + return log_error_errno(errno, "Failed to unshare cgroup namespace: %m"); r = mount_cgroups( "", arg_unified_cgroup_hierarchy, @@ -2568,7 +2573,6 @@ static int outer_child( ssize_t l; int r; _cleanup_close_ int fd = -1; - bool create_netns; assert(barrier); assert(directory); @@ -2811,11 +2815,8 @@ static int outer_child( if (fd < 0) return fd; - create_netns = !arg_network_namespace_path && arg_private_network; - pid = raw_clone(SIGCHLD|CLONE_NEWNS| arg_clone_ns_flags | - (create_netns ? CLONE_NEWNET : 0) | (arg_userns_mode != USER_NAMESPACE_NO ? CLONE_NEWUSER : 0)); if (pid < 0) return log_error_errno(errno, "Failed to fork inner child: %m"); -- cgit v1.2.2 From 4c7f25c07692d8f5f132839e9500617d97358b7e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 Mar 2018 11:46:49 +0100 Subject: sd-bus: drop fd_nonblock() calls that are implied by rearrange_stdio() (#8514) (cherry picked from commit 68b525d1d1e8153cbc2e2354fa650aa165f7a434) --- src/libsystemd/sd-bus/bus-socket.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index 166fba1579..082688b17e 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -963,9 +963,6 @@ int bus_socket_exec(sd_bus *b) { if (rearrange_stdio(s[1], s[1], STDERR_FILENO) < 0) _exit(EXIT_FAILURE); - (void) fd_nonblock(STDIN_FILENO, false); - (void) fd_nonblock(STDOUT_FILENO, false); - if (b->exec_argv) execvp(b->exec_path, b->exec_argv); else { -- cgit v1.2.2 From c58ab03f64890e7db88745a843bd4520e307099b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Mar 2018 20:41:30 +0100 Subject: journal: don't insist that the journal file header's boot ID matches the 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 (cherry picked from commit e71d1f6c7839ac97ae2805269f2a65d273e357a9) --- src/journal/journal-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c index dc6b21b1e9..4d35168591 100644 --- a/src/journal/journal-verify.c +++ b/src/journal/journal-verify.c @@ -1245,7 +1245,7 @@ int journal_file_verify( } if (entry_monotonic_set && - (!sd_id128_equal(entry_boot_id, f->header->boot_id) || + (sd_id128_equal(entry_boot_id, f->header->boot_id) && entry_monotonic != le64toh(f->header->tail_entry_monotonic))) { error(0, "Invalid tail monotonic timestamp"); r = -EBADMSG; -- cgit v1.2.2 From c885a886eb7400010c728814d6ef4c3404149009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 19 Mar 2018 09:21:02 +0100 Subject: basic/calendarspec: add check for repeat values that would overflow https://oss-fuzz.com/v2/issue/4651449704251392/7004 (cherry picked from commit e127f26b1a19571a4da6094c226ad5f34438357a) [The fuzz case was not backported.] --- src/basic/calendarspec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c index fd78022773..8f3bb9102f 100644 --- a/src/basic/calendarspec.c +++ b/src/basic/calendarspec.c @@ -181,6 +181,8 @@ int calendar_spec_normalize(CalendarSpec *c) { } _pure_ static bool chain_valid(CalendarComponent *c, int from, int to, bool end_of_month) { + assert(to >= from); + if (!c) return true; @@ -191,6 +193,10 @@ _pure_ static bool chain_valid(CalendarComponent *c, int from, int to, bool end_ if (c->start < from || c->start > to) return false; + /* Avoid overly large values that could cause overflow */ + if (c->repeat > to - from) + return false; + /* * c->repeat must be short enough so at least one repetition may * occur before the end of the interval. For dates scheduled -- cgit v1.2.2 From 59e82d4fb689d1c654284aab12cef2c081fbcb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 19 Mar 2018 15:43:35 +0100 Subject: core/load-fragment: reject overly long paths early 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. (cherry picked from commit e3c3d6761b3e7d7b628a5bcbbabeb9e6e06bb6a3) [The fuzz case was not backported.] --- src/core/load-fragment.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 1e3416c40b..5b30c47e83 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -257,11 +257,19 @@ int config_parse_unit_path_printf( assert(rvalue); assert(u); + /* Let's not bother with anything that is too long */ + if (strlen(rvalue) >= PATH_MAX) { + log_syntax(unit, LOG_ERR, filename, line, 0, + "%s value too long%s.", + lvalue, fatal ? "" : ", ignoring"); + return fatal ? -ENAMETOOLONG : 0; + } + r = unit_full_printf(u, rvalue, &k); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to resolve unit specifiers on %s%s: %m", - fatal ? "" : ", ignoring", rvalue); + "Failed to resolve unit specifiers in \"%s\"%s: %m", + rvalue, fatal ? "" : ", ignoring"); return fatal ? -ENOEXEC : 0; } -- cgit v1.2.2 From 9d8a15b10ecd7e67a3a4def4b3fa1ab39ad81658 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 24 Mar 2018 00:15:41 +1000 Subject: udev: don't label high-button mice as joysticks (#8493) If a device exposes more than 16 mouse buttons, we run into the BTN_JOYSTICK range, also labelling it as joystick. And since 774ff9b this results in only ID_INPUT_JOYSTICK but no ID_INPUT_MOUSE. Fixes #8460 (cherry picked from commit 0cd6767cf0352c6c987e7d169945aea5fd5b3a96) --- src/udev/udev-builtin-input_id.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index 02b86cce23..4d5b1233f1 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -195,15 +195,23 @@ static bool test_pointers(struct udev_device *dev, has_mt_coordinates = false; is_direct = test_bit(INPUT_PROP_DIRECT, bitmask_props); has_touch = test_bit(BTN_TOUCH, bitmask_key); + /* joysticks don't necessarily have buttons; e. g. * rudders/pedals are joystick-like, but buttonless; they have - * other fancy axes. Others have buttons only but no axes. */ - for (button = BTN_JOYSTICK; button < BTN_DIGI && !has_joystick_axes_or_buttons; button++) - has_joystick_axes_or_buttons = test_bit(button, bitmask_key); - for (button = BTN_TRIGGER_HAPPY1; button <= BTN_TRIGGER_HAPPY40 && !has_joystick_axes_or_buttons; button++) - has_joystick_axes_or_buttons = test_bit(button, bitmask_key); - for (button = BTN_DPAD_UP; button <= BTN_DPAD_RIGHT && !has_joystick_axes_or_buttons; button++) - has_joystick_axes_or_buttons = test_bit(button, bitmask_key); + * other fancy axes. Others have buttons only but no axes. + * + * The BTN_JOYSTICK range starts after the mouse range, so a mouse + * with more than 16 buttons runs into the joystick range (e.g. Mad + * Catz Mad Catz M.M.O.TE). Skip those. + */ + if (!test_bit(BTN_JOYSTICK - 1, bitmask_key)) { + for (button = BTN_JOYSTICK; button < BTN_DIGI && !has_joystick_axes_or_buttons; button++) + has_joystick_axes_or_buttons = test_bit(button, bitmask_key); + for (button = BTN_TRIGGER_HAPPY1; button <= BTN_TRIGGER_HAPPY40 && !has_joystick_axes_or_buttons; button++) + has_joystick_axes_or_buttons = test_bit(button, bitmask_key); + for (button = BTN_DPAD_UP; button <= BTN_DPAD_RIGHT && !has_joystick_axes_or_buttons; button++) + has_joystick_axes_or_buttons = test_bit(button, bitmask_key); + } for (axis = ABS_RX; axis < ABS_PRESSURE && !has_joystick_axes_or_buttons; axis++) has_joystick_axes_or_buttons = test_bit(axis, bitmask_abs); -- cgit v1.2.2 From 20785fa6ca3634e0d492486a66dd89a7886c0539 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Mar 2018 09:47:04 +0100 Subject: stat-util: fix fd_is_network_ns() This was broken in 77f9fa3b8ea46c27e5a5e9270f71bf1b4000c3e0. My fault. Fixes: #8543 (cherry picked from commit 29f74559d4dc6ea41232233d32f1a92bcee43626) --- src/basic/stat-util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 3689f6e983..67705947aa 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -254,7 +254,8 @@ int fd_is_network_ns(int fd) { if (r <= 0) return r; - if (ioctl(fd, NS_GET_NSTYPE) < 0) + r = ioctl(fd, NS_GET_NSTYPE); + if (r < 0) return -errno; return r == CLONE_NEWNET; -- cgit v1.2.2 From de5826c5b3d02b801810913b40a1090b04105127 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 20 Mar 2018 18:11:39 +0900 Subject: resolve: actually shows information about all specified interfaces (cherry picked from commit 2892077c937f85a019fcb3bdbcd4433f2e373274) --- src/resolve/resolve-tool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c index fce86d1e74..d7515721b6 100644 --- a/src/resolve/resolve-tool.c +++ b/src/resolve/resolve-tool.c @@ -2398,11 +2398,11 @@ int main(int argc, char **argv) { STRV_FOREACH(ifname, argv + optind) { int ifindex, q; - q = parse_ifindex(argv[optind], &ifindex); + q = parse_ifindex(*ifname, &ifindex); if (q < 0) { - ifindex = if_nametoindex(argv[optind]); + ifindex = if_nametoindex(*ifname); if (ifindex <= 0) { - log_error_errno(errno, "Failed to resolve interface name: %s", argv[optind]); + log_error_errno(errno, "Failed to resolve interface name '%s': %m", *ifname); continue; } } -- cgit v1.2.2 From bf3eefb69901df47736191aefd55f49e3d652fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 21 Mar 2018 16:07:20 +0100 Subject: man: add a note that nspawn gives access to network by default Fixes #6546. (cherry picked from commit bc96c63c0522dc81c036dcd340369eb04df8d0e9) --- man/systemd-nspawn.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 633d939384..55ef48bfec 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -519,8 +519,10 @@ configured with . If this option is specified, the CAP_NET_ADMIN capability will be added to the set of capabilities the container retains. The - latter may be disabled by using - . + latter may be disabled by using . + If this option is not specified (or implied by one of the options + listed below), the container will have full access to the host network. + -- cgit v1.2.2 From cca96c039e14dc01fba5964ab11d2e53e0a7a197 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 26 Mar 2018 17:34:53 +0200 Subject: core: don't include libmount.h in a header file (#8580) linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_* definitions. To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h should be included. And missing.h must be included last. Without this, building systemd may fail with: In file included from [...]/libmount/libmount.h:31:0, from ../systemd-238/src/core/manager.h:23, from ../systemd-238/src/core/emergency-action.h:37, from ../systemd-238/src/core/unit.h:34, from ../systemd-238/src/core/dbus-timer.h:25, from ../systemd-238/src/core/timer.c:26: [...]/sys/mount.h:57:2: error: expected identifier before numeric constant (cherry picked from commit 227b8a762fea1458547be2cdf0e6e4aac0079730) --- src/core/dbus-execute.c | 1 + src/core/manager.h | 3 ++- src/core/mount.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 635213a866..c6c7f26773 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -18,6 +18,7 @@ along with systemd; If not, see . ***/ +#include #include #include diff --git a/src/core/manager.h b/src/core/manager.h index d4eaaa1c4b..152640bd83 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -20,7 +20,6 @@ along with systemd; If not, see . ***/ -#include #include #include @@ -34,6 +33,8 @@ #include "list.h" #include "ratelimit.h" +struct libmnt_monitor; + /* Enforce upper limit how many names we allow */ #define MANAGER_MAX_NAMES 131072 /* 128K */ diff --git a/src/core/mount.c b/src/core/mount.c index cfe8ec9044..fb55c71d3c 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -23,6 +23,8 @@ #include #include +#include + #include "sd-messages.h" #include "alloc-util.h" -- cgit v1.2.2 From d66dac530acb3eaa4dcc0a0dcd79a3323ab1eac2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 27 Mar 2018 09:36:49 +0200 Subject: journal-file: we can't use a chain cache entry if we don't know where it starts (#8542) It might happen that we try to bisect through a chain of offset arrays in the journal whose last element was just allocated but no item yet written to. In that case that array will be all NUL, but it might still end up in our array chain cache. If it does, we cannot use it for bisection, since for bisection we need to know the value of the first entry in that array, but if it's uninitialized it does not have a first value. Hence, as a simple fix, in this unlikely case, simply ignore the chain cache. This is supposed to fix the issue pointed out in #8432, but in a more permissive way, as this case isn't strictly a badly formatted journal but actually a valid state (though one within a very short time window), and we should make the best of it, and handle it gracefully. Background: in each journal file entries are linked up in large arrays of offsets. In each array the entries are strictly ordered by the offsets of the entries, which permits search by bisection. These arrays are allocated with a fixed size and then filled up as entries are added to the journal file. If an array is fully filled up, a new array (double in size as the old one) is appended to the journal file, and linked up. This means, the journal file will contain a series of chained up arrays, each time doubling in size, and strictly ordered. When looking for an entry we maintain a "chain cache", which allows us to bypass traversing the chain in full if we look for entries close to each other in a short time. With the fix above we make sure we don't erroneously use a chain cache item that doesn't carry enough information for this bisection to work. Original issue identified (with patch) by @Kxuan. Replaces: #8432 (cherry picked from commit 96d4d0244bf6eabfd3598177101046653cb70e64) --- src/journal/journal-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 5643c0578d..9a225060b6 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -2187,7 +2187,7 @@ static int generic_array_bisect( a = first; ci = ordered_hashmap_get(f->chain_cache, &first); - if (ci && n > ci->total) { + if (ci && n > ci->total && ci->begin != 0) { /* Ah, we have iterated this bisection array chain * previously! Let's see if we can skip ahead in the * chain, as far as the last time. But we can't jump -- cgit v1.2.2 From e6a038ec9dde8accc2ced04d38127bda53b64d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 26 Mar 2018 10:40:45 +0200 Subject: README: mention systemd-stable Fixes #8564. https://www.freedesktop.org/wiki/Software/systemd/Backports/ has already been adjusted. (cherry picked from commit 94ac201ac2dd8228038f0451d81aee897aa007f6) --- README | 11 +++++++++++ README.md | 2 ++ 2 files changed, 13 insertions(+) diff --git a/README b/README index 8807e5cfe4..b735214e2e 100644 --- a/README +++ b/README @@ -314,6 +314,17 @@ WARNINGS: nice output only on exit(), hence on shutdown we don't execve() systemd-shutdown. +STABLE BRANCHES AND BACKPORTS + + Stable branches with backported patches are available in the + systemd-stable repo at https://github.com/systemd/systemd-stable. + + Stable branches are started for certain releases of systemd and named + after them, e.g. v238-stable. Stable branches are managed by + distribution maintainers on an as needed basis. See + https://www.freedesktop.org/wiki/Software/systemd/Backports/ for some + more information and examples. + ENGINEERING AND CONSULTING SERVICES: Kinvolk (https://kinvolk.io) offers professional engineering and consulting services for systemd. Please contact Chris Kühl diff --git a/README.md b/README.md index 4b017faf1b..c122d01731 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,5 @@ Please see our [Contribution Guidelines](../master/.github/CONTRIBUTING.md) for When preparing patches for systemd, please follow our [Coding Style Guidelines](../master/doc/CODING_STYLE). If you are looking for support, please contact our [mailing list](https://lists.freedesktop.org/mailman/listinfo/systemd-devel) or join our [IRC channel](irc://irc.freenode.org/%23systemd). + +Stable branches with backported patches are available in the [stable repo](https://github.com/systemd/systemd-stable). -- cgit v1.2.2 From 4cabaa3dd8eb7513802fe49ea386622cce3a87f4 Mon Sep 17 00:00:00 2001 From: Lauri Tirkkonen Date: Wed, 28 Mar 2018 13:57:21 +0300 Subject: nspawn: do not insist on locking read-only container on readonly fs (#8589) (cherry picked from commit 8be17c9b136c6884f38dde9e3ec519886ad4c7e0) --- src/shared/machine-image.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 66eefb3036..de67058207 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -881,8 +881,13 @@ int image_path_lock(const char *path, int operation, LockFile *global, LockFile * block devices are device local anyway. */ if (!path_startswith(path, "/dev")) { r = make_lock_file_for(path, operation, &t); - if (r < 0) - return r; + if (r < 0) { + if ((operation & LOCK_SH) && r == -EROFS) + log_debug_errno(r, "Failed to create shared " + "lock for %s: %m", path); + else + return r; + } } if (p) { -- cgit v1.2.2 From 6fd6c0d7d7502f61f177feb5356b97545827f012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 28 Mar 2018 10:15:44 +0200 Subject: shared/specifier: be less extravagant with memory allocations ubsan times out because we do too many allocations: $ valgrind build/fuzz-unit-file test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6977-full ... test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6977-full... ok ==1757== ==1757== HEAP SUMMARY: ==1757== in use at exit: 0 bytes in 0 blocks ==1757== total heap usage: 199,997 allocs, 199,997 frees, 90,045,318,585 bytes allocated ... ==3256== total heap usage: 100,120 allocs, 100,120 frees, 13,097,140 bytes allocated https://oss-fuzz.com/v2/issue/4651449704251392/6977 should now be really fixed. e3c3d6761b3e7d was the first attempt, but even with this change, e3c3d6761b3e7d still makes sense. (cherry picked from commit e2093454a248ff7d879077a77f4e9a086439d353) [fuzz case was not backported.] --- src/shared/specifier.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/shared/specifier.c b/src/shared/specifier.c index 23aaa88c4b..62be2bf0a2 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -46,7 +46,7 @@ #define POSSIBLE_SPECIFIERS ALPHANUMERICAL "%" int specifier_printf(const char *text, const Specifier table[], void *userdata, char **_ret) { - size_t l; + size_t l, allocated = 0; _cleanup_free_ char *ret = NULL; char *t; const char *f; @@ -57,14 +57,11 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata, assert(table); l = strlen(text); - ret = new(char, l+1); - if (!ret) + if (!GREEDY_REALLOC(ret, allocated, l + 1)) return -ENOMEM; - t = ret; - for (f = text; *f; f++, l--) { - + for (f = text; *f; f++, l--) if (percent) { if (*f == '%') *(t++) = '%'; @@ -77,7 +74,6 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata, if (i->lookup) { _cleanup_free_ char *w = NULL; - char *n; size_t k, j; r = i->lookup(i->specifier, i->data, userdata, &w); @@ -87,14 +83,9 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata, j = t - ret; k = strlen(w); - n = new(char, j + k + l + 1); - if (!n) + if (!GREEDY_REALLOC(ret, allocated, j + k + l + 1)) return -ENOMEM; - - memcpy(n, ret, j); - memcpy(n + j, w, k); - - free_and_replace(ret, n); + memcpy(ret + j, w, k); t = ret + j + k; } else if (strchr(POSSIBLE_SPECIFIERS, *f)) /* Oops, an unknown specifier. */ @@ -110,7 +101,6 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata, percent = true; else *(t++) = *f; - } /* if string ended with a stray %, also end with % */ if (percent) -- cgit v1.2.2 From 2cdc3c58322d75db434eae111e8f2026d509dde6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 28 Mar 2018 10:33:40 +0200 Subject: shared/specifier: use realloc to free some memory after specifier expansion This is a separate commit only because it actually *increases* memory allocations: ==3256== total heap usage: 100,120 allocs, 100,120 frees, 13,097,140 bytes allocated to ==4690== total heap usage: 100,121 allocs, 100,121 frees, 14,198,329 bytes allocated Essentially, we do a little more work to reduce the memory footprint a bit. For a test where we just allocate the memory and drop it soon afterwards, this is not beneficial, but it should still be useful for a long running program. (cherry picked from commit bec8a68ceee4cbf5de4d7026e750f11130c33ccd) --- src/shared/specifier.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/shared/specifier.c b/src/shared/specifier.c index 62be2bf0a2..849ff67e76 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -102,11 +102,18 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata, else *(t++) = *f; - /* if string ended with a stray %, also end with % */ + /* If string ended with a stray %, also end with % */ if (percent) *(t++) = '%'; + *(t++) = 0; + + /* Try to deallocate unused bytes, but don't sweat it too much */ + if ((size_t)(t - ret) < allocated) { + t = realloc(ret, t - ret); + if (t) + ret = t; + } - *t = 0; *_ret = ret; ret = NULL; return 0; -- cgit v1.2.2 From 9dc914916daacd120bbf52e4989764b3e0cbb1a6 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 28 Mar 2018 21:58:10 +0200 Subject: systemd-inhibit: ignore signal interrupt from keyboard (#8569) By default both processes, systemd-inhibit and the forked one, receive the signals. Pressing Ctrl+C on the keyboard results in SIGINT being sent to the processes, followed by SIGTERM being sent to the forked process when systemd-inhibit exits. This can cause trouble when the forked process does not clean up properly but exit immediately. Instead make systemd-inhibit ignore SIGINT, leaving it to the forked process to clean up and exit. (cherry picked from commit 106f12a08fcacef713438fc055872592399deeed) --- src/login/inhibit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/login/inhibit.c b/src/login/inhibit.c index 6b5d9c29b9..c118421e6b 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -254,6 +254,9 @@ int main(int argc, char *argv[]) { _cleanup_free_ char *w = NULL; pid_t pid; + /* Ignore SIGINT and allow the forked process to receive it */ + (void) ignore_signals(SIGINT, -1); + if (!arg_who) arg_who = w = strv_join(argv + optind, " "); -- cgit v1.2.2 From 18334f048bd679ee82fd1e614b1adc5dcc81adb5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 29 Mar 2018 23:15:56 +0900 Subject: timesync: on network event do not establish connection when NTP servers are not changed (#8611) Fixes #8603. (cherry picked from commit 3e85ec072180b6fbec82d715186985536859a29d) --- src/timesync/timesyncd-manager.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index a6d336c461..7743036023 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -1006,6 +1006,7 @@ static int manager_network_read_link_servers(Manager *m) { _cleanup_strv_free_ char **ntp = NULL; ServerName *n, *nx; char **i; + bool changed = false; int r; assert(m); @@ -1031,14 +1032,18 @@ static int manager_network_read_link_servers(Manager *m) { r = server_name_new(m, NULL, SERVER_LINK, *i); if (r < 0) goto clear; + + changed = true; } } LIST_FOREACH_SAFE(names, n, nx, m->link_servers) - if (n->marked) + if (n->marked) { server_name_free(n); + changed = true; + } - return 0; + return changed; clear: manager_flush_server_names(m, SERVER_LINK); @@ -1047,14 +1052,14 @@ clear: static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t revents, void *userdata) { Manager *m = userdata; - bool connected, online; + bool changed, connected, online; int r; assert(m); sd_network_monitor_flush(m->network_monitor); - manager_network_read_link_servers(m); + changed = !!manager_network_read_link_servers(m); /* check if the machine is online */ online = network_is_online(); @@ -1066,7 +1071,7 @@ static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t re log_info("No network connectivity, watching for changes."); manager_disconnect(m); - } else if (!connected && online) { + } else if (!connected && online && changed) { log_info("Network configuration changed, trying to establish connection."); if (m->current_server_address) -- cgit v1.2.2 From 5127fbedd7a40a9ab31ade29f416458e3adbe949 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 31 Mar 2018 05:55:45 -0500 Subject: generate-af-list.sh: slightly generalize pattern, fix w/musl (#8629) Accept definitions to other AF_ constants, not just PF_ ones, such as: #define AF_LINUX AF_LOCAL It may not be necessary to impose any restriction on the definitions of the macros extracted, but for now keep most of that requirement but match AF_* as well. (cherry picked from commit 203690537b2d2c099a1380e0950d07981b4471c4) --- src/basic/generate-af-list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/generate-af-list.sh b/src/basic/generate-af-list.sh index fa74198e58..39e2dad5e7 100755 --- a/src/basic/generate-af-list.sh +++ b/src/basic/generate-af-list.sh @@ -3,4 +3,4 @@ set -eu $1 -E -dM -include sys/socket.h - Date: Tue, 3 Apr 2018 04:06:53 +0100 Subject: man: machinectl: update fedora exmple URL (#8642) (cherry picked from commit fcc7ce4c8e68b0eaef2db1649d1b40ad54f8dc9c) --- man/machinectl.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/machinectl.xml b/man/machinectl.xml index 1adebf5da0..7bc9ee208e 100644 --- a/man/machinectl.xml +++ b/man/machinectl.xml @@ -999,12 +999,12 @@ Download a Fedora image, set a root password in it, start it as service - # machinectl pull-raw --verify=no https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.raw.xz -# systemd-nspawn -M Fedora-Cloud-Base-23-20151030 + # machinectl pull-raw --verify=no https://dl.fedoraproject.org/pub/fedora/linux/releases/27/CloudImages/x86_64/images/Fedora-Cloud-Base-27-1.6.x86_64.raw.xz +# systemd-nspawn -M Fedora-Cloud-Base-27-1.6.x86_64 # passwd # exit -# machinectl start Fedora-Cloud-Base-23-20151030 -# machinectl login Fedora-Cloud-Base-23-20151030 +# machinectl start Fedora-Cloud-Base-27-1.6.x86_64 +# machinectl login Fedora-Cloud-Base-27-1.6.x86_64 This downloads the specified .raw image with verification disabled. Then, a shell is opened in it -- cgit v1.2.2 From 27490aae697879bdcf45570b3be9c39f5eb72961 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Tue, 3 Apr 2018 16:04:22 +0300 Subject: core: skip the removal of cgroups in the TEST_RUN_MINIMAL mode (#8622) When `systemd` is run in the TEST_RUN_MINIMAL mode, it doesn't really set up cgroups, so it shouldn't try to remove anything. Closes https://github.com/systemd/systemd/issues/8474. (cherry picked from commit f6c63f6fc90040f0017a7cc37f3a05d5b86226d7) --- src/core/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 65ed86580f..a923ab8a76 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2306,7 +2306,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) { /* We can't really delete the group, since we are in it. But * let's trim it. */ - if (delete && m->cgroup_root) + if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL) (void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false); m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source); -- cgit v1.2.2 From c9a3144d792f9b7d2994b198288f1d1ff65b95a9 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Tue, 3 Apr 2018 10:05:11 -0300 Subject: tmpfiles: fix directory removal with force symlink (#8619) symlink_atomic returns -EISDIR when the target symlink path is a directory. Fixes #7447 Signed-off-by: Ricardo Salveti (cherry picked from commit 2ef5de1bd95cbcdab7efb6c3a35871c8a2786894) --- src/tmpfiles/tmpfiles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index f1890f3261..afd1111cdd 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1666,7 +1666,7 @@ static int create_item(Item *i) { r = symlink_atomic(i->argument, i->path); mac_selinux_create_file_clear(); - if (IN_SET(r, -EEXIST, -ENOTEMPTY)) { + if (IN_SET(r, -EISDIR, -EEXIST, -ENOTEMPTY)) { r = rm_rf(i->path, REMOVE_ROOT|REMOVE_PHYSICAL); if (r < 0) return log_error_errno(r, "rm -fr %s failed: %m", i->path); -- cgit v1.2.2 From 66a9314e5b655752b4239b41378927bbb98755b1 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 30 Mar 2018 17:06:50 +0900 Subject: bash-completion: busctl: suggests only writable properties for set-property (cherry picked from commit 1e58b1dc40a35d1b0fc8c3cef3ae3c3b7ac481fd) --- shell-completion/bash/busctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index d077675a32..cfa4d4fa83 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -58,8 +58,9 @@ __get_members() { local path=$3 local interface=$4 local type=$5 + local flags=$6 local a b - busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c; do [[ "$b" == "$type" ]] && echo " $a"; done; }; + busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }; } __get_signature() { @@ -176,7 +177,7 @@ _busctl() { elif [[ $n -eq 3 ]] ; then comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) elif [[ $n -eq 4 ]] ; then - comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property) + comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property writable) elif [[ $n -eq 5 ]] ; then comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]}) else -- cgit v1.2.2 From 8e27c889ae7b3bed634b4c67f4d43b94806799e3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 30 Mar 2018 17:08:11 +0900 Subject: bash-completion: busctl: do not suggest "-" for signature Fixes #8371. (cherry picked from commit 4cbb7c500aa664452f45f8ec5a2b1f79a872eb2e) --- shell-completion/bash/busctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index cfa4d4fa83..c467b291b3 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -70,7 +70,7 @@ __get_signature() { local interface=$4 local member=$5 local a b - busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" ]] && echo " \"$c\""; done; }; + busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }; } _busctl() { -- cgit v1.2.2 From c79751911c585e415926364e19c18877f53942df Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 30 Mar 2018 17:13:52 +0900 Subject: bash-completion: busctl: make variables local (cherry picked from commit 7f9c3ecad840fe8584ad4d350eefb67fe43869e7) --- shell-completion/bash/busctl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index c467b291b3..c357c25bc3 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -48,7 +48,7 @@ __get_interfaces() { local mode=$1 local busname=$2 local path=$3 - local a b + local a b c busctl $mode introspect --list --no-legend --no-pager $busname $path | { while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }; } @@ -59,7 +59,7 @@ __get_members() { local interface=$4 local type=$5 local flags=$6 - local a b + local a b c d e busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }; } @@ -69,12 +69,12 @@ __get_signature() { local path=$3 local interface=$4 local member=$5 - local a b + local a b c d busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }; } _busctl() { - local i verb comps mode + local i n verb comps mode local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} local -A OPTS=( [STANDALONE]='-h --help --version --no-pager --no-legend --system --user -- cgit v1.2.2 From 2ecc5e8c80b863a50e899e0e758fbd4149fa77dd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 5 Apr 2018 00:33:22 +0900 Subject: network: fix typo in log message (cherry picked from commit 3d282fff063c81893dc4bbd0282193d20dd5357e) --- src/network/networkd-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 4f55c0172f..1c519d8c49 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -1825,7 +1825,7 @@ int manager_set_timezone(Manager *m, const char *tz) { return log_oom(); if (!m->bus || sd_bus_is_ready(m->bus) <= 0) { - log_info("Not connected to system bus, not setting hostname."); + log_info("Not connected to system bus, not setting timezone."); return 0; } -- cgit v1.2.2 From 6fdb437b18fb8d6b91890edc076f0c43b8b5d6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 29 Mar 2018 16:19:33 +0200 Subject: tmpfiles: add a new return code for "operational failure" when processing Things can fail, and we have no control over it: - file system issues (immutable bits, file system errors, MAC refusals, etc) - kernel refusing certain arguments when writing to /proc/sys or /sys Let's add a new code for the case where we parsed configuration but failed to execute it because of external errors. (cherry picked from commit bb9947be2fa308d198b63b30e494ade5d68e5109) --- man/systemd-tmpfiles.xml | 12 ++++++++---- src/basic/fd-util.h | 4 ++++ src/tmpfiles/tmpfiles.c | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml index a6ae5e4f97..7c64dfaf58 100644 --- a/man/systemd-tmpfiles.xml +++ b/man/systemd-tmpfiles.xml @@ -225,11 +225,15 @@ Exit status - On success, 0 is returned. If the configuration was invalid (invalid syntax, missing - arguments, …), so some lines had to be ignored, but no other errors occurred, + On success, 0 is returned. If the configuration was syntactically invalid (syntax errors, + missing arguments, …), so some lines had to be ignored, but no other errors occurred, 65 is returned (EX_DATAERR from - /usr/include/sysexits.h). Otherwise, 1 is returned - (EXIT_FAILURE from /usr/include/stdlib.h). + /usr/include/sysexits.h). If the configuration was syntactically valid, but + could not be executed (lack of permissions, creation of files in missing directories, invalid + contents when writing to /sys/ values, …), 73 is + returned (EX_DATAERR from /usr/include/sysexits.h). + Otherwise, 1 is returned (EXIT_FAILURE from + /usr/include/stdlib.h). diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 635a538b5a..c68f482eb2 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -98,6 +98,10 @@ int acquire_data_fd(const void *data, size_t size, unsigned flags); #define ERRNO_IS_DISCONNECT(r) \ IN_SET(r, ENOTCONN, ECONNRESET, ECONNREFUSED, ECONNABORTED, EPIPE, ENETUNREACH) +/* Resource exhaustion, could be our fault or general system trouble */ +#define ERRNO_IS_RESOURCE(r) \ + IN_SET(r, ENOMEM, EMFILE, ENFILE) + int fd_move_above_stdio(int fd); int rearrange_stdio(int original_input_fd, int original_output_fd, int original_error_fd); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index afd1111cdd..cbacfae66b 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1293,7 +1293,7 @@ static int write_one_file(Item *i, const char *path) { fd = safe_close(fd); -done: + done: if (stat(path, &st) < 0) return log_error_errno(errno, "stat(%s) failed: %m", path); @@ -2729,7 +2729,7 @@ static int read_config_files(char **config_dirs, char **args, bool *invalid_conf } int main(int argc, char *argv[]) { - int r, k; + int r, k, r_process = 0; ItemArray *a; Iterator iterator; _cleanup_strv_free_ char **config_dirs = NULL; @@ -2776,7 +2776,7 @@ int main(int argc, char *argv[]) { t = strv_join(config_dirs, "\n\t"); if (t) - log_debug("Looking for configuration files in (higher priority first:\n\t%s", t); + log_debug("Looking for configuration files in (higher priority first):\n\t%s", t); } /* If command line arguments are specified along with --replace, read all @@ -2792,22 +2792,20 @@ int main(int argc, char *argv[]) { if (r < 0) goto finish; - - /* The non-globbing ones usually create things, hence we apply * them first */ ORDERED_HASHMAP_FOREACH(a, items, iterator) { k = process_item_array(a); - if (k < 0 && r == 0) - r = k; + if (k < 0 && r_process == 0) + r_process = k; } /* The globbing ones usually alter things, hence we apply them * second. */ ORDERED_HASHMAP_FOREACH(a, globs, iterator) { k = process_item_array(a); - if (k < 0 && r == 0) - r = k; + if (k < 0 && r_process == 0) + r_process = k; } finish: @@ -2822,10 +2820,12 @@ finish: mac_selinux_finish(); - if (r < 0) + if (r < 0 || ERRNO_IS_RESOURCE(-r_process)) return EXIT_FAILURE; else if (invalid_config) return EX_DATAERR; + else if (r_process < 0) + return EX_CANTCREAT; else return EXIT_SUCCESS; } -- cgit v1.2.2 From 63e0c53ba0d2857967e12ad5d6037aa90f44018f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 29 Mar 2018 16:37:21 +0200 Subject: tmpfiles: ignore "operational" errors during setup We still get the errors logged, but we don't fail the service. This is better for users because rerunning tmpfiles-setup.service a second time is dangerous (c.f. cd9f5b68ce08375eb1d68a4ddaa7a24a5092d7ba). Note that this only touches sd-tmpfiles-setup.service and sd-tmpfiles-setup-dev.service. sd-tmpfiles-clean.service is as before. https://bugzilla.redhat.com/show_bug.cgi?id=1539341 (cherry picked from commit c79b89e6eb5efaa69b7d8358c43373fb9fab0af6) --- units/systemd-tmpfiles-setup-dev.service.in | 2 +- units/systemd-tmpfiles-setup.service.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/units/systemd-tmpfiles-setup-dev.service.in b/units/systemd-tmpfiles-setup-dev.service.in index 6a6ebed955..1d06b369d4 100644 --- a/units/systemd-tmpfiles-setup-dev.service.in +++ b/units/systemd-tmpfiles-setup-dev.service.in @@ -20,4 +20,4 @@ ConditionCapability=CAP_SYS_MODULE Type=oneshot RemainAfterExit=yes ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create --boot -SuccessExitStatus=65 +SuccessExitStatus=65 73 diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in index 0410d0bfd8..384be59481 100644 --- a/units/systemd-tmpfiles-setup.service.in +++ b/units/systemd-tmpfiles-setup.service.in @@ -20,4 +20,4 @@ RefuseManualStop=yes Type=oneshot RemainAfterExit=yes ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev -SuccessExitStatus=65 +SuccessExitStatus=65 73 -- cgit v1.2.2 From f398c546c6fc43121131f41acec56b5a851bd35e Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Sat, 7 Apr 2018 17:33:48 +0200 Subject: systemd-udevd: limit children-max by available memory (#8668) Udev workers consume typically 50-100MiB virtual memory. On systems with lots of CPUs and relatively low memory, that may easily cause workers to be OOM-killed. This patch limits the number of workers to 8 per GiB memory. But don't let the limit drop below the smallest value we had without this patch (8 + 1 * 2 = 10); on small systems, udev's memory footprint is likely lower. (cherry picked from commit e438c57a640ac5afba366531be5e456b9fe22672) --- src/udev/udevd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 615c4ed3e2..daaab6417a 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1676,12 +1676,16 @@ int main(int argc, char *argv[]) { if (arg_children_max == 0) { cpu_set_t cpu_set; + unsigned long mem_limit; arg_children_max = 8; if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == 0) arg_children_max += CPU_COUNT(&cpu_set) * 2; + mem_limit = physical_memory() / (128LU*1024*1024); + arg_children_max = MAX(10U, MIN(arg_children_max, mem_limit)); + log_debug("set children_max to %u", arg_children_max); } -- cgit v1.2.2 From 01f208ccd06fb0fe547d8ee46cf8d35f51fc83d1 Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Thu, 5 Apr 2018 14:04:27 +0000 Subject: nspawn: wait for network namespace creation before interface setup (#8633) Otherwise, network interfaces can be "moved" into the container's namespace while it's still the same as the host namespace, in which case e.g. host0 for a veth ends up on the host side instead of inside the container. Regression introduced in 0441378080489e4ab6704cd0a2d78cb1ceaca899. Fixes #8599. (cherry picked from commit 7511655807e90aa33ea7b71991401a79ec36bb41) --- src/nspawn/nspawn.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 4b941edaea..8959fd3172 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2330,6 +2330,9 @@ static int inner_child( r = unshare(CLONE_NEWNET); if (r < 0) return log_error_errno(errno, "Failed to unshare network namespace: %m"); + + /* Tell the parent that it can setup network interfaces. */ + (void) barrier_place(barrier); /* #3 */ } r = mount_sysfs(NULL, arg_mount_settings); @@ -2338,7 +2341,7 @@ static int inner_child( /* Wait until we are cgroup-ified, so that we * can mount the right cgroup path writable */ - if (!barrier_place_and_sync(barrier)) { /* #3 */ + if (!barrier_place_and_sync(barrier)) { /* #4 */ log_error("Parent died too early"); return -ESRCH; } @@ -2449,7 +2452,7 @@ static int inner_child( /* Let the parent know that we are ready and * wait until the parent is ready with the * setup, too... */ - if (!barrier_place_and_sync(barrier)) { /* #4 */ + if (!barrier_place_and_sync(barrier)) { /* #5 */ log_error("Parent died too early"); return -ESRCH; } @@ -3557,6 +3560,14 @@ static int run(int master, if (arg_private_network) { + if (!arg_network_namespace_path) { + /* Wait until the child has unshared its network namespace. */ + if (!barrier_place_and_sync(&barrier)) { /* #3 */ + log_error("Child died too early"); + return -ESRCH; + } + } + r = move_network_interfaces(*pid, arg_network_interfaces); if (r < 0) return r; @@ -3680,7 +3691,7 @@ static int run(int master, * its setup (including cgroup-ification), and that * the child can now hand over control to the code to * run inside the container. */ - (void) barrier_place(&barrier); /* #3 */ + (void) barrier_place(&barrier); /* #4 */ /* Block SIGCHLD here, before notifying child. * process_pty() will handle it with the other signals. */ @@ -3708,7 +3719,7 @@ static int run(int master, return r; /* Let the child know that we are ready and wait that the child is completely ready now. */ - if (!barrier_place_and_sync(&barrier)) { /* #4 */ + if (!barrier_place_and_sync(&barrier)) { /* #5 */ log_error("Child died too early."); return -ESRCH; } -- cgit v1.2.2 From 8ca45a0167b039751832fd7a44138d5a51348d1a Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 6 Mar 2018 23:39:47 +0100 Subject: Use Arch Linux' device access groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cdrom → optical dialout → uucp tape → storage --- rules/50-udev-default.rules.in | 14 +++++++------- sysusers.d/basic.conf.in | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rules/50-udev-default.rules.in b/rules/50-udev-default.rules.in index 191f56f42e..f81c4d0fc5 100644 --- a/rules/50-udev-default.rules.in +++ b/rules/50-udev-default.rules.in @@ -22,7 +22,7 @@ SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" -KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" +KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="uucp" SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" @@ -57,13 +57,13 @@ KERNEL=="irlpt[0-9]*", GROUP="lp" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp" SUBSYSTEM=="block", GROUP="disk" -SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom" -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" -KERNEL=="sch[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd", GROUP="cdrom" +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="optical" +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="optical" +KERNEL=="sch[0-9]*", GROUP="optical" +KERNEL=="pktcdvd[0-9]*", GROUP="optical" +KERNEL=="pktcdvd", GROUP="optical" -SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape" +SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="storage" SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk" KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk" KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control" diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in index 8e358c02d6..33e513a368 100644 --- a/sysusers.d/basic.conf.in +++ b/sysusers.d/basic.conf.in @@ -24,14 +24,14 @@ g utmp - - - # Hardware access groups g audio - - - -g cdrom - - - -g dialout - - - g disk - - - g input - - - g kvm - - - g lp - - - +g optical - - - g render - - - -g tape - - - +g storage - - - +g uucp - - - g video - - - # Default group for normal users -- cgit v1.2.2 From 2fbc388bd59860bc728db7db444eaf313ee659cc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:19:20 -0400 Subject: FSDG: man/: Refer to the operating system as GNU/Linux This is not a blind replacement of "Linux" with "GNU/Linux". In some cases, "Linux" is (correctly) used to refer to just the kernel. In others, it is in a string for which code must also be adjusted; these instances are not included in this commit. --- man/daemon.xml | 4 ++-- man/journald.conf.xml | 2 +- man/machinectl.xml | 2 +- man/sd-bus-errors.xml | 2 +- man/sd-login.xml | 2 +- man/sd_bus_error_add_map.xml | 2 +- man/sd_uid_get_state.xml | 2 +- man/systemd-detect-virt.xml | 4 ++-- man/systemd-machine-id-setup.xml | 2 +- man/systemd-resolved.service.xml | 6 +++--- man/systemd.exec.xml | 2 +- man/systemd.socket.xml | 2 +- man/systemd.xml | 6 +++--- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/man/daemon.xml b/man/daemon.xml index 18337daad8..ab65f6f4d9 100644 --- a/man/daemon.xml +++ b/man/daemon.xml @@ -170,7 +170,7 @@ New-Style Daemons - Modern services for Linux should be implemented as + Modern services for GNU/Linux should be implemented as new-style daemons. This makes it easier to supervise and control them at runtime and simplifies their implementation. @@ -311,7 +311,7 @@ as detailed in the LSB Linux Standard Base Core Specification. This method of - activation is supported ubiquitously on Linux init systems, both + activation is supported ubiquitously on GNU/Linux init systems, both old-style and new-style systems. Among other issues, SysV init scripts have the disadvantage of involving shell scripts in the boot process. New-style init systems generally employ updated diff --git a/man/journald.conf.xml b/man/journald.conf.xml index 844228e324..58b21d424b 100644 --- a/man/journald.conf.xml +++ b/man/journald.conf.xml @@ -132,7 +132,7 @@ SplitMode= Controls whether to split up journal files per user, either uid or - none. Split journal files are primarily useful for access control: on UNIX/Linux access + none. Split journal files are primarily useful for access control: on GNU/Linux access control is managed per file, and the journal daemon will assign users read access to their journal files. If uid, all regular users will each get their own journal files, and system users will log to the system journal. If none, journal files are not split up by user and all messages are diff --git a/man/machinectl.xml b/man/machinectl.xml index 7bc9ee208e..93d5299d26 100644 --- a/man/machinectl.xml +++ b/man/machinectl.xml @@ -899,7 +899,7 @@ The machinectl tool operates on machines and images whose names must be chosen following strict rules. Machine names must be suitable for use as host names - following a conservative subset of DNS and UNIX/Linux + following a conservative subset of DNS and GNU/Linux semantics. Specifically, they must consist of one or more non-empty label strings, separated by dots. No leading or trailing dots are allowed. No sequences of multiple dots are allowed. The diff --git a/man/sd-bus-errors.xml b/man/sd-bus-errors.xml index a655ab1d97..b1f24381dd 100644 --- a/man/sd-bus-errors.xml +++ b/man/sd-bus-errors.xml @@ -128,7 +128,7 @@ In addition to this list, in sd-bus, the special error namespace System.Error. is used to map - arbitrary Linux system errors (as defined by errno3) to D-Bus errors and back. For example, the error EUCLEAN is mapped to diff --git a/man/sd-login.xml b/man/sd-login.xml index 148dd19cea..5b99d9e281 100644 --- a/man/sd-login.xml +++ b/man/sd-login.xml @@ -270,7 +270,7 @@ Multi-Seat on Linux - for an introduction to multi-seat support on Linux and the background for this set of APIs. + for an introduction to multi-seat support on GNU/Linux and the background for this set of APIs. diff --git a/man/sd_bus_error_add_map.xml b/man/sd_bus_error_add_map.xml index b79381fefd..072b31c7d3 100644 --- a/man/sd_bus_error_add_map.xml +++ b/man/sd_bus_error_add_map.xml @@ -84,7 +84,7 @@ The sd_bus_error_add_map() call may be used to register additional mappings for converting D-Bus errors - to Linux errno-style errors. The mappings + to GNU/Linux errno-style errors. The mappings defined with this call are consulted by calls such as sd_bus_error_set3 or diff --git a/man/sd_uid_get_state.xml b/man/sd_uid_get_state.xml index 1183d9079a..c8b62f7a43 100644 --- a/man/sd_uid_get_state.xml +++ b/man/sd_uid_get_state.xml @@ -199,7 +199,7 @@ An input parameter was invalid (out of range, or NULL, where that is not accepted). This is also returned if the passed user ID is 0xFFFF or 0xFFFFFFFF, which are - undefined on Linux. + undefined on GNU/Linux. diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml index aeeb51d09e..68ebf02f2e 100644 --- a/man/systemd-detect-virt.xml +++ b/man/systemd-detect-virt.xml @@ -161,12 +161,12 @@ lxc - Linux container implementation by LXC + Container implementation by LXC lxc-libvirt - Linux container implementation by libvirt + Container implementation by libvirt diff --git a/man/systemd-machine-id-setup.xml b/man/systemd-machine-id-setup.xml index 527cb7bff5..8c4a62ccee 100644 --- a/man/systemd-machine-id-setup.xml +++ b/man/systemd-machine-id-setup.xml @@ -90,7 +90,7 @@ and is different for every booted instance of the VM. - Similarly, if run inside a Linux container + Similarly, if run inside a container environment and a UUID is configured for the container, this is used to initialize the machine ID. For details, see the documentation of the getaddrinfo3 API as defined by RFC3493 and its related resolver functions, including gethostbyname3. This - API is widely supported, including beyond the Linux platform. In its current form it does not expose DNSSEC + API is widely supported, including beyond the GNU/Linux platform. In its current form it does not expose DNSSEC validation status information however, and is synchronous only. This API is backed by the glibc Name Service Switch (nss5). Usage of the glibc NSS module nss-resolve8 @@ -173,7 +173,7 @@ systemd-resolved maintains the - /run/systemd/resolve/stub-resolv.conf file for compatibility with traditional Linux + /run/systemd/resolve/stub-resolv.conf file for compatibility with traditional GNU/Linux programs. This file may be symlinked from /etc/resolv.conf. This file lists the 127.0.0.53 DNS stub (see above) as the only DNS server. It also contains a list of search domains that are in use by systemd-resolved. The list of search domains is always kept up-to-date. Note that @@ -189,7 +189,7 @@ systemd-resolved. This file does not contain any search domains. systemd-resolved maintains the - /run/systemd/resolve/resolv.conf file for compatibility with traditional Linux + /run/systemd/resolve/resolv.conf file for compatibility with traditional GNU/Linux programs. This file may be symlinked from /etc/resolv.conf and is always kept up-to-date, containing information about all known DNS servers. Note the file format's limitations: it does not know a concept of per-interface DNS servers and hence only contains system-wide DNS server definitions. Note that diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index daae94e372..c1867b4ed2 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -217,7 +217,7 @@ which must be one of a-z, A-Z or _ (i.e. numbers and - are not permitted as first character). The user/group name must have at least one character, and at most 31. These restrictions are enforced in order to avoid ambiguities and to ensure user/group names and unit files remain portable among - Linux systems. + GNU/Linux systems. When used in conjunction with DynamicUser= the user/group name specified is dynamically allocated at the time the service is started, and released at the time the service is stopped — diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml index a1943f65ab..a2b5ac0b59 100644 --- a/man/systemd.socket.xml +++ b/man/systemd.socket.xml @@ -302,7 +302,7 @@ Specifies a POSIX message queue name to listen on. This expects a valid message queue name (i.e. beginning with /). Behavior otherwise is very similar to the - ListenFIFO= directive above. On Linux + ListenFIFO= directive above. On GNU/Linux message queue descriptors are actually file descriptors and can be inherited between processes. diff --git a/man/systemd.xml b/man/systemd.xml index ad2c1e4f0b..26555036c4 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -66,7 +66,7 @@ Description - systemd is a system and service manager for Linux operating + systemd is a system and service manager for GNU/Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services. @@ -894,10 +894,10 @@ Kernel Command Line When run as system instance systemd parses a number of - kernel command line argumentsIf run inside a Linux + kernel command line argumentsIf run inside a container these arguments may be passed as command line arguments to systemd itself, next to any of the command line options listed - in the Options section above. If run outside of Linux containers, + in the Options section above. If run outside of a container, these arguments are parsed from /proc/cmdline instead.: -- cgit v1.2.2 From 38c716df393b37723d575c816213088ce1a1463f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:23:40 -0400 Subject: FSDG: os-release: Default PRETTY_NAME to "GNU/Linux" instead of "Linux" --- man/kernel-install.xml | 2 +- man/os-release.xml | 2 +- src/analyze/analyze.c | 2 +- src/core/main.c | 4 ++-- src/firstboot/firstboot.c | 2 +- src/kernel-install/90-loaderentry.install | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/man/kernel-install.xml b/man/kernel-install.xml index fa86a3aaa0..cc5ca2a2a9 100644 --- a/man/kernel-install.xml +++ b/man/kernel-install.xml @@ -112,7 +112,7 @@ PRETTY_NAME parameter specified in /etc/os-release or /usr/lib/os-release (if the former is - missing), or "Linux + missing), or "GNU/Linux KERNEL-VERSION", if unset. If the file initrd is found next to the linux file, the initrd will be added to diff --git a/man/os-release.xml b/man/os-release.xml index b0468c16a0..80d0d39bb9 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -212,7 +212,7 @@ suitable for presentation to the user. May or may not contain a release code name or OS version of some kind, as suitable. If not set, defaults to - PRETTY_NAME="Linux". Example: + PRETTY_NAME="GNU/Linux". Example: PRETTY_NAME="Fedora 17 (Beefy Miracle)". diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 092ff763ba..ab1895d1c3 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -715,7 +715,7 @@ static int analyze_plot(int argc, char *argv[], void *userdata) { svg("\n"); svg("%s", pretty_times); svg("%s %s (%s %s %s) %s %s", - isempty(host->os_pretty_name) ? "Linux" : host->os_pretty_name, + isempty(host->os_pretty_name) ? "GNU/Linux" : host->os_pretty_name, strempty(host->hostname), strempty(host->kernel_name), strempty(host->kernel_release), diff --git a/src/core/main.c b/src/core/main.c index 4b2d149237..d6ae0c3602 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1251,11 +1251,11 @@ static int status_welcome(void) { return status_printf(NULL, false, false, "\nWelcome to \x1B[%sm%s\x1B[0m!\n", isempty(ansi_color) ? "1" : ansi_color, - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); else return status_printf(NULL, false, false, "\nWelcome to %s!\n", - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); } static int write_container_id(void) { diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index effa092ec9..d293e0a94a 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -116,7 +116,7 @@ static void print_welcome(void) { log_warning_errno(r, "Failed to read os-release file: %m"); printf("\nWelcome to your new installation of %s!\nPlease configure a few basic system settings:\n\n", - isempty(pretty_name) ? "Linux" : pretty_name); + isempty(pretty_name) ? "GNU/Linux" : pretty_name); press_any_key(); diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install index a271cdb8a0..29047ccbff 100644 --- a/src/kernel-install/90-loaderentry.install +++ b/src/kernel-install/90-loaderentry.install @@ -40,7 +40,7 @@ elif [[ -f /usr/lib/os-release ]]; then fi if ! [[ $PRETTY_NAME ]]; then - PRETTY_NAME="Linux $KERNEL_VERSION" + PRETTY_NAME="GNU/Linux $KERNEL_VERSION" fi declare -a BOOT_OPTIONS -- cgit v1.2.2 From 4a1e3f326e01ae7d564d9d434d972fe423872501 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:24:56 -0400 Subject: FSDG: os-release: Default NAME to "GNU/Linux" instead of "Linux" --- man/os-release.xml | 2 +- src/journal-remote/journal-gatewayd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/os-release.xml b/man/os-release.xml index 80d0d39bb9..ad3891e719 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -123,7 +123,7 @@ A string identifying the operating system, without a version component, and suitable for presentation to the user. If not set, defaults to - NAME=Linux. Example: + NAME=GNU/Linux. Example: NAME=Fedora or NAME="Debian GNU/Linux". diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 5a437ce031..59b980873f 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -807,7 +807,7 @@ static int request_handler_machine( SD_ID128_FORMAT_VAL(mid), SD_ID128_FORMAT_VAL(bid), hostname_cleanup(hostname), - os_name ? os_name : "Linux", + os_name ? os_name : "GNU/Linux", v ? v : "bare", usage, cutoff_from, -- cgit v1.2.2 From 45c5668be215f1aef80c0eb3ae9cc305fb7dc071 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:28:30 -0400 Subject: FSDG: os-release: Default ID to "gnu-linux" instead of "linux" As far as I can tell, no code in this repository actually uses the ID field, so this is just a man page change. --- man/os-release.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/os-release.xml b/man/os-release.xml index ad3891e719..81f294c7e4 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -147,7 +147,7 @@ the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames. If not set, defaults to - ID=linux. Example: + ID=gnu-linux. Example: ID=fedora or ID=debian. -- cgit v1.2.2 From 0dd60e7bb37385fad3eeccab1fa51d335517343e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:31:20 -0400 Subject: FSDG: systemd-resolved: Fallback hostname to "gnu-linux" instead of "linux" --- src/resolve/resolved-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 2ee027791a..daa8292e8b 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -408,10 +408,10 @@ static int determine_hostname(char **full_hostname, char **llmnr_hostname, char static const char *fallback_hostname(void) { /* Determine the fall back hostname. For exposing this system to the outside world, we cannot have it to be - * "localhost" even if that's the compiled in hostname. In this case, let's revert to "linux" instead. */ + * "localhost" even if that's the compiled in hostname. In this case, let's revert to "gnu-linux" instead. */ if (is_localhost(FALLBACK_HOSTNAME)) - return "linux"; + return "gnu-linux"; return FALLBACK_HOSTNAME; } -- cgit v1.2.2 From e595919ca718bee1670b969172e2dfa362fef63f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 25 May 2016 12:32:21 -0400 Subject: FSDG: man/: Use FSDG operating systems as examples --- man/os-release.xml | 49 +++++++++++++++++++++++++------------------------ man/systemd-nspawn.xml | 48 ++++++++++++++++++++++++++---------------------- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/man/os-release.xml b/man/os-release.xml index 81f294c7e4..973e19747d 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -124,7 +124,7 @@ without a version component, and suitable for presentation to the user. If not set, defaults to NAME=GNU/Linux. Example: - NAME=Fedora or NAME="Debian + NAME=BLAG or NAME="gNewSense GNU/Linux". @@ -135,8 +135,8 @@ version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user. This field is optional. Example: - VERSION=17 or VERSION="17 (Beefy - Miracle)". + VERSION=210k or VERSION="210k + (Spartakus)". @@ -148,8 +148,8 @@ suitable for processing by scripts or usage in generated filenames. If not set, defaults to ID=gnu-linux. Example: - ID=fedora or - ID=debian. + ID=blag or + ID=gnewsense. @@ -170,9 +170,9 @@ should be listed in order of how closely the local operating system relates to the listed ones, starting with the closest. This field is optional. Example: for an operating system with - ID=centos, an assignment of + ID=blag, an assignment of ID_LIKE="rhel fedora" would be appropriate. - For an operating system with ID=ubuntu, an + For an operating system with ID=gnewsense, an assignment of ID_LIKE=debian is appropriate. @@ -201,8 +201,8 @@ identifying the operating system version, excluding any OS name information or release code name, and suitable for processing by scripts or usage in generated filenames. This - field is optional. Example: VERSION_ID=17 - or VERSION_ID=11.04. + field is optional. Example: VERSION_ID=210k + or VERSION_ID=7.0. @@ -213,8 +213,8 @@ a release code name or OS version of some kind, as suitable. If not set, defaults to PRETTY_NAME="GNU/Linux". Example: - PRETTY_NAME="Fedora 17 (Beefy - Miracle)". + PRETTY_NAME="BLAG 210k + (Spartakus)". @@ -237,7 +237,7 @@ Common Platform Enumeration Specification as proposed by the NIST. This field is optional. Example: - CPE_NAME="cpe:/o:fedoraproject:fedora:17" + CPE_NAME="cpe:/o:blagblagblag:blag:210k" @@ -272,8 +272,8 @@ one URL shall be listed in each setting. If multiple resources need to be referenced, it is recommended to provide an online landing page linking all available resources. Examples: - HOME_URL="https://fedoraproject.org/" and - BUG_REPORT_URL="https://bugzilla.redhat.com/" + HOME_URL="https://www.blagblagblag.org/" and + BUG_REPORT_URL="https://blag.fsf.org/" @@ -348,21 +348,22 @@ recommended to prefix new fields with an OS specific name in order to avoid name clashes. Applications reading this file must ignore unknown fields. Example: - DEBIAN_BTS="debbugs://bugs.debian.org/" + DEBIAN_BTS="debbugs://bugs.gnewsense.org/" Example - NAME=Fedora -VERSION="17 (Beefy Miracle)" -ID=fedora -VERSION_ID=17 -PRETTY_NAME="Fedora 17 (Beefy Miracle)" -ANSI_COLOR="0;34" -CPE_NAME="cpe:/o:fedoraproject:fedora:17" -HOME_URL="https://fedoraproject.org/" -BUG_REPORT_URL="https://bugzilla.redhat.com/" + NAME=Parabola +VERSION="rolling-release" +ID=parabola +ID_LIKE=arch +VERSION_ID=rolling-release +PRETTY_NAME="Parabola GNU/Linux-libre" +ANSI_COLOR="1;35" +CPE_NAME="cpe:/o:parabola:parabola:rolling-release" +HOME_URL="https://www.parabola.nu/" +BUG_REPORT_URL="https://labs.parabola.nu/" diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 55ef48bfec..b8b3d045eb 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -1080,11 +1080,12 @@ Examples + - Build and boot a minimal Fedora distribution in a container + Build and boot a minimal BLAG distribution in a container - # dnf -y --releasever=27 --installroot=/var/lib/machines/f27container \ - --disablerepo='*' --enablerepo=fedora --enablerepo=updates install \ - systemd passwd dnf fedora-release vim-minimal -# systemd-nspawn -bD /var/lib/machines/f27container + # dnf -y --releasever=140k --installroot=/var/lib/machines/blag140container \ + --disablerepo='*' --enablerepo=blag --enablerepo=updates install \ + systemd passwd dnf blag-release vim-minimal +# systemd-nspawn -bD /var/lib/machines/blag140container - This installs a minimal Fedora distribution into the - directory /var/lib/machines/f27container + This installs a minimal BLAG distribution into the + directory /var/lib/machines/blag140container and then boots an OS in a namespace container in it. Because the installation is located underneath the standard /var/lib/machines/ directory, it is also possible to start the machine using - systemd-nspawn -M f27container. + systemd-nspawn -M blag140container. - Spawn a shell in a container of a minimal Debian unstable distribution + Spawn a shell in a container of a minimal gNewSense Ucclia distribution - # debootstrap unstable ~/debian-tree/ -# systemd-nspawn -D ~/debian-tree/ + # debootstrap ucclia ~/gnewsense-tree/ +# systemd-nspawn -D ~/gnewsense-tree/ - This installs a minimal Debian unstable distribution into - the directory ~/debian-tree/ and then + This installs a minimal gNewSense unstable distribution into + the directory ~/gnewsense-tree/ and then spawns a shell in a namespace container in it. debootstrap supports @@ -1131,29 +1133,31 @@ Boot a minimal - <ulink url="https://www.archlinux.org">Arch Linux</ulink> distribution in a container + Parabola GNU/Linux-libre distribution in a container - # pacstrap -c -d ~/arch-tree/ base -# systemd-nspawn -bD ~/arch-tree/ + # pacstrap -c -d ~/parabola-tree/ base +# systemd-nspawn -bD ~/parabola-tree/ - This installs a minimal Arch Linux distribution into the - directory ~/arch-tree/ and then boots an OS + This installs a minimal Parabola distribution into the + directory ~/parabola-tree/ and then boots an OS in a namespace container in it. + Boot into an ephemeral snapshot of the host system -- cgit v1.2.2 From d376c0dea6172ab88fcb21643092228e3f415950 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 17 Dec 2016 00:56:43 -0500 Subject: FSDG: bootctl: Say "Systemd Boot Manager" instead of "Linux Boot Manager" --- src/boot/bootctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index ce77020aac..fe72a7d46e 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -685,13 +685,13 @@ static int install_variables(const char *esp_path, "Failed to determine current boot order: %m"); if (first || r == 0) { - r = efi_add_boot_option(slot, "Linux Boot Manager", + r = efi_add_boot_option(slot, "Systemd Boot Manager", part, pstart, psize, uuid, path); if (r < 0) return log_error_errno(r, "Failed to create EFI Boot variable entry: %m"); - log_info("Created EFI boot entry \"Linux Boot Manager\"."); + log_info("Created EFI boot entry \"Systemd Boot Manager\"."); } return insert_into_order(slot, first); -- cgit v1.2.2