[systemd/f21] Fixes for a few bugs

Zbigniew Jędrzejewski-Szmek zbyszek at fedoraproject.org
Thu Feb 5 17:44:06 UTC 2015


commit 3f5470f4eb55f5393685d4950df9d1dac4b49c7e
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Feb 5 12:29:46 2015 -0500

    Fixes for a few bugs

 ...handling-of-double-parameters-in-sd_bus_m.patch |   90 ++++++++++++++++++++
 ...ugfix-for-systemctl-reboot-command-with-a.patch |   41 +++++++++
 ...pdate-generator-accept-a-dangling-symlink.patch |   43 +++++++++
 ...ve-per-user-runtime-dir-again-if-setup-fa.patch |   56 ++++++++++++
 ...etting-the-shutdown-watchdog-configuratio.patch |   28 ++++++
 ...s-set-TimeoutSec-on-some-oneshot-services.patch |   47 ++++++++++
 ...-database-of-Bluetooth-company-identifier.patch |   66 ++++++++++++++
 ...etup-Do-not-warn-If-the-key-is-dev-random.patch |   30 +++++++
 0212-cryptsetup-only-warn-on-real-key-files.patch  |   30 +++++++
 ...r-we-defaulted-to-90s-as-default-timeout-.patch |   45 ++++++++++
 systemd.spec                                       |   17 ++++
 11 files changed, 493 insertions(+), 0 deletions(-)
