Compare commits

...

42 Commits
master ... f22

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 3e56ead7d3 Ignore the access mode on /var/log/journal 2016-03-14 21:08:59 -04:00
Jan Synacek 64fd902160 various fixes in kernel-install (#1244057)
Resolves: #1244057
2016-02-11 14:33:13 +01:00
Jan Synacek 6f4ed63c1a kexec -l followed by reboot hangs machine (#1277735)
Resolves: #1277735
2016-01-07 09:57:41 +01:00
Jan Synacek 5b6d8aaa58 sd-event malfunction can cause an event loop breakage, systemctl hang/reboot needed (#1290249)
Resolves: #1290249
2016-01-07 09:55:21 +01:00
Jan Synacek d189e94d31 Fix: all processes in scopes (including user sessions) SIGKILLed immediately on shutdown (#1274537)
Resolves: #1274537
2015-11-24 09:26:16 +01:00
Jan Synacek 0685e1fa68 remove the fix for Corsair K70 Keyboard introduced in 219-24 (#1267225)
It breaks more than it fixes... It has also been reverted upstream.

Related: #1262132
2015-10-19 10:26:24 +02:00
Jan Synacek 8a1079d923 Fix: Corsair K70 keyboard 'pipe' key not functioning correctly (#1262132) 2015-09-14 11:16:50 +02:00
Jan Synacek 39acbe5266 Fix: "systemctl edit some.service" is broken (#1262328)
Related: #1231949
2015-09-14 11:11:26 +02:00
Jan Synacek 6f003b7a94 Fix: Document the need to regenerate initrd in order to mask files under /usr (#1256966) 2015-09-02 09:57:22 +02:00
Jan Synacek 809b914fca Fix: journalctl -f broken with initially empty filter result (#1253649) 2015-09-01 09:06:47 +02:00
Jan Synacek 5d8bd0eb03 Fix: failure should be logged (#1241371) 2015-09-01 09:02:37 +02:00
Jan Synacek 9da70e9a59 Fix: systemctl edit falls back to 'nano' when EDITOR contains spaces (#1231949) 2015-09-01 08:52:19 +02:00
Jan Synacek bac6df9d13 Fix: Laptop sometimes doesn't suspend when the lid is closed (#1249822) 2015-09-01 08:50:32 +02:00
Zbigniew Jędrzejewski-Szmek b4e205f2c2 More patches (journal, evdev, ...) 2015-08-04 01:05:26 -04:00
Zbigniew Jędrzejewski-Szmek 610eae29f2 Fix patches 2015-07-25 00:23:59 -04:00
Zbigniew Jędrzejewski-Szmek 18123e6407 Revert "temporary fix to work around broken kernel headers"
This reverts commit 47f0430cf4.
2015-07-25 00:02:23 -04:00
Zbigniew Jędrzejewski-Szmek b457f3f357 Fix for wwn-* links 2015-07-25 00:02:20 -04:00
Zbigniew Jędrzejewski-Szmek 716763c46f Add one more bug to changelog 2015-07-21 16:16:02 -04:00
Zbigniew Jędrzejewski-Szmek 7676505491 Add one more bug to the changelog 2015-07-08 09:12:52 -04:00
Kay Sievers 47f0430cf4 temporary fix to work around broken kernel headers 2015-07-07 08:45:33 -04:00
Zbigniew Jędrzejewski-Szmek c28716f990 Backport patches 2015-07-07 08:11:31 -04:00
Zbigniew Jędrzejewski-Szmek a5a6c8cb48 Make /etc/udev/hwdb.d part of the rpm 2015-07-07 05:43:33 -04:00
Harald Hoyer 7bc176f058 add support for network disk encryption
https://bugzilla.redhat.com/show_bug.cgi?id=1229672
2015-06-09 15:03:44 +02:00
Michal Sekletar 1b2a337f1c Add unbound-anchor.timer to presets
Resolves: #1215641
2015-06-09 14:19:42 +02:00
Zbigniew Jędrzejewski-Szmek 080e64158f Check for botched translations 2015-05-30 18:45:15 -04:00
Zbigniew Jędrzejewski-Szmek e1532f235d systemd-devel should require systemd-libs 2015-05-30 18:42:47 -04:00
Jan Synacek 72df56c104 systemd aborts after systemctl daemon-reload (#1221652) 2015-05-18 10:18:08 +02:00
Zbigniew Jędrzejewski-Szmek 7f8958cefa Fix vconsole.conf sed script (#1218252) 2015-05-12 13:14:50 +02:00
Zbigniew Jędrzejewski-Szmek 0453073a30 Patches for outstanding annoyances 2015-04-29 10:05:36 -04:00
Zbigniew Jędrzejewski-Szmek adadbb09f8 Tighten requirements between subpackages
Use %{?_isa} everywhere: automatically generated requirements do not
specify the exact version. In principle it was possible to satisfy
automatically added requirements with an older systemd, and our manual
R:%{name}=%{version}-%{release} with a systemd package from a
different architecture. So tighten the requirements to make sure all
systemd subpackages are always upgraded in lock-step.

systemd-devel needs to require systemd-compat-libs explicitly. Otherwise
we get dangling symlinks.
2015-04-08 11:32:50 -04:00
Zbigniew Jędrzejewski-Szmek 421359071b More patches for outstanding bugs 2015-03-23 01:08:02 -04:00
Zbigniew Jędrzejewski-Szmek 16bc134a4e Create /var/lib/systemd/journal-upload 2015-03-23 00:58:25 -04:00
Zbigniew Jędrzejewski-Szmek 044ecb3524 Move more stuff to systemd-journal-gatewayd subpackage 2015-03-22 23:50:52 -04:00
Zbigniew Jędrzejewski-Szmek cb7da4db87 Introduce helper variables for commonly used dirs
No change intended.
2015-03-22 23:49:35 -04:00
Zbigniew Jędrzejewski-Szmek 37ffabf41e Reconfigure old Finnish keymaps in post 2015-03-14 13:29:49 -04:00
Zbigniew Jędrzejewski-Szmek a233116a44 Backport a bunch of patches 2015-03-14 13:29:22 -04:00
Jan Synacek 23229e62b8 Buttons on Lenovo X6* tablets broken (#1198939) 2015-03-10 14:41:53 +01:00
Michal Schmidt fd1e47240a arm: reenable lto. gcc-5.0.0-0.16 fixed the crash (#1193212) 2015-03-06 12:02:27 +01:00
Zbigniew Jędrzejewski-Szmek 941547bdcc Restore test verbosity 2015-03-03 20:12:03 -05:00
Zbigniew Jędrzejewski-Szmek 1e8afdf430 Remove s390 workaround 2015-03-03 20:12:03 -05:00
Zbigniew Jędrzejewski-Szmek d243c149f6 Bugfixes 2015-03-03 20:11:46 -05:00
Colin Walters 9bbe0e92dc Revert patch that breaks Atomic/OSTree (#1195761) 2015-02-24 17:37:22 -05:00
287 changed files with 36252 additions and 117 deletions

View File

@ -0,0 +1,28 @@
From 7057db8b36594bb03c611cab711cd992ad4de31e Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 17 Feb 2015 10:33:01 +0100
Subject: [PATCH] journal-remote: fix certificate status memory leak
The output of gnutls_certificate_verification_status_print() needs to be
freed.
Noticed this while staring at verify_cert_authorized() to see what could
possibly confuse gcc5 on armv7hl to segfault during compilation.
(cherry picked from commit 9c3cf9693ac5c0a332ba376f99e6adea28b1bb0d)
---
src/journal-remote/microhttpd-util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
index 34d93379da..de9c6ab32d 100644
--- a/src/journal-remote/microhttpd-util.c
+++ b/src/journal-remote/microhttpd-util.c
@@ -179,6 +179,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
log_info("Certificate status: %s", out.data);
+ gnutls_free(out.data);
return status == 0 ? 0 : -EPERM;
}

View File

@ -0,0 +1,32 @@
From 5852d2efbfb888dfb0adddb25afac0814d3ebcbb Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 17 Feb 2015 10:36:57 +0100
Subject: [PATCH] journal-remote: fix client_cert memory leak
Found by Valgrind while testing the previous memory leak fix.
(cherry picked from commit 32c3d7144cf9a5c8c03761d7f198142ca0f5f7b8)
---
src/journal-remote/microhttpd-util.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
index de9c6ab32d..a95fff18f3 100644
--- a/src/journal-remote/microhttpd-util.c
+++ b/src/journal-remote/microhttpd-util.c
@@ -239,10 +239,14 @@ static int get_auth_dn(gnutls_x509_crt_t client_cert, char **buf) {
return 0;
}
+static inline void gnutls_x509_crt_deinitp(gnutls_x509_crt_t *p) {
+ gnutls_x509_crt_deinit(*p);
+}
+
int check_permissions(struct MHD_Connection *connection, int *code, char **hostname) {
const union MHD_ConnectionInfo *ci;
gnutls_session_t session;
- gnutls_x509_crt_t client_cert;
+ _cleanup_(gnutls_x509_crt_deinitp) gnutls_x509_crt_t client_cert = NULL;
_cleanup_free_ char *buf = NULL;
int r;

View File

@ -0,0 +1,25 @@
From ea960d3fc09c1e3745791d3433094678fd7ccd50 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 17 Feb 2015 12:47:51 +0100
Subject: [PATCH] tmpfiles: Fix parse_acl error message
parse_acl() returns the error instead of setting errno.
(cherry picked from commit 484adfd914504cd7e95867cea20ca7af71b888f2)
---
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 c948d4d218..88ba7e46a2 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -689,7 +689,7 @@ static int get_acls_from_arg(Item *item) {
* afterwards, so the mask can be added now if necessary. */
r = parse_acl(item->argument, &item->acl_access, &item->acl_default, !item->force);
if (r < 0)
- log_warning_errno(errno, "Failed to parse ACL \"%s\": %m. Ignoring",
+ log_warning_errno(r, "Failed to parse ACL \"%s\": %m. Ignoring",
item->argument);
#else
log_warning_errno(ENOSYS, "ACLs are not supported. Ignoring");

View File

@ -0,0 +1,23 @@
From 8df2bb91718bf2ccc89c41f0dd19cd0bc8da1357 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Wed, 18 Feb 2015 14:33:50 +0100
Subject: [PATCH] test: utf8 - fix utf16 tests on BE machines
(cherry picked from commit 502184de0f95d3a124d4d4c77ae7a88747a0fac2)
---
src/test/test-utf8.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/test-utf8.c b/src/test/test-utf8.c
index befa385754..346f8524c6 100644
--- a/src/test/test-utf8.c
+++ b/src/test/test-utf8.c
@@ -95,7 +95,7 @@ static void test_utf8_escaping_printable(void) {
static void test_utf16_to_utf8(void) {
char *a = NULL;
- const uint16_t utf16[] = { 'a', 0xd800, 'b', 0xdc00, 'c', 0xd801, 0xdc37 };
+ const uint16_t utf16[] = { htole16('a'), htole16(0xd800), htole16('b'), htole16(0xdc00), htole16('c'), htole16(0xd801), htole16(0xdc37) };
const char utf8[] = { 'a', 'b', 'c', 0xf0, 0x90, 0x90, 0xb7, 0 };
a = utf16_to_utf8(utf16, 14);

View File

@ -0,0 +1,128 @@
From c429758054ee77383ca6d7323ecdd4163d3a3718 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 23 Feb 2015 23:19:54 -0500
Subject: [PATCH] tmpfiles: avoid creating duplicate acl entries
https://bugs.freedesktop.org/show_bug.cgi?id=89202
https://bugs.debian.org/778656
Status quo ante can be restored with:
getfacl -p /var/log/journal/`cat /etc/machine-id`|grep -v '^#'|sort -u|sudo setfacl --set-file=- /var/log/journal/`cat /etc/machine-id`
(cherry picked from commit 1c73f3bc29111a00738569c9d40a989b161a0624)
---
src/shared/acl-util.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++--
src/shared/acl-util.h | 4 +++
2 files changed, 81 insertions(+), 2 deletions(-)
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index a4ff1ab878..cbe09d7aba 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -282,6 +282,77 @@ int parse_acl(char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask)
return 0;
}
+static int acl_entry_equal(acl_entry_t a, acl_entry_t b) {
+ acl_tag_t tag_a, tag_b;
+
+ if (acl_get_tag_type(a, &tag_a) < 0)
+ return -errno;
+
+ if (acl_get_tag_type(b, &tag_b) < 0)
+ return -errno;
+
+ if (tag_a != tag_b)
+ return false;
+
+ switch (tag_a) {
+ case ACL_USER_OBJ:
+ case ACL_GROUP_OBJ:
+ case ACL_MASK:
+ case ACL_OTHER:
+ /* can have only one of those */
+ return true;
+ case ACL_USER: {
+ _cleanup_(acl_free_uid_tpp) uid_t *uid_a, *uid_b;
+
+ uid_a = acl_get_qualifier(a);
+ if (!uid_a)
+ return -errno;
+
+ uid_b = acl_get_qualifier(b);
+ if (!uid_b)
+ return -errno;
+
+ return *uid_a == *uid_b;
+ }
+ case ACL_GROUP: {
+ _cleanup_(acl_free_gid_tpp) gid_t *gid_a, *gid_b;
+
+ gid_a = acl_get_qualifier(a);
+ if (!gid_a)
+ return -errno;
+
+ gid_b = acl_get_qualifier(b);
+ if (!gid_b)
+ return -errno;
+
+ return *gid_a == *gid_b;
+ }
+ default:
+ assert_not_reached("Unknown acl tag type");
+ }
+}
+
+static int find_acl_entry(acl_t acl, acl_entry_t entry, acl_entry_t *out) {
+ acl_entry_t i;
+ int r;
+
+ for (r = acl_get_entry(acl, ACL_FIRST_ENTRY, &i);
+ r > 0;
+ r = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) {
+
+ r = acl_entry_equal(i, entry);
+ if (r < 0)
+ return r;
+ if (r > 0) {
+ *out = i;
+ return 1;
+ }
+ }
+ if (r < 0)
+ return -errno;
+ return 0;
+}
+
int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl) {
_cleanup_(acl_freep) acl_t old;
acl_entry_t i;
@@ -297,8 +368,12 @@ int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl) {
acl_entry_t j;
- if (acl_create_entry(&old, &j) < 0)
- return -errno;
+ r = find_acl_entry(old, i, &j);
+ if (r < 0)
+ return r;
+ if (r == 0)
+ if (acl_create_entry(&old, &j) < 0)
+ return -errno;
if (acl_copy_entry(j, i) < 0)
return -errno;
diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h
index 90e88ffa26..fdb90063fa 100644
--- a/src/shared/acl-util.h
+++ b/src/shared/acl-util.h
@@ -41,5 +41,9 @@ int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl);
DEFINE_TRIVIAL_CLEANUP_FUNC(acl_t, acl_free);
#define acl_free_charp acl_free
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, acl_free_charp);
+#define acl_free_uid_tp acl_free
+DEFINE_TRIVIAL_CLEANUP_FUNC(uid_t*, acl_free_uid_tp);
+#define acl_free_gid_tp acl_free
+DEFINE_TRIVIAL_CLEANUP_FUNC(gid_t*, acl_free_gid_tp);
#endif

View File

@ -0,0 +1,29 @@
From 57da343cebcd77d168d5648825698e4edbb56d2c Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 24 Feb 2015 13:26:09 +0100
Subject: [PATCH] shared/time-util: fix gcc5 warning
CC src/shared/libsystemd_shared_la-time-util.lo
src/shared/time-util.c: In function 'parse_nsec':
src/shared/time-util.c:789:25: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!*s != 0)
^
(cherry picked from commit 8e8933ca0f06bae19cb6db601e83b33f8ac80f2a)
---
src/shared/time-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 947ac1fcfb..1c36c577c4 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -786,7 +786,7 @@ int parse_nsec(const char *t, nsec_t *nsec) {
s = startswith(p, "infinity");
if (s) {
s += strspn(s, WHITESPACE);
- if (!*s != 0)
+ if (*s != 0)
return -EINVAL;
*nsec = NSEC_INFINITY;

View File

@ -0,0 +1,33 @@
From 5248b6bbaf09c74cd152257132cba9358549446a Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 24 Feb 2015 13:27:10 +0100
Subject: [PATCH] test-time: test "infinity" parsing in nanoseconds
(cherry picked from commit fdd30a1530810b659345c565e97beef06b7af2fd)
---
src/test/test-time.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/test/test-time.c b/src/test/test-time.c
index 8cfc4cc4fe..3840fff061 100644
--- a/src/test/test-time.c
+++ b/src/test/test-time.c
@@ -78,12 +78,18 @@ static void test_parse_nsec(void) {
assert_se(u == 2);
assert_se(parse_nsec(".7", &u) >= 0);
assert_se(u == 0);
+ assert_se(parse_nsec("infinity", &u) >= 0);
+ assert_se(u == NSEC_INFINITY);
+ assert_se(parse_nsec(" infinity ", &u) >= 0);
+ assert_se(u == NSEC_INFINITY);
assert_se(parse_nsec(" xyz ", &u) < 0);
assert_se(parse_nsec("", &u) < 0);
assert_se(parse_nsec(" . ", &u) < 0);
assert_se(parse_nsec(" 5. ", &u) < 0);
assert_se(parse_nsec(".s ", &u) < 0);
+ assert_se(parse_nsec(" infinity .7", &u) < 0);
+ assert_se(parse_nsec(".3 infinity", &u) < 0);
}
static void test_format_timespan_one(usec_t x, usec_t accuracy) {

View File

@ -0,0 +1,41 @@
From 588e3fe64330854d44f09b376a132c6384ac2499 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 24 Feb 2015 14:30:10 +0100
Subject: [PATCH] bootchart: fix default init path
Commit 6e1bf7ab99 used the wrong directory; we need rootlibexecdir, not
rootlibdir, as the latter is something like /lib/x86_64-linux-gnu/ on
multi-arch systems.
https://launchpad.net/bugs/1423867
(cherry picked from commit a804d849b3c2199bc25d1d4e65fc119fa4d7d0e2)
---
Makefile.am | 1 +
src/bootchart/bootchart.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index bf04d31840..cc577ced48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -198,6 +198,7 @@ AM_CPPFLAGS = \
-DKEXEC=\"$(KEXEC)\" \
-DLIBDIR=\"$(libdir)\" \
-DROOTLIBDIR=\"$(rootlibdir)\" \
+ -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
-DTEST_DIR=\"$(abs_top_srcdir)/test\" \
-I $(top_srcdir)/src \
-I $(top_builddir)/src/shared \
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 64a384bacf..175be68688 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -76,7 +76,7 @@ int sysfd=-1;
#define DEFAULT_HZ 25.0
#define DEFAULT_SCALE_X 100.0 /* 100px = 1sec */
#define DEFAULT_SCALE_Y 20.0 /* 16px = 1 process bar */
-#define DEFAULT_INIT ROOTLIBDIR "/systemd/systemd"
+#define DEFAULT_INIT ROOTLIBEXECDIR "/systemd"
#define DEFAULT_OUTPUT "/run/log"
/* graph defaults */

View File

@ -0,0 +1,41 @@
From 1df0ddca3ae405537ceb87eccdb76324f276706f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 24 Feb 2015 10:10:04 -0500
Subject: [PATCH] systemctl: bump NOFILE only for systemctl_main
It is not necessary when running as telinit, etc.
https://bugzilla.redhat.com/show_bug.cgi?id=1184712
(cherry picked from commit 95d383ee47db488f182048cfd6846f2e6b859f2b)
---
src/systemctl/systemctl.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 21cb898b9a..6b93ec8446 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -7204,6 +7204,11 @@ found:
}
}
+ /* Increase max number of open files to 16K if we can, we
+ * might needs this when browsing journal files, which might
+ * be split up into many files. */
+ setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
+
return verb->dispatch(bus, argv + optind);
}
@@ -7453,11 +7458,6 @@ int main(int argc, char*argv[]) {
goto finish;
}
- /* Increase max number of open files to 16K if we can, we
- * might needs this when browsing journal files, which might
- * be split up into many files. */
- setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
-
if (!avoid_bus())
r = bus_open_transport_systemd(arg_transport, arg_host, arg_scope != UNIT_FILE_SYSTEM, &bus);

View File

@ -0,0 +1,34 @@
From f17b6474aaca077482a68aedc1de9d654ab21bad Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Tue, 24 Feb 2015 20:40:07 +0100
Subject: [PATCH] acl-util: avoid freeing uninitialized pointer
CID#1271344/1271345
(cherry picked from commit 76dcbc4992e895a377aad26f8c4a0dcd71002396)
---
src/shared/acl-util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index cbe09d7aba..e67e9acb6a 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -302,7 +302,7 @@ static int acl_entry_equal(acl_entry_t a, acl_entry_t b) {
/* can have only one of those */
return true;
case ACL_USER: {
- _cleanup_(acl_free_uid_tpp) uid_t *uid_a, *uid_b;
+ _cleanup_(acl_free_uid_tpp) uid_t *uid_a = NULL, *uid_b = NULL;
uid_a = acl_get_qualifier(a);
if (!uid_a)
@@ -315,7 +315,7 @@ static int acl_entry_equal(acl_entry_t a, acl_entry_t b) {
return *uid_a == *uid_b;
}
case ACL_GROUP: {
- _cleanup_(acl_free_gid_tpp) gid_t *gid_a, *gid_b;
+ _cleanup_(acl_free_gid_tpp) gid_t *gid_a = NULL, *gid_b = NULL;
gid_a = acl_get_qualifier(a);
if (!gid_a)

View File

@ -0,0 +1,25 @@
From 668529dde3ecf35e24f39eaf3a3044099e4d5273 Mon Sep 17 00:00:00 2001
From: Aaro Koskinen <aaro.koskinen@nokia.com>
Date: Tue, 24 Feb 2015 18:32:31 +0200
Subject: [PATCH] bootchart: svg: fix checking of list end
If we have less samples than expected, systemd-bootchart will crash.
(cherry picked from commit c1682f17a0c966988e865c649e565dae41abf32d)
---
src/bootchart/svg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index e111fa9cce..144177cd47 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -1170,7 +1170,7 @@ static void svg_ps_bars(void) {
ps->sample = ps->sample->next;
sample_hz = ps->sample;
- for (ii=0;((ii<(int)arg_hz/2)&&(ps->sample->next));ii++)
+ for (ii=0;((ii<(int)arg_hz/2)&&(sample_hz->next));ii++)
sample_hz = sample_hz->next;
/* subtract bootchart cpu utilization from total */

View File

@ -0,0 +1,35 @@
From 5b49f6072e901336680708267c3d48a54c5410ae Mon Sep 17 00:00:00 2001
From: Aaro Koskinen <aaro.koskinen@nokia.com>
Date: Mon, 23 Feb 2015 16:01:31 +0200
Subject: [PATCH] systemd: add getrandom syscall numbers for MIPS
Add getrandom syscall numbers for MIPS. Based on Linux 3.17 kernel
(commit 42944521af97a3b25516f15f3149aec3779656dc, "MIPS: Wire up new
syscalls getrandom and memfd_create").
(cherry picked from commit 3bec6d4690d2a7f08dc27b8221299c1db94978c4)
---
src/shared/missing.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/shared/missing.h b/src/shared/missing.h
index b33a70cb2c..e72631e130 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -179,6 +179,16 @@ static inline int memfd_create(const char *name, unsigned int flags) {
# define __NR_getrandom 349
# elif defined(__powerpc__)
# define __NR_getrandom 359
+# elif defined _MIPS_SIM
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+# define __NR_getrandom 4353
+# endif
+# if _MIPS_SIM == _MIPS_SIM_NABI32
+# define __NR_getrandom 6317
+# endif
+# if _MIPS_SIM == _MIPS_SIM_ABI64
+# define __NR_getrandom 5313
+# endif
# else
# warning "__NR_getrandom unknown for your architecture"
# define __NR_getrandom 0xffffffff

View File

@ -0,0 +1,30 @@
From fc9805756d5c0088a3a67705bbf6bea30d0d35e5 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 25 Feb 2015 22:05:14 +0100
Subject: [PATCH] unit: use weaker dependencies between mount and device units
in --user mode
When running in user mode unmounting of mount units when a device
vanishes is unlikely to work, and even if it would work is already done
by PID 1 anyway. HEnce, when creating implicit dependencies between
mount units and their backing devices, created a Wants= type dependency
in --user mode, but leave a BindsTo= dependency in --system mode.
(cherry picked from commit 5bd4b173605142c7be493aa4d958ebaef21f421d)
---
src/core/unit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index ee8e607c27..9f1e55e2f1 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2845,7 +2845,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
if (r < 0)
return r;
- r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true);
+ r = unit_add_two_dependencies(u, UNIT_AFTER, u->manager->running_as == SYSTEMD_SYSTEM ? UNIT_BINDS_TO : UNIT_WANTS, device, true);
if (r < 0)
return r;

View File

@ -0,0 +1,39 @@
From ca0cf2741ef9db81141f4444ab58dd3552c8fb1f Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Tue, 17 Feb 2015 13:47:34 -0500
Subject: [PATCH] unit: When stopping due to BindsTo=, log which unit caused it
I'm trying to track down a relatively recent change in systemd
which broke OSTree; see https://bugzilla.gnome.org/show_bug.cgi?id=743891
Systemd started to stop sysroot.mount, and this patch should help
me debug why at least.
While we're here, "break" on the first unit we find that will
deactivate, as there's no point in further iteration.
(cherry picked from commit 98f738b62047229af4a929d7996e2ab04253b02c)
---
src/core/unit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 9f1e55e2f1..563f6fe850 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1648,12 +1648,14 @@ static void unit_check_binds_to(Unit *u) {
continue;
stop = true;
+ break;
}
if (!stop)
return;
- log_unit_info(u->id, "Unit %s is bound to inactive unit. Stopping, too.", u->id);
+ assert(other);
+ log_unit_info(u->id, "Unit %s is bound to inactive unit %s. Stopping, too.", u->id, other->id);
/* A unit we need to run is gone. Sniff. Let's stop this. */
manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);

View File

@ -0,0 +1,26 @@
From 2439dc6083d27271ee942559f0f73c99fa9e2b4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 26 Feb 2015 19:00:11 -0500
Subject: [PATCH] sysctl: downgrade message about sysctl overrides to debug
Printing it at info level was tedious. We don't do that for any other
overrides.
(cherry picked from commit 7933e4266f8124e3fca71f67757abd44155fa1cb)
---
src/sysctl/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 275a5b74ae..2415d84526 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -176,7 +176,7 @@ found:
if (streq(value, existing))
continue;
- log_info("Overwriting earlier assignment of %s in file '%s'.", p, path);
+ log_debug("Overwriting earlier assignment of %s in file '%s'.", p, path);
free(hashmap_remove(sysctl_options, p));
free(v);
}

View File

@ -0,0 +1,36 @@
From af6a96a36415400482ad504392ea93c6a0e2ed43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 26 Feb 2015 19:05:51 -0500
Subject: [PATCH] sysctl: add some hints how to override settings
Also a link to decent documentation for sysrq keys. It is surprising
hard to find.
https://lists.fedoraproject.org/pipermail/devel/2015-February/208412.html
(cherry picked from commit 16b65d7f463e91f6299dfa7b83d4b5fbeb109d1c)
---
sysctl.d/50-default.conf | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sysctl.d/50-default.conf b/sysctl.d/50-default.conf
index f18923399b..def151bb84 100644
--- a/sysctl.d/50-default.conf
+++ b/sysctl.d/50-default.conf
@@ -5,9 +5,16 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
-# See sysctl.d(5) and core(5) for for details.
+# See sysctl.d(5) and core(5) for for documentation.
+
+# To override settings in this file, create a local file in /etc
+# (e.g. /etc/sysctl.d/90-override.conf), and put any assignments
+# there.
# System Request functionality of the kernel (SYNC)
+#
+# Use kernel.sysrq = 1 to allow all keys.
+# See http://fedoraproject.org/wiki/QA/Sysrq for a list of values and keys.
kernel.sysrq = 16
# Append the PID to the core filename

View File

@ -0,0 +1,909 @@
From 5b788e932fe918fb022bc20c3a15eb59e0fad53a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 27 Feb 2015 21:55:08 +0100
Subject: [PATCH] core: rework device state logic
This change introduces a new state "tentative" for device units. Device
units are considered "plugged" when udev announced them, "dead" when
they are not available in the kernel, and "tentative" when they are
referenced in /proc/self/mountinfo or /proc/swaps but not (yet)
announced via udev.
This should fix a race when device nodes (like loop devices) are created
and immediately mounted. Previously, systemd might end up seeing the
mount unit before the device, and would thus pull down the mount because
its BindTo dependency on the device would not be fulfilled.
(cherry picked from commit 628c89cc68ab96fce2de7ebba5933725d147aecc)
---
src/core/device.c | 368 +++++++++++++++++++++++++++++++++---------------------
src/core/device.h | 14 ++-
src/core/mount.c | 46 ++++---
src/core/swap.c | 32 +++--
src/core/swap.h | 4 +-
src/core/unit.c | 1 -
6 files changed, 285 insertions(+), 180 deletions(-)
diff --git a/src/core/device.c b/src/core/device.c
index d3deac3936..75b9a46287 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -36,7 +36,8 @@
static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = UNIT_INACTIVE,
- [DEVICE_PLUGGED] = UNIT_ACTIVE
+ [DEVICE_TENTATIVE] = UNIT_ACTIVATING,
+ [DEVICE_PLUGGED] = UNIT_ACTIVE,
};
static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata);
@@ -65,6 +66,41 @@ static void device_unset_sysfs(Device *d) {
d->sysfs = NULL;
}
+static int device_set_sysfs(Device *d, const char *sysfs) {
+ Device *first;
+ char *copy;
+ int r;
+
+ assert(d);
+
+ if (streq_ptr(d->sysfs, sysfs))
+ return 0;
+
+ r = hashmap_ensure_allocated(&UNIT(d)->manager->devices_by_sysfs, &string_hash_ops);
+ if (r < 0)
+ return r;
+
+ copy = strdup(sysfs);
+ if (!copy)
+ return -ENOMEM;
+
+ device_unset_sysfs(d);
+
+ first = hashmap_get(UNIT(d)->manager->devices_by_sysfs, sysfs);
+ LIST_PREPEND(same_sysfs, first, d);
+
+ r = hashmap_replace(UNIT(d)->manager->devices_by_sysfs, copy, first);
+ if (r < 0) {
+ LIST_REMOVE(same_sysfs, first, d);
+ free(copy);
+ return r;
+ }
+
+ d->sysfs = copy;
+
+ return 0;
+}
+
static void device_init(Unit *u) {
Device *d = DEVICE(u);
@@ -112,8 +148,13 @@ static int device_coldplug(Unit *u) {
assert(d);
assert(d->state == DEVICE_DEAD);
- if (d->sysfs)
+ if (d->found & DEVICE_FOUND_UDEV)
+ /* If udev says the device is around, it's around */
device_set_state(d, DEVICE_PLUGGED);
+ else if (d->found != DEVICE_NOT_FOUND)
+ /* If a device is found in /proc/self/mountinfo or
+ * /proc/swaps, it's "tentatively" around. */
+ device_set_state(d, DEVICE_TENTATIVE);
return 0;
}
@@ -142,49 +183,9 @@ _pure_ static const char *device_sub_state_to_string(Unit *u) {
return device_state_to_string(DEVICE(u)->state);
}
-static int device_add_escaped_name(Unit *u, const char *dn) {
- _cleanup_free_ char *e = NULL;
- int r;
-
- assert(u);
- assert(dn);
- assert(dn[0] == '/');
-
- e = unit_name_from_path(dn, ".device");
- if (!e)
- return -ENOMEM;
-
- r = unit_add_name(u, e);
- if (r < 0 && r != -EEXIST)
- return r;
-
- return 0;
-}
-
-static int device_find_escape_name(Manager *m, const char *dn, Unit **_u) {
- _cleanup_free_ char *e = NULL;
- Unit *u;
-
- assert(m);
- assert(dn);
- assert(dn[0] == '/');
- assert(_u);
-
- e = unit_name_from_path(dn, ".device");
- if (!e)
- return -ENOMEM;
-
- u = manager_get_unit(m, e);
- if (u) {
- *_u = u;
- return 1;
- }
-
- return 0;
-}
-
-static int device_make_description(Unit *u, struct udev_device *dev, const char *path) {
+static int device_update_description(Unit *u, struct udev_device *dev, const char *path) {
const char *model;
+ int r;
assert(u);
assert(dev);
@@ -209,13 +210,16 @@ static int device_make_description(Unit *u, struct udev_device *dev, const char
j = strjoin(model, " ", label, NULL);
if (j)
- return unit_set_description(u, j);
- }
+ r = unit_set_description(u, j);
+ } else
+ r = unit_set_description(u, model);
+ } else
+ r = unit_set_description(u, path);
- return unit_set_description(u, model);
- }
+ if (r < 0)
+ log_unit_error_errno(u->id, r, "Failed to set device description: %m");
- return unit_set_description(u, path);
+ return r;
}
static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
@@ -242,20 +246,20 @@ static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
n = unit_name_mangle(e, MANGLE_NOGLOB);
if (!n)
- return -ENOMEM;
+ return log_oom();
r = unit_add_dependency_by_name(u, UNIT_WANTS, n, NULL, true);
if (r < 0)
- return r;
+ return log_unit_error_errno(u->id, r, "Failed to add wants dependency: %m");
}
if (!isempty(state))
- log_unit_warning(u->id, "Property %s on %s has trailing garbage, ignoring.",
- property, strna(udev_device_get_syspath(dev)));
+ log_unit_warning(u->id, "Property %s on %s has trailing garbage, ignoring.", property, strna(udev_device_get_syspath(dev)));
return 0;
}
-static int device_update_unit(Manager *m, struct udev_device *dev, const char *path, bool main) {
+static int device_setup_unit(Manager *m, struct udev_device *dev, const char *path, bool main) {
+ _cleanup_free_ char *e = NULL;
const char *sysfs;
Unit *u = NULL;
bool delete;
@@ -269,12 +273,18 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if (!sysfs)
return 0;
- r = device_find_escape_name(m, path, &u);
- if (r < 0)
- return r;
+ e = unit_name_from_path(path, ".device");
+ if (!e)
+ return log_oom();
+
+ u = manager_get_unit(m, e);
- if (u && DEVICE(u)->sysfs && !path_equal(DEVICE(u)->sysfs, sysfs))
+ if (u &&
+ DEVICE(u)->sysfs &&
+ !path_equal(DEVICE(u)->sysfs, sysfs)) {
+ log_unit_error(u->id, "Device %s appeared twice with different sysfs paths %s and %s", e, DEVICE(u)->sysfs, sysfs);
return -EEXIST;
+ }
if (!u) {
delete = true;
@@ -283,7 +293,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if (!u)
return log_oom();
- r = device_add_escaped_name(u, path);
+ r = unit_add_name(u, e);
if (r < 0)
goto fail;
@@ -295,37 +305,16 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
* actually been seen yet ->sysfs will not be
* initialized. Hence initialize it if necessary. */
- if (!DEVICE(u)->sysfs) {
- Device *first;
-
- DEVICE(u)->sysfs = strdup(sysfs);
- if (!DEVICE(u)->sysfs) {
- r = -ENOMEM;
- goto fail;
- }
-
- r = hashmap_ensure_allocated(&m->devices_by_sysfs, &string_hash_ops);
- if (r < 0)
- goto fail;
-
- first = hashmap_get(m->devices_by_sysfs, sysfs);
- LIST_PREPEND(same_sysfs, first, DEVICE(u));
-
- r = hashmap_replace(m->devices_by_sysfs, DEVICE(u)->sysfs, first);
- if (r < 0)
- goto fail;
- }
-
- device_make_description(u, dev, path);
+ r = device_set_sysfs(DEVICE(u), sysfs);
+ if (r < 0)
+ goto fail;
- if (main) {
- /* The additional systemd udev properties we only
- * interpret for the main object */
+ (void) device_update_description(u, dev, path);
- r = device_add_udev_wants(u, dev);
- if (r < 0)
- goto fail;
- }
+ /* The additional systemd udev properties we only interpret
+ * for the main object */
+ if (main)
+ (void) device_add_udev_wants(u, dev);
/* Note that this won't dispatch the load queue, the caller
* has to do that if needed and appropriate */
@@ -334,7 +323,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
return 0;
fail:
- log_warning_errno(r, "Failed to load device unit: %m");
+ log_unit_warning_errno(u->id, r, "Failed to set up device unit: %m");
if (delete && u)
unit_free(u);
@@ -342,7 +331,7 @@ fail:
return r;
}
-static int device_process_new_device(Manager *m, struct udev_device *dev) {
+static int device_process_new(Manager *m, struct udev_device *dev) {
const char *sysfs, *dn, *alias;
struct udev_list_entry *item = NULL, *first = NULL;
int r;
@@ -354,14 +343,14 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
return 0;
/* Add the main unit named after the sysfs path */
- r = device_update_unit(m, dev, sysfs, true);
+ r = device_setup_unit(m, dev, sysfs, true);
if (r < 0)
return r;
/* Add an additional unit for the device node */
dn = udev_device_get_devnode(dev);
if (dn)
- device_update_unit(m, dev, dn, false);
+ (void) device_setup_unit(m, dev, dn, false);
/* Add additional units for all symlinks */
first = udev_device_get_devlinks_list_entry(dev);
@@ -388,7 +377,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
st.st_rdev != udev_device_get_devnum(dev))
continue;
- device_update_unit(m, dev, p, false);
+ (void) device_setup_unit(m, dev, p, false);
}
/* Add additional units for all explicitly configured
@@ -405,7 +394,7 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
e[l] = 0;
if (path_is_absolute(e))
- device_update_unit(m, dev, e, false);
+ (void) device_setup_unit(m, dev, e, false);
else
log_warning("SYSTEMD_ALIAS for %s is not an absolute path, ignoring: %s", sysfs, e);
}
@@ -416,39 +405,62 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
return 0;
}
-static void device_set_path_plugged(Manager *m, struct udev_device *dev) {
- const char *sysfs;
+static void device_update_found_one(Device *d, bool add, DeviceFound found, bool now) {
+ DeviceFound n;
+
+ assert(d);
+
+ n = add ? (d->found | found) : (d->found & ~found);
+ if (n == d->found)
+ return;
+
+ d->found = n;
+
+ if (now) {
+ if (d->found & DEVICE_FOUND_UDEV)
+ device_set_state(d, DEVICE_PLUGGED);
+ else if (d->found != DEVICE_NOT_FOUND)
+ device_set_state(d, DEVICE_TENTATIVE);
+ else
+ device_set_state(d, DEVICE_DEAD);
+ }
+}
+
+static int device_update_found_by_sysfs(Manager *m, const char *sysfs, bool add, DeviceFound found, bool now) {
Device *d, *l;
assert(m);
- assert(dev);
+ assert(sysfs);
- sysfs = udev_device_get_syspath(dev);
- if (!sysfs)
- return;
+ if (found == DEVICE_NOT_FOUND)
+ return 0;
l = hashmap_get(m->devices_by_sysfs, sysfs);
LIST_FOREACH(same_sysfs, d, l)
- device_set_state(d, DEVICE_PLUGGED);
+ device_update_found_one(d, add, found, now);
+
+ return 0;
}
-static int device_process_removed_device(Manager *m, struct udev_device *dev) {
- const char *sysfs;
- Device *d;
+static int device_update_found_by_name(Manager *m, const char *path, bool add, DeviceFound found, bool now) {
+ _cleanup_free_ char *e = NULL;
+ Unit *u;
assert(m);
- assert(dev);
+ assert(path);
- sysfs = udev_device_get_syspath(dev);
- if (!sysfs)
- return -ENOMEM;
+ if (found == DEVICE_NOT_FOUND)
+ return 0;
- /* Remove all units of this sysfs path */
- while ((d = hashmap_get(m->devices_by_sysfs, sysfs))) {
- device_unset_sysfs(d);
- device_set_state(d, DEVICE_DEAD);
- }
+ e = unit_name_from_path(path, ".device");
+ if (!e)
+ return log_oom();
+ u = manager_get_unit(m, e);
+ if (!u)
+ return 0;
+
+ device_update_found_one(DEVICE(u), add, found, now);
return 0;
}
@@ -464,22 +476,6 @@ static bool device_is_ready(struct udev_device *dev) {
return parse_boolean(ready) != 0;
}
-static int device_process_new_path(Manager *m, const char *path) {
- _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
-
- assert(m);
- assert(path);
-
- dev = udev_device_new_from_syspath(m->udev, path);
- if (!dev)
- return log_oom();
-
- if (!device_is_ready(dev))
- return 0;
-
- return device_process_new_device(m, dev);
-}
-
static Unit *device_following(Unit *u) {
Device *d = DEVICE(u);
Device *other, *first = NULL;
@@ -606,12 +602,31 @@ static int device_enumerate(Manager *m) {
goto fail;
first = udev_enumerate_get_list_entry(e);
- udev_list_entry_foreach(item, first)
- device_process_new_path(m, udev_list_entry_get_name(item));
+ udev_list_entry_foreach(item, first) {
+ _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
+ const char *sysfs;
+
+ sysfs = udev_list_entry_get_name(item);
+
+ dev = udev_device_new_from_syspath(m->udev, sysfs);
+ if (!dev) {
+ log_oom();
+ continue;
+ }
+
+ if (!device_is_ready(dev))
+ continue;
+
+ (void) device_process_new(m, dev);
+
+ device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, false);
+ }
return 0;
fail:
+ log_error_errno(r, "Failed to enumerate devices: %m");
+
device_shutdown(m);
return r;
}
@@ -619,7 +634,7 @@ fail:
static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
_cleanup_udev_device_unref_ struct udev_device *dev = NULL;
Manager *m = userdata;
- const char *action;
+ const char *action, *sysfs;
int r;
assert(m);
@@ -641,33 +656,47 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
if (!dev)
return 0;
+ sysfs = udev_device_get_syspath(dev);
+ if (!sysfs) {
+ log_error("Failed to get udev sys path.");
+ return 0;
+ }
+
action = udev_device_get_action(dev);
if (!action) {
log_error("Failed to get udev action string.");
return 0;
}
- if (streq(action, "remove") || !device_is_ready(dev)) {
- r = device_process_removed_device(m, dev);
- if (r < 0)
- log_error_errno(r, "Failed to process device remove event: %m");
-
- r = swap_process_removed_device(m, dev);
+ if (streq(action, "remove")) {
+ r = swap_process_device_remove(m, dev);
if (r < 0)
log_error_errno(r, "Failed to process swap device remove event: %m");
- } else {
- r = device_process_new_device(m, dev);
- if (r < 0)
- log_error_errno(r, "Failed to process device new event: %m");
+ /* If we get notified that a device was removed by
+ * udev, then it's completely gone, hence unset all
+ * found bits */
+ device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP, true);
- r = swap_process_new_device(m, dev);
+ } else if (device_is_ready(dev)) {
+
+ (void) device_process_new(m, dev);
+
+ r = swap_process_device_new(m, dev);
if (r < 0)
log_error_errno(r, "Failed to process swap device new event: %m");
manager_dispatch_load_queue(m);
- device_set_path_plugged(m, dev);
+ /* The device is found now, set the udev found bit */
+ device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, true);
+
+ } else {
+ /* The device is nominally around, but not ready for
+ * us. Hence unset the udev bit, but leave the rest
+ * around. */
+
+ device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV, true);
}
return 0;
@@ -686,9 +715,58 @@ static bool device_supported(Manager *m) {
return read_only <= 0;
}
+int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now) {
+ _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
+ struct stat st;
+
+ assert(m);
+ assert(node);
+
+ /* This is called whenever we find a device referenced in
+ * /proc/swaps or /proc/self/mounts. Such a device might be
+ * mounted/enabled at a time where udev has not finished
+ * probing it yet, and we thus haven't learned about it
+ * yet. In this case we will set the device unit to
+ * "tentative" state. */
+
+ if (add) {
+ if (!path_startswith(node, "/dev"))
+ return 0;
+
+ if (stat(node, &st) < 0) {
+ if (errno == ENOENT)
+ return 0;
+
+ return log_error_errno(errno, "Failed to stat device node file %s: %m", node);
+ }
+
+ if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
+ return 0;
+
+ dev = udev_device_new_from_devnum(m->udev, S_ISBLK(st.st_mode) ? 'b' : 'c', st.st_rdev);
+ if (!dev) {
+ if (errno == ENOENT)
+ return 0;
+
+ return log_oom();
+ }
+
+ /* If the device is known in the kernel and newly
+ * appeared, then we'll create a device unit for it,
+ * under the name referenced in /proc/swaps or
+ * /proc/self/mountinfo. */
+
+ (void) device_setup_unit(m, dev, node, false);
+ }
+
+ /* Update the device unit's state, should it exist */
+ return device_update_found_by_name(m, node, add, found, now);
+}
+
static const char* const device_state_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = "dead",
- [DEVICE_PLUGGED] = "plugged"
+ [DEVICE_TENTATIVE] = "tentative",
+ [DEVICE_PLUGGED] = "plugged",
};
DEFINE_STRING_TABLE_LOOKUP(device_state, DeviceState);
diff --git a/src/core/device.h b/src/core/device.h
index bb7ae07834..0609b20fdb 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -29,20 +29,28 @@ typedef struct Device Device;
* simplifies the state engine greatly */
typedef enum DeviceState {
DEVICE_DEAD,
- DEVICE_PLUGGED,
+ DEVICE_TENTATIVE, /* mounted or swapped, but not (yet) announced by udev */
+ DEVICE_PLUGGED, /* announced by udev */
_DEVICE_STATE_MAX,
_DEVICE_STATE_INVALID = -1
} DeviceState;
+typedef enum DeviceFound {
+ DEVICE_NOT_FOUND = 0,
+ DEVICE_FOUND_UDEV = 1,
+ DEVICE_FOUND_MOUNT = 2,
+ DEVICE_FOUND_SWAP = 4,
+} DeviceFound;
+
struct Device {
Unit meta;
char *sysfs;
+ DeviceFound found;
/* In order to be able to distinguish dependencies on
different device nodes we might end up creating multiple
devices for the same sysfs path. We chain them up here. */
-
LIST_FIELDS(struct Device, same_sysfs);
DeviceState state;
@@ -52,3 +60,5 @@ extern const UnitVTable device_vtable;
const char* device_state_to_string(DeviceState i) _const_;
DeviceState device_state_from_string(const char *s) _pure_;
+
+int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now);
diff --git a/src/core/mount.c b/src/core/mount.c
index f3977e62de..c971330af2 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1391,7 +1391,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user
return 0;
}
-static int mount_add_one(
+static int mount_setup_unit(
Manager *m,
const char *what,
const char *where,
@@ -1434,7 +1434,7 @@ static int mount_add_one(
u = unit_new(m, sizeof(Mount));
if (!u)
- return -ENOMEM;
+ return log_oom();
r = unit_add_name(u, e);
if (r < 0)
@@ -1547,6 +1547,8 @@ static int mount_add_one(
return 0;
fail:
+ log_warning_errno(r, "Failed to set up mount unit: %m");
+
if (delete && u)
unit_free(u);
@@ -1554,33 +1556,36 @@ fail:
}
static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
- _cleanup_(mnt_free_tablep) struct libmnt_table *tb = NULL;
- _cleanup_(mnt_free_iterp) struct libmnt_iter *itr = NULL;
- struct libmnt_fs *fs;
+ _cleanup_(mnt_free_tablep) struct libmnt_table *t = NULL;
+ _cleanup_(mnt_free_iterp) struct libmnt_iter *i = NULL;
int r = 0;
assert(m);
- tb = mnt_new_table();
- itr = mnt_new_iter(MNT_ITER_FORWARD);
- if (!tb || !itr)
+ t = mnt_new_table();
+ if (!t)
return log_oom();
- r = mnt_table_parse_mtab(tb, NULL);
+ i = mnt_new_iter(MNT_ITER_FORWARD);
+ if (!i)
+ return log_oom();
+
+ r = mnt_table_parse_mtab(t, NULL);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m");
r = 0;
for (;;) {
const char *device, *path, *options, *fstype;
_cleanup_free_ const char *d = NULL, *p = NULL;
+ struct libmnt_fs *fs;
int k;
- k = mnt_table_next_fs(tb, itr, &fs);
+ k = mnt_table_next_fs(t, i, &fs);
if (k == 1)
break;
- else if (k < 0)
- return log_error_errno(k, "Failed to get next entry from /etc/fstab: %m");
+ if (k < 0)
+ return log_error_errno(k, "Failed to get next entry from /proc/self/mountinfo: %m");
device = mnt_fs_get_source(fs);
path = mnt_fs_get_target(fs);
@@ -1588,11 +1593,16 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
fstype = mnt_fs_get_fstype(fs);
d = cunescape(device);
+ if (!d)
+ return log_oom();
+
p = cunescape(path);
- if (!d || !p)
+ if (!p)
return log_oom();
- k = mount_add_one(m, d, p, options, fstype, set_flags);
+ (void) device_found_node(m, d, true, DEVICE_FOUND_MOUNT, set_flags);
+
+ k = mount_setup_unit(m, d, p, options, fstype, set_flags);
if (r == 0 && k < 0)
r = k;
}
@@ -1736,8 +1746,6 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
r = mount_load_proc_self_mountinfo(m, true);
if (r < 0) {
- log_error_errno(r, "Failed to reread /proc/self/mountinfo: %m");
-
/* Reset flags, just in case, for later calls */
LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_MOUNT]) {
Mount *mount = MOUNT(u);
@@ -1770,6 +1778,10 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
break;
}
+ if (mount->parameters_proc_self_mountinfo.what)
+ (void) device_found_node(m, mount->parameters_proc_self_mountinfo.what, false, DEVICE_FOUND_MOUNT, true);
+
+
} else if (mount->just_mounted || mount->just_changed) {
/* New or changed mount entry */
diff --git a/src/core/swap.c b/src/core/swap.c
index 6997921fde..5c19af5d91 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -338,7 +338,7 @@ static int swap_load(Unit *u) {
return swap_verify(s);
}
-static int swap_add_one(
+static int swap_setup_unit(
Manager *m,
const char *what,
const char *what_proc_swaps,
@@ -363,8 +363,10 @@ static int swap_add_one(
if (u &&
SWAP(u)->from_proc_swaps &&
- !path_equal(SWAP(u)->parameters_proc_swaps.what, what_proc_swaps))
+ !path_equal(SWAP(u)->parameters_proc_swaps.what, what_proc_swaps)) {
+ log_error("Swap %s appeared twice with different device paths %s and %s", e, SWAP(u)->parameters_proc_swaps.what, what_proc_swaps);
return -EEXIST;
+ }
if (!u) {
delete = true;
@@ -379,7 +381,7 @@ static int swap_add_one(
SWAP(u)->what = strdup(what);
if (!SWAP(u)->what) {
- r = log_oom();
+ r = -ENOMEM;
goto fail;
}
@@ -407,7 +409,6 @@ static int swap_add_one(
p->priority = priority;
unit_add_to_dbus_queue(u);
-
return 0;
fail:
@@ -419,7 +420,7 @@ fail:
return r;
}
-static int swap_process_new_swap(Manager *m, const char *device, int prio, bool set_flags) {
+static int swap_process_new(Manager *m, const char *device, int prio, bool set_flags) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
struct udev_list_entry *item = NULL, *first = NULL;
const char *dn;
@@ -428,7 +429,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
assert(m);
- r = swap_add_one(m, device, device, prio, set_flags);
+ r = swap_setup_unit(m, device, device, prio, set_flags);
if (r < 0)
return r;
@@ -444,7 +445,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
/* Add the main device node */
dn = udev_device_get_devnode(d);
if (dn && !streq(dn, device))
- swap_add_one(m, dn, device, prio, set_flags);
+ swap_setup_unit(m, dn, device, prio, set_flags);
/* Add additional units for all symlinks */
first = udev_device_get_devlinks_list_entry(d);
@@ -465,7 +466,7 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
st.st_rdev != udev_device_get_devnum(d))
continue;
- swap_add_one(m, p, device, prio, set_flags);
+ swap_setup_unit(m, p, device, prio, set_flags);
}
return r;
@@ -1091,15 +1092,17 @@ static int swap_load_proc_swaps(Manager *m, bool set_flags) {
if (k == EOF)
break;
- log_warning("Failed to parse /proc/swaps:%u", i);
+ log_warning("Failed to parse /proc/swaps:%u.", i);
continue;
}
d = cunescape(dev);
if (!d)
- return -ENOMEM;
+ return log_oom();
+
+ device_found_node(m, d, true, DEVICE_FOUND_SWAP, set_flags);
- k = swap_process_new_swap(m, d, prio, set_flags);
+ k = swap_process_new(m, d, prio, set_flags);
if (k < 0)
r = k;
}
@@ -1151,6 +1154,9 @@ static int swap_dispatch_io(sd_event_source *source, int fd, uint32_t revents, v
break;
}
+ if (swap->what)
+ device_found_node(m, swap->what, false, DEVICE_FOUND_SWAP, true);
+
} else if (swap->just_activated) {
/* New swap entry */
@@ -1298,7 +1304,7 @@ fail:
return r;
}
-int swap_process_new_device(Manager *m, struct udev_device *dev) {
+int swap_process_device_new(Manager *m, struct udev_device *dev) {
struct udev_list_entry *item = NULL, *first = NULL;
_cleanup_free_ char *e = NULL;
const char *dn;
@@ -1341,7 +1347,7 @@ int swap_process_new_device(Manager *m, struct udev_device *dev) {
return r;
}
-int swap_process_removed_device(Manager *m, struct udev_device *dev) {
+int swap_process_device_remove(Manager *m, struct udev_device *dev) {
const char *dn;
int r = 0;
Swap *s;
diff --git a/src/core/swap.h b/src/core/swap.h
index 73e64d87a4..914a2dbccd 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -116,8 +116,8 @@ struct Swap {
extern const UnitVTable swap_vtable;
-int swap_process_new_device(Manager *m, struct udev_device *dev);
-int swap_process_removed_device(Manager *m, struct udev_device *dev);
+int swap_process_device_new(Manager *m, struct udev_device *dev);
+int swap_process_device_remove(Manager *m, struct udev_device *dev);
const char* swap_state_to_string(SwapState i) _const_;
SwapState swap_state_from_string(const char *s) _pure_;
diff --git a/src/core/unit.c b/src/core/unit.c
index 563f6fe850..a6558ee23b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2843,7 +2843,6 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
return -ENOMEM;
r = manager_load_unit(u->manager, e, NULL, NULL, &device);
-
if (r < 0)
return r;

View File

@ -0,0 +1,23 @@
From 3d3a67138c63b47f2a5723577f886bc3c7995748 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Sat, 28 Feb 2015 23:39:55 +0100
Subject: [PATCH] core: fix return value on OOM
(cherry picked from commit c43b2132f37264600cc26e07c8d85dfdd6c969f0)
---
src/core/device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/core/device.c b/src/core/device.c
index 75b9a46287..1cc103c290 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -211,6 +211,8 @@ static int device_update_description(Unit *u, struct udev_device *dev, const cha
j = strjoin(model, " ", label, NULL);
if (j)
r = unit_set_description(u, j);
+ else
+ r = -ENOMEM;
} else
r = unit_set_description(u, model);
} else

View File

@ -0,0 +1,30 @@
From 9a46fe3127eea552cd76d4b549f8d8ba70ea01b3 Mon Sep 17 00:00:00 2001
From: Benjamin Franzke <benjaminfranzke@googlemail.com>
Date: Thu, 19 Feb 2015 20:47:28 +0100
Subject: [PATCH] machined: use x-machine-unix prefix for the container bus on
dbus1
This fixes "machinectl login" on systems configured with --disable-kdbus.
The error was:
machinectl login foo
Failed to get machine PTY: Input/output error
(cherry picked from commit f2273101c21bc59a390379e182e53cd4f07a7e71)
---
src/machine/machine-dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index b46f0a8dac..b0f0f66e09 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -477,7 +477,7 @@ int bus_machine_method_open_login(sd_bus *bus, sd_bus_message *message, void *us
#ifdef ENABLE_KDBUS
asprintf(&container_bus->address, "x-machine-kernel:pid=" PID_FMT ";x-machine-unix:pid=" PID_FMT, m->leader, m->leader);
#else
- asprintf(&container_bus->address, "x-machine-kernel:pid=" PID_FMT, m->leader);
+ asprintf(&container_bus->address, "x-machine-unix:pid=" PID_FMT, m->leader);
#endif
if (!container_bus->address)
return -ENOMEM;

View File

@ -0,0 +1,22 @@
From 3c350019fe9e4be16bf110988c324cfa3a21c61b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Fri, 20 Feb 2015 15:35:11 -0300
Subject: [PATCH] shared: AFS is also a network filesystem
(cherry picked from commit ba89821c104d959082aad6f3f0e05a8afd575023)
---
src/shared/util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/util.c b/src/shared/util.c
index ba035caed0..f24b5b4ec5 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1689,6 +1689,7 @@ bool chars_intersect(const char *a, const char *b) {
bool fstype_is_network(const char *fstype) {
static const char table[] =
+ "afs\0"
"cifs\0"
"smbfs\0"
"sshfs\0"

View File

@ -0,0 +1,28 @@
From 4e2d4dd757c6faa4d5a471c10cf6f45978524845 Mon Sep 17 00:00:00 2001
From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
Date: Fri, 20 Feb 2015 10:53:28 +0100
Subject: [PATCH] core: downgrade unit type not supported message
Otherwise every daemon reload prints out warnings like:
systemd[1]: Unit type .busname is not supported on this system.
systemd[1]: Unit type .swap is not supported on this system.
(cherry picked from commit 03afec3c9aa849ba13161c253b129b834298fd40)
---
src/core/manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/manager.c b/src/core/manager.c
index 4775219e4a..bc9b7ec620 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -961,7 +961,7 @@ int manager_enumerate(Manager *m) {
int q;
if (unit_vtable[c]->supported && !unit_vtable[c]->supported(m)) {
- log_info("Unit type .%s is not supported on this system.", unit_type_to_string(c));
+ log_debug("Unit type .%s is not supported on this system.", unit_type_to_string(c));
continue;
}

View File

@ -0,0 +1,94 @@
From 91a3ba906422127bb12095d1c7d0c7f0cb385588 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 2 Mar 2015 10:34:51 -0500
Subject: [PATCH] journal-remote: fix saving of binary fields
Binary fields were not processed properly, and resulting journal files
were non-conforming, resulting in an error ("Invalid field.") when reading.
https://bugs.freedesktop.org/show_bug.cgi?id=89391
(cherry picked from commit 09d801a82a46df518dd752e40bf13ac404daa2ce)
---
src/journal-remote/journal-remote-parse.c | 31 ++++++++++++++++++-------------
src/journal-remote/journal-remote-parse.h | 4 +++-
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
index d9dea8deb0..afded7e380 100644
--- a/src/journal-remote/journal-remote-parse.c
+++ b/src/journal-remote/journal-remote-parse.c
@@ -344,22 +344,25 @@ int process_data(RemoteSource *source) {
LLLLLLLL0011223344...\n
*/
sep = memchr(line, '=', n);
- if (sep)
+ if (sep) {
/* chomp newline */
n--;
- else
+
+ r = iovw_put(&source->iovw, line, n);
+ if (r < 0)
+ return r;
+ } else {
/* replace \n with = */
line[n-1] = '=';
- log_trace("Received: %.*s", (int) n, line);
- r = iovw_put(&source->iovw, line, n);
- if (r < 0) {
- log_error("Failed to put line in iovect");
- return r;
+ source->field_len = n;
+ source->state = STATE_DATA_START;
+
+ /* we cannot put the field in iovec until we have all data */
}
- if (!sep)
- source->state = STATE_DATA_START;
+ log_trace("Received: %.*s (%s)", (int) n, line, sep ? "text" : "binary");
+
return 0; /* continue */
}
@@ -382,6 +385,7 @@ int process_data(RemoteSource *source) {
case STATE_DATA: {
void *data;
+ char *field;
assert(source->data_size > 0);
@@ -396,11 +400,12 @@ int process_data(RemoteSource *source) {
assert(data);
- r = iovw_put(&source->iovw, data, source->data_size);
- if (r < 0) {
- log_error("failed to put binary buffer in iovect");
+ field = (char*) data - sizeof(uint64_t) - source->field_len;
+ memmove(field + sizeof(uint64_t), field, source->field_len);
+
+ r = iovw_put(&source->iovw, field + sizeof(uint64_t), source->field_len + source->data_size);
+ if (r < 0)
return r;
- }
source->state = STATE_DATA_FINISH;
diff --git a/src/journal-remote/journal-remote-parse.h b/src/journal-remote/journal-remote-parse.h
index 8499f4eb82..22db550913 100644
--- a/src/journal-remote/journal-remote-parse.h
+++ b/src/journal-remote/journal-remote-parse.h
@@ -42,7 +42,9 @@ typedef struct RemoteSource {
size_t offset; /* offset to the beginning of live data in the buffer */
size_t scanned; /* number of bytes since the beginning of data without a newline */
size_t filled; /* total number of bytes in the buffer */
- size_t data_size; /* size of the binary data chunk being processed */
+
+ size_t field_len; /* used for binary fields: the field name length */
+ size_t data_size; /* and the size of the binary data chunk being processed */
struct iovec_wrapper iovw;

View File

@ -0,0 +1,34 @@
From 983c520982b548c9bb8f2689a93f2fb35c54c392 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Sun, 1 Mar 2015 21:13:10 -0300
Subject: [PATCH] journal: fix Inappropriate ioctl for device on ext4
Logs constantly show
systemd-journald[395]: Failed to set file attributes: Inappropriate ioctl for device
This is because ext4 does not support FS_NOCOW_FL.
[zj: fold into one conditional as suggested on the ML and
fix (preexisting) r/errno confusion in error message.]
(cherry picked from commit 65eae3b76243d2dfd869f8c43b787575f7b4b994)
---
src/journal/journal-file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 2845e05ce0..0f28718b0e 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2611,8 +2611,8 @@ int journal_file_open(
* shouldn't be too bad, given that we do our own
* checksumming). */
r = chattr_fd(f->fd, true, FS_NOCOW_FL);
- if (r < 0)
- log_warning_errno(errno, "Failed to set file attributes: %m");
+ if (r < 0 && r != -ENOTTY)
+ log_warning_errno(r, "Failed to set file attributes: %m");
/* Let's attach the creation time to the journal file,
* so that the vacuuming code knows the age of this

View File

@ -0,0 +1,49 @@
From 3f0c8096f3d5e3b37d6e0e26f0562c1a8669f0d8 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 2 Mar 2015 20:55:38 +0100
Subject: [PATCH] sd-daemon: replace VLA with alloca(), to make llvm happy
https://bugs.freedesktop.org/show_bug.cgi?id=89379
(cherry picked from commit d4a144fadf89bca681724c6c9a65b4a165fa0f90)
---
src/libsystemd/sd-daemon/sd-daemon.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 028c2a7a5b..22a3a5347a 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -352,11 +352,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
.msg_iovlen = 1,
.msg_name = &sockaddr,
};
- union {
- struct cmsghdr cmsghdr;
- uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
- CMSG_SPACE(sizeof(int) * n_fds)];
- } control;
+ struct cmsghdr *control;
_cleanup_close_ int fd = -1;
struct cmsghdr *cmsg = NULL;
const char *e;
@@ -400,8 +396,10 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
msghdr.msg_namelen = sizeof(struct sockaddr_un);
+ control = alloca(CMSG_SPACE(sizeof(struct ucred)) + CMSG_SPACE(sizeof(int) * n_fds));
+
if (n_fds > 0) {
- msghdr.msg_control = &control;
+ msghdr.msg_control = control;
msghdr.msg_controllen = CMSG_LEN(sizeof(int) * n_fds);
cmsg = CMSG_FIRSTHDR(&msghdr);
@@ -418,7 +416,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
try_without_ucred = true;
controllen_without_ucred = msghdr.msg_controllen;
- msghdr.msg_control = &control;
+ msghdr.msg_control = control;
msghdr.msg_controllen += CMSG_LEN(sizeof(struct ucred));
if (cmsg)

View File

@ -0,0 +1,80 @@
From 5fb87c4b6582ddb0a0ab1f31300eae69ab963afb Mon Sep 17 00:00:00 2001
From: Hans-Peter Deifel <hpd@hpdeifel.de>
Date: Tue, 3 Mar 2015 00:35:08 +0100
Subject: [PATCH] tmpfiles: quietly ignore ACLs on unsupported filesystems
A warning is printed if ACLs cannot be retrieved for any reason other
than -ENOSYS. For -ENOSYS, debug log is printed.
(cherry picked from commit d873e8778c92014c02a9122852758b436fa95c0e)
---
src/tmpfiles/tmpfiles.c | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 88ba7e46a2..187997e1f4 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -704,6 +704,9 @@ static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modif
int r;
_cleanup_(acl_free_charpp) char *t = NULL;
+ /* Returns 0 for success, positive error if already warned,
+ * negative error otherwise. */
+
if (modify) {
r = acls_for_file(path, type, acl, &dup);
if (r < 0)
@@ -731,35 +734,36 @@ static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modif
r = acl_set_file(path, type, dup);
if (r < 0)
- return log_error_errno(-errno,
- "Setting %s ACL \"%s\" on %s failed: %m",
- type == ACL_TYPE_ACCESS ? "access" : "default",
- strna(t), path);
+ return -log_error_errno(errno,
+ "Setting %s ACL \"%s\" on %s failed: %m",
+ type == ACL_TYPE_ACCESS ? "access" : "default",
+ strna(t), path);
+
return 0;
}
#endif
static int path_set_acls(Item *item, const char *path) {
+ int r = 0;
#ifdef HAVE_ACL
- int r;
-
assert(item);
assert(path);
- if (item->acl_access) {
+ if (item->acl_access)
r = path_set_acl(path, ACL_TYPE_ACCESS, item->acl_access, item->force);
- if (r < 0)
- return r;
- }
- if (item->acl_default) {
+ if (r == 0 && item->acl_default)
r = path_set_acl(path, ACL_TYPE_DEFAULT, item->acl_default, item->force);
- if (r < 0)
- return r;
- }
-#endif
- return 0;
+ if (r > 0)
+ return -r; /* already warned */
+ else if (r == -ENOTSUP) {
+ log_debug_errno(r, "ACLs not supported by file system at %s", path);
+ return 0;
+ } else if (r < 0)
+ log_error_errno(r, "ACL operation on \"%s\" failed: %m", path);
+#endif
+ return r;
}
static int write_one_file(Item *i, const char *path) {

View File

@ -0,0 +1,27 @@
From 0436d5c5f4b39ba8177437fa92f082f8ef1830fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Mar 2015 19:07:28 -0500
Subject: [PATCH] shared/util: assume ac when /sys/class/power_supply is
missing
On s390 (at least) /sys/class/power_supply is not present. We should
treat this like if this directory was empty, and not an error.
(cherry picked from commit 6d89003462484c8656b698e07b9cf0a337e3818e)
---
src/shared/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index f24b5b4ec5..85487230a2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5994,7 +5994,7 @@ int on_ac_power(void) {
d = opendir("/sys/class/power_supply");
if (!d)
- return -errno;
+ return errno == ENOENT ? true : -errno;
for (;;) {
struct dirent *de;

View File

@ -0,0 +1,22 @@
From 4d5f8b0cbdda7f662b85bdf18344d9b83c8789a8 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Tue, 17 Feb 2015 20:06:13 +0100
Subject: [PATCH] import: remove unused variable
(cherry picked from commit b89c454b37a23433f8fd6ad7b93f5a6190930aa4)
---
src/import/import-tar.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
index 999aa8ab5e..493252a132 100644
--- a/src/import/import-tar.c
+++ b/src/import/import-tar.c
@@ -301,7 +301,6 @@ finish:
}
static int tar_import_job_on_open_disk(ImportJob *j) {
- _cleanup_close_pair_ int pipefd[2] = { -1 , -1 };
TarImport *i;
int r;

View File

@ -0,0 +1,44 @@
From bfc587ff72ad50e290b3f5426edb929b225da53f Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 18 Feb 2015 21:02:01 +0100
Subject: [PATCH] hwdb: fix ThinkPad X* Tablet special keys
ThinkPad tablet firmware has DMI product name and version reversed:
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: LENOVO
Product Name: 7762AS1
Version: ThinkPad X61 Tablet
Serial Number: LKZCDH2
UUID: 6ADBC681-4FC9-11CB-844F-B47CB9210BE2
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: ThinkPad X61 Tablet
(cherry picked from commit 39addb81b660dd7af7d21be941d8de6497abbdbf)
---
hwdb/60-keyboard.hwdb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 1b7d87101a..2cb976923d 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -586,7 +586,6 @@ keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnS10-*:pvr*
KEYBOARD_KEY_f3=f21
# Thinkpad X200_Tablet
-keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnThinkPad*X2*Tablet*:pvr*
keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet*
KEYBOARD_KEY_5d=menu
KEYBOARD_KEY_63=fn
@@ -596,7 +595,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet*
KEYBOARD_KEY_6c=direction # rotate screen
# ThinkPad X6 Tablet
-keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnThinkPad*X6*:pvr*
+keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X6*Tablet*
KEYBOARD_KEY_6c=direction # rotate
KEYBOARD_KEY_68=leftmeta # toolbox
KEYBOARD_KEY_6b=esc # escape

View File

@ -0,0 +1,34 @@
From 058bc7a903672a01981450a8c21ec03b92498aff Mon Sep 17 00:00:00 2001
From: Benjamin Franzke <benjaminfranzke@googlemail.com>
Date: Thu, 19 Feb 2015 13:10:18 +0100
Subject: [PATCH] man: add newlines to the pull-raw example in machinectl(1)
They were removed in commit 798d3a52 ("Reindent man pages to 2ch").
(cherry picked from commit ac92ced5bb41def1d90f871d6c8cfec2b03c0c7d)
---
man/machinectl.xml | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/man/machinectl.xml b/man/machinectl.xml
index 9b07af4226..640cb8b7d6 100644
--- a/man/machinectl.xml
+++ b/man/machinectl.xml
@@ -715,11 +715,12 @@
<title>Download a Fedora image, set a root password in it, start
it as service</title>
- <programlisting># machinectl pull-raw --verify=no
- http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
- # systemd-nspawn -M Fedora-Cloud-Base-20141203-21 # passwd #
- exit # machinectl start Fedora-Cloud-Base-20141203-21 #
- machinectl login Fedora-Cloud-Base-20141203-21</programlisting>
+ <programlisting># machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
+# systemd-nspawn -M Fedora-Cloud-Base-20141203-21
+# passwd
+# exit
+# machinectl start Fedora-Cloud-Base-20141203-21
+# machinectl login Fedora-Cloud-Base-20141203-21</programlisting>
<para>This downloads the specified <filename>.raw</filename>
image with verification disabled. Then a shell is opened in it

View File

@ -0,0 +1,133 @@
From 25e6978bb35805349c69d610c775cfd3a70058f7 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Thu, 19 Feb 2015 23:12:38 +0100
Subject: [PATCH] core, shared: in deserializing, match same files reached via
different paths
When dbus.socket is updated like this:
-ListenStream=/var/run/dbus/system_bus_socket
+ListenStream=/run/dbus/system_bus_socket
... and daemon-reload is performed, bad things happen.
During deserialization systemd does not recognize that the two paths
refer to the same named socket and replaces the socket file with a new
one. As a result, applications hang when they try talking to dbus.
Fix this by finding a match not only when the path names are equal, but
also when they point to the same inode.
In socket_address_equal() it is necessary to move the address size
comparison into the abstract sockets branch. For path name sockets the
comparison must not be done and for other families it is redundant
(their sizes are constant and checked by socket_address_verify()).
FIFOs and special files can also have multiple pathnames, so compare the
inodes for them as well. Note that previously the pathname checks used
streq_ptr(), but the paths cannot be NULL.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1186018
(cherry picked from commit c78e47a61fa8d9a21fece01c83e4c26ce0938d27)
---
src/core/socket.c | 6 +++---
src/shared/path-util.c | 4 ++++
src/shared/path-util.h | 1 +
src/shared/socket-util.c | 10 ++++------
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/core/socket.c b/src/core/socket.c
index 48c43a2880..88aae4815b 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -2100,7 +2100,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
LIST_FOREACH(port, p, s->ports)
if (p->type == SOCKET_FIFO &&
- streq_ptr(p->path, value+skip))
+ path_equal_or_files_same(p->path, value+skip))
break;
if (p) {
@@ -2119,7 +2119,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
LIST_FOREACH(port, p, s->ports)
if (p->type == SOCKET_SPECIAL &&
- streq_ptr(p->path, value+skip))
+ path_equal_or_files_same(p->path, value+skip))
break;
if (p) {
@@ -2138,7 +2138,7 @@ static int socket_deserialize_item(Unit *u, const char *key, const char *value,
LIST_FOREACH(port, p, s->ports)
if (p->type == SOCKET_MQUEUE &&
- streq_ptr(p->path, value+skip))
+ streq(p->path, value+skip))
break;
if (p) {
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index b9db7f1047..70bc1caa2a 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -436,6 +436,10 @@ bool path_equal(const char *a, const char *b) {
}
}
+bool path_equal_or_files_same(const char *a, const char *b) {
+ return path_equal(a, b) || files_same(a, b) > 0;
+}
+
char* path_join(const char *root, const char *path, const char *rest) {
assert(path);
diff --git a/src/shared/path-util.h b/src/shared/path-util.h
index bd0d32473f..bcf116ed3d 100644
--- a/src/shared/path-util.h
+++ b/src/shared/path-util.h
@@ -45,6 +45,7 @@ int path_make_relative(const char *from_dir, const char *to_path, char **_r);
char* path_kill_slashes(char *path);
char* path_startswith(const char *path, const char *prefix) _pure_;
bool path_equal(const char *a, const char *b) _pure_;
+bool path_equal_or_files_same(const char *a, const char *b);
char* path_join(const char *root, const char *path, const char *rest);
char** path_strv_make_absolute_cwd(char **l);
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index c6f64876be..c278d6f9d4 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -325,9 +325,6 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
if (a->type != b->type)
return false;
- if (a->size != b->size)
- return false;
-
if (socket_address_family(a) != socket_address_family(b))
return false;
@@ -352,14 +349,16 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
break;
case AF_UNIX:
-
if ((a->sockaddr.un.sun_path[0] == 0) != (b->sockaddr.un.sun_path[0] == 0))
return false;
if (a->sockaddr.un.sun_path[0]) {
- if (!strneq(a->sockaddr.un.sun_path, b->sockaddr.un.sun_path, sizeof(a->sockaddr.un.sun_path)))
+ if (!path_equal_or_files_same(a->sockaddr.un.sun_path, b->sockaddr.un.sun_path))
return false;
} else {
+ if (a->size != b->size)
+ return false;
+
if (memcmp(a->sockaddr.un.sun_path, b->sockaddr.un.sun_path, a->size) != 0)
return false;
}
@@ -367,7 +366,6 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
break;
case AF_NETLINK:
-
if (a->protocol != b->protocol)
return false;

View File

@ -0,0 +1,83 @@
From c3ddd973109320c7f8f06d07438bb9b1f7876866 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 20 Feb 2015 02:04:05 +0100
Subject: [PATCH] shared: use SocketAddress in socket_address_matches_fd()
Cleanup. No behavior change.
(cherry picked from commit dbafedacba3ee77098e932222ae7840e7b4040fc)
---
src/shared/socket-util.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index c278d6f9d4..c31f60ec7e 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -435,48 +435,48 @@ bool socket_ipv6_is_supported(void) {
}
bool socket_address_matches_fd(const SocketAddress *a, int fd) {
- union sockaddr_union sa;
- socklen_t salen = sizeof(sa), solen;
- int protocol, type;
+ SocketAddress b;
+ socklen_t solen;
assert(a);
assert(fd >= 0);
- if (getsockname(fd, &sa.sa, &salen) < 0)
+ b.size = sizeof(b.sockaddr);
+ if (getsockname(fd, &b.sockaddr.sa, &b.size) < 0)
return false;
- if (sa.sa.sa_family != a->sockaddr.sa.sa_family)
+ if (b.sockaddr.sa.sa_family != a->sockaddr.sa.sa_family)
return false;
- solen = sizeof(type);
- if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &solen) < 0)
+ solen = sizeof(b.type);
+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &b.type, &solen) < 0)
return false;
- if (type != a->type)
+ if (b.type != a->type)
return false;
if (a->protocol != 0) {
- solen = sizeof(protocol);
- if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &solen) < 0)
+ solen = sizeof(b.protocol);
+ if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, &b.protocol, &solen) < 0)
return false;
- if (protocol != a->protocol)
+ if (b.protocol != a->protocol)
return false;
}
- switch (sa.sa.sa_family) {
+ switch (b.sockaddr.sa.sa_family) {
case AF_INET:
- return sa.in.sin_port == a->sockaddr.in.sin_port &&
- sa.in.sin_addr.s_addr == a->sockaddr.in.sin_addr.s_addr;
+ return b.sockaddr.in.sin_port == a->sockaddr.in.sin_port &&
+ b.sockaddr.in.sin_addr.s_addr == a->sockaddr.in.sin_addr.s_addr;
case AF_INET6:
- return sa.in6.sin6_port == a->sockaddr.in6.sin6_port &&
- memcmp(&sa.in6.sin6_addr, &a->sockaddr.in6.sin6_addr, sizeof(struct in6_addr)) == 0;
+ return b.sockaddr.in6.sin6_port == a->sockaddr.in6.sin6_port &&
+ memcmp(&b.sockaddr.in6.sin6_addr, &a->sockaddr.in6.sin6_addr, sizeof(struct in6_addr)) == 0;
case AF_UNIX:
- return salen == a->size &&
- memcmp(sa.un.sun_path, a->sockaddr.un.sun_path, salen - offsetof(struct sockaddr_un, sun_path)) == 0;
+ return b.sockaddr.size == a->size &&
+ memcmp(b.sockaddr.un.sun_path, a->sockaddr.un.sun_path, b.size - offsetof(struct sockaddr_un, sun_path)) == 0;
}

View File

@ -0,0 +1,42 @@
From 1d23a6c379b429aaf257994d549a93d766b4cce0 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 20 Feb 2015 02:13:03 +0100
Subject: [PATCH] shared: avoid semi-duplicating socket_address_equal()
Just call socket_address_equal() from socket_address_matches_fd()
instead of implementing similar comparing of addresses.
(cherry picked from commit 02233928a502e46fc125118dba7234ba3e48dc15)
---
src/shared/socket-util.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index c31f60ec7e..deecce8a80 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -464,23 +464,7 @@ bool socket_address_matches_fd(const SocketAddress *a, int fd) {
return false;
}
- switch (b.sockaddr.sa.sa_family) {
-
- case AF_INET:
- return b.sockaddr.in.sin_port == a->sockaddr.in.sin_port &&
- b.sockaddr.in.sin_addr.s_addr == a->sockaddr.in.sin_addr.s_addr;
-
- case AF_INET6:
- return b.sockaddr.in6.sin6_port == a->sockaddr.in6.sin6_port &&
- memcmp(&b.sockaddr.in6.sin6_addr, &a->sockaddr.in6.sin6_addr, sizeof(struct in6_addr)) == 0;
-
- case AF_UNIX:
- return b.sockaddr.size == a->size &&
- memcmp(b.sockaddr.un.sun_path, a->sockaddr.un.sun_path, b.size - offsetof(struct sockaddr_un, sun_path)) == 0;
-
- }
-
- return false;
+ return socket_address_equal(a, &b);
}
int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, char **ret) {

View File

@ -0,0 +1,29 @@
From 04691e6f814b76ea497d8189b9b77d4c0feff794 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 20 Feb 2015 02:25:16 +0100
Subject: [PATCH] shared: handle unnamed sockets in socket_address_equal()
Make sure we don't inspect sun_path of unnamed sockets.
Since we cannot know if two unnamed sockets' adresses refer to the same
socket, just return false.
(cherry picked from commit 710708a54ccc48e168ad7d4cd401645ef9e2eb14)
---
src/shared/socket-util.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index deecce8a80..a4e26b1d8c 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -349,6 +349,10 @@ bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) {
break;
case AF_UNIX:
+ if (a->size <= offsetof(struct sockaddr_un, sun_path) ||
+ b->size <= offsetof(struct sockaddr_un, sun_path))
+ return false;
+
if ((a->sockaddr.un.sun_path[0] == 0) != (b->sockaddr.un.sun_path[0] == 0))
return false;

View File

@ -0,0 +1,23 @@
From 1295853b39d330c6e7c6ea431a8fc7ce8be801b3 Mon Sep 17 00:00:00 2001
From: Chris Morin <chris.morin2@gmail.com>
Date: Wed, 4 Feb 2015 14:54:34 -0500
Subject: [PATCH] man: make bootup graph consistent
(cherry picked from commit b44787bd437f4051660272b37bd6f75392f17931)
---
man/bootup.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/bootup.xml b/man/bootup.xml
index d97d550236..b92057af29 100644
--- a/man/bootup.xml
+++ b/man/bootup.xml
@@ -134,7 +134,7 @@
v v | v <emphasis>rescue.target</emphasis>
timers.target paths.target | sockets.target
| | | |
- v |_________________ | ___________________/
+ v \_________________ | ___________________/
\|/
v
basic.target

View File

@ -0,0 +1,23 @@
From 8b92bdb0bd91a1614c0132dc31a35ee6193c26da Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Mon, 23 Feb 2015 15:22:40 +0100
Subject: [PATCH] nspawn: fix whitespace and typo in partition table blurb
(cherry picked from commit 4aab5d0cbd979b2cccb88534f118bceaa86466d8)
---
src/nspawn/nspawn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index fb672510b4..7724df96bd 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2676,7 +2676,7 @@ static int setup_image(char **device_path, int *loop_nr) {
#define PARTITION_TABLE_BLURB \
"Note that the disk image needs to either contain only a single MBR partition of\n" \
- "type 0x83 that is marked bootable, or a sinlge GPT partition of type" \
+ "type 0x83 that is marked bootable, or a single GPT partition of type " \
"0FC63DAF-8483-4772-8E79-3D69D8477DE4 or follow\n" \
" http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/\n" \
"to be bootable with systemd-nspawn."

View File

@ -0,0 +1,53 @@
From 9b09a6df372e9eec7296c42239c8eef8f6edbdc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 23 Feb 2015 18:59:17 -0500
Subject: [PATCH] man: explain time units in tmpfiles
https://bugzilla.redhat.com/show_bug.cgi?id=1195294
(cherry picked from commit 00c53f4283ca41878a84b370840a84760b00d46e)
---
man/tmpfiles.d.xml | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index 8815bf9970..4bd0fcf751 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -443,23 +443,22 @@
delete when cleaning. If a file or directory is older than the
current time minus the age field, it is deleted. The field
format is a series of integers each followed by one of the
- following postfixes for the respective time units:</para>
-
- <variablelist>
- <varlistentry>
- <term><varname>s</varname></term>
- <term><varname>min</varname></term>
- <term><varname>h</varname></term>
- <term><varname>d</varname></term>
- <term><varname>w</varname></term>
- <term><varname>ms</varname></term>
- <term><varname>m</varname></term>
- <term><varname>us</varname></term></varlistentry>
- </variablelist>
+ following postfixes for the respective time units:
+ <constant>s</constant>,
+ <constant>m</constant> or <constant>min</constant>,
+ <constant>h</constant>,
+ <constant>d</constant>,
+ <constant>w</constant>,
+ <constant>ms</constant>,
+ <constant>us</constant>,
+ respectively meaning seconds, minutes, hours, days, weeks,
+ milliseconds, and microseconds. Full names of the time units can
+ be used too.
+ </para>
<para>If multiple integers and units are specified, the time
- values are summed up. If an integer is given without a unit,
- <varname>s</varname> is assumed.
+ values are summed. If an integer is given without a unit,
+ <constant>s</constant> is assumed.
</para>
<para>When the age is set to zero, the files are cleaned

View File

@ -0,0 +1,33 @@
From 33ff9ced04684fe88e988fe06573ad73c8d9c20a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 7 Feb 2015 11:16:04 -0500
Subject: [PATCH] systemctl: check validity of PID we received
(cherry picked from commit d028e01814a405e83c400c60545785d35dba2a17)
---
src/systemctl/systemctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 6b93ec8446..3da4d3d4f1 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -2881,6 +2881,9 @@ static int check_inhibitors(sd_bus *bus, enum action a) {
if (!sv)
return log_oom();
+ if ((pid_t) pid < 0)
+ return log_error_errno(ERANGE, "Bad PID %"PRIu32": %m", pid);
+
if (!strv_contains(sv,
a == ACTION_HALT ||
a == ACTION_POWEROFF ||
@@ -2892,7 +2895,7 @@ static int check_inhibitors(sd_bus *bus, enum action a) {
user = uid_to_name(uid);
log_warning("Operation inhibited by \"%s\" (PID "PID_FMT" \"%s\", user %s), reason is \"%s\".",
- who, pid, strna(comm), strna(user), why);
+ who, (pid_t) pid, strna(comm), strna(user), why);
c++;
}

View File

@ -0,0 +1,85 @@
From bddb25b6d9f5b1cf7f7219b3f23e3668f9563d6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 7 Feb 2015 11:35:37 -0500
Subject: [PATCH] systemctl: support auditd.service better
We would print the filename header before trying to open the file. But since
the header was printed to stdout, and the error to stderr, the error would appear
on the terminal before the header. It is cleaner to open the file first, then
and only then print the header.
Also exit on first error. We shouldn't report success if we were unable to open
a file.
(cherry picked from commit 8527b07be1c5211b50a1a6496585952857a25c73)
---
src/systemctl/systemctl.c | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3da4d3d4f1..4ec0cff21d 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4555,6 +4555,23 @@ static int init_home_and_lookup_paths(char **user_home, char **user_runtime, Loo
return 0;
}
+static int cat_file(const char *filename, bool newline) {
+ _cleanup_close_ int fd;
+
+ fd = open(filename, O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ if (fd < 0)
+ return -errno;
+
+ printf("%s%s# %s%s\n",
+ newline ? "\n" : "",
+ ansi_highlight_blue(),
+ filename,
+ ansi_highlight_off());
+ fflush(stdout);
+
+ return copy_bytes(fd, STDOUT_FILENO, (off_t) -1, false);
+}
+
static int cat(sd_bus *bus, char **args) {
_cleanup_free_ char *user_home = NULL;
_cleanup_free_ char *user_runtime = NULL;
@@ -4600,32 +4617,15 @@ static int cat(sd_bus *bus, char **args) {
puts("");
if (fragment_path) {
- printf("%s# %s%s\n",
- ansi_highlight_blue(),
- fragment_path,
- ansi_highlight_off());
- fflush(stdout);
-
- r = copy_file_fd(fragment_path, STDOUT_FILENO, false);
- if (r < 0) {
- log_warning_errno(r, "Failed to cat %s: %m", fragment_path);
- continue;
- }
+ r = cat_file(fragment_path, false);
+ if (r < 0)
+ return log_warning_errno(r, "Failed to cat %s: %m", fragment_path);
}
STRV_FOREACH(path, dropin_paths) {
- printf("%s%s# %s%s\n",
- isempty(fragment_path) && path == dropin_paths ? "" : "\n",
- ansi_highlight_blue(),
- *path,
- ansi_highlight_off());
- fflush(stdout);
-
- r = copy_file_fd(*path, STDOUT_FILENO, false);
- if (r < 0) {
- log_warning_errno(r, "Failed to cat %s: %m", *path);
- continue;
- }
+ r = cat_file(*path, path == dropin_paths);
+ if (r < 0)
+ return log_warning_errno(r, "Failed to cat %s: %m", *path);
}
}

View File

@ -0,0 +1,31 @@
From c52febcc0314c85d5a0cefc95d7f9ee0d7eb7081 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 24 Feb 2015 16:18:43 +0100
Subject: [PATCH] shared/unit-name: fix gcc5 warning
Fix the following gcc5 warning:
CC src/shared/libsystemd_shared_la-unit-name.lo
src/shared/unit-name.c: In function 'unit_name_is_valid':
src/shared/unit-name.c:102:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!template_ok == TEMPLATE_VALID && at+1 == e)
^
(cherry picked from commit f9bf3e260c480f7b660bec3f78a13f52a46ec34d)
---
src/shared/unit-name.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 21b66913c9..f728af4a81 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -100,7 +100,7 @@ bool unit_name_is_valid(const char *n, enum template_valid template_ok) {
if (at == n)
return false;
- if (!template_ok == TEMPLATE_VALID && at+1 == e)
+ if (template_ok != TEMPLATE_VALID && at+1 == e)
return false;
}

View File

@ -0,0 +1,32 @@
From 6af0a4ba45b63072df70ca4d6a8fc5790c66e149 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 24 Feb 2015 16:24:14 +0100
Subject: [PATCH] test-hashmap: fix gcc5 warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
gcc5 spits out a warning about test-hashmap.c:
CC src/test/test-hashmap.o
src/test/test-hashmap.c: In function test_string_compare_func:
src/test/test-hashmap.c:76:79: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
(cherry picked from commit 4b3eff61640672bf0b19cb8cdd88ce5e84dcda1c)
---
src/test/test-hashmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c
index 6900da9e89..351563b967 100644
--- a/src/test/test-hashmap.c
+++ b/src/test/test-hashmap.c
@@ -75,7 +75,7 @@ static void test_trivial_compare_func(void) {
}
static void test_string_compare_func(void) {
- assert_se(!string_compare_func("fred", "wilma") == 0);
+ assert_se(string_compare_func("fred", "wilma") != 0);
assert_se(string_compare_func("fred", "fred") == 0);
}

View File

@ -0,0 +1,29 @@
From cf0e4940eadeb4636a958e8d7bc243dd03120eb8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Fri, 20 Feb 2015 15:14:56 -0300
Subject: [PATCH] shared: fix wrong assertion in barrier_set_role()
assert(b->pipe[0] >= 0 && b->pipe[0] >= 0);
Test the same condition twice, pretty sure we mean
assert(b->pipe[0] >= 0 && b->pipe[1] >= 0);
(cherry picked from commit 3f7f1fad7621f584d9ce024abb313ecbc9bd0e62)
---
src/shared/barrier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/barrier.c b/src/shared/barrier.c
index f65363a67b..b7dca75097 100644
--- a/src/shared/barrier.c
+++ b/src/shared/barrier.c
@@ -178,7 +178,7 @@ void barrier_set_role(Barrier *b, unsigned int role) {
assert(b);
assert(role == BARRIER_PARENT || role == BARRIER_CHILD);
/* make sure this is only called once */
- assert(b->pipe[1] >= 0 && b->pipe[1] >= 0);
+ assert(b->pipe[0] >= 0 && b->pipe[1] >= 0);
if (role == BARRIER_PARENT)
b->pipe[1] = safe_close(b->pipe[1]);

View File

@ -0,0 +1,60 @@
From d150bc380c90b7ec9fda50f0124e75b12e489ef1 Mon Sep 17 00:00:00 2001
From: Marcel Holtmann <marcel@holtmann.org>
Date: Wed, 25 Feb 2015 07:27:49 +0100
Subject: [PATCH] hwdb: Update database of Bluetooth company identifiers
(cherry picked from commit 3cabeab1197d3e45f16f514f5a396e0fb311e867)
---
hwdb/20-bluetooth-vendor-product.hwdb | 42 +++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/hwdb/20-bluetooth-vendor-product.hwdb b/hwdb/20-bluetooth-vendor-product.hwdb
index fb789fd495..4fd951a584 100644
--- a/hwdb/20-bluetooth-vendor-product.hwdb
+++ b/hwdb/20-bluetooth-vendor-product.hwdb
@@ -1430,3 +1430,45 @@ bluetooth:v01D9*
bluetooth:v01DA*
ID_VENDOR_FROM_DATABASE=Logitech International SA
+
+bluetooth:v01DB*
+ ID_VENDOR_FROM_DATABASE=Innblue Consulting
+
+bluetooth:v01DC*
+ ID_VENDOR_FROM_DATABASE=iParking Ltd.
+
+bluetooth:v01DD*
+ ID_VENDOR_FROM_DATABASE=Koninklijke Philips Electronics N.V.
+
+bluetooth:v01DE*
+ ID_VENDOR_FROM_DATABASE=Minelab Electronics Pty Limited
+
+bluetooth:v01DF*
+ ID_VENDOR_FROM_DATABASE=Bison Group Ltd.
+
+bluetooth:v01E0*
+ ID_VENDOR_FROM_DATABASE=Widex A/S
+
+bluetooth:v01E1*
+ ID_VENDOR_FROM_DATABASE=Jolla Ltd
+
+bluetooth:v01E2*
+ ID_VENDOR_FROM_DATABASE=Lectronix, Inc.
+
+bluetooth:v01E3*
+ ID_VENDOR_FROM_DATABASE=Caterpillar Inc
+
+bluetooth:v01E4*
+ ID_VENDOR_FROM_DATABASE=Freedom Innovations
+
+bluetooth:v01E5*
+ ID_VENDOR_FROM_DATABASE=Dynamic Devices Ltd
+
+bluetooth:v01E6*
+ ID_VENDOR_FROM_DATABASE=Technology Solutions (UK) Ltd
+
+bluetooth:v01E7*
+ ID_VENDOR_FROM_DATABASE=IPS Group Inc.
+
+bluetooth:v01E8*
+ ID_VENDOR_FROM_DATABASE=STIR

View File

@ -0,0 +1,114 @@
From 55c5c56d07d4e1d402ee33dbcf4a04aa20c4279c Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 24 Feb 2015 19:45:17 +0100
Subject: [PATCH] journal: make skipping of exhausted journal files effective
again
Commit 668c965af "journal: skipping of exhausted journal files is bad if
direction changed" fixed a correctness issue, but it also significantly
limited the cases where the optimization that skips exhausted journal
files could apply.
As a result, some journalctl queries are much slower in v219 than in v218.
(e.g. queries where a "--since" cutoff should have quickly eliminated
older journal files from consideration, but didn't.)
If already in the initial iteration find_location_with_matches() finds
no entry, the journal file's location is not updated. This is fine,
except that:
- We must update at least f->last_direction. The optimization relies on
it. Let's separate that from journal_file_save_location() and update
it immediately after the direction checks.
- The optimization was conditional on "f->current_offset > 0", but it
would always be 0 in this scenario. This check is unnecessary for the
optimization.
(cherry picked from commit 950c07d421c04e5aae99973479f4f13131fb45e1)
---
src/journal/journal-file.c | 3 +--
src/journal/journal-file.h | 2 +-
src/journal/sd-journal.c | 24 +++++++++++++++---------
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 0f28718b0e..24c49b916a 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2014,8 +2014,7 @@ void journal_file_reset_location(JournalFile *f) {
f->current_xor_hash = 0;
}
-void journal_file_save_location(JournalFile *f, direction_t direction, Object *o, uint64_t offset) {
- f->last_direction = direction;
+void journal_file_save_location(JournalFile *f, Object *o, uint64_t offset) {
f->location_type = LOCATION_SEEK;
f->current_offset = offset;
f->current_seqnum = le64toh(o->entry.seqnum);
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 2526e14d65..403c8f760c 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -199,7 +199,7 @@ int journal_file_find_field_object(JournalFile *f, const void *field, uint64_t s
int journal_file_find_field_object_with_hash(JournalFile *f, const void *field, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset);
void journal_file_reset_location(JournalFile *f);
-void journal_file_save_location(JournalFile *f, direction_t direction, Object *o, uint64_t offset);
+void journal_file_save_location(JournalFile *f, Object *o, uint64_t offset);
int journal_file_compare_locations(JournalFile *af, JournalFile *bf);
int journal_file_next_entry(JournalFile *f, uint64_t p, direction_t direction, Object **ret, uint64_t *offset);
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 94891cdf35..9b57e5945d 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -723,13 +723,17 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
assert(j);
assert(f);
- if (f->last_direction == direction && f->current_offset > 0) {
- /* If we hit EOF before, recheck if any new entries arrived. */
- n_entries = le64toh(f->header->n_entries);
- if (f->location_type == LOCATION_TAIL && n_entries == f->last_n_entries)
- return 0;
- f->last_n_entries = n_entries;
+ n_entries = le64toh(f->header->n_entries);
+
+ /* If we hit EOF before, we don't need to look into this file again
+ * unless direction changed or new entries appeared. */
+ if (f->last_direction == direction && f->location_type == LOCATION_TAIL &&
+ n_entries == f->last_n_entries)
+ return 0;
+ f->last_n_entries = n_entries;
+
+ if (f->last_direction == direction && f->current_offset > 0) {
/* LOCATION_SEEK here means we did the work in a previous
* iteration and the current location already points to a
* candidate entry. */
@@ -738,14 +742,16 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
if (r <= 0)
return r;
- journal_file_save_location(f, direction, c, cp);
+ journal_file_save_location(f, c, cp);
}
} else {
+ f->last_direction = direction;
+
r = find_location_with_matches(j, f, direction, &c, &cp);
if (r <= 0)
return r;
- journal_file_save_location(f, direction, c, cp);
+ journal_file_save_location(f, c, cp);
}
/* OK, we found the spot, now let's advance until an entry
@@ -773,7 +779,7 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
if (r <= 0)
return r;
- journal_file_save_location(f, direction, c, cp);
+ journal_file_save_location(f, c, cp);
}
}

View File

@ -0,0 +1,34 @@
From c10e229f8222b92117ba38045ddb3e4d7951244a Mon Sep 17 00:00:00 2001
From: Arend van Spriel <arend@broadcom.com>
Date: Wed, 25 Feb 2015 11:02:39 +0100
Subject: [PATCH] hwdb: add sdio identifiers for Broadcom WLAN cards
This patch adds the sdio identifiers known to be supported by
the brcmfmac open-source driver.
(cherry picked from commit 0c591b6c92ded66bea5ed615796b0f8c1cd6b422)
---
hwdb/sdio.ids | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hwdb/sdio.ids b/hwdb/sdio.ids
index 8a4c7136d2..d61729744e 100644
--- a/hwdb/sdio.ids
+++ b/hwdb/sdio.ids
@@ -34,6 +34,16 @@
5347 GDM72xx WiMAX
02d0 Broadcom Corp.
044b Nintendo Wii WLAN daughter card
+ a887 BCM43143 WLAN card
+ 4324 BCM43241 WLAN card
+ 4329 BCM4329 WLAN card
+ 4330 BCM4330 WLAN card
+ 4334 BCM4334 WLAN card
+ a94c BCM43340 WLAN card
+ a94d BCM43341 WLAN card
+ 4335 BCM4335/BCM4339 WLAN card
+ a962 BCM43362 WLAN card
+ 4354 BCM4354 WLAN card
02db SyChip Inc.
0002 Pegasus WLAN SDIO Card (6060SD)
02df Marvell Technology Group Ltd.

View File

@ -0,0 +1,42 @@
From 99ed674eb8f9bdaa45d937379c2f00ea684a7fc9 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Fri, 27 Feb 2015 20:05:26 +0100
Subject: [PATCH] shared/condition: fix gcc5 warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the warning below.
src/shared/condition.c: In function condition_new:
src/shared/condition.c:47:27: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
assert(!parameter == (type == CONDITION_NULL));
^
src/shared/macro.h:42:44: note: in definition of macro _unlikely_
#define _unlikely_(x) (__builtin_expect(!!(x),0))
^
src/shared/macro.h:226:22: note: in expansion of macro assert_se
#define assert(expr) assert_se(expr)
^
src/shared/condition.c:47:9: note: in expansion of macro assert
assert(!parameter == (type == CONDITION_NULL));
^
(cherry picked from commit 8a9c6071cb7467170010f0287672c987981bdf9c)
---
src/shared/condition.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/condition.c b/src/shared/condition.c
index da7560f05f..796cc520d7 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -46,7 +46,7 @@ Condition* condition_new(ConditionType type, const char *parameter, bool trigger
assert(type >= 0);
assert(type < _CONDITION_TYPE_MAX);
- assert(!parameter == (type == CONDITION_NULL));
+ assert((!parameter) == (type == CONDITION_NULL));
c = new0(Condition, 1);
if (!c)

View File

@ -0,0 +1,34 @@
From dd416d4c05eb40bc80380978779cfbc67fab7d35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 27 Feb 2015 17:26:42 -0500
Subject: [PATCH] man: correct description of systemd-user-sessions
That part of functionality was removed in 7fb3ee51c1b377.
(cherry picked from commit 3849a2ac8198fedd25e66fe780821fa96eb6396d)
---
man/systemd-user-sessions.service.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/man/systemd-user-sessions.service.xml b/man/systemd-user-sessions.service.xml
index 9d796b1ae1..e75ef11c4e 100644
--- a/man/systemd-user-sessions.service.xml
+++ b/man/systemd-user-sessions.service.xml
@@ -55,13 +55,12 @@
<title>Description</title>
<para><filename>systemd-user-sessions.service</filename> is a
- service that controls user logins. After basic system
- initialization is complete it removes
+ service that controls user logins through
+ <citerefentry project='man-pages'><refentrytitle>pam_nologin</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+ After basic system initialization is complete it removes
<filename>/run/nologin</filename>, thus permitting logins. Before
system shutdown it creates <filename>/run/nologin</filename>, thus
- prohibiting further logins. At the same time it also kills all
- user processes, so that system shutdown may proceed without any
- remaining user processes around.</para>
+ prohibiting further logins.</para>
</refsect1>
<refsect1>

View File

@ -0,0 +1,31 @@
From 86d07870ff23fb3a0d13760d31ff23409ef19523 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 1 Mar 2015 22:46:43 -0500
Subject: [PATCH] build-sys: allow lto and FORTIFY_SOURCE with -O[sz]
https://bugs.freedesktop.org/show_bug.cgi?id=89382
(cherry picked from commit 0289f2fb2a64df53b589b771f69c43126b029590)
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 97a29d63fd..6bc347423b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,13 +208,13 @@ AS_CASE([$CC], [*clang*],
-Wno-gnu-variable-sized-type-not-at-end \
])])
-AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
+AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-flto -ffat-lto-objects])],
[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
-AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
+AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
[CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
-Wp,-D_FORTIFY_SOURCE=2])],
[AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])

23
0048-man-fix-typo.patch Normal file
View File

@ -0,0 +1,23 @@
From 33ffe19b7c01fc1f4d32c629d4c6462776d84644 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 3 Mar 2015 00:11:51 +0100
Subject: [PATCH] man: fix typo
(cherry picked from commit a68188812290cb9ec9f3f8a17b65e64549a4fd65)
---
man/systemd.netdev.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index 4480e1999d..ef58887dc8 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -108,7 +108,7 @@
<entry>A bond device is an aggregation of all its slave devices. See <ulink url="https://www.kernel.org/doc/Documentation/networking/bonding.txt">Linux Ethernet Bonding Driver HOWTO</ulink> for details.Local configuration</entry></row>
<row><entry><varname>bridge</varname></entry>
- <entry>A bridge devcie is a software switch, each of its slave devices and the bridge itself are ports of the switch.</entry></row>
+ <entry>A bridge device is a software switch, each of its slave devices and the bridge itself are ports of the switch.</entry></row>
<row><entry><varname>dummy</varname></entry>
<entry>A dummy device drops all packets sent to it.</entry></row>

View File

@ -0,0 +1,23 @@
From f0637f329a5da0680cd7ef79cc05ecdaa0194d82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Mar 2015 00:05:14 -0500
Subject: [PATCH] bus-proxyd: avoid logging oom twice
(cherry picked from commit c29005212dc38d98c707639d1a82ffa5270f2e97)
---
src/bus-proxyd/bus-proxyd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index b6b0056362..b6550ed3cf 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -82,7 +82,7 @@ static int client_context_new(ClientContext **out) {
c = new0(ClientContext, 1);
if (!c)
- return log_oom();
+ return -ENOMEM;
c->fd = -1;

View File

@ -0,0 +1,29 @@
From 7b95274e6adeec3b7bb44fd7cfe0a50902615151 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Mar 2015 10:36:47 -0500
Subject: [PATCH] Do not run sysv-generator-test when sysv compat is disabled
(cherry picked from commit dcf1369057231fbf09e37b5a48483763b4ae6e19)
---
Makefile.am | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index cc577ced48..aadaad2b8d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3786,9 +3786,14 @@ TESTS += \
if HAVE_PYTHON
TESTS += \
test/rule-syntax-check.py \
+ $(NULL)
+
+if HAVE_SYSV_COMPAT
+TESTS += \
test/sysv-generator-test.py \
$(NULL)
endif
+endif
manual_tests += \
test-libudev \

View File

@ -0,0 +1,26 @@
From 83a122de87bc2e5c01c083029d216da4241fe948 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Mar 2015 09:00:39 -0500
Subject: [PATCH] README: mention ACLs more
They are now useful for any fs used for journal storage.
(cherry picked from commit a6cccd8f580fc1e062dba3895e232007acd38781)
---
README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README b/README
index c72209262e..aac255f7f1 100644
--- a/README
+++ b/README
@@ -77,8 +77,8 @@ REQUIREMENTS:
Optional but strongly recommended:
CONFIG_IPV6
CONFIG_AUTOFS4_FS
- CONFIG_TMPFS_POSIX_ACL
CONFIG_TMPFS_XATTR
+ CONFIG_{TMPFS,EXT4,XFS,BTRFS_FS,...}_POSIX_ACL
CONFIG_SECCOMP
Required for CPUShares in resource control unit settings

View File

@ -0,0 +1,333 @@
From fdf1ec82999b343bedaeb48bca55f2dc53d2646d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 3 Mar 2015 19:10:21 -0500
Subject: [PATCH] Do not advertise .d snippets over main config file
For daemons which have a main configuration file, there's
little reason for the administrator to use configuration snippets.
They are useful for packagers which need to override settings, but
we shouldn't advertise that as the main way of configuring those
services.
https://bugs.freedesktop.org/show_bug.cgi?id=89397
(cherry picked from commit e93549ef29c4123d9ee45acb5815048390201e49)
---
man/bootchart.conf.xml | 3 +--
man/coredump.conf.xml | 3 +--
man/journald.conf.xml | 3 +--
man/logind.conf.xml | 8 +++++---
man/resolved.conf.xml | 3 +--
man/standard-conf.xml | 42 ++++++++++++++++++++++++++++++++++--------
man/systemd-sleep.conf.xml | 3 +--
man/systemd-system.conf.xml | 3 +--
man/timesyncd.conf.xml | 3 +--
src/bootchart/bootchart.conf | 7 ++++---
src/core/system.conf | 7 ++++---
src/journal/coredump.conf | 7 ++++---
src/journal/journald.conf | 7 ++++---
src/login/logind.conf | 7 ++++---
src/resolve/resolved.conf.in | 5 +++--
src/timesync/timesyncd.conf.in | 7 ++++---
16 files changed, 73 insertions(+), 45 deletions(-)
diff --git a/man/bootchart.conf.xml b/man/bootchart.conf.xml
index 8d9700d300..bf6ca0bf9e 100644
--- a/man/bootchart.conf.xml
+++ b/man/bootchart.conf.xml
@@ -68,8 +68,7 @@
parameters and graph output.</para>
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml
index 3d325e6ad7..0b7329bf55 100644
--- a/man/coredump.conf.xml
+++ b/man/coredump.conf.xml
@@ -63,8 +63,7 @@
a handler for core dumps invoked by the kernel.</para>
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index 364b58f07e..85146b0d82 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -64,8 +64,7 @@
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/logind.conf.xml b/man/logind.conf.xml
index ffaec50351..ca2b18783c 100644
--- a/man/logind.conf.xml
+++ b/man/logind.conf.xml
@@ -58,11 +58,13 @@
<refsect1>
<title>Description</title>
- <para>These files configure various parameters of the systemd login manager, <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+ <para>These files configure various parameters of the systemd
+ login manager,
+ <citerefentry><refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+ </para>
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/resolved.conf.xml b/man/resolved.conf.xml
index 36cae2706c..8047a4ea75 100644
--- a/man/resolved.conf.xml
+++ b/man/resolved.conf.xml
@@ -63,8 +63,7 @@
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/standard-conf.xml b/man/standard-conf.xml
index b87d7e955b..36af45927d 100644
--- a/man/standard-conf.xml
+++ b/man/standard-conf.xml
@@ -33,13 +33,39 @@
configuration file.</para>
</refsection>
- <refsection id='conf'>
- <title>Configuration File</title>
-
- <para>Configuration is also read from a single configuration file in
- <filename>/etc/</filename>. This file is read before any of the
- configuration directories, and has the lowest precedence; entries in a file
- in any configuration directory override entries in the single configuration
- file.</para>
+ <refsection id='main-conf'>
+ <title>Configuration Directories and Precedence</title>
+
+ <para>Default configuration is defined during compilation, so a
+ configuration file is only needed when it is necessary to deviate
+ from those defaults. By default the configuration file in
+ <filename>/etc/systemd/</filename> contains commented out entries
+ showing the defaults as a guide to the administrator. This file
+ can be edited to create local overrides.
+ </para>
+
+ <para>When packages need to customize the configuration, they can
+ install configuration snippets in
+ <filename>/usr/lib/systemd/*.conf.d/</filename>. Files in
+ <filename>/etc/</filename> are reserved for the local
+ administrator, who may use this logic to override the
+ configuration files installed by vendor packages. The main
+ configuration file is read before any of the configuration
+ directories, and has the lowest precedence; entries in a file in
+ any configuration directory override entries in the single
+ configuration file. Files in the
+ <filename>logind.conf.d/</filename> configuration subdirectories
+ are sorted by their filename in lexicographic order, regardless of
+ which of the subdirectories they reside in. If multiple files
+ specify the same option, the entry in the file with the
+ lexicographically latest name takes precedence. It is recommended
+ to prefix all filenames in those subdirectories with a two-digit
+ number and a dash, to simplify the ordering of the files.</para>
+
+ <para>To disable a configuration file supplied by the vendor, the
+ recommended way is to place a symlink to
+ <filename>/dev/null</filename> in the configuration directory in
+ <filename>/etc/</filename>, with the same filename as the vendor
+ configuration file.</para>
</refsection>
</refsection>
diff --git a/man/systemd-sleep.conf.xml b/man/systemd-sleep.conf.xml
index 433f2f83a0..bb17ec8669 100644
--- a/man/systemd-sleep.conf.xml
+++ b/man/systemd-sleep.conf.xml
@@ -112,8 +112,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
attempts to suspend or hibernate the machine.</para>
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml
index 7c3f237567..c7bcfaee4d 100644
--- a/man/systemd-system.conf.xml
+++ b/man/systemd-system.conf.xml
@@ -74,8 +74,7 @@
operations.</para>
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/man/timesyncd.conf.xml b/man/timesyncd.conf.xml
index 1127970a18..89a651c662 100644
--- a/man/timesyncd.conf.xml
+++ b/man/timesyncd.conf.xml
@@ -63,8 +63,7 @@
</refsect1>
- <xi:include href="standard-conf.xml" xpointer="confd" />
- <xi:include href="standard-conf.xml" xpointer="conf" />
+ <xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
diff --git a/src/bootchart/bootchart.conf b/src/bootchart/bootchart.conf
index 2d7cb61217..4f5e50936e 100644
--- a/src/bootchart/bootchart.conf
+++ b/src/bootchart/bootchart.conf
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/bootchart.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See bootchart.conf(5) for details
+# See bootchart.conf(5) for details.
[Bootchart]
#Samples=500
diff --git a/src/core/system.conf b/src/core/system.conf
index a3727200df..231609033b 100644
--- a/src/core/system.conf
+++ b/src/core/system.conf
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/system.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See systemd-system.conf(5) for details
+# See systemd-system.conf(5) for details.
[Manager]
#LogLevel=info
diff --git a/src/journal/coredump.conf b/src/journal/coredump.conf
index 0fe9fe801a..c2f0643e03 100644
--- a/src/journal/coredump.conf
+++ b/src/journal/coredump.conf
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/coredump.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See coredump.conf(5) for details
+# See coredump.conf(5) for details.
[Coredump]
#Storage=external
diff --git a/src/journal/journald.conf b/src/journal/journald.conf
index 29bdf8f183..47eefe91c1 100644
--- a/src/journal/journald.conf
+++ b/src/journal/journald.conf
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/journald.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See journald.conf(5) for details
+# See journald.conf(5) for details.
[Journal]
#Storage=auto
diff --git a/src/login/logind.conf b/src/login/logind.conf
index 6b1943a2d1..834c4c2ebf 100644
--- a/src/login/logind.conf
+++ b/src/login/logind.conf
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/logind.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See logind.conf(5) for details
+# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
diff --git a/src/resolve/resolved.conf.in b/src/resolve/resolved.conf.in
index e5a19ee474..3eb19e42b7 100644
--- a/src/resolve/resolved.conf.in
+++ b/src/resolve/resolved.conf.in
@@ -5,8 +5,9 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/resolved.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details
diff --git a/src/timesync/timesyncd.conf.in b/src/timesync/timesyncd.conf.in
index fc3c6c49cf..b6a2ada273 100644
--- a/src/timesync/timesyncd.conf.in
+++ b/src/timesync/timesyncd.conf.in
@@ -5,10 +5,11 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# You can override the directives in this file by creating files in
-# /etc/systemd/timesyncd.conf.d/*.conf.
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
#
-# See timesyncd.conf(5) for details
+# See timesyncd.conf(5) for details.
[Time]
#NTP=

View File

@ -0,0 +1,22 @@
From 0e1497b9c44688f5a038dbcc7d69090d55e2701a Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 4 Mar 2015 13:24:45 +1000
Subject: [PATCH] hwdb: add pnpid for the T450s touchpad
https://bugs.freedesktop.org/show_bug.cgi?id=89411
(cherry picked from commit c26c1d86b3e466e073577e27ad839a0c112cd17b)
---
hwdb/70-touchpad.hwdb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hwdb/70-touchpad.hwdb b/hwdb/70-touchpad.hwdb
index bbf44db778..9fcb5fdb9b 100644
--- a/hwdb/70-touchpad.hwdb
+++ b/hwdb/70-touchpad.hwdb
@@ -36,4 +36,6 @@
# Lenovo X1 Carbon 3rd
touchpad:pnpid:*LEN0048*:
+# Lenovo T450s
+touchpad:pnpid:*LEN200f*:
TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1

View File

@ -0,0 +1,30 @@
From 67ec035b3c192e71fb040959fe8d311d9c89edaa Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Wed, 4 Mar 2015 10:33:50 +0100
Subject: [PATCH] networkd: netdev - inform when we take over an existing
netdev
The crucial point here is that we will not change the settings of a netdev created by someone else
we simply use it as is and trust it was set up as intended.
This is confusing in the case of the pre-created netdev's (bond0 etc.), the solution should probably
be to simply make the kernel stop creating these devices as they are pretty useless.
(cherry picked from commit ff88a301e93cf1bddbaa7faa981f390a2a81a4bb)
---
src/network/networkd-netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 8119205dde..7d193d088e 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -261,7 +261,7 @@ static int netdev_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda
r = sd_rtnl_message_get_errno(m);
if (r == -EEXIST)
- log_netdev_debug(netdev, "netdev exists, using existing");
+ log_info_netdev(netdev, "netdev exists, using existing without changing its parameters");
else if (r < 0) {
log_warning_netdev(netdev, "netdev could not be created: %s", strerror(-r));
netdev_drop(netdev);

View File

@ -0,0 +1,181 @@
From 4015611680b1ee7ba43dbaf405fefb7ddb137797 Mon Sep 17 00:00:00 2001
From: Zachary Cook <zachcook1991@gmail.com>
Date: Wed, 4 Mar 2015 18:43:20 -0500
Subject: [PATCH] man: replace obsolete wiki link with man page
(cherry picked from commit b1c1a51944e8e11545ae2a230d674f5145595192)
---
man/systemd-cryptsetup-generator.xml | 6 ++----
man/systemd-debug-generator.xml | 6 ++----
man/systemd-efi-boot-generator.xml | 4 +---
man/systemd-fstab-generator.xml | 6 ++----
man/systemd-getty-generator.xml | 5 ++---
man/systemd-gpt-auto-generator.xml | 4 +---
man/systemd-system-update-generator.xml | 6 ++----
man/systemd-sysv-generator.xml | 6 ++----
man/systemd.unit.xml | 4 ++--
man/systemd.xml | 5 ++---
10 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/man/systemd-cryptsetup-generator.xml b/man/systemd-cryptsetup-generator.xml
index 0e48e79346..1974cd7a2d 100644
--- a/man/systemd-cryptsetup-generator.xml
+++ b/man/systemd-cryptsetup-generator.xml
@@ -59,10 +59,8 @@
<citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
units as necessary.</para>
- <para><filename>systemd-cryptsetup-generator</filename>
- implements the <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-cryptsetup-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-debug-generator.xml b/man/systemd-debug-generator.xml
index 74c3b2620e..5c5e9fc4a1 100644
--- a/man/systemd-debug-generator.xml
+++ b/man/systemd-debug-generator.xml
@@ -79,10 +79,8 @@
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
<command>enable</command> command.</para>
- <para><filename>systemd-debug-generator</filename> implements the
- <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-debug-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-efi-boot-generator.xml b/man/systemd-efi-boot-generator.xml
index b2d8d65e3d..fd7ba79837 100644
--- a/man/systemd-efi-boot-generator.xml
+++ b/man/systemd-efi-boot-generator.xml
@@ -68,9 +68,7 @@
only be activated on-demand, when accessed.</para>
<para><filename>systemd-efi-boot-generator</filename> implements
- the <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-fstab-generator.xml b/man/systemd-fstab-generator.xml
index 8f82e33304..022efb4130 100644
--- a/man/systemd-fstab-generator.xml
+++ b/man/systemd-fstab-generator.xml
@@ -71,10 +71,8 @@
for more information about special <filename>/etc/fstab</filename>
mount options this generator understands.</para>
- <para><filename>systemd-fstab-generator</filename> implements the
- <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-fstab-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-getty-generator.xml b/man/systemd-getty-generator.xml
index 0b5b2f2a71..338925964d 100644
--- a/man/systemd-getty-generator.xml
+++ b/man/systemd-getty-generator.xml
@@ -75,9 +75,8 @@
for more information on the <varname>console=</varname> kernel
parameter.</para>
- <para><filename>systemd-getty-generator</filename> implements the
- <ulink url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-getty-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
<para>Further information about configuration of gettys you may
find in
diff --git a/man/systemd-gpt-auto-generator.xml b/man/systemd-gpt-auto-generator.xml
index 9c706df246..8d2eaca4f6 100644
--- a/man/systemd-gpt-auto-generator.xml
+++ b/man/systemd-gpt-auto-generator.xml
@@ -157,9 +157,7 @@
using <command>btrfs subvolume set-default</command>.</para>
<para><filename>systemd-gpt-auto-generator</filename> implements
- the
- <ulink url="http://www.freedesktop.org/wiki/Software/systemd/Generators">Generator
- Specification</ulink>.</para>
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-system-update-generator.xml b/man/systemd-system-update-generator.xml
index 3eec1d7b93..e7fc95c742 100644
--- a/man/systemd-system-update-generator.xml
+++ b/man/systemd-system-update-generator.xml
@@ -61,10 +61,8 @@
Updates Specification</ulink>.
</para>
- <para><filename>systemd-system-update-generator</filename>
- implements the
- <ulink url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-system-update-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd-sysv-generator.xml b/man/systemd-sysv-generator.xml
index e619b1bc2e..f2d56cbcd2 100644
--- a/man/systemd-sysv-generator.xml
+++ b/man/systemd-sysv-generator.xml
@@ -81,10 +81,8 @@
part of early boot, so all wrapper units are ordered after
<filename>basic.target</filename>.</para>
- <para><filename>systemd-sysv-generator</filename>
- implements the <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
- specification</ulink>.</para>
+ <para><filename>systemd-sysv-generator</filename> implements
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
</refsect1>
<refsect1>
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 09e11b4711..a452f87baf 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -357,8 +357,8 @@
from directories not on the unit load path. See the
<command>link</command> command for
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
- Also, some units are dynamically created via generators <ulink
- url="http://www.freedesktop.org/wiki/Software/systemd/Generators/">Generators</ulink>.
+ Also, some units are dynamically created via a
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
</refsect1>
diff --git a/man/systemd.xml b/man/systemd.xml
index 80591dc732..9b92140e6b 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -415,9 +415,8 @@
<para>Units may be generated dynamically at boot and system
manager reload time, for example based on other configuration
- files or parameters passed on the kernel command line. For details
- see the
- <ulink url="http://www.freedesktop.org/wiki/Software/systemd/Generators">Generators Specification</ulink>.</para>
+ files or parameters passed on the kernel command line. For details see
+ <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
<para>Systems which invoke systemd in a container or initrd
environment should implement the

View File

@ -0,0 +1,31 @@
From 9b6d1109707911b63b76b1c7a26e89a21cef9011 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Thu, 5 Mar 2015 00:07:33 +0100
Subject: [PATCH] Use correct uname identifiers in arch_map for SuperH
architecture
https://bugs.freedesktop.org/show_bug.cgi?id=89421
(cherry picked from commit 3a867c6a2361c8af943d3ed452da6e8623a3f65d)
---
src/shared/architecture.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
index 34c5a53fa9..884abdd3ea 100644
--- a/src/shared/architecture.c
+++ b/src/shared/architecture.c
@@ -108,8 +108,12 @@ int uname_architecture(void) {
{ "armv8l", ARCHITECTURE_ARM },
{ "armv8b", ARCHITECTURE_ARM_BE },
#elif defined(__sh__) || defined(__sh64__)
- { "sh64", ARCHITECTURE_SH64 },
- { "sh", ARCHITECTURE_SH },
+ { "sh5", ARCHITECTURE_SH64 },
+ { "sh2", ARCHITECTURE_SH },
+ { "sh2a", ARCHITECTURE_SH },
+ { "sh3", ARCHITECTURE_SH },
+ { "sh4", ARCHITECTURE_SH },
+ { "sh4a", ARCHITECTURE_SH },
#elif defined(__m68k__)
{ "m68k", ARCHITECTURE_M68K },
#elif defined(__tilegx__)

View File

@ -0,0 +1,24 @@
From cc32b9d93a797ce30b139e839432c49ec228271f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 4 Mar 2015 20:25:04 -0500
Subject: [PATCH] hwdb: fix Dell XPS12 9Q33 key name
https://bugs.freedesktop.org/show_bug.cgi?id=84437
(cherry picked from commit 4f70555d76c90ffdc5a5e4f75bbc08b38022c911)
---
hwdb/60-keyboard.hwdb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 2cb976923d..88906655ef 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -259,7 +259,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS*:pvr*
# Dell XPS12 9Q33
keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS12-9Q33*:pvr*
KEYBOARD_KEY_88=wlan
- KEYBOARD_KEY_65=switchvideomode # Screen Rotate
+ KEYBOARD_KEY_65=direction # Screen Rotate
# Dell Latitude microphone mute
keyboard:name:Dell WMI hotkeys:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*

View File

@ -0,0 +1,36 @@
From c2695a243c2741939080ef92e06f0dfddb59d2af Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 4 Mar 2015 16:32:16 +0100
Subject: [PATCH] Remove the cap on epoll events
Currently the code will silently blank out events if there are more
then 512 epoll events, causing them never to be handled at all. This
patch removes the cap on the number of events for epoll_wait, thereby
avoiding this issue.
(cherry picked from commit 1c724e9e0ec5bc4bf791a3d7b1cf5b955cdb98b2)
---
src/libsystemd/sd-event/sd-event.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 25089a0335..c6350be9f4 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -37,7 +37,6 @@
#include "sd-event.h"
-#define EPOLL_QUEUE_MAX 512U
#define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC)
typedef enum EventSourceType {
@@ -2367,7 +2366,7 @@ _public_ int sd_event_wait(sd_event *e, uint64_t timeout) {
return 1;
}
- ev_queue_max = CLAMP(e->n_sources, 1U, EPOLL_QUEUE_MAX);
+ ev_queue_max = MAX(e->n_sources, 1u);
ev_queue = newa(struct epoll_event, ev_queue_max);
m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max,

View File

@ -0,0 +1,30 @@
From 7eaa810935ff190e039f465a06663b4d92aea794 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 4 Mar 2015 16:32:17 +0100
Subject: [PATCH] Allow up to 4096 simultaneous connections
On large system we hit the limit on 512 simultaneous dbus
connections, resulting in tons of annoying messages:
Too many concurrent connections, refusing
This patch raises the limit to 4096.
(cherry picked from commit cbecf9bf929318533fea798c57c10efcf6b2b447)
---
src/core/dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 260775cd85..85b5174868 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -44,7 +44,7 @@
#include "bus-internal.h"
#include "selinux-access.h"
-#define CONNECTIONS_MAX 512
+#define CONNECTIONS_MAX 4096
static void destroy_bus(Manager *m, sd_bus **bus);

View File

@ -0,0 +1,23 @@
From 09787b60a3876972b9194fe403a9ad9282f5dd86 Mon Sep 17 00:00:00 2001
From: Jonathon Gilbert <coroutines@gmail.com>
Date: Thu, 5 Mar 2015 20:29:56 +1000
Subject: [PATCH] hwdb: add Logitech G5 Laser Mouse
(cherry picked from commit 6437edbebe80e68b782f178c7a76e870a53811d7)
---
hwdb/70-mouse.hwdb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hwdb/70-mouse.hwdb b/hwdb/70-mouse.hwdb
index a62ebc497d..93ee4d9fa6 100644
--- a/hwdb/70-mouse.hwdb
+++ b/hwdb/70-mouse.hwdb
@@ -196,6 +196,8 @@ mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:4008:
mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:101b:
MOUSE_DPI=800@166
+# Logitech G5 Laser Mouse
+mouse:usb:v046dpc049:name:Logitech USB Gaming Mouse:
# Logitech G500s Laser Gaming Mouse
mouse:usb:v046dpc24e:name:Logitech G500s Laser Gaming Mouse:
MOUSE_DPI=400@500 *800@500 2000@500

View File

@ -0,0 +1,32 @@
From 71265e69fa8a26d8a9669824eeb3ea9d2fe7c923 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 5 Mar 2015 14:58:56 +0100
Subject: [PATCH] tmpfiles: Fix handling of duplicate lines
Commit 3f93da987 accidentally dropped the "return 0" after detection of a
duplicate line. Put it back, to get back the documented and intended "first
match wins" behaviour.
https://launchpad.net/bugs/1428540
(cherry picked from commit 6487ada88d63e4998113f4c57fa10b7c865f8026)
---
src/tmpfiles/tmpfiles.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 187997e1f4..1e10968164 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -1750,9 +1750,11 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
unsigned n;
for (n = 0; n < existing->count; n++) {
- if (!item_compatible(existing->items + n, &i))
+ if (!item_compatible(existing->items + n, &i)) {
log_warning("[%s:%u] Duplicate line for path \"%s\", ignoring.",
fname, line, i.path);
+ return 0;
+ }
}
} else {
existing = new0(ItemArray, 1);

View File

@ -0,0 +1,23 @@
From 9e28311ad66214528c4644ca593bcb5259462341 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri, 6 Mar 2015 11:02:04 +1000
Subject: [PATCH] hwdb: add Lenovo W451 to TOUCHPAD_HAS_TRACKPOINT_BUTTONS list
(cherry picked from commit 9638ee90862e4a24f5796e87beebc4c47e2728c2)
---
hwdb/70-touchpad.hwdb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hwdb/70-touchpad.hwdb b/hwdb/70-touchpad.hwdb
index 9fcb5fdb9b..8a324466b3 100644
--- a/hwdb/70-touchpad.hwdb
+++ b/hwdb/70-touchpad.hwdb
@@ -36,6 +36,8 @@
# Lenovo X1 Carbon 3rd
touchpad:pnpid:*LEN0048*:
+# Lenovo W541
+touchpad:pnpid:*LEN004a*:
# Lenovo T450s
touchpad:pnpid:*LEN200f*:
TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1

View File

@ -0,0 +1,39 @@
From b83da13fffc79b5f4c1edaba3764f4d9be6993ff Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 24 Feb 2015 17:49:02 +0100
Subject: [PATCH] vconsole: match on vtcon events, not fbcon ones
I observe that upon loading of framebuffer drivers, I do not get the
desired system font, but the kernel-level defaults (usually
lib/fonts/font_8x16.c, but your mileage may vary depending on kernel
config and boot options).
The fbcon driver may be loaded at a time way before the first
framebuffer device is active, such that the vconsole setup helper
runs too early.
The existing rule is non-fitting. The going live of the fbcon kernel
component does not indicate the proper time at which to load the
visuals, which really ought to be done when a new vtcon object comes
into existence. (The font table is a per-vtcon property.)
(cherry picked from commit a52750d1483ff139df33149afc0b675531e9cd79)
---
src/vconsole/90-vconsole.rules.in | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/vconsole/90-vconsole.rules.in b/src/vconsole/90-vconsole.rules.in
index 062009640c..35b9ad5151 100644
--- a/src/vconsole/90-vconsole.rules.in
+++ b/src/vconsole/90-vconsole.rules.in
@@ -5,7 +5,6 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
-# Kernel resets vconsole state when changing console drivers so run
-# systemd-vconsole-setup when fbcon loads
-
-ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fbcon", RUN+="@rootlibexecdir@/systemd-vconsole-setup"
+# Each vtcon keeps its own state of fonts.
+#
+ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="@rootlibexecdir@/systemd-vconsole-setup"

View File

@ -0,0 +1,375 @@
From 3ef091125ceb159374d2d0d4dbad84d90b252852 Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <intelfx100@gmail.com>
Date: Sat, 7 Mar 2015 08:44:52 -0500
Subject: [PATCH] core: do not spawn jobs or touch other units during
coldplugging
Because the order of coldplugging is not defined, we can reference a
not-yet-coldplugged unit and read its state while it has not yet been
set to a meaningful value.
This way, already active units may get started again.
We fix this by deferring such actions until all units have been at
least somehow coldplugged.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88401
(cherry picked from commit 6e392c9c45643d106673c6643ac8bf4e65da13c1)
---
src/core/automount.c | 2 +-
src/core/busname.c | 2 +-
src/core/device.c | 2 +-
src/core/manager.c | 35 +++++++++++++++++++++++++++++++++--
src/core/mount.c | 2 +-
src/core/path.c | 14 ++++++++++----
src/core/scope.c | 2 +-
src/core/service.c | 2 +-
src/core/slice.c | 2 +-
src/core/snapshot.c | 2 +-
src/core/socket.c | 2 +-
src/core/swap.c | 2 +-
src/core/target.c | 2 +-
src/core/timer.c | 14 ++++++++++----
src/core/unit.c | 25 ++++++++++++++++---------
src/core/unit.h | 12 +++++++++---
16 files changed, 89 insertions(+), 33 deletions(-)
diff --git a/src/core/automount.c b/src/core/automount.c
index 9f6bd84b21..e4c79415d1 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -235,7 +235,7 @@ static void automount_set_state(Automount *a, AutomountState state) {
unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state], true);
}
-static int automount_coldplug(Unit *u) {
+static int automount_coldplug(Unit *u, Hashmap *deferred_work) {
Automount *a = AUTOMOUNT(u);
int r;
diff --git a/src/core/busname.c b/src/core/busname.c
index 1d77292f9b..43d7607a30 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -335,7 +335,7 @@ static void busname_set_state(BusName *n, BusNameState state) {
unit_notify(UNIT(n), state_translation_table[old_state], state_translation_table[state], true);
}
-static int busname_coldplug(Unit *u) {
+static int busname_coldplug(Unit *u, Hashmap *deferred_work) {
BusName *n = BUSNAME(u);
int r;
diff --git a/src/core/device.c b/src/core/device.c
index 1cc103c290..4ff8827219 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -142,7 +142,7 @@ static void device_set_state(Device *d, DeviceState state) {
unit_notify(UNIT(d), state_translation_table[old_state], state_translation_table[state], true);
}
-static int device_coldplug(Unit *u) {
+static int device_coldplug(Unit *u, Hashmap *deferred_work) {
Device *d = DEVICE(u);
assert(d);
diff --git a/src/core/manager.c b/src/core/manager.c
index bc9b7ec620..203a6a0a1a 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -983,7 +983,28 @@ static int manager_coldplug(Manager *m) {
Unit *u;
char *k;
- assert(m);
+ /*
+ * Some unit types tend to spawn jobs or check other units' state
+ * during coldplug. This is wrong because it is undefined whether the
+ * units in question have been already coldplugged (i. e. their state
+ * restored). This way, we can easily re-start an already started unit
+ * or otherwise make a wrong decision based on the unit's state.
+ *
+ * Solve this by providing a way for coldplug functions to defer
+ * such actions until after all units have been coldplugged.
+ *
+ * We store Unit* -> int(*)(Unit*).
+ *
+ * https://bugs.freedesktop.org/show_bug.cgi?id=88401
+ */
+ _cleanup_hashmap_free_ Hashmap *deferred_work = NULL;
+ int(*proc)(Unit*);
+
+ assert(m);
+
+ deferred_work = hashmap_new(&trivial_hash_ops);
+ if (!deferred_work)
+ return -ENOMEM;
/* Then, let's set up their initial state. */
HASHMAP_FOREACH_KEY(u, k, m->units, i) {
@@ -993,7 +1014,17 @@ static int manager_coldplug(Manager *m) {
if (u->id != k)
continue;
- q = unit_coldplug(u);
+ q = unit_coldplug(u, deferred_work);
+ if (q < 0)
+ r = q;
+ }
+
+ /* After coldplugging and setting up initial state of the units,
+ * let's perform operations which spawn jobs or query units' state. */
+ HASHMAP_FOREACH_KEY(proc, u, deferred_work, i) {
+ int q;
+
+ q = proc(u);
if (q < 0)
r = q;
}
diff --git a/src/core/mount.c b/src/core/mount.c
index c971330af2..3ae0eb4621 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -617,7 +617,7 @@ static void mount_set_state(Mount *m, MountState state) {
m->reload_result = MOUNT_SUCCESS;
}
-static int mount_coldplug(Unit *u) {
+static int mount_coldplug(Unit *u, Hashmap *deferred_work) {
Mount *m = MOUNT(u);
MountState new_state = MOUNT_DEAD;
int r;
diff --git a/src/core/path.c b/src/core/path.c
index e5ea79fec7..51e36fa8be 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -440,7 +440,12 @@ static void path_set_state(Path *p, PathState state) {
static void path_enter_waiting(Path *p, bool initial, bool recheck);
-static int path_coldplug(Unit *u) {
+static int path_enter_waiting_coldplug(Unit *u) {
+ path_enter_waiting(PATH(u), true, true);
+ return 0;
+}
+
+static int path_coldplug(Unit *u, Hashmap *deferred_work) {
Path *p = PATH(u);
assert(p);
@@ -449,9 +454,10 @@ static int path_coldplug(Unit *u) {
if (p->deserialized_state != p->state) {
if (p->deserialized_state == PATH_WAITING ||
- p->deserialized_state == PATH_RUNNING)
- path_enter_waiting(p, true, true);
- else
+ p->deserialized_state == PATH_RUNNING) {
+ hashmap_put(deferred_work, u, &path_enter_waiting_coldplug);
+ path_set_state(p, PATH_WAITING);
+ } else
path_set_state(p, p->deserialized_state);
}
diff --git a/src/core/scope.c b/src/core/scope.c
index b41db7872c..ae6614fbf0 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -173,7 +173,7 @@ static int scope_load(Unit *u) {
return scope_verify(s);
}
-static int scope_coldplug(Unit *u) {
+static int scope_coldplug(Unit *u, Hashmap *deferred_work) {
Scope *s = SCOPE(u);
int r;
diff --git a/src/core/service.c b/src/core/service.c
index 15e29be149..7781b4e626 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -879,7 +879,7 @@ static void service_set_state(Service *s, ServiceState state) {
s->reload_result = SERVICE_SUCCESS;
}
-static int service_coldplug(Unit *u) {
+static int service_coldplug(Unit *u, Hashmap *deferred_work) {
Service *s = SERVICE(u);
int r;
diff --git a/src/core/slice.c b/src/core/slice.c
index ae9819d015..61ff9d3314 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -153,7 +153,7 @@ static int slice_load(Unit *u) {
return slice_verify(s);
}
-static int slice_coldplug(Unit *u) {
+static int slice_coldplug(Unit *u, Hashmap *deferred_work) {
Slice *t = SLICE(u);
assert(t);
diff --git a/src/core/snapshot.c b/src/core/snapshot.c
index b70c3beb60..b1d8448771 100644
--- a/src/core/snapshot.c
+++ b/src/core/snapshot.c
@@ -75,7 +75,7 @@ static int snapshot_load(Unit *u) {
return 0;
}
-static int snapshot_coldplug(Unit *u) {
+static int snapshot_coldplug(Unit *u, Hashmap *deferred_work) {
Snapshot *s = SNAPSHOT(u);
assert(s);
diff --git a/src/core/socket.c b/src/core/socket.c
index 88aae4815b..760de0203d 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1326,7 +1326,7 @@ static void socket_set_state(Socket *s, SocketState state) {
unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
}
-static int socket_coldplug(Unit *u) {
+static int socket_coldplug(Unit *u, Hashmap *deferred_work) {
Socket *s = SOCKET(u);
int r;
diff --git a/src/core/swap.c b/src/core/swap.c
index 5c19af5d91..369abf0f53 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -513,7 +513,7 @@ static void swap_set_state(Swap *s, SwapState state) {
job_add_to_run_queue(UNIT(other)->job);
}
-static int swap_coldplug(Unit *u) {
+static int swap_coldplug(Unit *u, Hashmap *deferred_work) {
Swap *s = SWAP(u);
SwapState new_state = SWAP_DEAD;
int r;
diff --git a/src/core/target.c b/src/core/target.c
index 33fb66bc3f..2411a8e758 100644
--- a/src/core/target.c
+++ b/src/core/target.c
@@ -107,7 +107,7 @@ static int target_load(Unit *u) {
return 0;
}
-static int target_coldplug(Unit *u) {
+static int target_coldplug(Unit *u, Hashmap *deferred_work) {
Target *t = TARGET(u);
assert(t);
diff --git a/src/core/timer.c b/src/core/timer.c
index 45744c7de5..48cf9c16a8 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -268,7 +268,12 @@ static void timer_set_state(Timer *t, TimerState state) {
static void timer_enter_waiting(Timer *t, bool initial);
-static int timer_coldplug(Unit *u) {
+static int timer_enter_waiting_coldplug(Unit *u) {
+ timer_enter_waiting(TIMER(u), false);
+ return 0;
+}
+
+static int timer_coldplug(Unit *u, Hashmap *deferred_work) {
Timer *t = TIMER(u);
assert(t);
@@ -276,9 +281,10 @@ static int timer_coldplug(Unit *u) {
if (t->deserialized_state != t->state) {
- if (t->deserialized_state == TIMER_WAITING)
- timer_enter_waiting(t, false);
- else
+ if (t->deserialized_state == TIMER_WAITING) {
+ hashmap_put(deferred_work, u, &timer_enter_waiting_coldplug);
+ timer_set_state(t, TIMER_WAITING);
+ } else
timer_set_state(t, t->deserialized_state);
}
diff --git a/src/core/unit.c b/src/core/unit.c
index a6558ee23b..565455bd63 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2859,27 +2859,34 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
return 0;
}
-int unit_coldplug(Unit *u) {
+static int unit_add_deserialized_job_coldplug(Unit *u) {
+ int r;
+
+ r = manager_add_job(u->manager, u->deserialized_job, u, JOB_IGNORE_REQUIREMENTS, false, NULL, NULL);
+ if (r < 0)
+ return r;
+
+ u->deserialized_job = _JOB_TYPE_INVALID;
+
+ return 0;
+}
+
+int unit_coldplug(Unit *u, Hashmap *deferred_work) {
int r;
assert(u);
if (UNIT_VTABLE(u)->coldplug)
- if ((r = UNIT_VTABLE(u)->coldplug(u)) < 0)
+ if ((r = UNIT_VTABLE(u)->coldplug(u, deferred_work)) < 0)
return r;
if (u->job) {
r = job_coldplug(u->job);
if (r < 0)
return r;
- } else if (u->deserialized_job >= 0) {
+ } else if (u->deserialized_job >= 0)
/* legacy */
- r = manager_add_job(u->manager, u->deserialized_job, u, JOB_IGNORE_REQUIREMENTS, false, NULL, NULL);
- if (r < 0)
- return r;
-
- u->deserialized_job = _JOB_TYPE_INVALID;
- }
+ hashmap_put(deferred_work, u, &unit_add_deserialized_job_coldplug);
return 0;
}
diff --git a/src/core/unit.h b/src/core/unit.h
index 291bc77a76..7ebc489c80 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -307,8 +307,14 @@ struct UnitVTable {
int (*load)(Unit *u);
/* If a lot of units got created via enumerate(), this is
- * where to actually set the state and call unit_notify(). */
- int (*coldplug)(Unit *u);
+ * where to actually set the state and call unit_notify().
+ *
+ * This must not reference other units (maybe implicitly through spawning
+ * jobs), because it is possible that they are not yet coldplugged.
+ * Such actions must be deferred until the end of coldplug bу adding
+ * a "Unit* -> int(*)(Unit*)" entry into the hashmap.
+ */
+ int (*coldplug)(Unit *u, Hashmap *deferred_work);
void (*dump)(Unit *u, FILE *f, const char *prefix);
@@ -544,7 +550,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
int unit_add_node_link(Unit *u, const char *what, bool wants);
-int unit_coldplug(Unit *u);
+int unit_coldplug(Unit *u, Hashmap *deferred_work);
void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) _printf_(3, 0);

View File

@ -0,0 +1,28 @@
From 646308cdc78e95caa311d6d140379ce24954c068 Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <intelfx100@gmail.com>
Date: Thu, 26 Feb 2015 02:46:24 +0300
Subject: [PATCH] firstboot: set all spwd fields to -1 for consistency with
sysusers
(cherry picked from commit ad525df851a1bef7369fe21b5cde382941e7b073)
---
src/firstboot/firstboot.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index a765d6d219..a37ca170fb 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -525,9 +525,9 @@ static int process_root_password(void) {
struct spwd item = {
.sp_namp = (char*) "root",
- .sp_min = 0,
- .sp_max = 99999,
- .sp_warn = 7,
+ .sp_min = -1,
+ .sp_max = -1,
+ .sp_warn = -1,
.sp_inact = -1,
.sp_expire = -1,
.sp_flag = (unsigned long) -1, /* this appears to be what everybody does ... */

View File

@ -0,0 +1,77 @@
From 3f25df7d013a98f7a60b216f1687e95ff6a6cbbb Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <intelfx100@gmail.com>
Date: Sat, 7 Mar 2015 18:11:32 +0300
Subject: [PATCH] sysusers: do not reject users with already present
/etc/shadow entries
This is needed to interoperate firstboot and sysusers. The former one is started
first, and it writes only /etc/shadow when it is told to set the root password.
It's better to relax checks here than to duplicate functionality in firstboot.
(cherry picked from commit c5abf22514b3925aa6f0d4a3f36f76799bf1911b)
---
src/sysusers/sysusers.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index e47bcb4dca..76b5962c51 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -605,6 +605,8 @@ static int write_files(void) {
if (r < 0)
goto finish;
+ lstchg = (long) (now(CLOCK_REALTIME) / USEC_PER_DAY);
+
original = fopen(shadow_path, "re");
if (original) {
struct spwd *sp;
@@ -618,8 +620,13 @@ static int write_files(void) {
i = hashmap_get(users, sp->sp_namp);
if (i && i->todo_user) {
- r = -EEXIST;
- goto finish;
+ /* we will update the existing entry */
+ sp->sp_lstchg = lstchg;
+
+ /* only the /etc/shadow stage is left, so we can
+ * safely remove the item from the todo set */
+ i->todo_user = false;
+ hashmap_remove(todo_uids, UID_TO_PTR(i->uid));
}
errno = 0;
@@ -642,7 +649,6 @@ static int write_files(void) {
goto finish;
}
- lstchg = (long) (now(CLOCK_REALTIME) / USEC_PER_DAY);
HASHMAP_FOREACH(i, todo_uids, iterator) {
struct spwd n = {
.sp_namp = i->name,
@@ -879,7 +885,6 @@ static int add_user(Item *i) {
if (!arg_root) {
struct passwd *p;
- struct spwd *sp;
/* Also check NSS */
errno = 0;
@@ -895,16 +900,6 @@ static int add_user(Item *i) {
}
if (!IN_SET(errno, 0, ENOENT))
return log_error_errno(errno, "Failed to check if user %s already exists: %m", i->name);
-
- /* And shadow too, just to be sure */
- errno = 0;
- sp = getspnam(i->name);
- if (sp) {
- log_error("User %s already exists in shadow database, but not in user database.", i->name);
- return -EBADMSG;
- }
- if (!IN_SET(errno, 0, ENOENT))
- return log_error_errno(errno, "Failed to check if user %s already exists in shadow database: %m", i->name);
}
/* Try to use the suggested numeric uid */

View File

@ -0,0 +1,40 @@
From fa09f5c3ceef08947225a9c39edb09411f3929d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 7 Mar 2015 14:19:20 -0500
Subject: [PATCH] nspawn: fix use-after-free and leak in error paths
CID #1257765.
(cherry picked from commit 8a16a7b4e7f6702a7e6edaead80ecf04be7d3ba2)
---
src/nspawn/nspawn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 7724df96bd..78bd584834 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -3627,7 +3627,7 @@ int main(int argc, char *argv[]) {
}
if (arg_ephemeral) {
- char *np;
+ _cleanup_free_ char *np = NULL;
/* If the specified path is a mount point we
* generate the new snapshot immediately
@@ -3657,13 +3657,13 @@ int main(int argc, char *argv[]) {
r = btrfs_subvol_snapshot(arg_directory, np, arg_read_only, true);
if (r < 0) {
- free(np);
log_error_errno(r, "Failed to create snapshot %s from %s: %m", np, arg_directory);
goto finish;
}
free(arg_directory);
arg_directory = np;
+ np = NULL;
remove_subvol = true;

View File

@ -0,0 +1,25 @@
From c29a899e634e5b16c7afcce1ac7c28514988a9f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 7 Mar 2015 14:23:38 -0500
Subject: [PATCH] login: fix copy-pasto in error path
CID #1256583.
(cherry picked from commit dcee01125dde502bd8108c36ddf2026c1348865f)
---
src/login/inhibit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 44bda34aff..88af23e35c 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -260,7 +260,7 @@ int main(int argc, char *argv[]) {
fd = inhibit(bus, &error);
if (fd < 0) {
- log_error("Failed to inhibit: %s", bus_error_message(&error, -r));
+ log_error("Failed to inhibit: %s", bus_error_message(&error, fd));
return EXIT_FAILURE;
}

View File

@ -0,0 +1,63 @@
From e8d55cb62e0c12b09d3fa02f4fc1a1e0b197020b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 8 Mar 2015 11:04:59 -0400
Subject: [PATCH] journalctl: update hint now that we set ACL everywhere
(cherry picked from commit 05c1853093d8c4e4aa16876b5129b65dac5abd01)
---
src/journal/journalctl.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 55c7786331..12c869f5af 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1542,10 +1542,17 @@ static int access_check_var_log_journal(sd_journal *j) {
have_access = in_group("systemd-journal") > 0;
if (!have_access) {
+ const char* dir;
+
+ if (access("/run/log/journal", F_OK) >= 0)
+ dir = "/run/log/journal";
+ else
+ dir = "/var/log/journal";
+
/* Let's enumerate all groups from the default ACL of
* the directory, which generally should allow access
* to most journal files too */
- r = search_acl_groups(&g, "/var/log/journal/", &have_access);
+ r = search_acl_groups(&g, dir, &have_access);
if (r < 0)
return r;
}
@@ -1571,7 +1578,7 @@ static int access_check_var_log_journal(sd_journal *j) {
return log_oom();
log_notice("Hint: You are currently not seeing messages from other users and the system.\n"
- " Users in the groups '%s' can see all messages.\n"
+ " Users in groups '%s' can see all messages.\n"
" Pass -q to turn off this notice.", s);
}
}
@@ -1595,18 +1602,8 @@ static int access_check(sd_journal *j) {
if (set_contains(j->errors, INT_TO_PTR(-EACCES))) {
#ifdef HAVE_ACL
- /* If /var/log/journal doesn't even exist,
- * unprivileged users have no access at all */
- if (access("/var/log/journal", F_OK) < 0 &&
- geteuid() != 0 &&
- in_group("systemd-journal") <= 0) {
- log_error("Unprivileged users cannot access messages, unless persistent log storage is\n"
- "enabled. Users in the 'systemd-journal' group may always access messages.");
- return -EACCES;
- }
-
- /* If /var/log/journal exists, try to pring a nice
- notice if the user lacks access to it */
+ /* If /run/log/journal or /var/log/journal exist, try
+ to pring a nice notice if the user lacks access to it. */
if (!arg_quiet && geteuid() != 0) {
r = access_check_var_log_journal(j);
if (r < 0)

View File

@ -0,0 +1,26 @@
From 67c29191b0d4880decb771f2ed5cd155a4de09db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 8 Mar 2015 11:11:50 -0400
Subject: [PATCH] sd-journal: return error when we cannot open a file
Lack of this caused journalctl not to display a hint about missing groups
properly when the user lacks permissions.
(cherry picked from commit 7b300be75e6d5755778dd7da63e7147866f21351)
---
src/journal/sd-journal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 9b57e5945d..9b9e8ac859 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1248,7 +1248,7 @@ static int add_file(sd_journal *j, const char *prefix, const char *filename) {
r = add_any_file(j, path);
if (r == -ENOENT)
return 0;
- return 0;
+ return r;
}
static int remove_file(sd_journal *j, const char *prefix, const char *filename) {

View File

@ -0,0 +1,70 @@
From e1deb661ba31023c77aaac6656da514654df3393 Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Mon, 9 Mar 2015 12:27:25 +0100
Subject: [PATCH] missing.h: add NDA_*
This is necessary to build with older kernel headers. NDA_VLAN was
introduced in v3.9 and NDA_PORT, NDA_VNI and NDA_IFINDEX in v3.10
(cherry picked from commit cf1755bac0426132c21fdca519a336ce7d920277)
---
configure.ac | 4 +++-
src/shared/missing.h | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 6bc347423b..14a7736a9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -333,7 +333,8 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
IFLA_VXLAN_LOCAL6,
IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
IFLA_BRIDGE_VLAN_INFO,
- IFLA_BRPORT_UNICAST_FLOOD],
+ IFLA_BRPORT_UNICAST_FLOOD,
+ NDA_IFINDEX],
[], [], [[
#include <inttypes.h>
#include <netinet/in.h>
@@ -344,6 +345,7 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
#include <linux/if_tunnel.h>
#include <linux/if_link.h>
#include <linux/if_bridge.h>
+#include <linux/neighbour.h>
]])
# This makes sure pkg.m4 is available.
diff --git a/src/shared/missing.h b/src/shared/missing.h
index e72631e130..802b4957e0 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -35,6 +35,7 @@
#include <linux/loop.h>
#include <linux/audit.h>
#include <linux/capability.h>
+#include <linux/neighbour.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
@@ -623,6 +624,21 @@ static inline int setns(int fd, int nstype) {
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
#endif
+#if !HAVE_DECL_NDA_IFINDEX
+#define NDA_UNSPEC 0
+#define NDA_DST 1
+#define NDA_LLADDR 2
+#define NDA_CACHEINFO 3
+#define NDA_PROBES 4
+#define NDA_VLAN 5
+#define NDA_PORT 6
+#define NDA_VNI 7
+#define NDA_IFINDEX 8
+#define __NDA_MAX 9
+
+#define NDA_MAX (__NDA_MAX - 1)
+#endif
+
#ifndef IPV6_UNICAST_IF
#define IPV6_UNICAST_IF 76
#endif

View File

@ -0,0 +1,85 @@
From 0c9591e78e2dde262865e3c683d2fbd80692d4ff Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Mon, 9 Mar 2015 16:16:23 +0100
Subject: [PATCH] udevd: close race in udev settle
The udev-settle guarantees that udevd is no longer processing any of the
events casued by udev-trigger. The way this works is that it sends a
synchronous PING to udevd after udev-trigger has ran, and when that returns
it knows that udevd has started processing the events from udev-trigger.
udev-settle will then wait for the event queue to empty before returning.
However, there was a race here, as we would only update the /run state at
the beginning of the event loop, before reading out new events and before
processing the ping.
That means that if the first uevent arrived in the same event-loop iteration
as the PING, we would return the ping before updating the queue state in /run
(which would happen on the next iteration).
The race window here is tiny (as the /run state would probably get updated
before udev-settle got a chance to read /run), but still a possibility.
Fix the problem by updating the /run state as the last step before returning
the PING.
We must still update it at the beginning of the loop as well, otherwise we
risk being stuck in poll() with a stale state in /run.
Reported-by: Daniel Drake <drake@endlessm.com>
(cherry picked from commit db93e063bdffe0a8b95fcc522aeacddf62d1a9f9)
---
src/udev/udevd.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 99d4c8983a..e98c1fd6da 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -909,6 +909,17 @@ static void handle_signal(struct udev *udev, int signo) {
}
}
+static void event_queue_update(void) {
+ if (!udev_list_node_is_empty(&event_list)) {
+ int fd;
+
+ fd = open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444);
+ if (fd >= 0)
+ close(fd);
+ } else
+ unlink("/run/udev/queue");
+}
+
static int systemd_fds(struct udev *udev, int *rctrl, int *rnetlink) {
int ctrl = -1, netlink = -1;
int fd, n;
@@ -1369,15 +1380,7 @@ int main(int argc, char *argv[]) {
}
/* tell settle that we are busy or idle */
- if (!udev_list_node_is_empty(&event_list)) {
- int fd;
-
- fd = open("/run/udev/queue", O_WRONLY|O_CREAT|O_CLOEXEC|O_TRUNC|O_NOFOLLOW, 0444);
- if (fd >= 0)
- close(fd);
- } else {
- unlink("/run/udev/queue");
- }
+ event_queue_update();
fdcount = epoll_wait(fd_ep, ev, ELEMENTSOF(ev), timeout);
if (fdcount < 0)
@@ -1502,6 +1505,11 @@ int main(int argc, char *argv[]) {
if (is_inotify)
handle_inotify(udev);
+ /* tell settle that we are busy or idle, this needs to be before the
+ * PING handling
+ */
+ event_queue_update();
+
/*
* This needs to be after the inotify handling, to make sure,
* that the ping is send back after the possibly generated

View File

@ -0,0 +1,27 @@
From 5180cbe32605e4ae5d1b8870a845d6bde73af168 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 9 Mar 2015 18:01:47 +0100
Subject: [PATCH] man: document that ExecStartPre= is not the place to start
long-running processes
(cherry picked from commit b481de3b22fcd838a8f059aed8745375afdb9eca)
---
man/systemd.service.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index c03b4e8a54..f598705633 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -334,6 +334,11 @@
<para>If any of those commands (not prefixed with
<literal>-</literal>) fail, the rest are not executed and the
unit is considered failed.</para>
+
+ <para>Note that <varname>ExecStartPre=</varname> may not be
+ used to start long-running processes. All processes forked
+ off by processes invoked via <varname>ExecStartPre=</varname> will
+ be killed before the next service process is run.</para>
</listitem>
</varlistentry>

View File

@ -0,0 +1,31 @@
From c59d61522d87fdaca015f51466d7357288a95110 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 9 Mar 2015 17:46:30 -0400
Subject: [PATCH] journal: fix return code
Introduced in fa6ac76083b8ff.
Might be related to CID #1261724, but I don't know if coverity can
recurse this deep.
(cherry picked from commit 977eaa1eae53af7f418d87fcb42f4a4d34aad739)
---
src/journal/journal-file.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 24c49b916a..f500568fec 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2652,10 +2652,8 @@ int journal_file_open(
}
r = mmap_cache_get(f->mmap, f->fd, f->prot, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h);
- if (r < 0) {
- r = -errno;
+ if (r < 0)
goto fail;
- }
f->header = h;

View File

@ -0,0 +1,27 @@
From c04228cbd9373f2e5242e871ef1cb8878559f27e Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Tue, 16 Dec 2014 16:14:48 +0100
Subject: [PATCH] console: fix error-code inversion
The error-code propagated via sysview is always negative. Avoid
multiplying by -1 before returning it. Otherwise, we will return >0
instead of <0, which will not be detected as error by sysview-core.
(cherry picked from commit 84c3561c58dd992b339afe5bb4c41971a2ebc486)
---
src/console/consoled-manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/console/consoled-manager.c b/src/console/consoled-manager.c
index 9dd62f04a0..25de0a218f 100644
--- a/src/console/consoled-manager.c
+++ b/src/console/consoled-manager.c
@@ -228,7 +228,7 @@ static int manager_sysview_session_control(Manager *m, sysview_event *event) {
sysview_session_get_name(session));
session_free(s);
sysview_session_set_userdata(session, NULL);
- return -error;
+ return error;
}
return 0;

View File

@ -0,0 +1,72 @@
From c98114c5e5c5b9d1e8fea75a0bfb37f0d329fd36 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Wed, 11 Mar 2015 13:53:21 +0100
Subject: [PATCH] bus-proxy: complain only once about queue overflows
If the local peer does not dispatch its incoming queue, the bus-proxy will
slowly fill its outgoing queue. Once its full, it will continously
complain that it cannot forward its messages.
As it turns out, pulseaudio does have an idle background dbus connection
that is not integrated into any mainloop (and given that gdbus and
libdbus1 both support background shared connections, PA is probably not
the only example), therefore, the bus-proxy will loudly complain if it
cannot forward NameOwnerChanged events once the queue is full.
This commit makes the proxy track queue-state and complain only once the
queue runs full, not if it is already full.
A PA bug-report (and patch) has been filed, and other applications should
be fixed similarly. Hence, lets keep the error message, instead of
dropping it. It's unused resources we really want to get rid of, so
silencing the message does not really help (which is actually what
dbus-daemon does).
(cherry picked from commit ec2c7b56599981a7d9e76b15c75af3e1af3e6f81)
---
src/bus-proxyd/proxy.c | 16 ++++++++++++----
src/bus-proxyd/proxy.h | 1 +
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/bus-proxyd/proxy.c b/src/bus-proxyd/proxy.c
index 3dea908f5b..e13cf5e2ea 100644
--- a/src/bus-proxyd/proxy.c
+++ b/src/bus-proxyd/proxy.c
@@ -729,13 +729,21 @@ static int proxy_process_destination_to_local(Proxy *p) {
/* Return the error to the client, if we can */
synthetic_reply_method_errnof(m, r, "Failed to forward message we got from destination: %m");
- log_error_errno(r,
- "Failed to forward message we got from destination: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m",
- p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type),
- strna(m->destination), strna(m->path), strna(m->interface), strna(m->member));
+ if (r == -ENOBUFS) {
+ /* if local dbus1 peer does not dispatch its queue, warn only once */
+ if (!p->queue_overflow)
+ log_error("Dropped messages due to queue overflow of local peer (pid: "PID_FMT" uid: "UID_FMT")", p->local_creds.pid, p->local_creds.uid);
+ p->queue_overflow = true;
+ } else
+ log_error_errno(r,
+ "Failed to forward message we got from destination: uid=" UID_FMT " gid=" GID_FMT" message=%s destination=%s path=%s interface=%s member=%s: %m",
+ p->local_creds.uid, p->local_creds.gid, bus_message_type_to_string(m->header->type),
+ strna(m->destination), strna(m->path), strna(m->interface), strna(m->member));
+
return 1;
}
+ p->queue_overflow = false;
return 1;
}
diff --git a/src/bus-proxyd/proxy.h b/src/bus-proxyd/proxy.h
index 913d47071b..782c4e60b3 100644
--- a/src/bus-proxyd/proxy.h
+++ b/src/bus-proxyd/proxy.h
@@ -40,6 +40,7 @@ struct Proxy {
SharedPolicy *policy;
bool got_hello : 1;
+ bool queue_overflow : 1;
};
int proxy_new(Proxy **out, int in_fd, int out_fd, const char *dest);

View File

@ -0,0 +1,31 @@
From b964d7b5736871e9bc7e07df209006d5da86cbe6 Mon Sep 17 00:00:00 2001
From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
Date: Wed, 11 Mar 2015 11:24:18 +0100
Subject: [PATCH] cgtop: fix assert when not on tty
systemd-cgtop --dept=1 -b -n 10 -d 0.1 | cat
Assertion 'new_length >= 3' failed at src/shared/util.c:3 \
595, function ellipsize_mem(). Aborting.
Aborted (core dumped)
(David: add comment)
(cherry picked from commit 510c4a0f1e7e7efe2897d2fbb9067f121467b103)
---
src/cgtop/cgtop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 3c7ad40605..f951c37cbc 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -447,7 +447,7 @@ static int display(Hashmap *a) {
Group *g;
Group **array;
signed path_columns;
- unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 0;
+ unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 3; /* 3 for ellipsize() to work properly */
char buffer[MAX3(21, FORMAT_BYTES_MAX, FORMAT_TIMESPAN_MAX)];
assert(a);

View File

@ -0,0 +1,28 @@
From f6aeb4c2de958ed625edacb6b14a5e4cca6d726c Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Thu, 12 Mar 2015 12:46:46 +0100
Subject: [PATCH] man: split paragraph
Explicitly put the "multiple EnvironmentFile=" description into its own
paragraph to make it much easier to find.
(cherry picked from commit f407824d751a9cb31abfdf0343fe179e0efef259)
---
man/systemd.exec.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index 11b160e58f..fdb1578641 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -283,7 +283,9 @@
shortly before the process is executed (more specifically,
after all processes from a previous unit state terminated.
This means you can generate these files in one unit state, and
- read it with this option in the next). Settings from these
+ read it with this option in the next).</para>
+
+ <para>Settings from these
files override settings made with
<varname>Environment=</varname>. If the same variable is set
twice from these files, the files will be read in the order

3156
0079-hwdb-update.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
From cbc0484a42adf93bdd6897f93b15b0eaeb3077f6 Mon Sep 17 00:00:00 2001
From: Richard Maw <richard.maw@codethink.co.uk>
Date: Thu, 12 Mar 2015 18:14:58 +0000
Subject: [PATCH] networkd: Begin with serial number 1 for netlink requests
"Notifications are of informal nature and no reply is expected, therefore the
sequence number is typically set to 0."[1]
If networkd is started soon after recent netlink activity, then there
will be messages with sequence number 0 in the buffer.
The first thing networkd does is to request a dump of all the links. If
it uses sequence number 0 for this, then it may confuse the dump request's
response with that of a notification.
This will result in it failing to properly enumerate all the links,
but more importantly, when it comes to enumerate all the addresses, it
will still have the link dump in progress, so the address enumeration
will fail with -EBUSY.
[1]: http://www.infradead.org/~tgr/libnl/doc/core.html#core_msg_types
[tomegun: sequence -> serial]
(cherry picked from commit d422e52a3523ad0955bec4f9fbed46e234d28590)
---
src/libsystemd/sd-rtnl/sd-rtnl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index ae49c77e01..7cdcc5d96a 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -61,6 +61,11 @@ static int sd_rtnl_new(sd_rtnl **ret) {
sizeof(struct nlmsghdr), sizeof(uint8_t)))
return -ENOMEM;
+ /* Change notification responses have sequence 0, so we must
+ * start our request sequence numbers at 1, or we may confuse our
+ * responses with notifications from the kernel */
+ rtnl->serial = 1;
+
*ret = rtnl;
rtnl = NULL;

View File

@ -0,0 +1,179 @@
From 62ae285fd7265de8ef410b876a8aec047a93ea37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 12 Mar 2015 21:29:28 -0400
Subject: [PATCH] journal-remote: downgrade routine messages to debug
https://bugs.freedesktop.org/show_bug.cgi?id=89486
(cherry picked from commit 0e72da6fe8671d49b4d458519f5ac7600fd04f03)
---
src/journal-remote/journal-remote-parse.c | 2 +-
src/journal-remote/journal-remote-write.c | 2 +-
src/journal-remote/journal-remote.c | 36 +++++++++++++++----------------
src/journal-remote/microhttpd-util.c | 4 ++--
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
index afded7e380..6c096de03a 100644
--- a/src/journal-remote/journal-remote-parse.c
+++ b/src/journal-remote/journal-remote-parse.c
@@ -443,7 +443,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) {
return r;
/* We have a full event */
- log_trace("Received a full event from source@%p fd:%d (%s)",
+ log_trace("Received full event from source@%p fd:%d (%s)",
source, source->fd, source->name);
if (!source->iovw.count) {
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c
index df30049397..99820fa7b8 100644
--- a/src/journal-remote/journal-remote-write.c
+++ b/src/journal-remote/journal-remote-write.c
@@ -156,7 +156,7 @@ int writer_write(Writer *w,
if (r < 0)
return r;
else
- log_info("%s: Successfully rotated journal", w->journal->path);
+ log_debug("%s: Successfully rotated journal", w->journal->path);
log_debug("Retrying write.");
r = journal_file_append_entry(w->journal, ts, iovw->iovec, iovw->count,
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 8f32a9a988..d1486e7cda 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -207,7 +207,7 @@ static int open_output(Writer *w, const char* host) {
log_error_errno(r, "Failed to open output journal %s: %m",
output);
else
- log_info("Opened output file %s", w->journal->path);
+ log_debug("Opened output file %s", w->journal->path);
return r;
}
@@ -747,7 +747,7 @@ static int setup_microhttpd_socket(RemoteServer *s,
const char *trust) {
int fd;
- fd = make_socket_fd(LOG_INFO, address, SOCK_STREAM | SOCK_CLOEXEC);
+ fd = make_socket_fd(LOG_DEBUG, address, SOCK_STREAM | SOCK_CLOEXEC);
if (fd < 0)
return fd;
@@ -844,7 +844,7 @@ static int remoteserver_init(RemoteServer *s,
if (n < 0)
return log_error_errno(n, "Failed to read listening file descriptors from environment: %m");
else
- log_info("Received %d descriptors", n);
+ log_debug("Received %d descriptors", n);
if (MAX(http_socket, https_socket) >= SD_LISTEN_FDS_START + n) {
log_error("Received fewer sockets than expected");
@@ -853,7 +853,7 @@ static int remoteserver_init(RemoteServer *s,
for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) {
if (sd_is_socket(fd, AF_UNSPEC, 0, true)) {
- log_info("Received a listening socket (fd:%d)", fd);
+ log_debug("Received a listening socket (fd:%d)", fd);
if (fd == http_socket)
r = setup_microhttpd_server(s, fd, NULL, NULL, NULL);
@@ -868,7 +868,7 @@ static int remoteserver_init(RemoteServer *s,
if (r < 0)
return log_error_errno(r, "Failed to retrieve remote name: %m");
- log_info("Received a connection socket (fd:%d) from %s", fd, hostname);
+ log_debug("Received a connection socket (fd:%d) from %s", fd, hostname);
r = add_source(s, fd, hostname, true);
} else {
@@ -908,7 +908,7 @@ static int remoteserver_init(RemoteServer *s,
}
if (arg_listen_raw) {
- log_info("Listening on a socket...");
+ log_debug("Listening on a socket...");
r = setup_raw_socket(s, arg_listen_raw);
if (r < 0)
return r;
@@ -930,12 +930,12 @@ static int remoteserver_init(RemoteServer *s,
const char *output_name;
if (streq(*file, "-")) {
- log_info("Using standard input as source.");
+ log_debug("Using standard input as source.");
fd = STDIN_FILENO;
output_name = "stdin";
} else {
- log_info("Reading file %s...", *file);
+ log_debug("Reading file %s...", *file);
fd = open(*file, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
if (fd < 0)
@@ -1014,22 +1014,22 @@ static int dispatch_raw_source_event(sd_event_source *event,
if (source->state == STATE_EOF) {
size_t remaining;
- log_info("EOF reached with source fd:%d (%s)",
- source->fd, source->name);
+ log_debug("EOF reached with source fd:%d (%s)",
+ source->fd, source->name);
remaining = source_non_empty(source);
if (remaining > 0)
- log_warning("Premature EOF. %zu bytes lost.", remaining);
+ log_notice("Premature EOF. %zu bytes lost.", remaining);
remove_source(s, source->fd);
- log_info("%zu active sources remaining", s->active);
+ log_debug("%zu active sources remaining", s->active);
return 0;
} else if (r == -E2BIG) {
- log_error("Entry too big, skipped");
+ log_notice_errno(E2BIG, "Entry too big, skipped");
return 1;
} else if (r == -EAGAIN) {
return 0;
} else if (r < 0) {
- log_info_errno(r, "Closing connection: %m");
+ log_debug_errno(r, "Closing connection: %m");
remove_source(server, fd);
return 0;
} else
@@ -1071,10 +1071,10 @@ static int accept_connection(const char* type, int fd,
return r;
}
- log_info("Accepted %s %s connection from %s",
- type,
- socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
- a);
+ log_debug("Accepted %s %s connection from %s",
+ type,
+ socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
+ a);
*hostname = b;
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
index a95fff18f3..b45c38d682 100644
--- a/src/journal-remote/microhttpd-util.c
+++ b/src/journal-remote/microhttpd-util.c
@@ -178,7 +178,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
if (r < 0)
return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
- log_info("Certificate status: %s", out.data);
+ log_debug("Certificate status: %s", out.data);
gnutls_free(out.data);
return status == 0 ? 0 : -EPERM;
@@ -280,7 +280,7 @@ int check_permissions(struct MHD_Connection *connection, int *code, char **hostn
return -EPERM;
}
- log_info("Connection from %s", buf);
+ log_debug("Connection from %s", buf);
if (hostname) {
*hostname = buf;

View File

@ -0,0 +1,156 @@
From 706ce3faab879d4cb20906ad6d27e962ab3e4ad0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 13 Mar 2015 00:02:28 -0400
Subject: [PATCH] journal-remote: process events without delay
journal-remote buffers input, and then parses it handling one journal entry at a time.
It was possible for useful data to be left in the buffer after some entries were
processesed. But all data would be already read from the fd, so there would be
no reason for the event loop to call the handler again. After some new data came in,
the handler would be called again, and would then process the "old" data in the buffer.
Fix this by enabling a handler wherever we process input data and do not exhaust data
from the input buffer (i.e. when EAGAIN was not encountered). The handler runs until
we encounter EAGAIN.
Looping over the input data is done in this roundabout way to allow the event loop
to dispatch other events in the meanwhile. If the loop was inside the handler, a
source which produced data fast enough could completely monopolize the process.
https://bugs.freedesktop.org/show_bug.cgi?id=89516
(cherry picked from commit 043945b93824e33e040954612aaa934cd1a43a1b)
---
src/journal-remote/journal-remote-parse.c | 1 +
src/journal-remote/journal-remote-parse.h | 1 +
src/journal-remote/journal-remote.c | 65 +++++++++++++++++++++++++++----
3 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
index 6c096de03a..7e62954351 100644
--- a/src/journal-remote/journal-remote-parse.c
+++ b/src/journal-remote/journal-remote-parse.c
@@ -41,6 +41,7 @@ void source_free(RemoteSource *source) {
writer_unref(source->writer);
sd_event_source_unref(source->event);
+ sd_event_source_unref(source->buffer_event);
free(source);
}
diff --git a/src/journal-remote/journal-remote-parse.h b/src/journal-remote/journal-remote-parse.h
index 22db550913..06a50296a1 100644
--- a/src/journal-remote/journal-remote-parse.h
+++ b/src/journal-remote/journal-remote-parse.h
@@ -54,6 +54,7 @@ typedef struct RemoteSource {
Writer *writer;
sd_event_source *event;
+ sd_event_source *buffer_event;
} RemoteSource;
RemoteSource* source_new(int fd, bool passive_fd, char *name, Writer *writer);
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index d1486e7cda..b7cc6d7172 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -289,6 +289,8 @@ static int dispatch_raw_source_event(sd_event_source *event,
int fd,
uint32_t revents,
void *userdata);
+static int dispatch_raw_source_until_block(sd_event_source *event,
+ void *userdata);
static int dispatch_blocking_source_event(sd_event_source *event,
void *userdata);
static int dispatch_raw_connection_event(sd_event_source *event,
@@ -376,8 +378,15 @@ static int add_source(RemoteServer *s, int fd, char* name, bool own_name) {
r = sd_event_add_io(s->events, &source->event,
fd, EPOLLIN|EPOLLRDHUP|EPOLLPRI,
- dispatch_raw_source_event, s);
- if (r == -EPERM) {
+ dispatch_raw_source_event, source);
+ if (r == 0) {
+ /* Add additional source for buffer processing. It will be
+ * enabled later. */
+ r = sd_event_add_defer(s->events, &source->buffer_event,
+ dispatch_raw_source_until_block, source);
+ if (r == 0)
+ sd_event_source_set_enabled(source->buffer_event, SD_EVENT_OFF);
+ } else if (r == -EPERM) {
log_debug("Falling back to sd_event_add_defer for fd:%d (%s)", fd, name);
r = sd_event_add_defer(s->events, &source->event,
dispatch_blocking_source_event, source);
@@ -997,15 +1006,18 @@ static void server_destroy(RemoteServer *s) {
**********************************************************************
**********************************************************************/
-static int dispatch_raw_source_event(sd_event_source *event,
- int fd,
- uint32_t revents,
- void *userdata) {
+static int handle_raw_source(sd_event_source *event,
+ int fd,
+ uint32_t revents,
+ RemoteServer *s) {
- RemoteServer *s = userdata;
RemoteSource *source;
int r;
+ /* Returns 1 if there might be more data pending,
+ * 0 if data is currently exhausted, negative on error.
+ */
+
assert(fd >= 0 && fd < (ssize_t) s->sources_size);
source = s->sources[fd];
assert(source->fd == fd);
@@ -1036,11 +1048,48 @@ static int dispatch_raw_source_event(sd_event_source *event,
return 1;
}
+static int dispatch_raw_source_until_block(sd_event_source *event,
+ void *userdata) {
+ RemoteSource *source = userdata;
+ int r;
+
+ /* Make sure event stays around even if source is destroyed */
+ sd_event_source_ref(event);
+
+ r = handle_raw_source(event, source->fd, EPOLLIN, server);
+ if (r != 1)
+ /* No more data for now */
+ sd_event_source_set_enabled(event, SD_EVENT_OFF);
+
+ sd_event_source_unref(event);
+
+ return r;
+}
+
+static int dispatch_raw_source_event(sd_event_source *event,
+ int fd,
+ uint32_t revents,
+ void *userdata) {
+ RemoteSource *source = userdata;
+ int r;
+
+ assert(source->event);
+ assert(source->buffer_event);
+
+ r = handle_raw_source(event, fd, EPOLLIN, server);
+ if (r == 1)
+ /* Might have more data. We need to rerun the handler
+ * until we are sure the buffer is exhausted. */
+ sd_event_source_set_enabled(source->buffer_event, SD_EVENT_ON);
+
+ return r;
+}
+
static int dispatch_blocking_source_event(sd_event_source *event,
void *userdata) {
RemoteSource *source = userdata;
- return dispatch_raw_source_event(event, source->fd, EPOLLIN, server);
+ return handle_raw_source(event, source->fd, EPOLLIN, server);
}
static int accept_connection(const char* type, int fd,

View File

@ -0,0 +1,26 @@
From 1d6c7cfcd4e9f4117264e1611ce881a871b92a56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 13 Mar 2015 00:25:31 -0400
Subject: [PATCH] man: update example 2 in systemd.network(5)
none/both/v4/v6 are deprecated in favour of no/yes/ipv4/ipv6.
https://bugs.freedesktop.org/show_bug.cgi?id=89221
(cherry picked from commit 9c8ca3f7a69f82ca181b3cd2d5e1d3e621938abb)
---
man/systemd.network.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 485876b6ac..24f8416ef9 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -643,7 +643,7 @@ Gateway=192.168.0.1</programlisting>
Name=en*
[Network]
-DHCP=both</programlisting>
+DHCP=yes</programlisting>
</example>
<example>

View File

@ -0,0 +1,24 @@
From 4bbc153799e5b29d19c1ec699abfa3d562d8be46 Mon Sep 17 00:00:00 2001
From: Mathieu Chevrier <chevrier.mathieu@gmail.com>
Date: Fri, 13 Mar 2015 00:33:44 -0400
Subject: [PATCH] gpt-auto-generator: fix detection of /srv
https://bugs.freedesktop.org/show_bug.cgi?id=89226
(cherry picked from commit d736e4f3e76daca4ab1b1fc444737e5ee20a27cd)
---
src/gpt-auto-generator/gpt-auto-generator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 5c58b58f8a..869a230f17 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -548,7 +548,7 @@ static int enumerate_partitions(dev_t devnum) {
srv_rw = !(flags & GPT_FLAG_READ_ONLY),
free(srv);
- srv = strdup(node);
+ srv = strdup(subnode);
if (!srv)
return log_oom();
}

View File

@ -0,0 +1,28 @@
From 12e474fdf33ffc500aacad39fe19aa57b344f9cb Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Fri, 13 Mar 2015 15:49:07 +0100
Subject: [PATCH] sd-rtnl: never set serial to 0
In the unlikely event that we wrap the counter, skip 0 as this is used
for broadcasts.
Suggested by Richard Maw.
(cherry picked from commit 913b0eef1a01e0c78f0453b0174e75d5caae1023)
---
src/libsystemd/sd-rtnl/sd-rtnl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index 7cdcc5d96a..5df39e1177 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -262,7 +262,7 @@ static void rtnl_seal_message(sd_rtnl *rtnl, sd_rtnl_message *m) {
assert(m);
assert(m->hdr);
- m->hdr->nlmsg_seq = rtnl->serial++;
+ m->hdr->nlmsg_seq = rtnl->serial++ ? : rtnl->serial++;
rtnl_message_seal(m);

View File

@ -0,0 +1,45 @@
From 1261a8df61818d48c6bc9445a16b40e24ffaa74e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 13 Mar 2015 21:10:13 -0500
Subject: [PATCH] gpt-auto-generator: allow type check to fail
add_mount() is OK with unknow file type, but we have to initalize
the variable to NULL not to pass garbage on error.
(cherry picked from commit a0b1209c4a59754f428894e0485413542da50014)
---
src/gpt-auto-generator/gpt-auto-generator.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 869a230f17..e0a5bb305b 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -290,7 +290,7 @@ static int probe_and_add_mount(
const char *post) {
_cleanup_blkid_free_probe_ blkid_probe b = NULL;
- const char *fstype;
+ const char *fstype = NULL;
int r;
assert(id);
@@ -323,14 +323,11 @@ static int probe_and_add_mount(
r = blkid_do_safeprobe(b);
if (r == -2 || r == 1) /* no result or uncertain */
return 0;
- else if (r != 0) {
- if (errno == 0)
- errno = EIO;
- log_error_errno(errno, "Failed to probe %s: %m", what);
- return -errno;
- }
+ else if (r != 0)
+ return log_error_errno(errno ?: EIO, "Failed to probe %s: %m", what);
- blkid_probe_lookup_value(b, "TYPE", &fstype, NULL);
+ /* add_mount is OK with fstype being NULL. */
+ (void) blkid_probe_lookup_value(b, "TYPE", &fstype, NULL);
return add_mount(
id,

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,90 @@
From 0cdbfc2734a4e1b3b926be66c31a37e50c9d1733 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 13 Mar 2015 21:24:30 -0500
Subject: [PATCH] man: link to fd.o for dbus stuff
(cherry picked from commit 3b5cfcdb580f5b766ff7fb1a2839bd37d74a98de)
---
man/busctl.xml | 2 +-
man/custom-html.xsl | 13 +++++++++++++
man/systemd-bus-proxyd.xml | 2 +-
man/systemd-bus-proxyd@.service.xml | 2 +-
man/systemd-machine-id-setup.xml | 2 +-
5 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/man/busctl.xml b/man/busctl.xml
index cc1844b0a0..807fc78e8f 100644
--- a/man/busctl.xml
+++ b/man/busctl.xml
@@ -465,7 +465,7 @@ o "/org/freedesktop/systemd1/job/42684"</programlisting>
<title>See Also</title>
<para>
- <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry project='dbus'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<ulink url="http://freedesktop.org/wiki/Software/dbus">D-Bus</ulink>,
<ulink url="https://code.google.com/p/d-bus/">kdbus</ulink>,
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
diff --git a/man/custom-html.xsl b/man/custom-html.xsl
index 32299db710..706b95a1c4 100644
--- a/man/custom-html.xsl
+++ b/man/custom-html.xsl
@@ -91,6 +91,19 @@
<xsl:call-template name="inline.charseq"/>
</xsl:template>
+<xsl:template match="citerefentry[@project='dbus']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://dbus.freedesktop.org/doc/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
<xsl:template match="refsect1/title|refsect1/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<h2>
diff --git a/man/systemd-bus-proxyd.xml b/man/systemd-bus-proxyd.xml
index 2c7764047b..e0efe99854 100644
--- a/man/systemd-bus-proxyd.xml
+++ b/man/systemd-bus-proxyd.xml
@@ -101,7 +101,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<title>See Also</title>
<para>
- <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry project='dbus'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<ulink url="http://freedesktop.org/wiki/Software/dbus">D-Bus</ulink>,
<ulink url="https://code.google.com/p/d-bus/">kdbus</ulink>
</para>
diff --git a/man/systemd-bus-proxyd@.service.xml b/man/systemd-bus-proxyd@.service.xml
index 141b43f6d9..dc4f07ff1b 100644
--- a/man/systemd-bus-proxyd@.service.xml
+++ b/man/systemd-bus-proxyd@.service.xml
@@ -73,7 +73,7 @@
<para>
<citerefentry><refentrytitle>systemd-bus-proxyd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry project='dbus'><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<ulink url="http://freedesktop.org/wiki/Software/dbus">D-Bus</ulink>,
<ulink url="https://code.google.com/p/d-bus/">kdbus</ulink>
</para>
diff --git a/man/systemd-machine-id-setup.xml b/man/systemd-machine-id-setup.xml
index 22bad3e5f4..182717f524 100644
--- a/man/systemd-machine-id-setup.xml
+++ b/man/systemd-machine-id-setup.xml
@@ -122,7 +122,7 @@
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>dbus-uuidgen</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry project='dbus'><refentrytitle>dbus-uuidgen</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>

View File

@ -0,0 +1,23 @@
From 01c9c40501ba72a595160137ab31a80bd42f62c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 13 Mar 2015 21:25:37 -0500
Subject: [PATCH] man: fix name of systemd.resource-control(5)
(cherry picked from commit ee41f6028189819c728316e917ca09b9eb0a7850)
---
man/systemctl.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/systemctl.xml b/man/systemctl.xml
index b5e4cdf862..50e6bc93f2 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -1721,7 +1721,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.resource-management</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
<citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,

View File

@ -0,0 +1,37 @@
From 19e98bf405a8105db71a4e3247b0397509825a6e Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Fri, 13 Mar 2015 17:24:46 -0400
Subject: [PATCH] selinux: fix SEGV during switch-root if SELinux policy loaded
If you've got SELinux policy loaded, label_hnd is your labeling handle.
When systemd is shutting down, we free that handle via mac_selinux_finish().
But: switch_root() calls mkdir_p_label(), which tries to look up a label
using that freed handle, and so we get a bunch of garbage and eventually
SEGV in libselinux.
(This doesn't happen in the switch-root from initramfs to real root because
there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we
never attempt any lookups.)
So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so
nobody tries to use it after it becomes invalid.
https://bugzilla.redhat.com/show_bug.cgi?id=1185604
(cherry picked from commit f5ce2b49585a14cefb6d02f61c8dcdf7628a8605)
---
src/shared/selinux-util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c
index a2233e0cfb..a46ddf8498 100644
--- a/src/shared/selinux-util.c
+++ b/src/shared/selinux-util.c
@@ -117,6 +117,7 @@ void mac_selinux_finish(void) {
return;
selabel_close(label_hnd);
+ label_hnd = NULL;
#endif
}

View File

@ -0,0 +1,35 @@
From 4acdc3835b2c9d395f1df95bb1dd5620a4a0e7e5 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Sat, 14 Mar 2015 16:48:54 +0100
Subject: [PATCH] service: don't add After= dependencies on .busname units if
kdbus support is disabled
(cherry picked from commit 6962fd3bd28cb5d3aaff69c1e3b6cc006e7c8426)
---
src/core/service.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/core/service.c b/src/core/service.c
index 7781b4e626..ae5e610008 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -556,14 +556,16 @@ static int service_add_extras(Service *s) {
s->notify_access = NOTIFY_MAIN;
if (s->bus_name) {
+#ifdef ENABLE_KDBUS
const char *n;
- r = unit_watch_bus_name(UNIT(s), s->bus_name);
+ n = strjoina(s->bus_name, ".busname");
+ r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
if (r < 0)
return r;
+#endif
- n = strjoina(s->bus_name, ".busname");
- r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
+ r = unit_watch_bus_name(UNIT(s), s->bus_name);
if (r < 0)
return r;
}

View File

@ -0,0 +1,38 @@
From 317e24365d3d88b7a5282577a35bc8f259737f93 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Wed, 11 Mar 2015 22:23:38 +0100
Subject: [PATCH] libudev: monitor - fix error path in send_device
Return -errno rather than -1 in case sendmsg() fails.
(cherry picked from commit a4445e88cece0444c66d70876b03065158dd4685)
---
src/libudev/libudev-monitor.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 3f1fee7f7e..d0486e3d1e 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -749,12 +749,20 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor,
* If we send to a multicast group, we will get
* ECONNREFUSED, which is expected.
*/
- if (destination != NULL)
+ if (destination)
smsg.msg_name = &destination->snl;
else
smsg.msg_name = &udev_monitor->snl_destination;
smsg.msg_namelen = sizeof(struct sockaddr_nl);
count = sendmsg(udev_monitor->sock, &smsg, 0);
+ if (count < 0) {
+ if (!destination && errno == ECONNREFUSED) {
+ log_debug("passed unknown number of bytes to netlink monitor %p", udev_monitor);
+ return 0;
+ } else
+ return -errno;
+ }
+
log_debug("passed %zi bytes to netlink monitor %p", count, udev_monitor);
return count;
}

View File

@ -0,0 +1,23 @@
From 84d7bc201f8875bed45c9516fcec62d5f82d3718 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 17:41:53 -0400
Subject: [PATCH] core: remove left-over debug message
(cherry picked from commit bdb26d423a7f992bec5c28e17894c684d770d6f3)
---
src/core/load-fragment.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 90bf5634c8..f17a82fcdf 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -634,8 +634,6 @@ int config_parse_exec(const char *unit,
n[k] = NULL;
- log_debug("path: %s", path ?: n[0]);
-
if (!n[0])
reason = "Empty executable name or zeroeth argument";
else if (!string_is_safe(path ?: n[0]))

View File

@ -0,0 +1,23 @@
From b238b0eaf71449e128480bb5a5875a4b51cafd6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 17:56:13 -0400
Subject: [PATCH] units: there is no systemd-udev-hwdb-update.service
(cherry picked from commit d99ce93383028f08470b6d334bc1a31ca8d16b22)
---
units/systemd-udevd.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
index f6acd6fe4c..2791f73ac3 100644
--- a/units/systemd-udevd.service.in
+++ b/units/systemd-udevd.service.in
@@ -10,7 +10,7 @@ Description=udev Kernel Device Manager
Documentation=man:systemd-udevd.service(8) man:udev(7)
DefaultDependencies=no
Wants=systemd-udevd-control.socket systemd-udevd-kernel.socket
-After=systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udev-hwdb-update.service systemd-sysusers.service
+After=systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-hwdb-update.service systemd-sysusers.service
Before=sysinit.target
ConditionPathIsReadWrite=/sys

View File

@ -0,0 +1,29 @@
From 5112d77f6a279cfa1cf4c1f3eac896f475650952 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 20:14:39 -0400
Subject: [PATCH] util: remove redundant debug message
mar 14 20:05:34 fedora22 systemd[4058]: /usr/lib/systemd/system-generators/kdump-dep-generator.sh will be executed.
mar 14 20:05:34 fedora22 systemd[4058]: Spawned /usr/lib/systemd/system-generators/kdump-dep-generator.sh as 4059.
The second line already says everything.
(cherry picked from commit 7034e9db51d0b6f8e1dbbe9127393c6fbc06fe28)
---
src/shared/util.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 85487230a2..1e1bf944f2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4115,8 +4115,7 @@ static int do_execute(char **directories, usec_t timeout, char *argv[]) {
if (null_or_empty_path(path)) {
log_debug("%s is empty (a mask).", path);
continue;
- } else
- log_debug("%s will be executed.", path);
+ }
pid = fork();
if (pid < 0) {

View File

@ -0,0 +1,26 @@
From a6a1e98b4e16777989ada937402f0b5373dad4a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 20:24:47 -0400
Subject: [PATCH] tmpfiles: remove redundant debug message
Mar 13 19:48:30 adam.happyassassin.net systemd-tmpfiles[970]: "/var/lib/machines" has right mode 40700
Mar 13 19:48:30 adam.happyassassin.net systemd-tmpfiles[970]: /var/lib/machines created successfully.
(cherry picked from commit 51bfdaf66c381793d2f39ad891f3411a55927da6)
---
src/tmpfiles/tmpfiles.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 1e10968164..73a9c9d5b6 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -1209,8 +1209,6 @@ static int create_item(Item *i) {
break;
}
- log_debug("%s created successfully.", i->path);
-
return 0;
}

View File

@ -0,0 +1,275 @@
From 68f8c0b9eeeead72fbdf90b32e5cf01862d9c351 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 21:46:59 -0400
Subject: [PATCH] sysv-generator: initialize LookupPaths just once
With debugging on, sysv-generator would print the full set of
lookup paths for *every* sysv script.
While at it, pass LookupPaths as a pointer in sysv-generator,
and constify it everywhere.
(cherry picked from commit a8ffe6fbcbfdba39aef8dce8b298b3e0cb377c0e)
---
src/shared/install.c | 55 ++++++++++++++++++++++---------------
src/shared/install.h | 11 +++++++-
src/shared/path-lookup.c | 1 +
src/shared/path-lookup.h | 3 +-
src/sysv-generator/sysv-generator.c | 14 +++++-----
5 files changed, 53 insertions(+), 31 deletions(-)
diff --git a/src/shared/install.c b/src/shared/install.c
index 65f1c245c6..92b8d6e8ef 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1084,7 +1084,7 @@ static int unit_file_load(
static int unit_file_search(
InstallContext *c,
InstallInfo *info,
- LookupPaths *paths,
+ const LookupPaths *paths,
const char *root_dir,
bool allow_symlink,
bool load,
@@ -1153,7 +1153,7 @@ static int unit_file_search(
}
static int unit_file_can_install(
- LookupPaths *paths,
+ const LookupPaths *paths,
const char *root_dir,
const char *name,
bool allow_symlink,
@@ -1317,7 +1317,7 @@ static int install_info_symlink_wants(
static int install_info_symlink_link(
InstallInfo *i,
- LookupPaths *paths,
+ const LookupPaths *paths,
const char *config_path,
const char *root_dir,
bool force,
@@ -1345,7 +1345,7 @@ static int install_info_symlink_link(
static int install_info_apply(
InstallInfo *i,
- LookupPaths *paths,
+ const LookupPaths *paths,
const char *config_path,
const char *root_dir,
bool force,
@@ -1377,7 +1377,7 @@ static int install_info_apply(
static int install_context_apply(
InstallContext *c,
- LookupPaths *paths,
+ const LookupPaths *paths,
const char *config_path,
const char *root_dir,
bool force,
@@ -1424,7 +1424,7 @@ static int install_context_apply(
static int install_context_mark_for_removal(
InstallContext *c,
- LookupPaths *paths,
+ const LookupPaths *paths,
Set **remove_symlinks_to,
const char *config_path,
const char *root_dir) {
@@ -1785,39 +1785,28 @@ int unit_file_get_default(
return -ENOENT;
}
-UnitFileState unit_file_get_state(
+UnitFileState unit_file_lookup_state(
UnitFileScope scope,
const char *root_dir,
+ const LookupPaths *paths,
const char *name) {
- _cleanup_lookup_paths_free_ LookupPaths paths = {};
UnitFileState state = _UNIT_FILE_STATE_INVALID;
char **i;
_cleanup_free_ char *path = NULL;
int r;
- assert(scope >= 0);
- assert(scope < _UNIT_FILE_SCOPE_MAX);
- assert(name);
-
- if (root_dir && scope != UNIT_FILE_SYSTEM)
- return -EINVAL;
+ assert(paths);
if (!unit_name_is_valid(name, TEMPLATE_VALID))
return -EINVAL;
- r = lookup_paths_init_from_scope(&paths, scope, root_dir);
- if (r < 0)
- return r;
-
- STRV_FOREACH(i, paths.unit_path) {
+ STRV_FOREACH(i, paths->unit_path) {
struct stat st;
char *partial;
bool also = false;
free(path);
- path = NULL;
-
path = path_join(root_dir, *i, name);
if (!path)
return -ENOMEM;
@@ -1858,7 +1847,7 @@ UnitFileState unit_file_get_state(
else if (r > 0)
return state;
- r = unit_file_can_install(&paths, root_dir, partial, true, &also);
+ r = unit_file_can_install(paths, root_dir, partial, true, &also);
if (r < 0 && errno != ENOENT)
return r;
else if (r > 0)
@@ -1873,6 +1862,28 @@ UnitFileState unit_file_get_state(
return r < 0 ? r : state;
}
+UnitFileState unit_file_get_state(
+ UnitFileScope scope,
+ const char *root_dir,
+ const char *name) {
+
+ _cleanup_lookup_paths_free_ LookupPaths paths = {};
+ int r;
+
+ assert(scope >= 0);
+ assert(scope < _UNIT_FILE_SCOPE_MAX);
+ assert(name);
+
+ if (root_dir && scope != UNIT_FILE_SYSTEM)
+ return -EINVAL;
+
+ r = lookup_paths_init_from_scope(&paths, scope, root_dir);
+ if (r < 0)
+ return r;
+
+ return unit_file_lookup_state(scope, root_dir, &paths, name);
+}
+
int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name) {
_cleanup_strv_free_ char **files = NULL;
char **p;
diff --git a/src/shared/install.h b/src/shared/install.h
index 357be0f92d..3ca39397e6 100644
--- a/src/shared/install.h
+++ b/src/shared/install.h
@@ -23,6 +23,7 @@
#include "hashmap.h"
#include "unit-name.h"
+#include "path-lookup.h"
typedef enum UnitFileScope {
UNIT_FILE_SYSTEM,
@@ -98,7 +99,15 @@ int unit_file_set_default(UnitFileScope scope, const char *root_dir, const char
int unit_file_get_default(UnitFileScope scope, const char *root_dir, char **name);
int unit_file_add_dependency(UnitFileScope scope, bool runtime, const char *root_dir, char **files, char *target, UnitDependency dep, bool force, UnitFileChange **changes, unsigned *n_changes);
-UnitFileState unit_file_get_state(UnitFileScope scope, const char *root_dir, const char *filename);
+UnitFileState unit_file_lookup_state(
+ UnitFileScope scope,
+ const char *root_dir,
+ const LookupPaths *paths,
+ const char *name);
+UnitFileState unit_file_get_state(
+ UnitFileScope scope,
+ const char *root_dir,
+ const char *filename);
int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap *h);
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 291a2f4054..812730be1c 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -31,6 +31,7 @@
#include "strv.h"
#include "path-util.h"
#include "path-lookup.h"
+#include "install.h"
int user_config_home(char **config_home) {
const char *e;
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index 2ec888da81..f1925eef69 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -22,7 +22,8 @@
***/
#include "macro.h"
-#include "install.h"
+
+typedef enum UnitFileScope UnitFileScope;
typedef struct LookupPaths {
char **unit_path;
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 6e39b449eb..0125ca27d9 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -723,10 +723,10 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
return 0;
}
-static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
char **path;
- STRV_FOREACH(path, lp.sysvinit_path) {
+ STRV_FOREACH(path, lp->sysvinit_path) {
_cleanup_closedir_ DIR *d = NULL;
struct dirent *de;
@@ -768,7 +768,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
if (!fpath)
return log_oom();
- if (unit_file_get_state(UNIT_FILE_SYSTEM, NULL, name) >= 0) {
+ if (unit_file_lookup_state(UNIT_FILE_SYSTEM, NULL, lp, name) >= 0) {
log_debug("Native unit for %s already exists, skipping", name);
continue;
}
@@ -793,7 +793,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
return 0;
}
-static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_services) {
char **p;
unsigned i;
_cleanup_closedir_ DIR *d = NULL;
@@ -804,7 +804,7 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
_cleanup_set_free_ Set *shutdown_services = NULL;
int r = 0;
- STRV_FOREACH(p, lp.sysvrcnd_path)
+ STRV_FOREACH(p, lp->sysvrcnd_path)
for (i = 0; i < ELEMENTSOF(rcnd_table); i ++) {
struct dirent *de;
@@ -954,13 +954,13 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
- r = enumerate_sysv(lp, all_services);
+ r = enumerate_sysv(&lp, all_services);
if (r < 0) {
log_error("Failed to generate units for all init scripts.");
return EXIT_FAILURE;
}
- r = set_dependencies_from_rcnd(lp, all_services);
+ r = set_dependencies_from_rcnd(&lp, all_services);
if (r < 0) {
log_error("Failed to read runlevels from rcnd links.");
return EXIT_FAILURE;

View File

@ -0,0 +1,31 @@
From 1708f0d4156c6579691728bebe429ece10f5a2be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 21:49:10 -0400
Subject: [PATCH] core: do not use quotes around virt and arch
Quotes are useful when the string can contain spaces or be otherwise
confusing. Not possible with those two.
(cherry picked from commit d3f86679783aee216d60b125acfb5f39a0df555f)
---
src/core/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/main.c b/src/core/main.c
index ba2de85bd3..fd527d4d63 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1537,11 +1537,11 @@ int main(int argc, char *argv[]) {
detect_virtualization(&virtualization);
if (virtualization)
- log_info("Detected virtualization '%s'.", virtualization);
+ log_info("Detected virtualization %s.", virtualization);
write_container_id();
- log_info("Detected architecture '%s'.", architecture_to_string(uname_architecture()));
+ log_info("Detected architecture %s.", architecture_to_string(uname_architecture()));
if (in_initrd())
log_info("Running in initial RAM disk.");

View File

@ -0,0 +1,37 @@
From 61504cbece6425b0e3acbb594aeed458fdc674e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 22:22:49 -0400
Subject: [PATCH] udev: downgrade "has devpath" and "filled with db file"
messages
Udev debug messages have to be significantly overhauled... For now
just downgrade those two. They are responsible for approximately 25%
of debug output during boot and are rather useless.
(cherry picked from commit cdd45c1ffbf790facd1817757832aa25d9211967)
---
src/libudev/libudev-device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index 9863901a33..e408942221 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -613,7 +613,7 @@ int udev_device_read_db(struct udev_device *udev_device, const char *dbfile)
}
fclose(f);
- log_debug("device %p filled with db file data", udev_device);
+ log_trace("device %p filled with db file data", udev_device);
return 0;
}
@@ -775,7 +775,7 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con
return NULL;
udev_device_set_syspath(udev_device, path);
- log_debug("device %p has devpath '%s'", udev_device, udev_device_get_devpath(udev_device));
+ log_trace("device %p has devpath '%s'", udev_device, udev_device_get_devpath(udev_device));
return udev_device;
}

View File

@ -0,0 +1,36 @@
From 46746489010823c9a7cea7c39593aeb68ceee176 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 14 Mar 2015 22:35:30 -0400
Subject: [PATCH] cryptsetup-generator: remove warning about crypttab access
mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This file contains no privileged data — just names of devices to decrypt
and files containing keys. On a running system most of this can be inferred from
the device tree anyway.
(cherry picked from commit 71e4e1258436e7e81d772aed52a02bb5d9c87cb8)
---
src/cryptsetup/cryptsetup-generator.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 05061c0704..db8337f92a 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -377,13 +377,6 @@ static int add_crypttab_devices(void) {
return 0;
}
- /* If we readd support for specifying passphrases
- * directly in crypttab we should upgrade the warning
- * below, though possibly only if a passphrase is
- * specified directly. */
- if (st.st_mode & 0005)
- log_debug("/etc/crypttab is world-readable. This is usually not a good idea.");
-
for (;;) {
int r, k;
char line[LINE_MAX], *l, *uuid;

Some files were not shown because too many files have changed in this diff Show More