Browse Source

systemd package update

Signed-off-by: basebuilder_pel7ppc64bebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64bebuilder0 7 years ago
parent
commit
f70c9cb1aa
  1. 60
      SOURCES/0001-kernel-install-add-fedora-specific-callouts-to-new-k.patch
  2. 55
      SOURCES/0002-Revert-fsck-re-enable-fsck-l.patch
  3. 25
      SOURCES/0003-sysctl-bring-back-etc-sysctl.conf.patch
  4. 88
      SOURCES/0004-remove-user-.service.patch
  5. 63
      SOURCES/0005-logind-session-save-stopping-flag.patch
  6. 33
      SOURCES/0006-man-mention-System-Administrator-s-Guide-in-systemct.patch
  7. 40
      SOURCES/0007-rules-automatically-online-hot-added-CPUs.patch
  8. 54
      SOURCES/0008-Revert-remove-references-of-readahead.patch
  9. 220
      SOURCES/0009-Revert-missing-remove-fanotify.patch
  10. 3376
      SOURCES/0010-Revert-readahead-wipe-out-readahead.patch
  11. 41
      SOURCES/0011-rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch
  12. 91
      SOURCES/0012-udev-net_id-correctly-name-netdevs-based-on-dev_port.patch
  13. 77
      SOURCES/0013-Revert-blkid-Warn-when-rejecting-a-superblock-with-a.patch
  14. 27
      SOURCES/0014-journald-audit-exit-gracefully-in-the-case-we-can-t-.patch
  15. 24
      SOURCES/0015-fedora-disable-resolv.conf-symlink.patch
  16. 358
      SOURCES/0016-Revert-timedated-manage-systemd-timesyncd-directly-i.patch
  17. 28
      SOURCES/0017-journal-remote-fix-certificate-status-memory-leak.patch
  18. 32
      SOURCES/0018-journal-remote-fix-client_cert-memory-leak.patch
  19. 25
      SOURCES/0019-tmpfiles-Fix-parse_acl-error-message.patch
  20. 23
      SOURCES/0020-test-utf8-fix-utf16-tests-on-BE-machines.patch
  21. 128
      SOURCES/0021-tmpfiles-avoid-creating-duplicate-acl-entries.patch
  22. 29
      SOURCES/0022-shared-time-util-fix-gcc5-warning.patch
  23. 33
      SOURCES/0023-test-time-test-infinity-parsing-in-nanoseconds.patch
  24. 41
      SOURCES/0024-bootchart-fix-default-init-path.patch
  25. 41
      SOURCES/0025-systemctl-bump-NOFILE-only-for-systemctl_main.patch
  26. 34
      SOURCES/0026-acl-util-avoid-freeing-uninitialized-pointer.patch
  27. 25
      SOURCES/0027-bootchart-svg-fix-checking-of-list-end.patch
  28. 35
      SOURCES/0028-systemd-add-getrandom-syscall-numbers-for-MIPS.patch
  29. 30
      SOURCES/0029-unit-use-weaker-dependencies-between-mount-and-devic.patch
  30. 39
      SOURCES/0030-unit-When-stopping-due-to-BindsTo-log-which-unit-cau.patch
  31. 26
      SOURCES/0031-sysctl-downgrade-message-about-sysctl-overrides-to-d.patch
  32. 36
      SOURCES/0032-sysctl-add-some-hints-how-to-override-settings.patch
  33. 909
      SOURCES/0033-core-rework-device-state-logic.patch
  34. 23
      SOURCES/0034-core-fix-return-value-on-OOM.patch
  35. 30
      SOURCES/0035-machined-use-x-machine-unix-prefix-for-the-container.patch
  36. 22
      SOURCES/0036-shared-AFS-is-also-a-network-filesystem.patch
  37. 28
      SOURCES/0037-core-downgrade-unit-type-not-supported-message.patch
  38. 94
      SOURCES/0038-journal-remote-fix-saving-of-binary-fields.patch
  39. 34
      SOURCES/0039-journal-fix-Inappropriate-ioctl-for-device-on-ext4.patch
  40. 49
      SOURCES/0040-sd-daemon-replace-VLA-with-alloca-to-make-llvm-happy.patch
  41. 80
      SOURCES/0041-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch
  42. 27
      SOURCES/0042-shared-util-assume-ac-when-sys-class-power_supply-is.patch
  43. 22
      SOURCES/0043-import-remove-unused-variable.patch
  44. 44
      SOURCES/0044-hwdb-fix-ThinkPad-X-Tablet-special-keys.patch
  45. 34
      SOURCES/0045-man-add-newlines-to-the-pull-raw-example-in-machinec.patch
  46. 133
      SOURCES/0046-core-shared-in-deserializing-match-same-files-reache.patch
  47. 83
      SOURCES/0047-shared-use-SocketAddress-in-socket_address_matches_f.patch
  48. 42
      SOURCES/0048-shared-avoid-semi-duplicating-socket_address_equal.patch
  49. 29
      SOURCES/0049-shared-handle-unnamed-sockets-in-socket_address_equa.patch
  50. 23
      SOURCES/0050-man-make-bootup-graph-consistent.patch
  51. 23
      SOURCES/0051-nspawn-fix-whitespace-and-typo-in-partition-table-bl.patch
  52. 53
      SOURCES/0052-man-explain-time-units-in-tmpfiles.patch
  53. 33
      SOURCES/0053-systemctl-check-validity-of-PID-we-received.patch
  54. 85
      SOURCES/0054-systemctl-support-auditd.service-better.patch
  55. 31
      SOURCES/0055-shared-unit-name-fix-gcc5-warning.patch
  56. 32
      SOURCES/0056-test-hashmap-fix-gcc5-warning.patch
  57. 29
      SOURCES/0057-shared-fix-wrong-assertion-in-barrier_set_role.patch
  58. 60
      SOURCES/0058-hwdb-Update-database-of-Bluetooth-company-identifier.patch
  59. 114
      SOURCES/0059-journal-make-skipping-of-exhausted-journal-files-eff.patch
  60. 42
      SOURCES/0060-shared-condition-fix-gcc5-warning.patch
  61. 34
      SOURCES/0061-man-correct-description-of-systemd-user-sessions.patch
  62. 31
      SOURCES/0062-build-sys-allow-lto-and-FORTIFY_SOURCE-with-O-sz.patch
  63. 23
      SOURCES/0063-man-fix-typo.patch
  64. 23
      SOURCES/0064-bus-proxyd-avoid-logging-oom-twice.patch
  65. 29
      SOURCES/0065-Do-not-run-sysv-generator-test-when-sysv-compat-is-d.patch
  66. 26
      SOURCES/0066-README-mention-ACLs-more.patch
  67. 333
      SOURCES/0067-Do-not-advertise-.d-snippets-over-main-config-file.patch
  68. 22
      SOURCES/0068-hwdb-add-pnpid-for-the-T450s-touchpad.patch
  69. 30
      SOURCES/0069-networkd-netdev-inform-when-we-take-over-an-existing.patch
  70. 181
      SOURCES/0070-man-replace-obsolete-wiki-link-with-man-page.patch
  71. 31
      SOURCES/0071-Use-correct-uname-identifiers-in-arch_map-for-SuperH.patch
  72. 24
      SOURCES/0072-hwdb-fix-Dell-XPS12-9Q33-key-name.patch
  73. 36
      SOURCES/0073-Remove-the-cap-on-epoll-events.patch
  74. 30
      SOURCES/0074-Allow-up-to-4096-simultaneous-connections.patch
  75. 23
      SOURCES/0075-hwdb-add-Logitech-G5-Laser-Mouse.patch
  76. 32
      SOURCES/0076-tmpfiles-Fix-handling-of-duplicate-lines.patch
  77. 23
      SOURCES/0077-hwdb-add-Lenovo-W451-to-TOUCHPAD_HAS_TRACKPOINT_BUTT.patch
  78. 39
      SOURCES/0078-vconsole-match-on-vtcon-events-not-fbcon-ones.patch
  79. 375
      SOURCES/0079-core-do-not-spawn-jobs-or-touch-other-units-during-c.patch
  80. 28
      SOURCES/0080-firstboot-set-all-spwd-fields-to-1-for-consistency-w.patch
  81. 77
      SOURCES/0081-sysusers-do-not-reject-users-with-already-present-et.patch
  82. 40
      SOURCES/0082-nspawn-fix-use-after-free-and-leak-in-error-paths.patch
  83. 25
      SOURCES/0083-login-fix-copy-pasto-in-error-path.patch
  84. 63
      SOURCES/0084-journalctl-update-hint-now-that-we-set-ACL-everywher.patch
  85. 26
      SOURCES/0085-sd-journal-return-error-when-we-cannot-open-a-file.patch
  86. 70
      SOURCES/0086-missing.h-add-NDA_.patch
  87. 85
      SOURCES/0087-udevd-close-race-in-udev-settle.patch
  88. 27
      SOURCES/0088-man-document-that-ExecStartPre-is-not-the-place-to-s.patch
  89. 31
      SOURCES/0089-journal-fix-return-code.patch
  90. 27
      SOURCES/0090-console-fix-error-code-inversion.patch
  91. 72
      SOURCES/0091-bus-proxy-complain-only-once-about-queue-overflows.patch
  92. 31
      SOURCES/0092-cgtop-fix-assert-when-not-on-tty.patch
  93. 28
      SOURCES/0093-man-split-paragraph.patch
  94. 3156
      SOURCES/0094-hwdb-update.patch
  95. 45
      SOURCES/0095-networkd-Begin-with-serial-number-1-for-netlink-requ.patch
  96. 179
      SOURCES/0096-journal-remote-downgrade-routine-messages-to-debug.patch
  97. 156
      SOURCES/0097-journal-remote-process-events-without-delay.patch
  98. 26
      SOURCES/0098-man-update-example-2-in-systemd.network-5.patch
  99. 24
      SOURCES/0099-gpt-auto-generator-fix-detection-of-srv.patch
  100. 28
      SOURCES/0100-sd-rtnl-never-set-serial-to-0.patch
  101. Some files were not shown because too many files have changed in this diff Show More

