From 64282b85b2e78fbbbd80f68c78e839bf08da569b Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Oct 07 2016 11:55:30 +0000 Subject: Fix systemctl set-default --- diff --git a/0001-systemctl-be-sure-to-be-quiet-with-systemctl-is-enab.patch b/0001-systemctl-be-sure-to-be-quiet-with-systemctl-is-enab.patch index 2961564..b8dd9c3 100644 --- a/0001-systemctl-be-sure-to-be-quiet-with-systemctl-is-enab.patch +++ b/0001-systemctl-be-sure-to-be-quiet-with-systemctl-is-enab.patch @@ -31,6 +31,3 @@ index 6a0ed79a53..6e61eeadef 100644 if (!isempty(arg_root)) argv[c++] = q = strappend("--root=", arg_root); --- -2.9.0 - diff --git a/0002-logind-0-and-100-should-be-valid-for-UserTasksMax-38.patch b/0002-logind-0-and-100-should-be-valid-for-UserTasksMax-38.patch index 67ea0d1..790cde1 100644 --- a/0002-logind-0-and-100-should-be-valid-for-UserTasksMax-38.patch +++ b/0002-logind-0-and-100-should-be-valid-for-UserTasksMax-38.patch @@ -24,6 +24,3 @@ index 348e396292..63363035e7 100644 k = system_tasks_max_scale(r, 100U); else { --- -2.9.0 - diff --git a/0003-systemd-ask-password-make-sure-directory-watch-is-st.patch b/0003-systemd-ask-password-make-sure-directory-watch-is-st.patch index 2e6acac..1ba5bd7 100644 --- a/0003-systemd-ask-password-make-sure-directory-watch-is-st.patch +++ b/0003-systemd-ask-password-make-sure-directory-watch-is-st.patch @@ -38,6 +38,3 @@ index 95ec9bc8a0..a3ca617256 100644 [Path] DirectoryNotEmpty=/run/systemd/ask-password --- -2.9.0 - diff --git a/0004-Revert-logind-really-handle-KeyIgnoreInhibited-optio.patch b/0004-Revert-logind-really-handle-KeyIgnoreInhibited-optio.patch index 42c28e6..bde3dc7 100644 --- a/0004-Revert-logind-really-handle-KeyIgnoreInhibited-optio.patch +++ b/0004-Revert-logind-really-handle-KeyIgnoreInhibited-optio.patch @@ -32,6 +32,3 @@ index 8ef48dbaa1..a950409254 100644 if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) { log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key)); return 0; --- -2.9.0 - diff --git a/0005-man-explain-that-KeyIgnoreInhibited-only-apply-to-a-.patch b/0005-man-explain-that-KeyIgnoreInhibited-only-apply-to-a-.patch index e23be0e..be3d9b5 100644 --- a/0005-man-explain-that-KeyIgnoreInhibited-only-apply-to-a-.patch +++ b/0005-man-explain-that-KeyIgnoreInhibited-only-apply-to-a-.patch @@ -107,6 +107,3 @@ index 5733e42cd1..f0bdb1c756 100644 pam_systemd8 PAM module. --- -2.9.0 - diff --git a/0006-systemctl-fix-preset-all-with-missing-etc-systemd-sy.patch b/0006-systemctl-fix-preset-all-with-missing-etc-systemd-sy.patch index cab1d4c..e4b7dac 100644 --- a/0006-systemctl-fix-preset-all-with-missing-etc-systemd-sy.patch +++ b/0006-systemctl-fix-preset-all-with-missing-etc-systemd-sy.patch @@ -23,6 +23,3 @@ index 7b49e1ece9..2d9306058d 100644 do { int q, cfd; --- -2.9.0 - diff --git a/0007-shared-install-remove-unused-paramater-and-add-more-.patch b/0007-shared-install-remove-unused-paramater-and-add-more-.patch index 7969740..5bbfc6e 100644 --- a/0007-shared-install-remove-unused-paramater-and-add-more-.patch +++ b/0007-shared-install-remove-unused-paramater-and-add-more-.patch @@ -72,6 +72,3 @@ index 2d9306058d..5e0f9c5d0c 100644 if (r == -ERFKILL) r = unit_file_changes_add(changes, n_changes, UNIT_FILE_IS_MASKED, de->d_name, NULL); --- -2.9.0 - diff --git a/0008-shared-install-ignore-unit-symlinks-when-doing-prese.patch b/0008-shared-install-ignore-unit-symlinks-when-doing-prese.patch index f1b2371..eaefe3d 100644 --- a/0008-shared-install-ignore-unit-symlinks-when-doing-prese.patch +++ b/0008-shared-install-ignore-unit-symlinks-when-doing-prese.patch @@ -81,6 +81,3 @@ index 5e0f9c5d0c..ef5a56391c 100644 r = query_presets(name, presets); if (r < 0) return r; --- -2.9.0 - diff --git a/0009-man-describe-what-symlinks-to-unit-do-and-specify-th.patch b/0009-man-describe-what-symlinks-to-unit-do-and-specify-th.patch index 6803d15..f9d888e 100644 --- a/0009-man-describe-what-symlinks-to-unit-do-and-specify-th.patch +++ b/0009-man-describe-what-symlinks-to-unit-do-and-specify-th.patch @@ -92,6 +92,3 @@ index 85a7b12d76..f818e772a9 100644 Along with a unit file foo.service, the directory foo.service.wants/ may exist. All --- -2.9.0 - diff --git a/0010-shared-install-move-root-skipping-into-create_symlin.patch b/0010-shared-install-move-root-skipping-into-create_symlin.patch index db8d434..f448773 100644 --- a/0010-shared-install-move-root-skipping-into-create_symlin.patch +++ b/0010-shared-install-move-root-skipping-into-create_symlin.patch @@ -142,6 +142,3 @@ index ef5a56391c..8c45725f5a 100644 } int unit_file_get_default( --- -2.9.0 - diff --git a/0011-shared-install-when-creating-symlinks-keep-existing-.patch b/0011-shared-install-when-creating-symlinks-keep-existing-.patch index d24e311..c52cb74 100644 --- a/0011-shared-install-when-creating-symlinks-keep-existing-.patch +++ b/0011-shared-install-when-creating-symlinks-keep-existing-.patch @@ -95,6 +95,3 @@ index 8c45725f5a..9ce8e4d390 100644 return 1; if (!force) { --- -2.9.0 - diff --git a/0012-shared-install-properly-report-masked-units-listed-i.patch b/0012-shared-install-properly-report-masked-units-listed-i.patch index 3b29913..f83107f 100644 --- a/0012-shared-install-properly-report-masked-units-listed-i.patch +++ b/0012-shared-install-properly-report-masked-units-listed-i.patch @@ -73,6 +73,3 @@ index 9ce8e4d390..9d9f4dff4f 100644 if (i->type != UNIT_FILE_TYPE_REGULAR) continue; --- -2.9.0 - diff --git a/0013-Revert-pid1-reconnect-to-the-console-before-being-re.patch b/0013-Revert-pid1-reconnect-to-the-console-before-being-re.patch index 9aeb475..1d4a5db 100644 --- a/0013-Revert-pid1-reconnect-to-the-console-before-being-re.patch +++ b/0013-Revert-pid1-reconnect-to-the-console-before-being-re.patch @@ -43,6 +43,3 @@ index f2adca7d2b..f59a55f166 100644 for (j = 1, i = 1; j < (unsigned) argc; j++) args[i++] = argv[j]; args[i++] = NULL; --- -2.9.0 - diff --git a/0014-systemd-ignore-lack-of-tty-when-checking-whether-col.patch b/0014-systemd-ignore-lack-of-tty-when-checking-whether-col.patch index 3330782..9b87c3d 100644 --- a/0014-systemd-ignore-lack-of-tty-when-checking-whether-col.patch +++ b/0014-systemd-ignore-lack-of-tty-when-checking-whether-col.patch @@ -60,6 +60,3 @@ index df56d85317..47d31ad4d7 100644 else enabled = !terminal_is_dumb(); } --- -2.9.0 - diff --git a/0015-shared-install-do-not-enable-masked-instances-4005.patch b/0015-shared-install-do-not-enable-masked-instances-4005.patch index 560c88a..882c606 100644 --- a/0015-shared-install-do-not-enable-masked-instances-4005.patch +++ b/0015-shared-install-do-not-enable-masked-instances-4005.patch @@ -125,6 +125,3 @@ index 9d9f4dff4f..cb2a2e7e0d 100644 r += 1; continue; } --- -2.9.0 - diff --git a/0016-If-the-notification-message-length-is-0-ignore-the-m.patch b/0016-If-the-notification-message-length-is-0-ignore-the-m.patch index 0213889..dda08c5 100644 --- a/0016-If-the-notification-message-length-is-0-ignore-the-m.patch +++ b/0016-If-the-notification-message-length-is-0-ignore-the-m.patch @@ -27,6 +27,3 @@ index 4d84a0b37e..a085ed899a 100644 CMSG_FOREACH(cmsg, &msghdr) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { --- -2.9.0 - diff --git a/0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch b/0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch index f0599cf..a324efd 100644 --- a/0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch +++ b/0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch @@ -46,6 +46,3 @@ index a085ed899a..36488b673a 100644 } } --- -2.9.0 - diff --git a/0018-pid1-process-zero-length-notification-messages-again.patch b/0018-pid1-process-zero-length-notification-messages-again.patch index d602290..e241fe6 100644 --- a/0018-pid1-process-zero-length-notification-messages-again.patch +++ b/0018-pid1-process-zero-length-notification-messages-again.patch @@ -75,6 +75,3 @@ index 36488b673a..85bf858992 100644 found = true; } --- -2.9.0 - diff --git a/0019-shared-install-fix-set-default-with-empty-root-4118.patch b/0019-shared-install-fix-set-default-with-empty-root-4118.patch new file mode 100644 index 0000000..f105f55 --- /dev/null +++ b/0019-shared-install-fix-set-default-with-empty-root-4118.patch @@ -0,0 +1,30 @@ +From eadc5d94950a04f9fb64cb3906644af04de81970 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sat, 10 Sep 2016 12:07:51 +0100 +Subject: [PATCH] shared/install: fix set-default with empty root (#4118) + +https://bugzilla.redhat.com/show_bug.cgi?id=1374371 + +When root was empty or equal to "/", chroot_symlinks_same was called with +root==NULL, and strjoina returned "", so the code thought both paths are equal +even if they were not. Fix that by always providing a non-null first argument +to strjoina. +(cherry picked from commit ae9efab711e7478b4f035edd00824d518bcf0d3c) +--- + src/shared/install.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/shared/install.c b/src/shared/install.c +index cb2a2e7e0d..cf1e8349d7 100644 +--- a/src/shared/install.c ++++ b/src/shared/install.c +@@ -403,6 +403,9 @@ static bool chroot_symlinks_same(const char *root, const char *wd, const char *a + /* This will give incorrect results if the paths are relative and go outside + * of the chroot. False negatives are possible. */ + ++ if (!root) ++ root = "/"; ++ + a = strjoina(path_is_absolute(a) ? root : wd, "/", a); + b = strjoina(path_is_absolute(b) ? root : wd, "/", b); + return path_equal_or_files_same(a, b); diff --git a/systemd.spec b/systemd.spec index 2fdda48..567b627 100644 --- a/systemd.spec +++ b/systemd.spec @@ -12,7 +12,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 231 -Release: 8%{?gitcommit:.git%{gitcommitshort}}%{?dist} +Release: 9%{?gitcommit:.git%{gitcommitshort}}%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -54,7 +54,7 @@ Patch0015: 0015-shared-install-do-not-enable-masked-instances-4005.patch Patch0016: 0016-If-the-notification-message-length-is-0-ignore-the-m.patch Patch0017: 0017-pid1-don-t-return-any-error-in-manager_dispatch_noti.patch Patch0018: 0018-pid1-process-zero-length-notification-messages-again.patch - +Patch0019: 0019-shared-install-fix-set-default-with-empty-root-4118.patch Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch @@ -951,6 +951,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd %{_mandir}/man[1578]/systemd-nspawn.* %changelog +* Fri Oct 7 2016 Zbigniew Jędrzejewski-Szmek - 231-9 +- Fix systemctl set-default (#1374371) + * Tue Oct 4 2016 Zbigniew Jędrzejewski-Szmek - 231-8 - Apply fix for #1378974