From 84a063d7dbb5c1b46a0c4f9858714582a09e150e22d634d76050b9f100cfc5b7 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 26 Jun 2014 09:31:57 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=690 --- ...e-use-correct-format-string-for-UIDs.patch | 20 ++++ ...-fix-cycle-break-attempts-outside-tr.patch | 42 ++++++++ ...fsck-implementation-linked-to-bin-tr.patch | 98 +++++++++++++++++++ systemd-mini.changes | 8 ++ systemd-mini.spec | 9 ++ systemd.changes | 8 ++ systemd.spec | 9 ++ 7 files changed, 194 insertions(+) create mode 100644 0001-core-use-correct-format-string-for-UIDs.patch create mode 100644 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch create mode 100644 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch diff --git a/0001-core-use-correct-format-string-for-UIDs.patch b/0001-core-use-correct-format-string-for-UIDs.patch new file mode 100644 index 00000000..f0906df0 --- /dev/null +++ b/0001-core-use-correct-format-string-for-UIDs.patch @@ -0,0 +1,20 @@ +Based on d6239dc4b0cf55a953d6c40890859b85d504ef19 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20Bartoszkiewicz?= +Date: Wed, 25 Jun 2014 14:54:48 +0200 +Subject: [PATCH] core: use correct format string for UIDs + +--- + src/core/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- src/core/main.c ++++ src/core/main.c 2014-06-26 09:29:28.182235325 +0000 +@@ -1526,7 +1526,7 @@ int main(int argc, char *argv[]) { + + } else { + _cleanup_free_ char *t = uid_to_name(getuid()); +- log_debug(PACKAGE_STRING " running in user mode for user "PID_FMT"/%s. (" SYSTEMD_FEATURES ")", ++ log_debug(PACKAGE_STRING " running in user mode for user "UID_FMT"/%s. (" SYSTEMD_FEATURES ")", + getuid(), t); + } + diff --git a/0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch b/0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch new file mode 100644 index 00000000..61888e5f --- /dev/null +++ b/0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch @@ -0,0 +1,42 @@ +From 375ae4aa4d2f89ae8afdd27e9f2b8336fcc2a046 Mon Sep 17 00:00:00 2001 +From: Uoti Urpala +Date: Mon, 23 Jun 2014 16:50:03 +0300 +Subject: [PATCH] core/transaction: fix cycle break attempts outside + transaction + +Patch fixes some incorrect-looking code in transaction.c. +It could fix cases where Debian users with bad package configurations +had systemd go into an infinite loop printing messages about breaking an +ordering cycle, though I have not reproduced that problem myself. + +transaction_verify_order_one() considers jobs/units outside current +transaction when checking whether ordering dependencies cause cycles. +It would also incorrectly try to break cycles at these jobs; this +cannot work, as the break action is to remove the job from the +transaction, which is a no-op if the job isn't part of the transaction +to begin with. The unit_matters_to_anchor() test also looks like it +would not work correctly for non-transaction jobs. Add a check to +verify that the unit is part of the transaction before considering a +job a candidate for deletion. + +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752259 +--- + src/core/transaction.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/core/transaction.c src/core/transaction.c +index d23a45c..805d40a 100644 +--- src/core/transaction.c ++++ src/core/transaction.c +@@ -381,7 +381,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi + "Found dependency on %s/%s", + k->unit->id, job_type_to_string(k->type)); + +- if (!delete && ++ if (!delete && hashmap_get(tr->jobs, k->unit) && + !unit_matters_to_anchor(k->unit, k)) { + /* Ok, we can drop this one, so let's + * do so. */ +-- +1.7.9.2 + diff --git a/0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch b/0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch new file mode 100644 index 00000000..8c53718c --- /dev/null +++ b/0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch @@ -0,0 +1,98 @@ +Based on 571d0134bd464444567cf4eb0d2ed8df40045f36 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 24 Jun 2014 19:37:22 +0200 +Subject: [PATCH] fsck: consider a fsck implementation linked to /bin/true + non-existant + +--- + src/fsck/fsck.c | 32 ++++++++++++++++++++++---------- + src/shared/path-util.c | 26 +++++++++++++++----------- + 2 files changed, 37 insertions(+), 21 deletions(-) + +--- src/fsck/fsck.c ++++ src/fsck/fsck.c 2014-06-26 09:19:58.591864710 +0000 +@@ -280,16 +280,28 @@ int main(int argc, char *argv[]) { + + type = udev_device_get_property_value(udev_device, "ID_FS_TYPE"); + if (type) { +- const char *checker = strappenda("/sbin/fsck.", type); +- r = access(checker, X_OK); +- if (r < 0) { +- if (errno == ENOENT) { +- log_info("%s doesn't exist, not checking file system on %s", +- checker, device); +- return EXIT_SUCCESS; +- } else +- log_warning("%s cannot be used for %s: %m", +- checker, device); ++ _cleanup_free_ char *p = NULL, *d = NULL; ++ const char *checker = strappenda("fsck.", type); ++ r = find_binary(checker, &p); ++ if (r == -ENOENT) { ++ log_info("fsck.%s doesn't exist, not checking file system on %s", ++ type, device); ++ return EXIT_SUCCESS; ++ } else if (r < 0) { ++ log_warning("fsck.%s cannot be used for %s: %m", ++ type, device); ++ return r; ++ } ++ ++ /* An fsck that is linked to /bin/true is a non-existant fsck */ ++ r = readlink_malloc(p, &d); ++ if (r >= 0 && ++ (path_equal(d, "/bin/true") || ++ path_equal(d, "/usr/bin/true") || ++ path_equal(d, "/dev/null"))) { ++ log_info("fsck.%s doesn't exist, not checking file system on %s", ++ type, device); ++ return EXIT_SUCCESS; + } + } + +--- src/shared/path-util.c ++++ src/shared/path-util.c 2014-06-26 09:14:15.651559638 +0000 +@@ -425,19 +425,21 @@ int path_is_os_tree(const char *path) { + + int find_binary(const char *name, char **filename) { + assert(name); +- assert(filename); + +- if (strchr(name, '/')) { +- char *p; ++ if (is_path(name)) { ++ if (access(name, X_OK) < 0) ++ return -errno; ++ ++ if (filename) { ++ char *p; + +- if (path_is_absolute(name)) +- p = strdup(name); +- else + p = path_make_absolute_cwd(name); +- if (!p) +- return -ENOMEM; ++ if (!p) ++ return -ENOMEM; ++ ++ *filename = p; ++ } + +- *filename = p; + return 0; + } else { + const char *path; +@@ -463,8 +465,10 @@ int find_binary(const char *name, char * + continue; + } + +- path_kill_slashes(p); +- *filename = p; ++ if (filename) { ++ path_kill_slashes(p); ++ *filename = p; ++ } + + return 0; + } diff --git a/systemd-mini.changes b/systemd-mini.changes index 2959085d..8c966d91 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jun 26 09:31:19 UTC 2014 - werner@suse.de + +- Add upstream patchs + 0001-core-use-correct-format-string-for-UIDs.patch + 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch + 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch + ------------------------------------------------------------------- Thu Jun 26 06:44:09 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index bf733d82..e8b092c2 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -599,6 +599,12 @@ Patch294: 0004-cryptsetup-don-t-add-unit-dependency-on-dev-null-dev.patch Patch295: 0005-man-fix-path-in-crypttab-5.patch # PATCH-FIX-UPSTREAM added at 2014/06/26 Patch296: 0001-units-order-network-online.target-after-network.targ.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch297: 0001-core-use-correct-format-string-for-UIDs.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch298: 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch299: 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch # UDEV PATCHES # ============ @@ -1140,6 +1146,9 @@ cp %{SOURCE7} m4/ %patch294 -p0 %patch295 -p0 %patch296 -p0 +%patch297 -p0 +%patch298 -p0 +%patch299 -p0 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 2959085d..8c966d91 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jun 26 09:31:19 UTC 2014 - werner@suse.de + +- Add upstream patchs + 0001-core-use-correct-format-string-for-UIDs.patch + 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch + 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch + ------------------------------------------------------------------- Thu Jun 26 06:44:09 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index cfaac1d7..c4c26840 100644 --- a/systemd.spec +++ b/systemd.spec @@ -594,6 +594,12 @@ Patch294: 0004-cryptsetup-don-t-add-unit-dependency-on-dev-null-dev.patch Patch295: 0005-man-fix-path-in-crypttab-5.patch # PATCH-FIX-UPSTREAM added at 2014/06/26 Patch296: 0001-units-order-network-online.target-after-network.targ.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch297: 0001-core-use-correct-format-string-for-UIDs.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch298: 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch +# PATCH-FIX-UPSTREAM added at 2014/06/26 +Patch299: 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch # UDEV PATCHES # ============ @@ -1135,6 +1141,9 @@ cp %{SOURCE7} m4/ %patch294 -p0 %patch295 -p0 %patch296 -p0 +%patch297 -p0 +%patch298 -p0 +%patch299 -p0 # udev patches %patch1001 -p1