60
SOURCES/0001-kernel-install-add-fedora-specific-callouts-to-new-k.patch

@ -0,0 +1,60 @@
From 139d2c57d86203e421b17a4b6ec168c49fcb9893 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 14 Jan 2014 17:48:08 -0500
Subject: [PATCH] kernel-install: add fedora specific callouts to
new-kernel-pkg

---
src/kernel-install/kernel-install | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
mode change 100644 => 100755 src/kernel-install/kernel-install

diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
old mode 100644
new mode 100755
index 3ae1d77e3..f1c74de27
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -71,6 +71,42 @@ fi
KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"
+if [[ -x /sbin/new-kernel-pkg ]]; then
+ KERNEL_DIR="${KERNEL_IMAGE%/*}"
+ if [[ "${KERNEL_DIR}" != "/boot" ]]; then
+ for i in \
+ "$KERNEL_IMAGE" \
+ "$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac" \
+ "$KERNEL_DIR"/System.map \
+ "$KERNEL_DIR"/config \
+ "$KERNEL_DIR"/zImage.stub \
+ "$KERNEL_DIR"/dtb \
+ ; do
+ [[ -e "$i" ]] || continue
+ cp -a "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
+ done
+ fi
+
+ [[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
+ case "$COMMAND" in
+ add)
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
+ ;;
+ remove)
+ /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
+ ;;
+ *)
+ ;;
+ esac
+
+ # exit, if we can't find a boot loader spec conforming setup
+ if ! [[ -d /boot/loader/entries || -L /boot/loader/entries ]]; then
+ exit 0
+ fi
+fi
+
if [[ -f /etc/machine-id ]]; then
read MACHINE_ID < /etc/machine-id
fi

55
SOURCES/0002-Revert-fsck-re-enable-fsck-l.patch

@ -0,0 +1,55 @@
From 42026958cced6fe111bbaccad04d24d8ca3d6c55 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 14 Nov 2014 17:07:57 +0100
Subject: [PATCH] Revert "fsck: re-enable fsck -l"

This reverts commit 48d3e8d07f2978f001cc85b2dddb7f8ec9d07006.

(We have older util-linux in rhel7))

Conflicts:
README
---
README | 3 ++-
src/fsck/fsck.c | 13 +++++++++----
2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/README b/README
index c72209262..5f5783a68 100644
--- a/README
+++ b/README
@@ -135,7 +135,8 @@ REQUIREMENTS:
During runtime, you need the following additional
dependencies:
- util-linux >= v2.25 required
+ util-linux >= v2.19 (requires fsck -l, agetty -s),
+ v2.21 required for tests in test/
dbus >= 1.4.0 (strictly speaking optional, but recommended)
dracut (optional)
PolicyKit (optional)
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 78ceeb6fa..d8976809d 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -323,11 +323,16 @@ int main(int argc, char *argv[]) {
cmdline[i++] = "-T";
/*
- * Since util-linux v2.25 fsck uses /run/fsck/<diskname>.lock files.
- * The previous versions use flock for the device and conflict with
- * udevd, see https://bugs.freedesktop.org/show_bug.cgi?id=79576#c5
+ * Disable locking which conflict with udev's event
+ * ownershipi, until util-linux moves the flock
+ * synchronization file which prevents multiple fsck running
+ * on the same rotationg media, from the disk device
+ * node to a privately owned regular file.
+ *
+ * https://bugs.freedesktop.org/show_bug.cgi?id=79576#c5
+ *
+ * cmdline[i++] = "-l";
*/
- cmdline[i++] = "-l";
if (!root_directory)
cmdline[i++] = "-M";

25
SOURCES/0003-sysctl-bring-back-etc-sysctl.conf.patch

@ -0,0 +1,25 @@
From d2deeea1d5aa1d13139b9e9f70c6655abb589530 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 11 Nov 2013 11:17:57 +0100
Subject: [PATCH] sysctl: bring back /etc/sysctl.conf

Read /etc/sysctl.conf as the last file, overwriting everything.
---
src/sysctl/sysctl.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 275a5b74a..d007c932c 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -320,6 +320,10 @@ int main(int argc, char *argv[]) {
if (k < 0 && r == 0)
r = k;
}
+
+ k = parse_file(sysctl_options, "/etc/sysctl.conf", true);
+ if (k < 0 && r == 0)
+ r = k;
}
k = apply_all(sysctl_options);

88
SOURCES/0004-remove-user-.service.patch

@ -0,0 +1,88 @@
From cd37b8d217cc240074f8ff77f1986551f6c8834a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 14 Nov 2014 17:32:10 +0100
Subject: [PATCH] remove user@.service