---
diff --git a/0204-sd-bus-fix-handling-of-double-parameters-in-sd_bus_m.patch b/0204-sd-bus-fix-handling-of-double-parameters-in-sd_bus_m.patch
new file mode 100644
index 0000000..2644a7e
--- /dev/null
+++ b/0204-sd-bus-fix-handling-of-double-parameters-in-sd_bus_m.patch
@@ -0,0 +1,90 @@
+From 93d88c5b4dcf3ba2289b100608412c774436fa67 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 23 Jan 2015 01:13:09 +0100
+Subject: [PATCH] sd-bus: fix handling of double parameters in
+ sd_bus_message_append()
+
+We really need to use va_arg() with the right type here as uint64_t and
+double might have the same size, but are passed differently as
+arguments.
+
+(cherry picked from commit 6cd37a5e59e01f4a2b3f02d9746b3e7417d424e6)
+---
+ src/libsystemd/sd-bus/bus-message.c      | 11 +++++++++--
+ src/libsystemd/sd-bus/test-bus-marshal.c | 13 +++++++++++++
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
+index 1362a60f08..ce2b3bcc95 100644
+--- a/src/libsystemd/sd-bus/bus-message.c
++++ b/src/libsystemd/sd-bus/bus-message.c
+@@ -2308,8 +2308,7 @@ int bus_message_append_ap(
+                 }
+ 
+                 case SD_BUS_TYPE_INT64:
+-                case SD_BUS_TYPE_UINT64:
+-                case SD_BUS_TYPE_DOUBLE: {
++                case SD_BUS_TYPE_UINT64: {
+                         uint64_t x;
+ 
+                         x = va_arg(ap, uint64_t);
+@@ -2317,6 +2316,14 @@ int bus_message_append_ap(
+                         break;
+                 }
+ 
++                case SD_BUS_TYPE_DOUBLE: {
++                        double x;
++
++                        x = va_arg(ap, double);
++                        r = sd_bus_message_append_basic(m, *t, &x);
++                        break;
++                }
++
+                 case SD_BUS_TYPE_STRING:
+                 case SD_BUS_TYPE_OBJECT_PATH:
+                 case SD_BUS_TYPE_SIGNATURE: {
+diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c
+index 9532112524..7200d8c53c 100644
+--- a/src/libsystemd/sd-bus/test-bus-marshal.c
++++ b/src/libsystemd/sd-bus/test-bus-marshal.c
+@@ -22,6 +22,7 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <byteswap.h>
++#include <math.h>
+ 
+ #ifdef HAVE_GLIB
+ #include <gio/gio.h>
+@@ -94,6 +95,8 @@ int main(int argc, char *argv[]) {
+         _cleanup_fclose_ FILE *ms = NULL;
+         size_t first_size = 0, second_size = 0, third_size = 0;
+         _cleanup_bus_unref_ sd_bus *bus = NULL;
++        double dbl;
++        uint64_t u64;
+ 
+         r = sd_bus_default_system(&bus);
+         if (r < 0)
+@@ -145,6 +148,9 @@ int main(int argc, char *argv[]) {
+         r = sd_bus_message_append_array(m, 'u', NULL, 0);
+         assert_se(r >= 0);
+ 
++        r = sd_bus_message_append(m, "a(stdo)", 1, "foo", 815ULL, 47.0, "/");
++        assert_se(r >= 0);
++
+         r = bus_message_seal(m, 4711, 0);
+         assert_se(r >= 0);
+ 
+@@ -268,6 +274,13 @@ int main(int argc, char *argv[]) {
+         assert_se(r > 0);
+         assert_se(sz == 0);
+ 
++        r = sd_bus_message_read(m, "a(stdo)", 1, &x, &u64, &dbl, &y);
++        assert_se(r > 0);
++        assert_se(streq(x, "foo"));
++        assert_se(u64 == 815ULL);
++        assert_se(fabs(dbl - 47.0) < 0.1);
++        assert_se(streq(y, "/"));
++
+         r = sd_bus_message_peek_type(m, NULL, NULL);
+         assert_se(r == 0);
+ 
diff --git a/0205-systemctl-bugfix-for-systemctl-reboot-command-with-a.patch b/0205-systemctl-bugfix-for-systemctl-reboot-command-with-a.patch
new file mode 100644
index 0000000..de724ed
--- /dev/null
+++ b/0205-systemctl-bugfix-for-systemctl-reboot-command-with-a.patch
@@ -0,0 +1,41 @@
+From c0008e613b88b2e117a0876d1055ef5628092718 Mon Sep 17 00:00:00 2001
+From: Sangjung Woo <sangjung.woo at samsung.com>
+Date: Fri, 23 Jan 2015 20:21:57 +0900
+Subject: [PATCH] systemctl: bugfix for systemctl reboot command with argument
+
+According to systemctl man page, 'systemctl reboot [arg]' should work
+without any errors. However, it does not work because of 'Invalid number
+of arguments' error, except for 'reboot [arg]'. This patch fixes the bug
+so that both of commands work in exactly the same way.
+
+(cherry picked from commit b986229efe2cc96157aa14c37bab7843311bbef1)
+---
+ src/systemctl/systemctl.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
+index 251eeb4333..161f76f237 100644
+--- a/src/systemctl/systemctl.c
++++ b/src/systemctl/systemctl.c
+@@ -3031,6 +3031,12 @@ static int start_special(sd_bus *bus, char **args) {
+                 return -EPERM;
+         }
+ 
++        if (a == ACTION_REBOOT) {
++                r = update_reboot_param_file(args[1]);
++                if (r < 0)
++                        return r;
++        }
++
+         if (arg_force >= 2 &&
+             (a == ACTION_HALT ||
+              a == ACTION_POWEROFF ||
+@@ -6749,7 +6755,7 @@ static int systemctl_main(sd_bus *bus, int argc, char *argv[], int bus_error) {
+                 { "import-environment",    MORE,  1, import_environment},
+                 { "halt",                  EQUAL, 1, start_special,    FORCE },
+                 { "poweroff",              EQUAL, 1, start_special,    FORCE },
+-                { "reboot",                EQUAL, 1, start_special,    FORCE },
++                { "reboot",                MORE,  1, start_special,    FORCE },
+                 { "kexec",                 EQUAL, 1, start_special     },
+                 { "suspend",               EQUAL, 1, start_special     },
+                 { "hibernate",             EQUAL, 1, start_special     },
diff --git a/0206-system-update-generator-accept-a-dangling-symlink.patch b/0206-system-update-generator-accept-a-dangling-symlink.patch
new file mode 100644
index 0000000..571ae0c
--- /dev/null
+++ b/0206-system-update-generator-accept-a-dangling-symlink.patch
@@ -0,0 +1,43 @@
+From f0e9c36257cb2be566dac427124c4abd111fa7ea Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Mon, 26 Jan 2015 07:34:32 +0100
+Subject: [PATCH] system-update-generator: accept a dangling symlink
+
+The offline update mechanism is explicitly designed to work with a
+separate /var. systemd-update-generator is supposed to run early,
+before filesystems are mounted, so it cannot check if the
+/system-update symlink actually points to anything.
+
+The update is run *after* filesystems are mounted, so it should be
+able to access the target of the symlink without trouble.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1178978
+(cherry picked from commit 6b321a790142449e0cf3685ffa5294e147d692f7)
+---
+ src/shared/util.h                                     | 2 ++
+ src/system-update-generator/system-update-generator.c | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/shared/util.h b/src/shared/util.h
+index 6b595d51ea..e4fb54215b 100644
+--- a/src/shared/util.h
++++ b/src/shared/util.h
+@@ -999,3 +999,5 @@ int free_and_strdup(char **p, const char *s);
+ int sethostname_idempotent(const char *s);
+ 
+ #define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
++
++#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
+diff --git a/src/system-update-generator/system-update-generator.c b/src/system-update-generator/system-update-generator.c
+index 4f22c9c359..e1be3f2bc9 100644
+--- a/src/system-update-generator/system-update-generator.c
++++ b/src/system-update-generator/system-update-generator.c
+@@ -37,7 +37,7 @@ static const char *arg_dest = "/tmp";
+ static int generate_symlink(void) {
+         const char *p = NULL;
+ 
+-        if (access("/system-update", F_OK) < 0) {
++        if (laccess("/system-update", F_OK) < 0) {
+                 if (errno == ENOENT)
+                         return 0;
+ 
diff --git a/0207-logind-remove-per-user-runtime-dir-again-if-setup-fa.patch b/0207-logind-remove-per-user-runtime-dir-again-if-setup-fa.patch
new file mode 100644
index 0000000..6832a76
--- /dev/null
+++ b/0207-logind-remove-per-user-runtime-dir-again-if-setup-fa.patch
@@ -0,0 +1,56 @@
+From 8ce77d0b80b835d337f61bd24c05b586ef059062 Mon Sep 17 00:00:00 2001
+From: Christian Seiler <christian at iwakd.de>
+Date: Fri, 23 Jan 2015 15:26:18 +0100
+Subject: [PATCH] logind: remove per-user runtime dir again if setup fails
+
+If setup of per-user runtime dir fails, clean up afterwards by removing
+the directory before returning from the function, so we don't leave the
+directory behind.
+
+If this is not done, the second time the user logs in logind would
+assume that the directory is already set up, even though it isn't.
+
+(cherry picked from commit 4d858e7d9f39038713f760d7acc64acf7bba2aa7)
+
+Conflicts:
+	src/login/logind-user.c
+---
+ src/login/logind-user.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/login/logind-user.c b/src/login/logind-user.c
+index 1205b48abb..093eaadb61 100644
+--- a/src/login/logind-user.c
++++ b/src/login/logind-user.c
+@@ -330,7 +330,6 @@ static int user_mkdir_runtime_path(User *u) {
+                         r = asprintf(&t, "mode=0700,smackfsroot=*,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size);
+                 else
+                         r = asprintf(&t, "mode=0700,uid=" UID_FMT ",gid=" GID_FMT ",size=%zu", u->uid, u->gid, u->manager->runtime_dir_size);
+-
+                 if (r < 0) {
+                         r = log_oom();
+                         goto fail;
+@@ -338,7 +337,8 @@ static int user_mkdir_runtime_path(User *u) {
+ 
+                 r = mount("tmpfs", p, "tmpfs", MS_NODEV|MS_NOSUID, t);
+                 if (r < 0) {
+-                        log_error("Failed to mount per-user tmpfs directory %s: %s", p, strerror(-r));
++                        log_error("Failed to mount per-user tmpfs directory %s: %m", p);
++                        r = -errno;
+                         goto fail;
+                 }
+         }
+@@ -347,7 +347,12 @@ static int user_mkdir_runtime_path(User *u) {
+         return 0;
+ 
+ fail:
+-        free(p);
++        if (p) {
++                /* Try to clean up, but ignore errors */
++                (void) rmdir(p);
++                free(p);
++        }
++
+         u->runtime_path = NULL;
+         return r;
+ }
diff --git a/0208-core-make-setting-the-shutdown-watchdog-configuratio.patch b/0208-core-make-setting-the-shutdown-watchdog-configuratio.patch
new file mode 100644
index 0000000..b827a2d
--- /dev/null
+++ b/0208-core-make-setting-the-shutdown-watchdog-configuratio.patch
@@ -0,0 +1,28 @@
+From de879b0c3136e84a07eb5322828a8dd6481d45f1 Mon Sep 17 00:00:00 2001
+From: Maxim Mikityanskiy <maxtram95 at gmail.com>
+Date: Thu, 29 Jan 2015 01:23:07 +0100
+Subject: [PATCH] core: make setting the shutdown watchdog configuration via
+ dbus work
+
+https://bugs.freedesktop.org/show_bug.cgi?id=88284
+(cherry picked from commit 81f5fc2d43800c23a4440ed94cfe38d579e896fe)
+
+Conflicts:
+	src/core/main.c
+---
+ src/core/main.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/core/main.c b/src/core/main.c
+index face753f87..f0dd0c95b9 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -1839,6 +1839,8 @@ finish:
+         pager_close();
+ 
+         if (m) {
++                arg_shutdown_watchdog = m->shutdown_watchdog;
++
+                 manager_free(m);
+                 m = NULL;
+         }
diff --git a/0209-units-set-TimeoutSec-on-some-oneshot-services.patch b/0209-units-set-TimeoutSec-on-some-oneshot-services.patch
new file mode 100644
index 0000000..03637c5
--- /dev/null
+++ b/0209-units-set-TimeoutSec-on-some-oneshot-services.patch
@@ -0,0 +1,47 @@
+From 7f7f58a080285d4f3c95ebb8c11bf15938f0692c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek at in.waw.pl>
+Date: Fri, 30 Jan 2015 23:54:21 -0500
+Subject: [PATCH] units: set TimeoutSec on some oneshot services
+
+Services which are not crucial to system bootup, and have Type=oneshot
+can effectively "hang" the system if they fail to complete for whatever
+reason. To allow the boot to continue, kill them after a timeout.
+
+In case of systemd-journal-flush the flush will continue in the background,
+and in the other two cases the job will be aborted, but this should not
+result in any permanent problem.
+
+(cherry picked from commit 0775b9b61120f8be99cd45a7df907b828188cb47)
+---
+ units/systemd-backlight at .service.in             | 1 +
+ units/systemd-journal-catalog-update.service.in | 1 +
+ units/systemd-journal-flush.service.in          | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/units/systemd-backlight at .service.in b/units/systemd-backlight at .service.in
+index e945d8733f..82d0868bea 100644
+--- a/units/systemd-backlight at .service.in
++++ b/units/systemd-backlight at .service.in
+@@ -19,3 +19,4 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-backlight load %i
+ ExecStop=@rootlibexecdir@/systemd-backlight save %i
++TimeoutSec=2min
+diff --git a/units/systemd-journal-catalog-update.service.in b/units/systemd-journal-catalog-update.service.in
+index 0cb7076f12..98b546e75c 100644
+--- a/units/systemd-journal-catalog-update.service.in
++++ b/units/systemd-journal-catalog-update.service.in
+@@ -18,3 +18,4 @@ ConditionNeedsUpdate=/etc
+ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootbindir@/journalctl --update-catalog
++TimeoutSec=2min
+diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in
+index 98c91b4bc5..53a6f30cfd 100644
+--- a/units/systemd-journal-flush.service.in
++++ b/units/systemd-journal-flush.service.in
+@@ -19,3 +19,4 @@ RequiresMountsFor=/var/log/journal
+ ExecStart=@rootbindir@/journalctl --flush
+ Type=oneshot
+ RemainAfterExit=yes
++TimeoutSec=2min
diff --git a/0210-hwdb-Update-database-of-Bluetooth-company-identifier.patch b/0210-hwdb-Update-database-of-Bluetooth-company-identifier.patch
new file mode 100644
index 0000000..c819a5a
--- /dev/null
+++ b/0210-hwdb-Update-database-of-Bluetooth-company-identifier.patch
@@ -0,0 +1,66 @@
+From ef51af0c9e0e17fe8643ad4cfbfa4980cd136b2d Mon Sep 17 00:00:00 2001
+From: Marcel Holtmann <marcel at holtmann.org>
+Date: Mon, 2 Feb 2015 09:18:28 +0100
+Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
+
+(cherry picked from commit 3cc711193df8f11daf30c918ec2dc4c0bfe04715)
+---
+ hwdb/20-bluetooth-vendor-product.hwdb | 48 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+
+diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
+index d3aea5f66f..1dd1fee46d 100644
+--- a/hwdb/20-bluetooth-vendor-product.hwdb
++++ b/hwdb/20-bluetooth-vendor-product.hwdb
+@@ -1325,3 +1325,51 @@ bluetooth:v01B6*
+ 
+ bluetooth:v01B7*
+  ID_VENDOR_FROM_DATABASE=General Electric Company
++
++bluetooth:v01B8*
++ ID_VENDOR_FROM_DATABASE=i+D3 S.L.
++
++bluetooth:v01B9*
++ ID_VENDOR_FROM_DATABASE=HANA Micron
++
++bluetooth:v01BA*
++ ID_VENDOR_FROM_DATABASE=Stages Cycling LLC
++
++bluetooth:v01BB*
++ ID_VENDOR_FROM_DATABASE=Cochlear Bone Anchored Solutions AB
++
++bluetooth:v01BC*
++ ID_VENDOR_FROM_DATABASE=SenionLab AB
++
++bluetooth:v01BD*
++ ID_VENDOR_FROM_DATABASE=Syszone Co., Ltd
++
++bluetooth:v01BE*
++ ID_VENDOR_FROM_DATABASE=Pulsate Mobile Ltd.
++
++bluetooth:v01BF*
++ ID_VENDOR_FROM_DATABASE=Hong Kong HunterSun Electronic Limited
++
++bluetooth:v01C0*
++ ID_VENDOR_FROM_DATABASE=pironex GmbH
++
++bluetooth:v01C1*
++ ID_VENDOR_FROM_DATABASE=BRADATECH Corp.
++
++bluetooth:v01C2*
++ ID_VENDOR_FROM_DATABASE=Transenergooil AG
++
++bluetooth:v01C3*
++ ID_VENDOR_FROM_DATABASE=Bunch
++
++bluetooth:v01C4*
++ ID_VENDOR_FROM_DATABASE=DME Microelectronics
++
++bluetooth:v01C5*
++ ID_VENDOR_FROM_DATABASE=Bitcraze AB
++
++bluetooth:v01C6*
++ ID_VENDOR_FROM_DATABASE=HASWARE Inc.
++
++bluetooth:v01C7*
++ ID_VENDOR_FROM_DATABASE=Abiogenix Inc.
diff --git a/0211-cryptsetup-Do-not-warn-If-the-key-is-dev-random.patch b/0211-cryptsetup-Do-not-warn-If-the-key-is-dev-random.patch
new file mode 100644
index 0000000..4f71cfa
--- /dev/null
+++ b/0211-cryptsetup-Do-not-warn-If-the-key-is-dev-random.patch
@@ -0,0 +1,30 @@
+From 71e27642c3661572502a7d18f4d55fe4f6d70a64 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez at opensuse.org>
+Date: Mon, 2 Feb 2015 12:06:05 -0300
+Subject: [PATCH] cryptsetup: Do not warn If the key is /dev/*random
+
+Using /dev/urandom as a key is valid for swap, do not
+warn if this devices are world readable.
+
+(cherry picked from commit 05f73ad22b85270c7db4ff7cbb6da852ad71d4c1)
+---
+ src/cryptsetup/cryptsetup.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
+index 94570eb82d..1c1feb53ab 100644
+--- a/src/cryptsetup/cryptsetup.c
++++ b/src/cryptsetup/cryptsetup.c
+@@ -596,8 +596,10 @@ int main(int argc, char *argv[]) {
+ 
+                         /* Ideally we'd do this on the open fd, but since this is just a
+                          * warning it's OK to do this in two steps. */
+-                        if (stat(key_file, &st) >= 0 && (st.st_mode & 0005))
+-                                log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
++                        if (stat(key_file, &st) >= 0 && (st.st_mode & 0005)) {
++                                if(!STR_IN_SET(key_file, "/dev/urandom", "/dev/random", "/dev/hw_random"))
++                                    log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
++                        }
+                 }
+ 
+                 for (tries = 0; arg_tries == 0 || tries < arg_tries; tries++) {
diff --git a/0212-cryptsetup-only-warn-on-real-key-files.patch b/0212-cryptsetup-only-warn-on-real-key-files.patch
new file mode 100644
index 0000000..b4c5123
--- /dev/null
+++ b/0212-cryptsetup-only-warn-on-real-key-files.patch
@@ -0,0 +1,30 @@
+From 66eb624c2216aa0a1e667acb39706d6f8b2e84c0 Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt at ubuntu.com>
+Date: Mon, 2 Feb 2015 16:53:39 +0100
+Subject: [PATCH] cryptsetup: only warn on real key files
+
+Simplify the check from commit 05f73ad to only apply the warning to regular
+files instead of enumerating device nodes.
+
+(cherry picked from commit 3f4d56a069d8aedc0a784b6f4a2c049db76289b7)
+---
+ src/cryptsetup/cryptsetup.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
+index 1c1feb53ab..a0f58c88eb 100644
+--- a/src/cryptsetup/cryptsetup.c
++++ b/src/cryptsetup/cryptsetup.c
+@@ -596,10 +596,8 @@ int main(int argc, char *argv[]) {
+ 
+                         /* Ideally we'd do this on the open fd, but since this is just a
+                          * warning it's OK to do this in two steps. */
+-                        if (stat(key_file, &st) >= 0 && (st.st_mode & 0005)) {
+-                                if(!STR_IN_SET(key_file, "/dev/urandom", "/dev/random", "/dev/hw_random"))
+-                                    log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
+-                        }
++                        if (stat(key_file, &st) >= 0 && S_ISREG(st.st_mode) && (st.st_mode & 0005))
++                                log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
+                 }
+ 
+                 for (tries = 0; arg_tries == 0 || tries < arg_tries; tries++) {
diff --git a/0213-units-so-far-we-defaulted-to-90s-as-default-timeout-.patch b/0213-units-so-far-we-defaulted-to-90s-as-default-timeout-.patch
new file mode 100644
index 0000000..9f748fe
--- /dev/null
+++ b/0213-units-so-far-we-defaulted-to-90s-as-default-timeout-.patch
@@ -0,0 +1,45 @@
+From 838ec2a9a6448c8defef353ddd44a32fa7de2750 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 2 Feb 2015 21:34:32 +0100
+Subject: [PATCH] units: so far we defaulted to 90s as default timeout for most
+ things, let's do so for our oneshot services too
+
+Fewer surprises, and stuff...
+
+(cherry picked from commit 75f709fbf284041d951717cfb3bf6304db0fa7c9)
+---
+ units/systemd-backlight at .service.in             | 2 +-
+ units/systemd-journal-catalog-update.service.in | 2 +-
+ units/systemd-journal-flush.service.in          | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/units/systemd-backlight at .service.in b/units/systemd-backlight at .service.in
+index 82d0868bea..b146e30f2d 100644
+--- a/units/systemd-backlight at .service.in
++++ b/units/systemd-backlight at .service.in
+@@ -19,4 +19,4 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-backlight load %i
+ ExecStop=@rootlibexecdir@/systemd-backlight save %i
+-TimeoutSec=2min
++TimeoutSec=90s
+diff --git a/units/systemd-journal-catalog-update.service.in b/units/systemd-journal-catalog-update.service.in
+index 98b546e75c..5b85889dda 100644
+--- a/units/systemd-journal-catalog-update.service.in
++++ b/units/systemd-journal-catalog-update.service.in
+@@ -18,4 +18,4 @@ ConditionNeedsUpdate=/etc
+ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootbindir@/journalctl --update-catalog
+-TimeoutSec=2min
++TimeoutSec=90s
+diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in
+index 53a6f30cfd..a0a2e3fdb4 100644
+--- a/units/systemd-journal-flush.service.in
++++ b/units/systemd-journal-flush.service.in
+@@ -19,4 +19,4 @@ RequiresMountsFor=/var/log/journal
+ ExecStart=@rootbindir@/journalctl --flush
+ Type=oneshot
+ RemainAfterExit=yes
+-TimeoutSec=2min
++TimeoutSec=90s
diff --git a/systemd.spec b/systemd.spec
index 7c5c20a..35ebf1c 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -244,6 +244,16 @@ Patch0200:      0200-tmpfiles-make-sure-not-to-concatenate-non-absolute-p.patch
 Patch0201:      0201-sysv-generator-only-allow-regular-files-in-enumerate.patch
 Patch0202:      0202-logind-fix-sd_eviocrevoke-ioctl-call.patch
 Patch0203:      0203-core-cgroup-fix-embarrassing-typo.patch
+Patch0204:      0204-sd-bus-fix-handling-of-double-parameters-in-sd_bus_m.patch
+Patch0205:      0205-systemctl-bugfix-for-systemctl-reboot-command-with-a.patch
+Patch0206:      0206-system-update-generator-accept-a-dangling-symlink.patch
+Patch0207:      0207-logind-remove-per-user-runtime-dir-again-if-setup-fa.patch
+Patch0208:      0208-core-make-setting-the-shutdown-watchdog-configuratio.patch
+Patch0209:      0209-units-set-TimeoutSec-on-some-oneshot-services.patch
+Patch0210:      0210-hwdb-Update-database-of-Bluetooth-company-identifier.patch
+Patch0211:      0211-cryptsetup-Do-not-warn-If-the-key-is-dev-random.patch
+Patch0212:      0212-cryptsetup-only-warn-on-real-key-files.patch
+Patch0213:      0213-units-so-far-we-defaulted-to-90s-as-default-timeout-.patch
 
 Patch0995:      journald-when-we-detect-the-journal-file-we-are-abou.patch
 Patch0996:      hwdb-add-a-touchpad-hwdb.patch
@@ -1036,6 +1046,13 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
 %changelog
 * Thu Feb 05 2015 Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> - 216-19
 - Quick fix for https://github.com/docker/docker/issues/10280
+- Fix 'systemctl reboot arg' invocations
+- Fix shutdown watchdog configuration over dbus
+- Remove per-user runtime dir again if setup fails
+- Specify timeouts on more systemd jobs to avoid stalling if they hang
+- Do not warn if cryptsetup keys are /dev/random*
+- Update bluetooth identifiers hwdb
+- Fix offline updates with separate /var (#1178978)
 
 * Thu Feb 05 2015 Jan Synáček <jsynacek at redhat.com> - 216-18
 - RFE: journal: automatically rotate the file if it is unlinked (#1171719)


More information about the scm-commits mailing list