Conflicts:
Makefile.am
---
Makefile.am | 2 --
src/login/logind-user.c | 38 --------------------------------------
2 files changed, 40 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index bf04d3184..75459f74d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -535,7 +535,6 @@ nodist_systemunit_DATA = \
units/systemd-sysctl.service \
units/emergency.service \
units/rescue.service \
- units/user@.service \
units/systemd-suspend.service \
units/systemd-halt.service \
units/systemd-poweroff.service \
@@ -597,7 +596,6 @@ EXTRA_DIST += \
units/systemd-fsck@.service.in \
units/systemd-fsck-root.service.in \
units/systemd-machine-id-commit.service.in \
- units/user@.service.m4.in \
units/debug-shell.service.in \
units/systemd-suspend.service.in \
units/quotaon.service.in \
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index f4c4490e8..97eb4feca 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -399,39 +399,6 @@ static int user_start_slice(User *u) {
return 0;
}
-static int user_start_service(User *u) {
- _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- char *job;
- int r;
-
- assert(u);
-
- if (!u->service) {
- char lu[DECIMAL_STR_MAX(uid_t) + 1], *service;
- sprintf(lu, UID_FMT, u->uid);
-
- service = unit_name_build("user", lu, ".service");
- if (!service)
- return log_oom();
-
- r = manager_start_unit(u->manager, service, &error, &job);
- if (r < 0) {
- log_error("Failed to start user service: %s", bus_error_message(&error, r));
- free(service);
- } else {
- u->service = service;
-
- free(u->service_job);
- u->service_job = job;
- }
- }
-
- if (u->service)
- hashmap_put(u->manager->user_units, u->service, u);
-
- return 0;
-}
-
int user_start(User *u) {
int r;
@@ -452,11 +419,6 @@ int user_start(User *u) {
if (r < 0)
return r;
- /* Spawn user systemd */
- r = user_start_service(u);
- if (r < 0)
- return r;
-
if (!dual_timestamp_is_set(&u->timestamp))
dual_timestamp_get(&u->timestamp);

63
SOURCES/0005-logind-session-save-stopping-flag.patch

@ -0,0 +1,63 @@
From 932ae09a155ef463d99d4b4e7cf04aafbcd78a19 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 2 Apr 2014 14:41:26 +0200
Subject: [PATCH] logind-session: save stopping flag

Conflicts:
src/login/logind-session.c
---
src/login/logind-session.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index a02a537f7..d2e7b4012 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -181,12 +181,14 @@ int session_save(Session *s) {
"USER=%s\n"
"ACTIVE=%i\n"
"STATE=%s\n"
- "REMOTE=%i\n",
- s->user->uid,
+ "REMOTE=%i\n"
+ "STOPPING=%i\n",
+ (unsigned long) s->user->uid,
s->user->name,
session_is_active(s),
session_state_to_string(session_get_state(s)),
- s->remote);
+ s->remote,
+ s->stopping);
if (s->type >= 0)
fprintf(f, "TYPE=%s\n", session_type_to_string(s->type));
@@ -309,7 +311,8 @@ int session_load(Session *s) {
*uid = NULL,
*realtime = NULL,
*monotonic = NULL,
- *controller = NULL;
+ *controller = NULL,
+ *stopping = NULL;
int k, r;
@@ -337,6 +340,7 @@ int session_load(Session *s) {
"REALTIME", &realtime,
"MONOTONIC", &monotonic,
"CONTROLLER", &controller,
+ "STOPPING", &stopping,
NULL);
if (r < 0)
@@ -453,6 +457,11 @@ int session_load(Session *s) {
session_restore_vt(s);
}
+ if (stopping) {
+ k = parse_boolean(stopping);
+ if (k >= 0)
+ s->stopping = k;
+ }
return r;
}

33
SOURCES/0006-man-mention-System-Administrator-s-Guide-in-systemct.patch

@ -0,0 +1,33 @@
From d4582346f47064de24470b5f92e418966004925f Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 28 Aug 2014 15:12:10 +0200
Subject: [PATCH] man: mention System Administrator's Guide in systemctl
manpage

Resolves: #978948
---
man/systemctl.xml | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/man/systemctl.xml b/man/systemctl.xml
index 338c1d328..6f30474c3 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -1713,6 +1713,17 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<xi:include href="less-variables.xml" xpointer="less"/>
</refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <para>
+ For examples how to use systemctl in comparsion
+ with old service and chkconfig command please see:
+ <ulink url="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Services.html">
+ Managing System Services
+ </ulink>
+ </para>
+ </refsect1>
+
<refsect1>
<title>See Also</title>
<para>

40
SOURCES/0007-rules-automatically-online-hot-added-CPUs.patch

@ -0,0 +1,40 @@
From cb0c7e5445624b7bc67fc4c10a91d5cf3dd6ce6f Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Mon, 22 Sep 2014 07:41:06 +0200
Subject: [PATCH] rules: automatically online hot-added CPUs

RHEL-only patch

Resolves: #968811

Conflicts:
Makefile.am
---
Makefile.am | 3 ++-
rules/40-redhat.rules | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 rules/40-redhat.rules

diff --git a/Makefile.am b/Makefile.am
index 75459f74d..a734e9c48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3564,7 +3564,8 @@ dist_udevrules_DATA += \
rules/75-tty-description.rules \
rules/78-sound-card.rules \
rules/80-net-setup-link.rules \
- rules/95-udev-late.rules
+ rules/95-udev-late.rules \
+ rules/40-redhat.rules
nodist_udevrules_DATA += \
rules/99-systemd.rules
diff --git a/rules/40-redhat.rules b/rules/40-redhat.rules
new file mode 100644
index 000000000..2b494e57c
--- /dev/null
+++ b/rules/40-redhat.rules
@@ -0,0 +1,3 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"

54
SOURCES/0008-Revert-remove-references-of-readahead.patch

@ -0,0 +1,54 @@
From 1b83fbe90a241c6d5c4ab0dc8a3f97215fb277bf Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 19 Nov 2014 12:14:00 +0100
Subject: [PATCH] Revert "remove references of readahead"

This reverts commit 3b71c18d3e3906f8606c66bea98b327684394e61.
---
.gitignore | 1 +
README | 1 +
TODO | 7 +++++++
3 files changed, 9 insertions(+)

diff --git a/.gitignore b/.gitignore
index e8a4085a3..0360f7c6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,6 +107,7 @@
/systemd-quotacheck
/systemd-random-seed
/systemd-rc-local-generator
+/systemd-readahead
/systemd-remount-api-vfs
/systemd-remount-fs
/systemd-reply-password
diff --git a/README b/README
index 5f5783a68..287d05c9b 100644
--- a/README
+++ b/README
@@ -30,6 +30,7 @@ AUTHOR:
LICENSE:
LGPLv2.1+ for all code
+ - except sd-readahead.[ch] which is MIT
- except src/shared/MurmurHash2.c which is Public Domain
- except src/shared/siphash24.c which is CC0 Public Domain
- except src/journal/lookup3.c which is Public Domain
diff --git a/TODO b/TODO
index 255a4f2d0..90b2c4b30 100644
--- a/TODO
+++ b/TODO
@@ -786,6 +786,13 @@ Features:
* and a dbus call to generate target from current state
+* readahead:
+ - drop /.readahead on bigger upgrades with yum
+ - move readahead files into /var (look for them with .path units?)
+ - readahead: use BTRFS_IOC_DEFRAG_RANGE instead of BTRFS_IOC_DEFRAG ioctl, with START_IO
+ - readahead: when bumping /sys readahead variable save mtime and compare later to detect changes
+ - readahead: make use of EXT4_IOC_MOVE_EXT, as used by http://e4rat.sourceforge.net/
+
* GC unreferenced jobs (such as .device jobs)
* write blog stories about:

220
SOURCES/0009-Revert-missing-remove-fanotify.patch

@ -0,0 +1,220 @@
From 66d06bd0a577ddb2461e8d1e5c8c2fbf6845227d Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 19 Nov 2014 12:14:13 +0100
Subject: [PATCH] Revert "missing: remove fanotify"

This reverts commit c7e4a7bece7a5c4484d229dd5e8ff01a5d49c62e.

Conflicts:
src/shared/missing.h
---
Makefile.am | 1 +
configure.ac | 1 +
src/shared/linux/fanotify.h | 98 +++++++++++++++++++++++++++++++++++++++++++++
src/shared/missing.h | 64 +++++++++++++++++++++++++++++
4 files changed, 164 insertions(+)
create mode 100644 src/shared/linux/fanotify.h

diff --git a/Makefile.am b/Makefile.am
index a734e9c48..70e4fbc6d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -749,6 +749,7 @@ libsystemd_shared_la_SOURCES = \
src/shared/capability.c \
src/shared/capability.h \
src/shared/linux/auto_dev-ioctl.h \
+ src/shared/linux/fanotify.h \
src/shared/ioprio.h \
src/shared/missing.h \
src/shared/initreq.h \
diff --git a/configure.ac b/configure.ac
index 97a29d63f..3f50887a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -310,6 +310,7 @@ RT_LIBS="$LIBS"
AC_SUBST(RT_LIBS)
LIBS="$save_LIBS"
+AC_CHECK_FUNCS([fanotify_init fanotify_mark])
AC_CHECK_FUNCS([memfd_create])
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
diff --git a/src/shared/linux/fanotify.h b/src/shared/linux/fanotify.h
new file mode 100644
index 000000000..5cc1a7e67
--- /dev/null
+++ b/src/shared/linux/fanotify.h
@@ -0,0 +1,98 @@
+#ifndef _LINUX_FANOTIFY_H
+#define _LINUX_FANOTIFY_H
+
+#include <linux/types.h>
+
+/* the following events that user-space can register for */
+#define FAN_ACCESS 0x00000001 /* File was accessed */
+#define FAN_MODIFY 0x00000002 /* File was modified */
+#define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */
+#define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */
+#define FAN_OPEN 0x00000020 /* File was opened */
+
+#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
+
+/* FIXME currently Q's have no limit.... */
+#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
+
+#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
+#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
+
+/* helper events */
+#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
+
+/* flags used for fanotify_init() */
+#define FAN_CLOEXEC 0x00000001
+#define FAN_NONBLOCK 0x00000002
+
+#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK)
+
+/* flags used for fanotify_modify_mark() */
+#define FAN_MARK_ADD 0x00000001
+#define FAN_MARK_REMOVE 0x00000002
+#define FAN_MARK_DONT_FOLLOW 0x00000004
+#define FAN_MARK_ONLYDIR 0x00000008
+#define FAN_MARK_MOUNT 0x00000010
+#define FAN_MARK_IGNORED_MASK 0x00000020
+#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
+#define FAN_MARK_FLUSH 0x00000080
+
+#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
+ FAN_MARK_REMOVE |\
+ FAN_MARK_DONT_FOLLOW |\
+ FAN_MARK_ONLYDIR |\
+ FAN_MARK_MOUNT |\
+ FAN_MARK_IGNORED_MASK |\
+ FAN_MARK_IGNORED_SURV_MODIFY)
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility. Apps will get only the
+ * events that they originally wanted. Be sure to add new events here!
+ */
+#define FAN_ALL_EVENTS (FAN_ACCESS |\
+ FAN_MODIFY |\
+ FAN_CLOSE |\
+ FAN_OPEN)
+
+/*
+ * All events which require a permission response from userspace
+ */
+#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\
+ FAN_ACCESS_PERM)
+
+#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\
+ FAN_ALL_PERM_EVENTS |\
+ FAN_Q_OVERFLOW)
+
+#define FANOTIFY_METADATA_VERSION 2
+
+struct fanotify_event_metadata {
+ __u32 event_len;
+ __u32 vers;
+ __u64 mask;
+ __s32 fd;
+ __s32 pid;
+} __attribute__ ((packed));
+
+struct fanotify_response {
+ __s32 fd;
+ __u32 response;
+} __attribute__ ((packed));
+
+/* Legit userspace responses to a _PERM event */
+#define FAN_ALLOW 0x01
+#define FAN_DENY 0x02
+
+/* Helper functions to deal with fanotify_event_metadata buffers */
+#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
+
+#define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \
+ (struct fanotify_event_metadata*)(((char *)(meta)) + \
+ (meta)->event_len))
+
+#define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \
+ (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \
+ (long)(meta)->event_len <= (long)(len))
+
+#endif /* _LINUX_FANOTIFY_H */
diff --git a/src/shared/missing.h b/src/shared/missing.h
index b33a70cb2..06a55769a 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -156,6 +156,70 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
# endif
#endif
+#ifdef __x86_64__
+# ifndef __NR_fanotify_init
+# define __NR_fanotify_init 300
+# endif
+# ifndef __NR_fanotify_mark
+# define __NR_fanotify_mark 301
+# endif
+#elif defined _MIPS_SIM
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+# ifndef __NR_fanotify_init
+# define __NR_fanotify_init 4336
+# endif
+# ifndef __NR_fanotify_mark
+# define __NR_fanotify_mark 4337
+# endif
+# elif _MIPS_SIM == _MIPS_SIM_NABI32
+# ifndef __NR_fanotify_init
+# define __NR_fanotify_init 6300
+# endif
+# ifndef __NR_fanotify_mark
+# define __NR_fanotify_mark 6301
+# endif
+# elif _MIPS_SIM == _MIPS_SIM_ABI64
+# ifndef __NR_fanotify_init
+# define __NR_fanotify_init 5295
+# endif
+# ifndef __NR_fanotify_mark
+# define __NR_fanotify_mark 5296
+# endif
+# endif
+#else
+# ifndef __NR_fanotify_init
+# define __NR_fanotify_init 338
+# endif
+# ifndef __NR_fanotify_mark
+# define __NR_fanotify_mark 339
+# endif
+#endif
+
+#ifndef HAVE_FANOTIFY_INIT
+static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) {
+ return syscall(__NR_fanotify_init, flags, event_f_flags);
+}
+#endif
+
+#ifndef HAVE_FANOTIFY_MARK
+static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
+ int dfd, const char *pathname) {
+#if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __powerpc__ && !defined __powerpc64__ \
+ || defined __arm__ && !defined __aarch64__
+ union {
+ uint64_t _64;
+ uint32_t _32[2];
+ } _mask;
+ _mask._64 = mask;
+
+ return syscall(__NR_fanotify_mark, fanotify_fd, flags,
+ _mask._32[0], _mask._32[1], dfd, pathname);
+#else
+ return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname);
+#endif
+}
+#endif
+
#ifndef HAVE_MEMFD_CREATE
static inline int memfd_create(const char *name, unsigned int flags) {
return syscall(__NR_memfd_create, name, flags);

3376
SOURCES/0010-Revert-readahead-wipe-out-readahead.patch

File diff suppressed because it is too large Load Diff

41
SOURCES/0011-rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch

@ -0,0 +1,41 @@
From 2411be37e26457c5e6734dbf08feb4b8375c13a2 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Mon, 22 Sep 2014 07:53:52 +0200
Subject: [PATCH] rules: add rule for naming Dell iDRAC USB Virtual NIC as
'idrac'

RHEL-only patch

Resolves: #1054477
---
Makefile.am | 3 ++-
rules/73-idrac.rules | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 rules/73-idrac.rules

diff --git a/Makefile.am b/Makefile.am
index b0e4b5a42..9e64d6f98 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3567,7 +3567,8 @@ dist_udevrules_DATA += \
rules/78-sound-card.rules \
rules/80-net-setup-link.rules \
rules/95-udev-late.rules \
- rules/40-redhat.rules
+ rules/40-redhat.rules \
+ rules/73-idrac.rules
nodist_udevrules_DATA += \
rules/99-systemd.rules
diff --git a/rules/73-idrac.rules b/rules/73-idrac.rules
new file mode 100644
index 000000000..d67fc425b
--- /dev/null
+++ b/rules/73-idrac.rules
@@ -0,0 +1,6 @@
+# do not edit this file, it will be overwritten on update
+
+# On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC
+# with terminates in the iDRAC. Help identify this with 'idrac'
+
+ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a102", NAME="idrac"

91
SOURCES/0012-udev-net_id-correctly-name-netdevs-based-on-dev_port.patch

@ -0,0 +1,91 @@
From 74b66951fcd54e6ab51023f60cc021fe355be1a8 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Sat, 25 Oct 2014 17:10:11 +0200
Subject: [PATCH] udev: net_id - correctly name netdevs based on dev_port when
set

Upstream, dev_id was replaced by dev_port, and the same happened for some kernel
drivers. This logic is not in the RHEL7 kernel, except for one new driver which
uses dev_port, but never used dev_id in the past.

To give proper names to these devices, fall back to using dev_port when dev_id
is not set. This does not affect any existing drivers.

(rhel only)

Resolves: #1155996

Conflicts:
src/udev/udev-builtin-net_id.c

Conflicts:
src/udev/udev-builtin-net_id.c
---
src/udev/udev-builtin-net_id.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 37ff1b800..99caa0a2a 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -38,7 +38,7 @@
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_port>] -- hotplug slot index number
* x<MAC> -- MAC address
- * [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>]
+ * [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>/<dev_port>]
* -- PCI geographical location
* [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
* -- USB port number chain
@@ -169,7 +169,7 @@ static bool is_pci_multifunction(struct udev_device *dev) {
static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
struct udev *udev = udev_device_get_udev(names->pcidev);
- unsigned domain, bus, slot, func, dev_port = 0;
+ unsigned domain, bus, slot, func, dev_id = 0;
size_t l;
char *s;
const char *attr;
@@ -183,9 +183,15 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
return -ENOENT;
/* kernel provided multi-device index */
- attr = udev_device_get_sysattr_value(dev, "dev_port");
- if (attr)
- dev_port = strtol(attr, NULL, 10);
+ attr = udev_device_get_sysattr_value(dev, "dev_id");
+ if (attr) {
+ dev_id = strtol(attr, NULL, 16);
+ if (dev_id == 0) {
+ attr = udev_device_get_sysattr_value(dev, "dev_port");
+ if (attr)
+ dev_id = strtol(attr, NULL, 16);
+ }
+ }
/* compose a name based on the raw kernel's PCI bus, slot numbers */
s = names->pci_path;
@@ -194,9 +200,9 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
l = strpcpyf(&s, l, "P%u", domain);
l = strpcpyf(&s, l, "p%us%u", bus, slot);
if (func > 0 || is_pci_multifunction(names->pcidev))
- l = strpcpyf(&s, l, "f%u", func);
- if (dev_port > 0)
- l = strpcpyf(&s, l, "d%u", dev_port);
+ l = strpcpyf(&s, l, "f%d", func);
+ if (dev_id > 0)
+ l = strpcpyf(&s, l, "d%d", dev_id);
if (l == 0)
names->pci_path[0] = '\0';
@@ -245,8 +251,8 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
l = strpcpyf(&s, l, "s%d", hotplug_slot);
if (func > 0 || is_pci_multifunction(names->pcidev))
l = strpcpyf(&s, l, "f%d", func);
- if (dev_port > 0)
- l = strpcpyf(&s, l, "d%d", dev_port);
+ if (dev_id > 0)
+ l = strpcpyf(&s, l, "d%d", dev_id);
if (l == 0)
names->pci_path[0] = '\0';
}

77
SOURCES/0013-Revert-blkid-Warn-when-rejecting-a-superblock-with-a.patch

@ -0,0 +1,77 @@
From f1faa24b260222e70d38492e5e3f126700dbd9f8 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 4 Mar 2015 16:10:36 +0100
Subject: [PATCH] Revert "blkid: Warn when rejecting a superblock with a bad
csum"

This reverts commit d47f6ca5f9b7a0b400d8bdb050151a0284fb4bdb.
---
README | 2 +-
configure.ac | 2 +-
src/udev/udev-builtin-blkid.c | 13 +------------
3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/README b/README
index 287d05c9b..ac2a81c0c 100644
--- a/README
+++ b/README
@@ -115,7 +115,7 @@ REQUIREMENTS:
libcap
libmount >= 2.20 (from util-linux)
libseccomp >= 1.0.0 (optional)
- libblkid >= 2.24 (from util-linux) (optional)
+ libblkid >= 2.20 (from util-linux) (optional)
libkmod >= 15 (optional)
PAM >= 1.1.2 (optional)
libcryptsetup (optional)
diff --git a/configure.ac b/configure.ac
index f701bcf71..9c25c3c6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,7 +437,7 @@ AM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"])
have_blkid=no
AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
if test "x$enable_blkid" != "xno"; then
- PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
+ PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
[AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
AC_MSG_ERROR([*** blkid support requested but libraries not found])
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
index 03e3dc286..89995831b 100644
--- a/src/udev/udev-builtin-blkid.c
+++ b/src/udev/udev-builtin-blkid.c
@@ -221,7 +221,6 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
blkid_probe pr;
const char *data;
const char *name;
- const char *prtype = NULL;
int nvals;
int i;
int err = 0;
@@ -257,8 +256,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
blkid_probe_set_superblocks_flags(pr,
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE |
- BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION |
- BLKID_SUBLKS_BADCSUM);
+ BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION);
if (noraid)
blkid_probe_filter_superblocks_usage(pr, BLKID_FLTR_NOTIN, BLKID_USAGE_RAID);
@@ -280,15 +278,6 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
err = probe_superblocks(pr);
if (err < 0)
goto out;
- if (blkid_probe_has_value(pr, "SBBADCSUM")) {
- if (!blkid_probe_lookup_value(pr, "TYPE", &prtype, NULL))
- log_warning("incorrect %s checksum on %s",
- prtype, udev_device_get_devnode(dev));
- else
- log_warning("incorrect checksum on %s",
- udev_device_get_devnode(dev));
- goto out;
- }
/* If we are a partition then our parent passed on the root
* partition UUID to us */

27
SOURCES/0014-journald-audit-exit-gracefully-in-the-case-we-can-t-.patch

@ -0,0 +1,27 @@
From 9b5e05005e534fc7fb6dc56c94e3296bb17fe122 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 6 Mar 2015 12:41:20 +0100
Subject: [PATCH] journald-audit: exit gracefully in the case we can't join
audit multicast group

---
src/journal/journald-audit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
index c2f1545cc..151097a6e 100644
--- a/src/journal/journald-audit.c
+++ b/src/journal/journald-audit.c
@@ -529,8 +529,10 @@ int server_open_audit(Server *s) {
}
r = bind(s->audit_fd, &sa.sa, sizeof(sa.nl));
- if (r < 0)
- return log_error_errno(errno, "Failed to join audit multicast group: %m");
+ if (r < 0) {
+ log_warning_errno(errno, "Failed to join audit multicast group, ignoring: %m");
+ return 0;
+ }
} else
fd_nonblock(s->audit_fd, 1);

24
SOURCES/0015-fedora-disable-resolv.conf-symlink.patch

@ -0,0 +1,24 @@
From 634aa6447d365af61b6cd78651eb80c32da966dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 3 Oct 2014 21:34:14 -0400
Subject: [PATCH] fedora: disable resolv.conf symlink

Conflicts:
tmpfiles.d/etc.conf.m4
---
tmpfiles.d/etc.conf.m4 | 3 ---
1 file changed, 3 deletions(-)

diff --git a/tmpfiles.d/etc.conf.m4 b/tmpfiles.d/etc.conf.m4
index 9b0e080e6..125d6e0a1 100644
--- a/tmpfiles.d/etc.conf.m4
+++ b/tmpfiles.d/etc.conf.m4
@@ -10,8 +10,5 @@
L /etc/os-release - - - - ../usr/lib/os-release
L /etc/localtime - - - - ../usr/share/zoneinfo/UTC
L+ /etc/mtab - - - - ../proc/self/mounts
-m4_ifdef(`ENABLE_RESOLVED',
-L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf
-)m4_dnl
C /etc/nsswitch.conf - - - -
C /etc/pam.d - - - -

358
SOURCES/0016-Revert-timedated-manage-systemd-timesyncd-directly-i.patch

@ -0,0 +1,358 @@
From 1a3dd33f98312421e0f3d654e8f5d56554557a8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 3 Oct 2014 21:34:14 -0400
Subject: [PATCH] Revert "timedated: manage systemd-timesyncd directly instead
of lists of alternatives"

This reverts commit b72ddf0f4f552dd53d6404b6ddbc9f17d02b8e12.

Conflicts:
Makefile.am
NEWS
src/timedate/timedated.c
---
Makefile.am | 9 ++
src/timedate/timedated.c | 252 ++++++++++++++++++++++++++++++-----------------
2 files changed, 170 insertions(+), 91 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9e64d6f98..bf65b2406 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,6 +111,7 @@ catalogdir=$(prefix)/lib/systemd/catalog
kernelinstalldir = $(prefix)/lib/kernel/install.d
factory_etcdir = $(prefix)/share/factory/etc
factory_pamdir = $(prefix)/share/factory/etc/pam.d
+ntpunitsdir=$(prefix)/lib/systemd/ntp-units.d
# And these are the special ones for /
rootprefix=@rootprefix@
@@ -5101,6 +5102,10 @@ dist_systemunit_DATA_busnames += \
polkitpolicy_files += \
src/timedate/org.freedesktop.timedate1.policy
+INSTALL_DIRS += \
+ $(prefix)/lib/systemd/ntp-units.d \
+ $(sysconfdir)/systemd/ntp-units.d
+
SYSTEM_UNIT_ALIASES += \
systemd-timedated.service dbus-org.freedesktop.timedate1.service
@@ -5177,6 +5182,10 @@ EXTRA_DIST += \
CLEANFILES += \
src/timesync/timesyncd.conf
+
+dist_ntpunits_DATA = \
+ src/timesync/90-systemd.list
+
endif
# ------------------------------------------------------------------------------
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 753c3d1d6..66097ef74 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -186,141 +186,211 @@ static int context_write_data_local_rtc(Context *c) {
return write_string_file_atomic_label("/etc/adjtime", w);
}
+static char** get_ntp_services(void) {
+ _cleanup_strv_free_ char **r = NULL, **files = NULL;
+ char **i;
+ int k;
+
+ k = conf_files_list(&files, ".list", NULL,
+ "/etc/systemd/ntp-units.d",
+ "/run/systemd/ntp-units.d",
+ "/usr/local/lib/systemd/ntp-units.d",
+ "/usr/lib/systemd/ntp-units.d",
+ NULL);
+ if (k < 0)
+ return NULL;
+
+ STRV_FOREACH(i, files) {
+ _cleanup_fclose_ FILE *f;
+
+ f = fopen(*i, "re");
+ if (!f)
+ continue;
+
+ for (;;) {
+ char line[PATH_MAX], *l;
+
+ if (!fgets(line, sizeof(line), f)) {
+ if (ferror(f))
+ log_error("Failed to read NTP unit file: %m");
+
+ break;
+ }
+
+ l = strstrip(line);
+ if (l[0] == 0 || l[0] == '#')
+ continue;
+
+ if (strv_extend(&r, l) < 0) {
+ log_oom();
+ return NULL;
+ }
+ }
+ }
+
+ i = r;
+ r = NULL; /* avoid cleanup */
+
+ return strv_uniq(i);
+}
+
static int context_read_ntp(Context *c, sd_bus *bus) {
- _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- sd_bus_message *reply = NULL;
- const char *s;
+ _cleanup_strv_free_ char **l;
+ char **i;
int r;
assert(c);
assert(bus);
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "GetUnitFileState",
- &error,
- &reply,
- "s",
- "systemd-timesyncd.service");
+ l = get_ntp_services();
+ STRV_FOREACH(i, l) {
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message *reply = NULL;
+ const char *s;
- if (r < 0) {
- if (sd_bus_error_has_name(&error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
- sd_bus_error_has_name(&error, "org.freedesktop.systemd1.LoadFailed") ||
- sd_bus_error_has_name(&error, "org.freedesktop.systemd1.NoSuchUnit"))
- return 0;
+ r = sd_bus_call_method(
+ bus,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "GetUnitFileState",
+ &error,
+ &reply,
+ "s",
+ *i);
- return r;
- }
+ if (r < 0) {
+ /* This implementation does not exist. Try the next one. */
+ if (sd_bus_error_has_name(&error, SD_BUS_ERROR_FILE_NOT_FOUND))
+ continue;
- r = sd_bus_message_read(reply, "s", &s);
- if (r < 0)
- return r;
+ return r;
+ }
+
+ r = sd_bus_message_read(reply, "s", &s);
+ if (r < 0)
+ return r;
- c->can_ntp = true;
- c->use_ntp = STR_IN_SET(s, "enabled", "enabled-runtime");
+ c->can_ntp = true;
+ c->use_ntp = STR_IN_SET(s, "enabled", "enabled-runtime");
+
+ return 0;
+ }
return 0;
}
static int context_start_ntp(Context *c, sd_bus *bus, sd_bus_error *error) {
+ _cleanup_strv_free_ char **l = NULL;
+ char **i;
int r;
assert(c);
assert(bus);
assert(error);
- if (c->use_ntp)
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "StartUnit",
- error,
- NULL,
- "ss",
- "systemd-timesyncd.service",
- "replace");
- else
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "StopUnit",
- error,
- NULL,
- "ss",
- "systemd-timesyncd.service",
- "replace");
+ l = get_ntp_services();
+ STRV_FOREACH(i, l) {
+
+ if (c->use_ntp)
+ r = sd_bus_call_method(
+ bus,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "StartUnit",
+ error,
+ NULL,
+ "ss", *i, "replace");
+ else
+ r = sd_bus_call_method(
+ bus,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "StopUnit",
+ error,
+ NULL,
+ "ss", *i, "replace");
+
+ if (r < 0) {
+ if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
+ sd_bus_error_has_name(error, "org.freedesktop.systemd1.LoadFailed") ||
+ sd_bus_error_has_name(error, "org.freedesktop.systemd1.NoSuchUnit")) {
+ /* This implementation does not exist. Try the next one. */
+ sd_bus_error_free(error);
+ continue;
+ }
- if (r < 0) {
- if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND) ||
- sd_bus_error_has_name(error, "org.freedesktop.systemd1.LoadFailed") ||
- sd_bus_error_has_name(error, "org.freedesktop.systemd1.NoSuchUnit"))
- return sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
+ return r;
+ }
- return r;
+ return 1;
}
- return 0;
+ sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
+ return -ENOTSUP;
}
static int context_enable_ntp(Context*c, sd_bus *bus, sd_bus_error *error) {
+ _cleanup_strv_free_ char **l = NULL;
+ char **i;
int r;
assert(c);
assert(bus);
assert(error);
- if (c->use_ntp)
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "EnableUnitFiles",
- error,
- NULL,
- "asbb", 1,
- "systemd-timesyncd.service",
- false, true);
- else
+ l = get_ntp_services();
+ STRV_FOREACH(i, l) {
+ if (c->use_ntp)
+ r = sd_bus_call_method(
+ bus,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "EnableUnitFiles",
+ error,
+ NULL,
+ "asbb", 1, *i, false, true);
+ else
+ r = sd_bus_call_method(
+ bus,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "DisableUnitFiles",
+ error,
+ NULL,
+ "asb", 1, *i, false);
+
+ if (r < 0) {
+ if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND)) {
+ /* This implementation does not exist. Try the next one. */
+ sd_bus_error_free(error);
+ continue;
+ }
+
+ return r;
+ }
+
r = sd_bus_call_method(
bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
- "DisableUnitFiles",
+ "Reload",
error,
NULL,
- "asb", 1,
- "systemd-timesyncd.service",
- false);
-
- if (r < 0) {
- if (sd_bus_error_has_name(error, SD_BUS_ERROR_FILE_NOT_FOUND))
- return sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
+ NULL);
+ if (r < 0)
+ return r;
- return r;
+ return 1;
}
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "Reload",
- error,
- NULL,
- NULL);
- if (r < 0)
- return r;
-
- return 0;
+ sd_bus_error_set_const(error, "org.freedesktop.timedate1.NoNTPSupport", "NTP not supported.");
+ return -ENOTSUP;
}
static int property_get_rtc_time(

28
SOURCES/0017-journal-remote-fix-certificate-status-memory-leak.patch

@ -0,0 +1,28 @@
From fb1115e5738b798bb99e5a699838395ca463e29d 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 34d93379d..de9c6ab32 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;
}

32
SOURCES/0018-journal-remote-fix-client_cert-memory-leak.patch

@ -0,0 +1,32 @@
From 0488761858a3bfbf06a25fbf3bc0e28fdfc28234 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 de9c6ab32..a95fff18f 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;

25
SOURCES/0019-tmpfiles-Fix-parse_acl-error-message.patch

@ -0,0 +1,25 @@
From 3d9f88326fefe4bf8f5ed4b1210c6b563a3eecff 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 c948d4d21..88ba7e46a 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");

23
SOURCES/0020-test-utf8-fix-utf16-tests-on-BE-machines.patch

@ -0,0 +1,23 @@
From c49cced2ef923522398695531363de2eb3940273 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 befa38575..346f8524c 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);

128
SOURCES/0021-tmpfiles-avoid-creating-duplicate-acl-entries.patch

@ -0,0 +1,128 @@
From c7d4f7a5a6cef5a46f905141e2ac27da3c96d2b7 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 a4ff1ab87..cbe09d7ab 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 90e88ffa2..fdb90063f 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

29
SOURCES/0022-shared-time-util-fix-gcc5-warning.patch

@ -0,0 +1,29 @@
From 15bfa13aa624e1f2a15571ad5278acec643c0489 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 947ac1fcf..1c36c577c 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;

33
SOURCES/0023-test-time-test-infinity-parsing-in-nanoseconds.patch

@ -0,0 +1,33 @@
From 33d01e64bc4e286e4eb772de8b3781686c2d3a3a 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 8cfc4cc4f..3840fff06 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) {

41
SOURCES/0024-bootchart-fix-default-init-path.patch

@ -0,0 +1,41 @@
From 685ddafd9e3c5f548e02e38633f366ff453f918b 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 bf65b2406..2e6455f6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -199,6 +199,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 64a384bac..175be6868 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 */

41
SOURCES/0025-systemctl-bump-NOFILE-only-for-systemctl_main.patch

@ -0,0 +1,41 @@
From 4581f8d1cde9b6fac4320e5cdf5234c96bbd60ae 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 21cb898b9..6b93ec844 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);

34
SOURCES/0026-acl-util-avoid-freeing-uninitialized-pointer.patch

@ -0,0 +1,34 @@
From 86592a27154d8da0e695304a75ae1458c574c962 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 cbe09d7ab..e67e9acb6 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)

25
SOURCES/0027-bootchart-svg-fix-checking-of-list-end.patch

@ -0,0 +1,25 @@
From 93ac68f5225bc0cf63ead3a3212539586d1fffb7 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 e111fa9cc..144177cd4 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 */

35
SOURCES/0028-systemd-add-getrandom-syscall-numbers-for-MIPS.patch

@ -0,0 +1,35 @@
From 32213f2f1d98bf851a570ecc35c018001e5d5ac4 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 06a55769a..8cb0b2c96 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -243,6 +243,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

30
SOURCES/0029-unit-use-weaker-dependencies-between-mount-and-devic.patch

@ -0,0 +1,30 @@
From 1c0e8e9ce84cd74a20a60b98ab3a39d75d05b45f 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 ee8e607c2..9f1e55e2f 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;

39
SOURCES/0030-unit-When-stopping-due-to-BindsTo-log-which-unit-cau.patch

@ -0,0 +1,39 @@
From 95216d7246fe5e8ac404cc9d432072eb59f2af04 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 9f1e55e2f..563f6fe85 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);

26
SOURCES/0031-sysctl-downgrade-message-about-sysctl-overrides-to-d.patch

@ -0,0 +1,26 @@
From 24e82cb7aa809bb8d50f40957cfed51dc48e0d72 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 d007c932c..b6945eda5 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);
}

36
SOURCES/0032-sysctl-add-some-hints-how-to-override-settings.patch

@ -0,0 +1,36 @@
From 66d069acb953ed8f2bfc6d76561d594520b5c67b 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 f18923399..def151bb8 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

909
SOURCES/0033-core-rework-device-state-logic.patch

@ -0,0 +1,909 @@
From 30ced6a8c742e1c798fff439b28a9800ca43f3e7 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 d3deac393..75b9a4628 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 bb7ae0783..0609b20fd 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 f3977e62d..c971330af 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 6997921fd..5c19af5d9 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 73e64d87a..914a2dbcc 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 563f6fe85..a6558ee23 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;

23
SOURCES/0034-core-fix-return-value-on-OOM.patch

@ -0,0 +1,23 @@
From 8cbaef2f9e08dc14e827445de76072e31aa6cce7 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 75b9a4628..1cc103c29 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

30
SOURCES/0035-machined-use-x-machine-unix-prefix-for-the-container.patch

@ -0,0 +1,30 @@
From e02e6845a4c4abe7d79df4305810703af5e6ec21 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 b46f0a8da..b0f0f66e0 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;

22
SOURCES/0036-shared-AFS-is-also-a-network-filesystem.patch

@ -0,0 +1,22 @@
From 46392c1d8f433ee44fc5bacb085879779a662468 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 ba035caed..f24b5b4ec 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"

28
SOURCES/0037-core-downgrade-unit-type-not-supported-message.patch

@ -0,0 +1,28 @@
From 0b78cbf29f02adc3cc490bf2b4e9365057ed7d7b 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 4775219e4..bc9b7ec62 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;
}

94
SOURCES/0038-journal-remote-fix-saving-of-binary-fields.patch

@ -0,0 +1,94 @@
From 608259be892c532d0afaeb81de3a5ee578d7658a 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 d9dea8deb..afded7e38 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 8499f4eb8..22db55091 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;

34
SOURCES/0039-journal-fix-Inappropriate-ioctl-for-device-on-ext4.patch

@ -0,0 +1,34 @@
From b3df4af4258e3285704f9622b9655084439c6f5e 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 2845e05ce..0f28718b0 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

49
SOURCES/0040-sd-daemon-replace-VLA-with-alloca-to-make-llvm-happy.patch

@ -0,0 +1,49 @@
From 529c94b47f886f99796cff0f5827d6c2ebdcea19 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 028c2a7a5..22a3a5347 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)

80
SOURCES/0041-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch

@ -0,0 +1,80 @@
From 6ad61c838992d17f5faa94faa8f17967083a4226 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 88ba7e46a..187997e1f 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) {

27
SOURCES/0042-shared-util-assume-ac-when-sys-class-power_supply-is.patch

@ -0,0 +1,27 @@
From a2911c593e9d69a2aa01d89d876e313f90e7db17 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 f24b5b4ec..85487230a 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;

22
SOURCES/0043-import-remove-unused-variable.patch

@ -0,0 +1,22 @@
From 2bbdb63f7e5f125e1259b0fcfcea8226c5ae4e58 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 999aa8ab5..493252a13 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;

44
SOURCES/0044-hwdb-fix-ThinkPad-X-Tablet-special-keys.patch

@ -0,0 +1,44 @@
From 61d5dff976f33ec7189eae58641c49088e166479 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 1b7d87101..2cb976923 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

34
SOURCES/0045-man-add-newlines-to-the-pull-raw-example-in-machinec.patch

@ -0,0 +1,34 @@
From e411ef694a09d001cdb97e139af6884b01be4aba 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 9b07af422..640cb8b7d 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

133
SOURCES/0046-core-shared-in-deserializing-match-same-files-reache.patch

@ -0,0 +1,133 @@
From 5d66d4942090a971de8df2c3de9ce143a208eb37 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 48c43a288..88aae4815 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 b9db7f104..70bc1caa2 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 bd0d32473..bcf116ed3 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 c6f64876b..c278d6f9d 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;

83
SOURCES/0047-shared-use-SocketAddress-in-socket_address_matches_f.patch

@ -0,0 +1,83 @@
From 73cbcbaf7e04d42816ada8ee44b5fbc6b7f0bdb4 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 c278d6f9d..c31f60ec7 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;
}

42
SOURCES/0048-shared-avoid-semi-duplicating-socket_address_equal.patch

@ -0,0 +1,42 @@
From ea81ddfdc0eadfb62e28ed998d33c5e1d3b3abab 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 c31f60ec7..deecce8a8 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) {

29
SOURCES/0049-shared-handle-unnamed-sockets-in-socket_address_equa.patch

@ -0,0 +1,29 @@
From 394185c013c15e47ffa1bdc5948ac6010c329728 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 deecce8a8..a4e26b1d8 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;

23
SOURCES/0050-man-make-bootup-graph-consistent.patch

@ -0,0 +1,23 @@
From d65ce525915a604d31cda80b5d7a8d639fb5cbb9 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 d97d55023..b92057af2 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

23
SOURCES/0051-nspawn-fix-whitespace-and-typo-in-partition-table-bl.patch

@ -0,0 +1,23 @@
From 3af8c723aebecb5d220fdb5b1fb80a097c366db1 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 fb672510b..7724df96b 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."

53
SOURCES/0052-man-explain-time-units-in-tmpfiles.patch

@ -0,0 +1,53 @@
From 6995221c988db99faa5de5ed948466e1982d9d9d 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 8815bf997..4bd0fcf75 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

33
SOURCES/0053-systemctl-check-validity-of-PID-we-received.patch

@ -0,0 +1,33 @@
From 3b573e5c39f452f98084b3d36486369882455b72 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 6b93ec844..3da4d3d4f 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++;
}

85
SOURCES/0054-systemctl-support-auditd.service-better.patch

@ -0,0 +1,85 @@
From 98d1fe84e1eac91563bff326539465cd34e971c0 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 3da4d3d4f..4ec0cff21 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);
}
}

31
SOURCES/0055-shared-unit-name-fix-gcc5-warning.patch

@ -0,0 +1,31 @@
From 10cfa6f617fdc2b9d85823163b4445f5ae9058c5 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 21b66913c..f728af4a8 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;
}

32
SOURCES/0056-test-hashmap-fix-gcc5-warning.patch

@ -0,0 +1,32 @@
From a4409b8ae6b80acffc9a4f89df2d06c498b8c8f9 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 6900da9e8..351563b96 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);
}

29
SOURCES/0057-shared-fix-wrong-assertion-in-barrier_set_role.patch

@ -0,0 +1,29 @@
From 5acd5e264d53cf293ac5d2e57371690120fb7119 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 f65363a67..b7dca7509 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]);

60
SOURCES/0058-hwdb-Update-database-of-Bluetooth-company-identifier.patch

@ -0,0 +1,60 @@
From 7958951ba84f870c624b4d2ab452b12c844bde20 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 fb789fd49..4fd951a58 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

114
SOURCES/0059-journal-make-skipping-of-exhausted-journal-files-eff.patch

@ -0,0 +1,114 @@
From 0ad01db952718d3437fa8f077a065d17efe5279b 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 0f28718b0..24c49b916 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 2526e14d6..403c8f760 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 94891cdf3..9b57e5945 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);
}
}

42
SOURCES/0060-shared-condition-fix-gcc5-warning.patch

@ -0,0 +1,42 @@
From 2ee0903b0a00dd4a13af8a26ee5fb435c9895568 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 da7560f05..796cc520d 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)

34
SOURCES/0061-man-correct-description-of-systemd-user-sessions.patch

@ -0,0 +1,34 @@
From 3104b6659b1405d25cdb5cad68e2bb2c9f8b5980 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 9d796b1ae..e75ef11c4 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>

31
SOURCES/0062-build-sys-allow-lto-and-FORTIFY_SOURCE-with-O-sz.patch

@ -0,0 +1,31 @@
From 21511551c7d49424a202b25ffe76cf1371dfc0c1 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 9c25c3c6f..3201428c4 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
SOURCES/0063-man-fix-typo.patch

@ -0,0 +1,23 @@
From 3f4c4af890ff655bf409875d0775f436e6d63353 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 4480e1999..ef58887dc 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>

23
SOURCES/0064-bus-proxyd-avoid-logging-oom-twice.patch

@ -0,0 +1,23 @@
From 61dd027666b40102bc9463217264f1deaab4cc8a 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 b6b005636..b6550ed3c 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;

29
SOURCES/0065-Do-not-run-sysv-generator-test-when-sysv-compat-is-d.patch

@ -0,0 +1,29 @@
From c11c73fc4541bf0ea5a418ebea53e58668100f82 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 2e6455f6e..4933f76bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3789,9 +3789,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 \

26
SOURCES/0066-README-mention-ACLs-more.patch

@ -0,0 +1,26 @@
From b1e53a9d3cc7c6fbe4447e201c8f6348ffcd7b6a 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 ac2a81c0c..ffc2cf9f2 100644
--- a/README
+++ b/README
@@ -78,8 +78,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

333
SOURCES/0067-Do-not-advertise-.d-snippets-over-main-config-file.patch

@ -0,0 +1,333 @@
From b72201257216f687bf3462ad7539612cccbbce75 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 8d9700d30..bf6ca0bf9 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 3d325e6ad..0b7329bf5 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 364b58f07..85146b0d8 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 ffaec5035..ca2b18783 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 36cae2706..8047a4ea7 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 b87d7e955..36af45927 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 433f2f83a..bb17ec866 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 7c3f23756..c7bcfaee4 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 1127970a1..89a651c66 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 2d7cb6121..4f5e50936 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 a3727200d..231609033 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 0fe9fe801..c2f0643e0 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 29bdf8f18..47eefe91c 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 6b1943a2d..834c4c2eb 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 e5a19ee47..3eb19e42b 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 fc3c6c49c..b6a2ada27 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=

22
SOURCES/0068-hwdb-add-pnpid-for-the-T450s-touchpad.patch

@ -0,0 +1,22 @@
From 48b8df6ea51021e6624bdc45ff371dd033d379df 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 bbf44db77..9fcb5fdb9 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

30
SOURCES/0069-networkd-netdev-inform-when-we-take-over-an-existing.patch

@ -0,0 +1,30 @@
From fab00ed4a9ce8a1d579028c2fc39db3717b454da 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 8119205dd..7d193d088 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);

181
SOURCES/0070-man-replace-obsolete-wiki-link-with-man-page.patch

@ -0,0 +1,181 @@
From d3a45e70ee215646cdfbe19f514be08ae95e12eb 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 0e48e7934..1974cd7a2 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 74c3b2620..5c5e9fc4a 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 b2d8d65e3..fd7ba7983 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 8f82e3330..022efb413 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 0b5b2f2a7..338925964 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 9c706df24..8d2eaca4f 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 3eec1d7b9..e7fc95c74 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 e619b1bc2..f2d56cbcd 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 09e11b471..a452f87ba 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 80591dc73..9b92140e6 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

31
SOURCES/0071-Use-correct-uname-identifiers-in-arch_map-for-SuperH.patch

@ -0,0 +1,31 @@
From 3df99b05df12b73e4d081ee223f9b35ed33f47ca 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 34c5a53fa..884abdd3e 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__)

24
SOURCES/0072-hwdb-fix-Dell-XPS12-9Q33-key-name.patch

@ -0,0 +1,24 @@
From e43361ab55a61ebfaf16e1c78be1bce1fdf84c67 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 2cb976923..88906655e 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*

36
SOURCES/0073-Remove-the-cap-on-epoll-events.patch

@ -0,0 +1,36 @@
From f5ce5e24f9cf18a37ef6aedb149891d07767b045 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 25089a033..c6350be9f 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,

30
SOURCES/0074-Allow-up-to-4096-simultaneous-connections.patch

@ -0,0 +1,30 @@
From b4ea0d8280135b7eabb1bb70e24d62c86e065db3 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 260775cd8..85b517486 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);

23
SOURCES/0075-hwdb-add-Logitech-G5-Laser-Mouse.patch

@ -0,0 +1,23 @@
From b9c441e4f5e7049c23d3f5d0a5a874b13e0356fc 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 a62ebc497..93ee4d9fa 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

32
SOURCES/0076-tmpfiles-Fix-handling-of-duplicate-lines.patch

@ -0,0 +1,32 @@
From 339b62c8f336bb51dc7a925062abeb3ce76145e6 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 187997e1f..1e1096816 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);

23
SOURCES/0077-hwdb-add-Lenovo-W451-to-TOUCHPAD_HAS_TRACKPOINT_BUTT.patch

@ -0,0 +1,23 @@
From 01dd8dc414460df51940c64e73cf318a9f587270 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 9fcb5fdb9..8a324466b 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

39
SOURCES/0078-vconsole-match-on-vtcon-events-not-fbcon-ones.patch

@ -0,0 +1,39 @@
From 5e6503d0d2efb5cbff945df42423640ffb138073 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 062009640..35b9ad515 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"

375
SOURCES/0079-core-do-not-spawn-jobs-or-touch-other-units-during-c.patch

@ -0,0 +1,375 @@
From f997080b4d17a40b59b398e4354b6368d9c85f69 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 9f6bd84b2..e4c79415d 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 1d77292f9..43d7607a3 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 1cc103c29..4ff882721 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 bc9b7ec62..203a6a0a1 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 c971330af..3ae0eb462 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 e5ea79fec..51e36fa8b 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 b41db7872..ae6614fbf 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 15e29be14..7781b4e62 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 ae9819d01..61ff9d331 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 b70c3beb6..b1d844877 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 88aae4815..760de0203 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 5c19af5d9..369abf0f5 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 33fb66bc3..2411a8e75 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 45744c7de..48cf9c16a 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 a6558ee23..565455bd6 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 291bc77a7..7ebc489c8 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);

28
SOURCES/0080-firstboot-set-all-spwd-fields-to-1-for-consistency-w.patch

@ -0,0 +1,28 @@
From 5857b7843b35d84f976a399765f1c9a5365742a2 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 a765d6d21..a37ca170f 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 ... */

77
SOURCES/0081-sysusers-do-not-reject-users-with-already-present-et.patch

@ -0,0 +1,77 @@
From 169e74d772eac561a24f461ac65118d3d83a5980 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 e47bcb4dc..76b5962c5 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 */

40
SOURCES/0082-nspawn-fix-use-after-free-and-leak-in-error-paths.patch

@ -0,0 +1,40 @@
From 28b5692e9ab3dbb07e4d6b8e44b370637c04ba86 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 7724df96b..78bd58483 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;

25
SOURCES/0083-login-fix-copy-pasto-in-error-path.patch

@ -0,0 +1,25 @@
From d67968957aece7a1d4da581d86ad719c9a7fad21 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 44bda34af..88af23e35 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;
}

63
SOURCES/0084-journalctl-update-hint-now-that-we-set-ACL-everywher.patch

@ -0,0 +1,63 @@
From cf04c51fb2d5ce08a8b8aafec999e2007ef53c83 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 55c778633..12c869f5a 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)

26
SOURCES/0085-sd-journal-return-error-when-we-cannot-open-a-file.patch

@ -0,0 +1,26 @@
From 5633544097b9c3bf3d63ef3be9e7db5d4e1f49dc 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 9b57e5945..9b9e8ac85 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) {

70
SOURCES/0086-missing.h-add-NDA_.patch

@ -0,0 +1,70 @@
From eceb99d70a7c0916cb626dfbcb50894e1f4e9431 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 3201428c4..081ed0f6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,7 +334,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>
@@ -345,6 +346,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 8cb0b2c96..6ef4dbdf4 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>
@@ -687,6 +688,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

85
SOURCES/0087-udevd-close-race-in-udev-settle.patch

@ -0,0 +1,85 @@
From 175c446fc5ca6adbeeb25dfe0ef725e2f1914259 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 99d4c8983..e98c1fd6d 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

27
SOURCES/0088-man-document-that-ExecStartPre-is-not-the-place-to-s.patch

@ -0,0 +1,27 @@
From 1c8b76caab7d5164ac2d0d09aff9e4ffecdf205e 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 c03b4e8a5..f59870563 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>

31
SOURCES/0089-journal-fix-return-code.patch

@ -0,0 +1,31 @@
From 185e6b251907bdf6adc63866f38722e9fb3d3715 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 24c49b916..f500568fe 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;

27
SOURCES/0090-console-fix-error-code-inversion.patch

@ -0,0 +1,27 @@
From 6e2893aa4e1d6471b174e56c5132da31f890d620 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 9dd62f04a..25de0a218 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;

72
SOURCES/0091-bus-proxy-complain-only-once-about-queue-overflows.patch

@ -0,0 +1,72 @@
From 4c6c21f92a8204abf031e42bb4949a0ecf039f7a 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 3dea908f5..e13cf5e2e 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 913d47071..782c4e60b 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);

31
SOURCES/0092-cgtop-fix-assert-when-not-on-tty.patch

@ -0,0 +1,31 @@
From 33088d83ecaf03611e3d20a893e675e4d7c3ae9a 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 3c7ad4060..f951c37cb 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);

28
SOURCES/0093-man-split-paragraph.patch

@ -0,0 +1,28 @@
From 682a699e71147673f8de5fa12dbec8f2a4c28d9c 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 11b160e58..fdb157864 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
SOURCES/0094-hwdb-update.patch

File diff suppressed because it is too large Load Diff

45
SOURCES/0095-networkd-Begin-with-serial-number-1-for-netlink-requ.patch

@ -0,0 +1,45 @@
From 0dd3b68d80bd32ecc5db65d634072390dad581aa 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 ae49c77e0..7cdcc5d96 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;

179
SOURCES/0096-journal-remote-downgrade-routine-messages-to-debug.patch

@ -0,0 +1,179 @@
From c546fffcff0d2e3522738aac30391d5996bdf4a6 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 afded7e38..6c096de03 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 df3004939..99820fa7b 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 8f32a9a98..d1486e7cd 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 a95fff18f..b45c38d68 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;

156
SOURCES/0097-journal-remote-process-events-without-delay.patch

@ -0,0 +1,156 @@
From 47ac92420da9ecbffaf3aa0046d170be358639a2 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 6c096de03..7e6295435 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 22db55091..06a50296a 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 d1486e7cd..b7cc6d717 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,

26
SOURCES/0098-man-update-example-2-in-systemd.network-5.patch

@ -0,0 +1,26 @@
From 131de4184e86e7096d987973d7c4918f8303fa4b 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 485876b6a..24f8416ef 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>

24
SOURCES/0099-gpt-auto-generator-fix-detection-of-srv.patch

@ -0,0 +1,24 @@
From a9c2be5c2e43bd5fb37dd45f84e6787f4abec23f 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 7d5a6c650..cceeeb845 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -549,7 +549,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();
}

28
SOURCES/0100-sd-rtnl-never-set-serial-to-0.patch

@ -0,0 +1,28 @@
From fc9d7a3891dc293cccd4e127cfb1e2355f4e93da 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 7cdcc5d96..5df39e117 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);

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

Loading…
Cancel
Save