Compare commits

...

33 Commits
master ... f23

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 91e73e19d9 Unbreak spec file
commmit --amend failure, sorry.
2016-10-01 11:29:11 -04:00
Zbigniew Jędrzejewski-Szmek fff97bd061 Fix for the empty notify message fuckup 2016-10-01 11:25:39 -04:00
Zbigniew Jędrzejewski-Szmek 726f6ebadc Add %systemd_ordering macro 2016-08-17 18:23:23 +00:00
Zbigniew Jędrzejewski-Szmek 9fbdc4bf7f Ignore the access mode on /var/log/journal 2016-03-14 21:07:02 -04:00
Zbigniew Jędrzejewski-Szmek 321bb91ea0 Add bug number 2016-03-14 21:04:52 -04:00
Jan Synacek fdc56a0c15 various fixes in kernel-install (#1244057)
Resolves: #1244057
2016-02-11 14:32:04 +01:00
Jan Synacek 66361260e2 RFE: Please provide option RandomSec= to systemd timer (#1303552)
Resolves: #1303552
2016-02-01 14:24:40 +01:00
Jan Synacek 743659b0b9 systemd asking for password on boot: ask_password_tty() prints multiple asterisks when typing special characters (#1301984)
Resolves: #1301984
2016-02-01 14:23:44 +01:00
Jan Synacek b1b71981b2 Stopping services using glob patterns does not work as stated in man page (#1288851)
Resolves: #1288851
2016-02-01 14:22:32 +01:00
Jan Synacek 64a629fdb1 machined: rework state tracking logic for machines (#1297225)
Resolves: #1297225
2016-01-25 10:22:38 +01:00
Jan Synacek a841490109 hwdb: add axis ranges and resolution for Dell Lattitude E6220 (#1293576)
Resolves: #1293576
2016-01-25 10:22:28 +01:00
Jan Synacek 566578510f transaction: downgrade warnings about wanted unit which are not found (#1278264)
Resolves: #1278264
2016-01-25 10:22:06 +01:00
Jan Synacek f8f052cc58 units: increase watchdog timeout to 3min for all our services 2016-01-25 10:16:24 +01:00
Jan Synacek 4993dcdfa0 udev_enumerate_scan_devices() broken when used with udev_enumerate_add_match_parent() (#1295979)
Resolves: #1295979
2016-01-07 14:10:06 +01:00
Jan Synacek 69066a593d Journalctl says "no entries" even when told to be quiet (#1293062)
Resolves: #1293062
2016-01-07 14:08:45 +01:00
Jan Synacek e40f4d2f65 Regression: journalctl -f broken (again) with initially empty filter result (#1292805)
Resolves: #1292805
2016-01-07 14:07:46 +01:00
Jan Synacek 9207cfc856 Terminal multiplexers (tmux, screen) are broken in systemd-nspawn containers (#1282626)
Resolves: #1282626
2016-01-07 14:06:04 +01:00
Jan Synacek 6a25424b39 re-apply patches that were removed by mistake (#1263208)
Related: #1263208
2016-01-05 15:22:19 +01:00
Jan Synacek eda41b72a3 do not assume fstab is present (#1281606) 2015-12-14 12:21:36 +01:00
Jan Synacek d5d6bb7d39 Add forgotten patch 2015-12-14 10:41:03 +01:00
Jan Synacek 60ed166b54 Backport fixes
Resolves: #1283971
Resolves: #1279156
Resolves: #1278475
Resolves: #1266776
Resolves: #1266775
Resolves: #1255619
Resolves: #1238285
Resolves: #1182661
Resolves: #1287592
2015-12-14 10:29:17 +01:00
Jan Synacek c9f6df1cdc remove the fix for Corsair K70 Keyboard introduced in 222-3 (#1267225)
It breaks more than it fixes... It has also been reverted upstream.

Related: #1262132
2015-10-19 08:36:15 +02:00
Jan Synacek 0f282e27e8 Add forgotten patch
Related: #1268601
2015-10-06 09:27:58 +02:00
Jan Synacek 275528dc1a it's not possible to log in again shortly after log out (#1263208)
Resolves: #1263208
2015-10-05 14:34:27 +02:00
Jan Synacek a9d2e0cabe systemctl shows the full cgroup hierarchy when doing status of a or non-existing unit (#1268601)
Resolves: #1268601
2015-10-05 14:30:49 +02:00
Michal Sekletar f4c637778b Bump release 2015-09-25 00:56:42 +02:00
Michal Sekletar fb7efbf012 Assorted bugfixes and backports
Most notably revert of
743970d2ea

Resolves: #1170765,#1202598
2015-09-25 00:51:08 +02:00
Michal Sekletar f72f2e475e Conflict with chkconfig version < 1.5
/usr/lib/systemd/systemd-sysv-install is an alias to chkconfig shipped in
chkconfig-1.5 and higher

Resolves: #1226908
2015-09-24 23:14:44 +02:00
Adam Miller 26dfcc1ea7 Re-port walters' patches to unbreak Atomic BZ#1195761 2015-09-21 15:10:50 -05:00
Jan Synacek 5f4d81446d Fix: user systemd-journal-upload should be in systemd-journal group (#1262743) 2015-09-18 12:50:09 +02:00
Jan Synacek 5e6dd1bb71 Fix: Corsair K70 keyboard 'pipe' key not functioning correctly (#1262132) 2015-09-17 13:31:09 +02:00
Jan Synacek dab26592cc Fix: Upgrading from 22 to 23 by fedup fails (#1251334) 2015-09-17 13:29:20 +02:00
Jan Synacek 4c8e89957b systemd-tmpfiles-setup.service fails on 23 Alpha RC1 Server (#1250737) 2015-09-17 13:27:04 +02:00
91 changed files with 5825 additions and 25 deletions

View File

@ -0,0 +1,45 @@
From c40bef16bf3e63a42718260b4633cb2d682984d8 Mon Sep 17 00:00:00 2001
From: Adam Miller <admiller@redhat.com>
Date: Fri, 18 Sep 2015 17:57:35 -0500
Subject: [PATCH 2/2] Re-apply walters' unit patch for F23/systemd-v222
Originally in the f22 fedpkg/distgit branch with commit id:
9bbe0e92dc59d5a42258c729b105a7d9901eb35e
[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.
---
src/core/unit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index fac017c..0a66a6a 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1641,7 +1641,7 @@ static void unit_check_unneeded(Unit *u) {
static void unit_check_binds_to(Unit *u) {
bool stop = false;
- Unit *other;
+ Unit *other = NULL;
Iterator i;
int r;
@@ -1676,7 +1676,7 @@ static void unit_check_binds_to(Unit *u) {
}
assert(other);
- log_unit_info(u, "Unit is bound to inactive unit %s. Stopping, too.", other->id);
+ 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. */
r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);
--
2.4.3

View File

@ -0,0 +1,27 @@
From eade863e97e0a09daefd844728c7f5a25a914924 Mon Sep 17 00:00:00 2001
From: Adam Miller <admiller@redhat.com>
Date: Fri, 18 Sep 2015 17:55:19 -0500
Subject: [PATCH 1/2] Revert "core/mount: add dependencies to dynamically
mounted mounts too"
This reverts commit 06e97888883e2cc12eb6514e80c7f0014295f59b.
---
src/core/mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 851b413..87c4088 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -304,7 +304,7 @@ static int mount_add_device_links(Mount *m) {
assert(m);
- p = get_mount_parameters(m);
+ p = get_mount_parameters_fragment(m);
if (!p)
return 0;
--
2.4.3

View File

@ -0,0 +1,40 @@
From df676a819f84b230f4aa3eb600083fe357c674c8 Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Date: Wed, 24 Jun 2015 12:01:26 +0900
Subject: [PATCH 01/47] selinux: fix missing SELinux unit access check
Currently, SELinux unit access check is not performed if a given unit
file has not been registered in a hash table. This is because function
manager_get_unit() only tries to pick up a Unit object from a Unit
hash table. Instead, we use function manager_load_unit() searching
Unit file pathes for the given Unit file.
---
src/core/selinux-access.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index e9a9a02..50a90b0 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -302,12 +302,12 @@ int mac_selinux_unit_access_check_strv(
int r;
STRV_FOREACH(i, units) {
- u = manager_get_unit(m, *i);
- if (u) {
- r = mac_selinux_unit_access_check(u, message, permission, error);
- if (r < 0)
- return r;
- }
+ r = manager_load_unit(m, *i, NULL, error, &u);
+ if (r < 0)
+ return r;
+ r = mac_selinux_unit_access_check(u, message, permission, error);
+ if (r < 0)
+ return r;
}
#endif
return 0;
--
2.5.0

View File

@ -0,0 +1,45 @@
From ad75a97f7d86ddbc1b8521ae084862013c1713b0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 22 Jul 2015 22:02:14 +0200
Subject: [PATCH] tmpfiles: downgrade errors when a file system does not
support file attributes
This downgrades errors from setting file attributes via tmpfiles to
warnings and makes them non-fatal.
Also, as a special case, if a file system does not support file
attributes at all, then the message is downgraded to debug, so that it
is not seen at all.
With this change reiserfs should not see any messages at all anymore
(since it apparently does not implement file attributes at all), but XFS
will still get a warning but no failure. The warning is something the
XFS kernel folks should fix though, by adjusting their file attributes
behaviour to be identical to ext234's.
Fixes #560.
---
src/tmpfiles/tmpfiles.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 42f757c..271984b 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -955,9 +955,10 @@ static int path_set_attribute(Item *item, const char *path) {
r = chattr_fd(fd, f, item->attribute_mask);
if (r < 0)
- return log_error_errno(r,
- "Cannot set file attribute for '%s', value=0x%08x, mask=0x%08x: %m",
- path, item->attribute_value, item->attribute_mask);
+ log_full_errno(r == -ENOTTY ? LOG_DEBUG : LOG_WARNING,
+ r,
+ "Cannot set file attribute for '%s', value=0x%08x, mask=0x%08x: %m",
+ path, item->attribute_value, item->attribute_mask);
return 0;
}
--
2.4.3

View File

@ -0,0 +1,58 @@
From 3838f0fac7c2ea7b778b70ce64d449f8b9d1667a Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 25 Jun 2015 16:44:22 +0200
Subject: [PATCH 02/47] install: make unit_file_get_list aware of
UNIT_FILE_INDIRECT
Commit aedd401 introduced new unit file state, UNIT_FILE_INDIRECT. Unit file is
said to have indirect state if it contains [Install] section which has only
Also= directive. Thus, if enable of such unit file is requested then some other
unit file gets enabled.
Whether or not unit file is in indirect state can be determined by calling
unit_file_can_install. Function unit_file_get_list populates list of unit files
present in given lookup location. So far it did call unit_file_can_install in a
way that would prevent finding out about unit files in indirect state. Such unit
file would be incorrectly marked as static.
Fixes following assertion in test-install,
Assertion 'p->state == s' failed at src/test/test-install.c:59, function main(). Aborting.
[1] 26868 abort (core dumped) ./test-install
---
src/shared/install.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/shared/install.c b/src/shared/install.c
index c37cf19..3d2b5ae 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -2190,6 +2190,7 @@ int unit_file_get_list(
_cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL;
struct dirent *de;
_cleanup_free_ char *path = NULL;
+ bool also = false;
errno = 0;
de = readdir(d);
@@ -2243,7 +2244,7 @@ int unit_file_get_list(
if (!path)
return -ENOMEM;
- r = unit_file_can_install(&paths, root_dir, path, true, NULL);
+ r = unit_file_can_install(&paths, root_dir, path, true, &also);
if (r == -EINVAL || /* Invalid setting? */
r == -EBADMSG || /* Invalid format? */
r == -ENOENT /* Included file not found? */)
@@ -2253,7 +2254,7 @@ int unit_file_get_list(
else if (r > 0)
f->state = UNIT_FILE_DISABLED;
else
- f->state = UNIT_FILE_STATIC;
+ f->state = also ? UNIT_FILE_INDIRECT : UNIT_FILE_STATIC;
found:
r = hashmap_put(h, basename(f->path), f);
--
2.5.0

View File

@ -0,0 +1,26 @@
From 67a3328fbdecd1d81431cc6380de5b3f2d628def Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 6 Aug 2015 23:47:46 -0400
Subject: [PATCH] load-fragment: fix segv on parse error
https://bugzilla.redhat.com/show_bug.cgi?id=1251334
---
src/core/load-fragment.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index ba73cc4..2991721 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1986,7 +1986,7 @@ int config_parse_environ(const char *unit,
return log_oom();
FOREACH_WORD_QUOTED(word, l, k, state) {
- _cleanup_free_ char *n;
+ _cleanup_free_ char *n = NULL;
char **x;
r = cunescape_length(word, l, 0, &n);
--
2.4.3

View File

@ -0,0 +1,28 @@
From ab050366e780ba7e2ecda2c60689f21d0aee3b9e Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 7 Jul 2015 17:21:03 -0400
Subject: [PATCH 03/47] journal-gatewayd: fix tmpfile logic
"rw" is not a valid mode string for f*open(). This got broken in
cc02a7b33049 ("journal-gatewayd: factor out opening of temp
file").
---
src/journal-remote/journal-gatewayd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index d9450ae..9a09f40 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -132,7 +132,7 @@ static int request_meta_ensure_tmp(RequestMeta *m) {
if (fd < 0)
return fd;
- m->tmp = fdopen(fd, "rw");
+ m->tmp = fdopen(fd, "w+");
if (!m->tmp) {
safe_close(fd);
return -errno;
--
2.5.0

View File

@ -0,0 +1,42 @@
From 388a91b06473b13a59ba217d23b26ca3dc0f2555 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 7 Aug 2015 00:06:15 -0400
Subject: [PATCH] man: clarify that unknown escapes must be escaped
https://bugzilla.redhat.com/show_bug.cgi?id=1251334
is about a unit file which has
Environment=TERM=linux PS1=system-upgrade:\w\$\x20
We used to allow that, but after recent tightening of parsing
rules, we barf. Make it clear that this is intentional.
---
man/systemd.service.xml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 4368ca8..7e96989 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -922,7 +922,10 @@
the arguments. Double quotes ("...") and single quotes ('...') may
be used, in which case everything until the next matching quote
becomes part of the same argument. C-style escapes are also
- supported, see table below. Quotes themselves are removed after
+ supported. The table below contains the list of allowed escape
+ patterns. Only patterns which match the syntax in the table are
+ allowed; others will result in an error, and must be escaped by
+ doubling the backslash. Quotes themselves are removed after
parsing and escape sequences substituted. In addition, a trailing
backslash (<literal>\</literal>) may be used to merge lines.
</para>
@@ -939,7 +942,7 @@
<literal>&amp;</literal>, and <emphasis>other elements of shell
syntax are not supported</emphasis>.</para>
- <para>The command to execute must an absolute path name. It may
+ <para>The command to execute must be an absolute path name. It may
contain spaces, but control characters are not allowed.</para>
<para>The command line accepts <literal>%</literal> specifiers as
--
2.4.3

View File

@ -0,0 +1,26 @@
From e53d6affb53497c39fb41d139ab00e1a27c65e4c Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Wed, 8 Jul 2015 13:52:48 +0200
Subject: [PATCH 04/47] resolved: fix marshalling of RRSIG records
The key tag is 16, not 8 bits.
---
src/resolve/resolved-dns-packet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index bb74b18..47cc975 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -691,7 +691,7 @@ int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, size_t *star
if (r < 0)
goto fail;
- r = dns_packet_append_uint8(p, rr->rrsig.key_tag, NULL);
+ r = dns_packet_append_uint16(p, rr->rrsig.key_tag, NULL);
if (r < 0)
goto fail;
--
2.5.0

View File

@ -0,0 +1,93 @@
From 53003ef7b748e005a01687337bb36763f60d4adc Mon Sep 17 00:00:00 2001
From: Thomas Blume <Thomas.Blume@suse.com>
Date: Mon, 29 Jun 2015 11:26:27 +0200
Subject: [PATCH 05/47] Reload manager defaults at daemon-reload
"systemctl daemon-reload" should also update the manager defaults from
/etc/systemd/system.conf.
For details, see:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033062.html
Amended to use manager_set_defaults() as common function.
---
src/core/main.c | 42 ++++++++++++++++++++++++++++--------------
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/core/main.c b/src/core/main.c
index 523f0ce..186cfdd 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -685,6 +685,26 @@ static int parse_config_file(void) {
return 0;
}
+static void manager_set_defaults(Manager *m) {
+
+ assert(m);
+
+ m->default_timer_accuracy_usec = arg_default_timer_accuracy_usec;
+ m->default_std_output = arg_default_std_output;
+ m->default_std_error = arg_default_std_error;
+ m->default_timeout_start_usec = arg_default_timeout_start_usec;
+ m->default_timeout_stop_usec = arg_default_timeout_stop_usec;
+ m->default_restart_usec = arg_default_restart_usec;
+ m->default_start_limit_interval = arg_default_start_limit_interval;
+ m->default_start_limit_burst = arg_default_start_limit_burst;
+ m->default_cpu_accounting = arg_default_cpu_accounting;
+ m->default_blockio_accounting = arg_default_blockio_accounting;
+ m->default_memory_accounting = arg_default_memory_accounting;
+
+ manager_set_default_rlimits(m, arg_default_rlimit);
+ manager_environment_add(m, NULL, arg_default_environment);
+}
+
static int parse_argv(int argc, char *argv[]) {
enum {
@@ -1630,28 +1650,15 @@ int main(int argc, char *argv[]) {
}
m->confirm_spawn = arg_confirm_spawn;
- m->default_timer_accuracy_usec = arg_default_timer_accuracy_usec;
- m->default_std_output = arg_default_std_output;
- m->default_std_error = arg_default_std_error;
- m->default_restart_usec = arg_default_restart_usec;
- m->default_timeout_start_usec = arg_default_timeout_start_usec;
- m->default_timeout_stop_usec = arg_default_timeout_stop_usec;
- m->default_start_limit_interval = arg_default_start_limit_interval;
- m->default_start_limit_burst = arg_default_start_limit_burst;
- m->default_cpu_accounting = arg_default_cpu_accounting;
- m->default_blockio_accounting = arg_default_blockio_accounting;
- m->default_memory_accounting = arg_default_memory_accounting;
m->runtime_watchdog = arg_runtime_watchdog;
m->shutdown_watchdog = arg_shutdown_watchdog;
-
m->userspace_timestamp = userspace_timestamp;
m->kernel_timestamp = kernel_timestamp;
m->initrd_timestamp = initrd_timestamp;
m->security_start_timestamp = security_start_timestamp;
m->security_finish_timestamp = security_finish_timestamp;
- manager_set_default_rlimits(m, arg_default_rlimit);
- manager_environment_add(m, NULL, arg_default_environment);
+ manager_set_defaults(m);
manager_set_show_status(m, arg_show_status);
manager_set_first_boot(m, empty_etc);
@@ -1763,6 +1770,13 @@ int main(int argc, char *argv[]) {
case MANAGER_RELOAD:
log_info("Reloading.");
+
+ r = parse_config_file();
+ if (r < 0)
+ log_error("Failed to parse config file.");
+
+ manager_set_defaults(m);
+
r = manager_reload(m);
if (r < 0)
log_error_errno(r, "Failed to reload: %m");
--
2.5.0

View File

@ -0,0 +1,24 @@
From f0bb84f7db0af57520521846ff782871fbbd6020 Mon Sep 17 00:00:00 2001
From: cee1 <fykcee1@gmail.com>
Date: Thu, 9 Jul 2015 13:52:16 +0800
Subject: [PATCH 06/47] basic/util.c fopen_temporary(): close fd if failed
---
src/basic/util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/basic/util.c b/src/basic/util.c
index aa912bd..100facb 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -2535,6 +2535,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
if (!f) {
unlink(t);
free(t);
+ safe_close(fd);
return -errno;
}
--
2.5.0

View File

@ -0,0 +1,38 @@
From 4ce4ea9a73c6118618c4dc7100523dab3bdc55d4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 9 Jul 2015 18:43:55 -0300
Subject: [PATCH 07/47] tmpfiles: don't recursively descend into journal
directories in /var
Do so only in /run. We shouldn't alter ACLs for existing files in /var,
but only for new files. If the admin made changes to the ACLs they
shouls stay in place.
We should still do recursive ACL changes for files in /run, since those
are not persistent, and will hence lack ACLs on every boot.
Also, /var/log/journal might be quit large, /run/log/journal is usually
not, hence we should avoid the recursive descending on /var, but not on
/run.
Fixes #534
---
tmpfiles.d/systemd.conf.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmpfiles.d/systemd.conf.m4 b/tmpfiles.d/systemd.conf.m4
index b447b01..d9d51af 100644
--- a/tmpfiles.d/systemd.conf.m4
+++ b/tmpfiles.d/systemd.conf.m4
@@ -35,7 +35,7 @@ z /var/log/journal 2755 root systemd-journal - -
z /var/log/journal/%m 2755 root systemd-journal - -
m4_ifdef(`HAVE_ACL',``
a+ /var/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
-A+ /var/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x
+a+ /var/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x
'')m4_dnl
d /var/lib/systemd 0755 root root -
--
2.5.0

View File

@ -0,0 +1,32 @@
From efe9f80f5e99abdddad320e8771da236eada169f Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 9 Jul 2015 16:25:00 +0200
Subject: [PATCH 08/47] units: emergency.service: wait for plymouth to shut
down
Merely calling "plymouth quit" isn't sufficient, as plymouth needs some time to
shut down. This needs plymouth --wait (which is a no-op when it's not running).
Fixes invisible emergency shell with plymouth running endlessly.
https://launchpad.net/bugs/1471258
---
units/emergency.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/emergency.service.in b/units/emergency.service.in
index 52b9b1c..8dc3cbd 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -16,7 +16,7 @@ Before=shutdown.target
[Service]
Environment=HOME=/root
WorkingDirectory=/root
-ExecStartPre=-/bin/plymouth quit
+ExecStartPre=-/bin/plymouth --wait quit
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
Type=idle
--
2.5.0

View File

@ -0,0 +1,26 @@
From d0bf853933a390b2152444a4d449442e696e5990 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vito.caputo@coreos.com>
Date: Fri, 10 Jul 2015 16:40:46 -0700
Subject: [PATCH 09/47] core: include unit in path state transition debug
logging.
---
src/core/path.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/path.c b/src/core/path.c
index 6d26d89..20995d9 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -426,7 +426,7 @@ static void path_set_state(Path *p, PathState state) {
path_unwatch(p);
if (state != old_state)
- log_debug("Changed %s -> %s", path_state_to_string(old_state), path_state_to_string(state));
+ log_unit_debug(UNIT(p), "Changed %s -> %s", path_state_to_string(old_state), path_state_to_string(state));
unit_notify(UNIT(p), state_translation_table[old_state], state_translation_table[state], true);
}
--
2.5.0

View File

@ -0,0 +1,25 @@
From 6e01dc69d385df006933c4023fae61536cd7793d Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 11 Jul 2015 14:19:36 -0300
Subject: [PATCH 10/47] util: make sure we don't clobber errno in error path
---
src/basic/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basic/util.c b/src/basic/util.c
index 100facb..dffb4a2 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -2533,7 +2533,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
f = fdopen(fd, "we");
if (!f) {
- unlink(t);
+ unlink_noerrno(t);
free(t);
safe_close(fd);
return -errno;
--
2.5.0

View File

@ -0,0 +1,28 @@
From 633a012f7db23425b55f2d4154a0a710b6079f9a Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Wed, 15 Jul 2015 11:58:03 +0200
Subject: [PATCH 11/47] sd-boot: ignore missing /etc/machine-id
If /etc/machine-id is missing (eg., gold images), we should not fail
installing sd-boot. This is a perfectly fine use-case and we should simply
skip installing the default loader config in that case.
---
src/boot/bootctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index ed69fb0..faab82d 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -888,7 +888,7 @@ static int install_loader_config(const char *esp_path) {
f = fopen("/etc/machine-id", "re");
if (!f)
- return -errno;
+ return errno == ENOENT ? 0 : -errno;
if (fgets(line, sizeof(line), f) != NULL) {
char *s;
--
2.5.0

View File

@ -0,0 +1,57 @@
From 6944177d055172a4590555375fa5015c92d6fa2a Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Thu, 23 Jul 2015 21:18:36 +0200
Subject: [PATCH 12/47] virt: handle Virtualbox 5.0 with kvm hypervisor
Virtualbox 5.0 now supports kvm hypervisor. In this case cpuid
identidies as "kvm", which breaks units depending on
ConditionVirtualization=oracle.
So return "oracle" even with kvm hypervisor.
---
src/basic/virt.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 1299a75..a8d2671 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -188,7 +188,7 @@ int detect_vm(const char **id) {
_cleanup_free_ char *domcap = NULL, *cpuinfo_contents = NULL;
static thread_local int cached_found = -1;
static thread_local const char *cached_id = NULL;
- const char *_id = NULL;
+ const char *_id = NULL, *_id_cpuid = NULL;
int r;
if (_likely_(cached_found >= 0)) {
@@ -234,10 +234,26 @@ int detect_vm(const char **id) {
/* this will set _id to "other" and return 0 for unknown hypervisors */
r = detect_vm_cpuid(&_id);
- if (r != 0)
+
+ /* finish when found a known hypervisor other than kvm */
+ if (r < 0 || (r > 0 && !streq(_id, "kvm")))
goto finish;
+ _id_cpuid = _id;
+
r = detect_vm_dmi(&_id);
+
+ /* kvm with and without Virtualbox */
+ if (streq_ptr(_id_cpuid, "kvm")) {
+ if (r > 0 && streq(_id, "oracle"))
+ goto finish;
+
+ _id = _id_cpuid;
+ r = 1;
+ goto finish;
+ }
+
+ /* information from dmi */
if (r != 0)
goto finish;
--
2.5.0

View File

@ -0,0 +1,43 @@
From 559f85ce2cb5bc2f92c9c231ab1703dde817313d Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 23 Jul 2015 21:41:22 +0200
Subject: [PATCH 13/47] copy: when we recursively copy a directory tree, copy
everything
Don't ignore hidden files and directories.
Fixes #386
---
src/basic/copy.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/basic/copy.c b/src/basic/copy.c
index 230e7e4..e2d356d 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -24,6 +24,7 @@
#include "util.h"
#include "btrfs-util.h"
+#include "strv.h"
#include "copy.h"
#define COPY_BUFFER_SIZE (16*1024)
@@ -262,10 +263,13 @@ static int fd_copy_directory(
(void) copy_xattr(dirfd(d), fdt);
}
- FOREACH_DIRENT(de, d, return -errno) {
+ FOREACH_DIRENT_ALL(de, d, return -errno) {
struct stat buf;
int q;
+ if (STR_IN_SET(de->d_name, ".", ".."))
+ continue;
+
if (fstatat(dirfd(d), de->d_name, &buf, AT_SYMLINK_NOFOLLOW) < 0) {
r = -errno;
continue;
--
2.5.0

View File

@ -0,0 +1,40 @@
From fd17710ad438a0d6228e807936119ed451eb843a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 23 Jul 2015 23:36:34 +0200
Subject: [PATCH 14/47] fileio: get_status_field() don't clobber arg on OOM
According to our coding style guidelines we shouldn't clobber
pass-by-ref arguments on failure, hence don't do so here either.
---
src/basic/fileio.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index 00fb6f8..eb6f3ce 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -786,7 +786,7 @@ int executable_is_script(const char *path, char **interpreter) {
*/
int get_status_field(const char *filename, const char *pattern, char **field) {
_cleanup_free_ char *status = NULL;
- char *t;
+ char *t, *f;
size_t len;
int r;
@@ -820,9 +820,10 @@ int get_status_field(const char *filename, const char *pattern, char **field) {
len = strcspn(t, WHITESPACE);
- *field = strndup(t, len);
- if (!*field)
+ f = strndup(t, len);
+ if (!f)
return -ENOMEM;
+ *field = f;
return 0;
}
--
2.5.0

View File

@ -0,0 +1,63 @@
From 357546b20df2ec0414d2ed048555ba4269859cc0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 01:40:44 +0200
Subject: [PATCH 15/47] journal-verify: don't hit SIGFPE when determining
progress
If we determine the progress based on a number of objects available,
don't blindly devide by the number of objects, given that it might be 0.
---
src/journal/journal-verify.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index ce734d8..cf5be1f 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -69,6 +69,16 @@ static void draw_progress(uint64_t p, usec_t *last_usec) {
fflush(stdout);
}
+static uint64_t scale_progress(uint64_t scale, uint64_t p, uint64_t m) {
+
+ /* Calculates scale * p / m, but handles m == 0 safely, and saturates */
+
+ if (p >= m || m == 0)
+ return scale;
+
+ return scale * p / m;
+}
+
static void flush_progress(void) {
unsigned n, i;
@@ -584,7 +594,7 @@ static int verify_hash_table(
uint64_t last = 0, p;
if (show_progress)
- draw_progress(0xC000 + (0x3FFF * i / n), last_usec);
+ draw_progress(0xC000 + scale_progress(0x3FFF, i, n), last_usec);
p = le64toh(f->data_hash_table[i].head_hash_offset);
while (p != 0) {
@@ -726,7 +736,7 @@ static int verify_entry_array(
Object *o;
if (show_progress)
- draw_progress(0x8000 + (0x3FFF * i / n), last_usec);
+ draw_progress(0x8000 + scale_progress(0x3FFF, i, n), last_usec);
if (a == 0) {
error(a, "array chain too short at %"PRIu64" of %"PRIu64, i, n);
@@ -863,7 +873,7 @@ int journal_file_verify(
p = le64toh(f->header->header_size);
while (p != 0) {
if (show_progress)
- draw_progress(0x7FFF * p / le64toh(f->header->tail_object_offset), &last_usec);
+ draw_progress(scale_progress(0x7FFF, p, le64toh(f->header->tail_object_offset)), &last_usec);
r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o);
if (r < 0) {
--
2.5.0

View File

@ -0,0 +1,162 @@
From ba94d686b53cdd4e47627006fc0cb640462571ad Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 01:55:45 +0200
Subject: [PATCH 16/47] journal: avoid mapping empty data and field hash tables
When a new journal file is created we write the header first, then sync
and only then create the data and field hash tables in them. That means
to other processes it might appear that the files have a valid header
but not data and field hash tables. Our reader code should be able to
deal with this.
With this change we'll not map the two hash tables right-away after
opening a file for reading anymore (because that will of course fail if
the objects are missing), but delay this until the first time we access
them. On top of that, when we want to look something up in the hash
tables and we notice they aren't initialized yet, we consider them
empty.
This improves handling of some journal files reported in #487.
---
src/journal/journal-file.c | 37 ++++++++++++++++++++++++++-----------
src/journal/journal-file.h | 3 +++
src/journal/journal-verify.c | 14 ++++++++++++++
3 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index be6a552..f7815b2 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -656,13 +656,16 @@ static int journal_file_setup_field_hash_table(JournalFile *f) {
return 0;
}
-static int journal_file_map_data_hash_table(JournalFile *f) {
+int journal_file_map_data_hash_table(JournalFile *f) {
uint64_t s, p;
void *t;
int r;
assert(f);
+ if (f->data_hash_table)
+ return 0;
+
p = le64toh(f->header->data_hash_table_offset);
s = le64toh(f->header->data_hash_table_size);
@@ -678,13 +681,16 @@ static int journal_file_map_data_hash_table(JournalFile *f) {
return 0;
}
-static int journal_file_map_field_hash_table(JournalFile *f) {
+int journal_file_map_field_hash_table(JournalFile *f) {
uint64_t s, p;
void *t;
int r;
assert(f);
+ if (f->field_hash_table)
+ return 0;
+
p = le64toh(f->header->field_hash_table_offset);
s = le64toh(f->header->field_hash_table_size);
@@ -803,10 +809,18 @@ int journal_file_find_field_object_with_hash(
assert(f);
assert(field && size > 0);
+ /* If the field hash table is empty, we can't find anything */
+ if (le64toh(f->header->field_hash_table_size) <= 0)
+ return 0;
+
+ /* Map the field hash table, if it isn't mapped yet. */
+ r = journal_file_map_field_hash_table(f);
+ if (r < 0)
+ return r;
+
osize = offsetof(Object, field.payload) + size;
m = le64toh(f->header->field_hash_table_size) / sizeof(HashItem);
-
if (m <= 0)
return -EBADMSG;
@@ -866,6 +880,15 @@ int journal_file_find_data_object_with_hash(
assert(f);
assert(data || size == 0);
+ /* If there's no data hash table, then there's no entry. */
+ if (le64toh(f->header->data_hash_table_size) <= 0)
+ return 0;
+
+ /* Map the data hash table, if it isn't mapped yet. */
+ r = journal_file_map_data_hash_table(f);
+ if (r < 0)
+ return r;
+
osize = offsetof(Object, data.payload) + size;
m = le64toh(f->header->data_hash_table_size) / sizeof(HashItem);
@@ -2731,14 +2754,6 @@ int journal_file_open(
#endif
}
- r = journal_file_map_field_hash_table(f);
- if (r < 0)
- goto fail;
-
- r = journal_file_map_data_hash_table(f);
- if (r < 0)
- goto fail;
-
if (mmap_cache_got_sigbus(f->mmap, f->fd)) {
r = -EIO;
goto fail;
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 403c8f7..e92b75e 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -229,3 +229,6 @@ int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, usec_t *
int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to);
bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec);
+
+int journal_file_map_data_hash_table(JournalFile *f);
+int journal_file_map_field_hash_table(JournalFile *f);
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index cf5be1f..7d68149 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -590,6 +590,13 @@ static int verify_hash_table(
assert(last_usec);
n = le64toh(f->header->data_hash_table_size) / sizeof(HashItem);
+ if (n <= 0)
+ return 0;
+
+ r = journal_file_map_data_hash_table(f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to map data hash table: %m");
+
for (i = 0; i < n; i++) {
uint64_t last = 0, p;
@@ -647,6 +654,13 @@ static int data_object_in_hash_table(JournalFile *f, uint64_t hash, uint64_t p)
assert(f);
n = le64toh(f->header->data_hash_table_size) / sizeof(HashItem);
+ if (n <= 0)
+ return 0;
+
+ r = journal_file_map_data_hash_table(f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to map data hash table: %m");
+
h = hash % n;
q = le64toh(f->data_hash_table[h].head_hash_offset);
--
2.5.0

View File

@ -0,0 +1,84 @@
From 7a7ce2cf1989d2f3ac28f2cf911862daacce18a1 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 02:00:43 +0200
Subject: [PATCH 17/47] journal: when verifying journal files, handle empty
ones nicely
A journal file that carries no objects should be considered valid.
---
src/journal/journal-verify.c | 37 ++++++++++++++-----------------------
1 file changed, 14 insertions(+), 23 deletions(-)
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 7d68149..637162e 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -885,7 +885,11 @@ int journal_file_verify(
* superficial structure, headers, hashes. */
p = le64toh(f->header->header_size);
- while (p != 0) {
+ for (;;) {
+ /* Early exit if there are no objects in the file, at all */
+ if (le64toh(f->header->tail_object_offset) == 0)
+ break;
+
if (show_progress)
draw_progress(scale_progress(0x7FFF, p, le64toh(f->header->tail_object_offset)), &last_usec);
@@ -901,9 +905,6 @@ int journal_file_verify(
goto fail;
}
- if (p == le64toh(f->header->tail_object_offset))
- found_last = true;
-
n_objects ++;
r = journal_file_object_verify(f, p, o);
@@ -1148,13 +1149,15 @@ int journal_file_verify(
n_weird ++;
}
- if (p == le64toh(f->header->tail_object_offset))
- p = 0;
- else
- p = p + ALIGN64(le64toh(o->object.size));
- }
+ if (p == le64toh(f->header->tail_object_offset)) {
+ found_last = true;
+ break;
+ }
- if (!found_last) {
+ p = p + ALIGN64(le64toh(o->object.size));
+ };
+
+ if (!found_last && le64toh(f->header->tail_object_offset) != 0) {
error(le64toh(f->header->tail_object_offset), "tail object pointer dead");
r = -EBADMSG;
goto fail;
@@ -1200,19 +1203,7 @@ int journal_file_verify(
goto fail;
}
- if (n_data_hash_tables != 1) {
- error(0, "missing data hash table");
- r = -EBADMSG;
- goto fail;
- }
-
- if (n_field_hash_tables != 1) {
- error(0, "missing field hash table");
- r = -EBADMSG;
- goto fail;
- }
-
- if (!found_main_entry_array) {
+ if (!found_main_entry_array && le64toh(f->header->entry_array_offset) != 0) {
error(0, "missing entry array");
r = -EBADMSG;
goto fail;
--
2.5.0

View File

@ -0,0 +1,31 @@
From e9fc552926b1c663653b81a7d09645e27f425db8 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 02:02:07 +0200
Subject: [PATCH 18/47] journal: explain the error when we find a non-DATA
object that is compressed
Only objects of type DATA may be compressed, generate a message about
that, like we do for all other errros.
---
src/journal/journal-verify.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 637162e..0a8f30c 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -123,8 +123,10 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
* other objects. */
if ((o->object.flags & OBJECT_COMPRESSED_XZ) &&
- o->object.type != OBJECT_DATA)
+ o->object.type != OBJECT_DATA) {
+ error(offset, "Found compressed object that isn't of type DATA, which is not allowed.");
return -EBADMSG;
+ }
switch (o->object.type) {
--
2.5.0

View File

@ -0,0 +1,643 @@
From 203084042c51f91f170625911b83c9908ff7eeaf Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 02:18:13 +0200
Subject: [PATCH 19/47] journal: uppercase first character in verify error
messages
In the english language the first character of a sentence is supposed to
be uppercase. Let's make sure this also applies to the journal
verification error messages.
---
src/journal/journal-verify.c | 162 ++++++++++++++++++++-----------------------
1 file changed, 75 insertions(+), 87 deletions(-)
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 0a8f30c..eaf006d 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -135,15 +135,15 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
int compression, r;
if (le64toh(o->data.entry_offset) == 0)
- warning(offset, "unused data (entry_offset==0)");
+ warning(offset, "Unused data (entry_offset==0)");
if ((le64toh(o->data.entry_offset) == 0) ^ (le64toh(o->data.n_entries) == 0)) {
- error(offset, "bad n_entries: %"PRIu64, o->data.n_entries);
+ error(offset, "Bad n_entries: %"PRIu64, o->data.n_entries);
return -EBADMSG;
}
if (le64toh(o->object.size) - offsetof(DataObject, payload) <= 0) {
- error(offset, "bad object size (<= %zu): %"PRIu64,
+ error(offset, "Bad object size (<= %zu): %"PRIu64,
offsetof(DataObject, payload),
le64toh(o->object.size));
return -EBADMSG;
@@ -171,7 +171,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
h2 = hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload));
if (h1 != h2) {
- error(offset, "invalid hash (%08"PRIx64" vs. %08"PRIx64, h1, h2);
+ error(offset, "Invalid hash (%08"PRIx64" vs. %08"PRIx64, h1, h2);
return -EBADMSG;
}
@@ -179,7 +179,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
!VALID64(o->data.next_field_offset) ||
!VALID64(o->data.entry_offset) ||
!VALID64(o->data.entry_array_offset)) {
- error(offset, "invalid offset (next_hash_offset="OFSfmt", next_field_offset="OFSfmt", entry_offset="OFSfmt", entry_array_offset="OFSfmt,
+ error(offset, "Invalid offset (next_hash_offset="OFSfmt", next_field_offset="OFSfmt", entry_offset="OFSfmt", entry_array_offset="OFSfmt,
o->data.next_hash_offset,
o->data.next_field_offset,
o->data.entry_offset,
@@ -193,7 +193,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
case OBJECT_FIELD:
if (le64toh(o->object.size) - offsetof(FieldObject, payload) <= 0) {
error(offset,
- "bad field size (<= %zu): %"PRIu64,
+ "Bad field size (<= %zu): %"PRIu64,
offsetof(FieldObject, payload),
le64toh(o->object.size));
return -EBADMSG;
@@ -202,7 +202,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if (!VALID64(o->field.next_hash_offset) ||
!VALID64(o->field.head_data_offset)) {
error(offset,
- "invalid offset (next_hash_offset="OFSfmt", head_data_offset="OFSfmt,
+ "Invalid offset (next_hash_offset="OFSfmt", head_data_offset="OFSfmt,
o->field.next_hash_offset,
o->field.head_data_offset);
return -EBADMSG;
@@ -212,7 +212,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
case OBJECT_ENTRY:
if ((le64toh(o->object.size) - offsetof(EntryObject, items)) % sizeof(EntryItem) != 0) {
error(offset,
- "bad entry size (<= %zu): %"PRIu64,
+ "Bad entry size (<= %zu): %"PRIu64,
offsetof(EntryObject, items),
le64toh(o->object.size));
return -EBADMSG;
@@ -220,28 +220,28 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if ((le64toh(o->object.size) - offsetof(EntryObject, items)) / sizeof(EntryItem) <= 0) {
error(offset,
- "invalid number items in entry: %"PRIu64,
+ "Invalid number items in entry: %"PRIu64,
(le64toh(o->object.size) - offsetof(EntryObject, items)) / sizeof(EntryItem));
return -EBADMSG;
}
if (le64toh(o->entry.seqnum) <= 0) {
error(offset,
- "invalid entry seqnum: %"PRIx64,
+ "Invalid entry seqnum: %"PRIx64,
le64toh(o->entry.seqnum));
return -EBADMSG;
}
if (!VALID_REALTIME(le64toh(o->entry.realtime))) {
error(offset,
- "invalid entry realtime timestamp: %"PRIu64,
+ "Invalid entry realtime timestamp: %"PRIu64,
le64toh(o->entry.realtime));
return -EBADMSG;
}
if (!VALID_MONOTONIC(le64toh(o->entry.monotonic))) {
error(offset,
- "invalid entry monotonic timestamp: %"PRIu64,
+ "Invalid entry monotonic timestamp: %"PRIu64,
le64toh(o->entry.monotonic));
return -EBADMSG;
}
@@ -250,7 +250,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if (o->entry.items[i].object_offset == 0 ||
!VALID64(o->entry.items[i].object_offset)) {
error(offset,
- "invalid entry item (%"PRIu64"/%"PRIu64" offset: "OFSfmt,
+ "Invalid entry item (%"PRIu64"/%"PRIu64" offset: "OFSfmt,
i, journal_file_entry_n_items(o),
o->entry.items[i].object_offset);
return -EBADMSG;
@@ -264,7 +264,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if ((le64toh(o->object.size) - offsetof(HashTableObject, items)) % sizeof(HashItem) != 0 ||
(le64toh(o->object.size) - offsetof(HashTableObject, items)) / sizeof(HashItem) <= 0) {
error(offset,
- "invalid %s hash table size: %"PRIu64,
+ "Invalid %s hash table size: %"PRIu64,
o->object.type == OBJECT_DATA_HASH_TABLE ? "data" : "field",
le64toh(o->object.size));
return -EBADMSG;
@@ -274,7 +274,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if (o->hash_table.items[i].head_hash_offset != 0 &&
!VALID64(le64toh(o->hash_table.items[i].head_hash_offset))) {
error(offset,
- "invalid %s hash table item (%"PRIu64"/%"PRIu64") head_hash_offset: "OFSfmt,
+ "Invalid %s hash table item (%"PRIu64"/%"PRIu64") head_hash_offset: "OFSfmt,
o->object.type == OBJECT_DATA_HASH_TABLE ? "data" : "field",
i, journal_file_hash_table_n_items(o),
le64toh(o->hash_table.items[i].head_hash_offset));
@@ -283,7 +283,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if (o->hash_table.items[i].tail_hash_offset != 0 &&
!VALID64(le64toh(o->hash_table.items[i].tail_hash_offset))) {
error(offset,
- "invalid %s hash table item (%"PRIu64"/%"PRIu64") tail_hash_offset: "OFSfmt,
+ "Invalid %s hash table item (%"PRIu64"/%"PRIu64") tail_hash_offset: "OFSfmt,
o->object.type == OBJECT_DATA_HASH_TABLE ? "data" : "field",
i, journal_file_hash_table_n_items(o),
le64toh(o->hash_table.items[i].tail_hash_offset));
@@ -293,7 +293,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if ((o->hash_table.items[i].head_hash_offset != 0) !=
(o->hash_table.items[i].tail_hash_offset != 0)) {
error(offset,
- "invalid %s hash table item (%"PRIu64"/%"PRIu64"): head_hash_offset="OFSfmt" tail_hash_offset="OFSfmt,
+ "Invalid %s hash table item (%"PRIu64"/%"PRIu64"): head_hash_offset="OFSfmt" tail_hash_offset="OFSfmt,
o->object.type == OBJECT_DATA_HASH_TABLE ? "data" : "field",
i, journal_file_hash_table_n_items(o),
le64toh(o->hash_table.items[i].head_hash_offset),
@@ -308,14 +308,14 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if ((le64toh(o->object.size) - offsetof(EntryArrayObject, items)) % sizeof(le64_t) != 0 ||
(le64toh(o->object.size) - offsetof(EntryArrayObject, items)) / sizeof(le64_t) <= 0) {
error(offset,
- "invalid object entry array size: %"PRIu64,
+ "Invalid object entry array size: %"PRIu64,
le64toh(o->object.size));
return -EBADMSG;
}
if (!VALID64(o->entry_array.next_entry_array_offset)) {
error(offset,
- "invalid object entry array next_entry_array_offset: "OFSfmt,
+ "Invalid object entry array next_entry_array_offset: "OFSfmt,
o->entry_array.next_entry_array_offset);
return -EBADMSG;
}
@@ -324,7 +324,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
if (le64toh(o->entry_array.items[i]) != 0 &&
!VALID64(le64toh(o->entry_array.items[i]))) {
error(offset,
- "invalid object entry array item (%"PRIu64"/%"PRIu64"): "OFSfmt,
+ "Invalid object entry array item (%"PRIu64"/%"PRIu64"): "OFSfmt,
i, journal_file_entry_array_n_items(o),
le64toh(o->entry_array.items[i]));
return -EBADMSG;
@@ -335,14 +335,14 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
case OBJECT_TAG:
if (le64toh(o->object.size) != sizeof(TagObject)) {
error(offset,
- "invalid object tag size: %"PRIu64,
+ "Invalid object tag size: %"PRIu64,
le64toh(o->object.size));
return -EBADMSG;
}
if (!VALID_EPOCH(o->tag.epoch)) {
error(offset,
- "invalid object tag epoch: %"PRIu64,
+ "Invalid object tag epoch: %"PRIu64,
o->tag.epoch);
return -EBADMSG;
}
@@ -415,8 +415,7 @@ static int entry_points_to_data(
assert(entry_fd >= 0);
if (!contains_uint64(f->mmap, entry_fd, n_entries, entry_p)) {
- error(data_p,
- "data object references invalid entry at "OFSfmt, entry_p);
+ error(data_p, "Data object references invalid entry at "OFSfmt, entry_p);
return -EBADMSG;
}
@@ -432,8 +431,7 @@ static int entry_points_to_data(
}
if (!found) {
- error(entry_p,
- "data object at "OFSfmt" not referenced by linked entry", data_p);
+ error(entry_p, "Data object at "OFSfmt" not referenced by linked entry", data_p);
return -EBADMSG;
}
@@ -476,7 +474,7 @@ static int entry_points_to_data(
x = z;
}
- error(entry_p, "entry object doesn't exist in main entry array");
+ error(entry_p, "Entry object doesn't exist in main entry array");
return -EBADMSG;
}
@@ -506,9 +504,7 @@ static int verify_data(
/* Entry array means at least two objects */
if (a && n < 2) {
- error(p,
- "entry array present (entry_array_offset="OFSfmt", but n_entries=%"PRIu64")",
- a, n);
+ error(p, "Entry array present (entry_array_offset="OFSfmt", but n_entries=%"PRIu64")", a, n);
return -EBADMSG;
}
@@ -528,12 +524,12 @@ static int verify_data(
uint64_t next, m, j;
if (a == 0) {
- error(p, "array chain too short");
+ error(p, "Array chain too short");
return -EBADMSG;
}
if (!contains_uint64(f->mmap, entry_array_fd, n_entry_arrays, a)) {
- error(p, "invalid array offset "OFSfmt, a);
+ error(p, "Invalid array offset "OFSfmt, a);
return -EBADMSG;
}
@@ -543,8 +539,7 @@ static int verify_data(
next = le64toh(o->entry_array.next_entry_array_offset);
if (next != 0 && next <= a) {
- error(p, "array chain has cycle (jumps back from "OFSfmt" to "OFSfmt")",
- a, next);
+ error(p, "Array chain has cycle (jumps back from "OFSfmt" to "OFSfmt")", a, next);
return -EBADMSG;
}
@@ -553,7 +548,7 @@ static int verify_data(
q = le64toh(o->entry_array.items[j]);
if (q <= last) {
- error(p, "data object's entry array not sorted");
+ error(p, "Data object's entry array not sorted");
return -EBADMSG;
}
last = q;
@@ -611,8 +606,7 @@ static int verify_hash_table(
uint64_t next;
if (!contains_uint64(f->mmap, data_fd, n_data, p)) {
- error(p, "invalid data object at hash entry %"PRIu64" of %"PRIu64,
- i, n);
+ error(p, "Invalid data object at hash entry %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
@@ -622,14 +616,12 @@ static int verify_hash_table(
next = le64toh(o->data.next_hash_offset);
if (next != 0 && next <= p) {
- error(p, "hash chain has a cycle in hash entry %"PRIu64" of %"PRIu64,
- i, n);
+ error(p, "Hash chain has a cycle in hash entry %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
if (le64toh(o->data.hash) % n != i) {
- error(p, "hash value mismatch in hash entry %"PRIu64" of %"PRIu64,
- i, n);
+ error(p, "Hash value mismatch in hash entry %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
@@ -642,7 +634,7 @@ static int verify_hash_table(
}
if (last != le64toh(f->data_hash_table[i].tail_hash_offset)) {
- error(p, "tail hash pointer mismatch in hash table");
+ error(p, "Tail hash pointer mismatch in hash table");
return -EBADMSG;
}
}
@@ -703,16 +695,16 @@ static int verify_entry(
h = le64toh(o->entry.items[i].hash);
if (!contains_uint64(f->mmap, data_fd, n_data, q)) {
- error(p, "invalid data object of entry");
- return -EBADMSG;
- }
+ error(p, "Invalid data object of entry");
+ return -EBADMSG;
+ }
r = journal_file_move_to_object(f, OBJECT_DATA, q, &u);
if (r < 0)
return r;
if (le64toh(u->data.hash) != h) {
- error(p, "hash mismatch for data object of entry");
+ error(p, "Hash mismatch for data object of entry");
return -EBADMSG;
}
@@ -720,7 +712,7 @@ static int verify_entry(
if (r < 0)
return r;
if (r == 0) {
- error(p, "data object missing from hash table");
+ error(p, "Data object missing from hash table");
return -EBADMSG;
}
}
@@ -755,12 +747,12 @@ static int verify_entry_array(
draw_progress(0x8000 + scale_progress(0x3FFF, i, n), last_usec);
if (a == 0) {
- error(a, "array chain too short at %"PRIu64" of %"PRIu64, i, n);
+ error(a, "Array chain too short at %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
if (!contains_uint64(f->mmap, entry_array_fd, n_entry_arrays, a)) {
- error(a, "invalid array %"PRIu64" of %"PRIu64, i, n);
+ error(a, "Invalid array %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
@@ -770,9 +762,7 @@ static int verify_entry_array(
next = le64toh(o->entry_array.next_entry_array_offset);
if (next != 0 && next <= a) {
- error(a,
- "array chain has cycle at %"PRIu64" of %"PRIu64" (jumps back from to "OFSfmt")",
- i, n, next);
+ error(a, "Array chain has cycle at %"PRIu64" of %"PRIu64" (jumps back from to "OFSfmt")", i, n, next);
return -EBADMSG;
}
@@ -782,15 +772,13 @@ static int verify_entry_array(
p = le64toh(o->entry_array.items[j]);
if (p <= last) {
- error(a, "entry array not sorted at %"PRIu64" of %"PRIu64,
- i, n);
+ error(a, "Entry array not sorted at %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
last = p;
if (!contains_uint64(f->mmap, entry_fd, n_entries, p)) {
- error(a, "invalid array entry at %"PRIu64" of %"PRIu64,
- i, n);
+ error(a, "Invalid array entry at %"PRIu64" of %"PRIu64, i, n);
return -EBADMSG;
}
@@ -878,7 +866,7 @@ int journal_file_verify(
for (i = 0; i < sizeof(f->header->reserved); i++)
if (f->header->reserved[i] != 0) {
- error(offsetof(Header, reserved[i]), "reserved field is non-zero");
+ error(offsetof(Header, reserved[i]), "Reserved field is non-zero");
r = -EBADMSG;
goto fail;
}
@@ -897,12 +885,12 @@ int journal_file_verify(
r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o);
if (r < 0) {
- error(p, "invalid object");
+ error(p, "Invalid object");
goto fail;
}
if (p > le64toh(f->header->tail_object_offset)) {
- error(offsetof(Header, tail_object_offset), "invalid tail object pointer");
+ error(offsetof(Header, tail_object_offset), "Invalid tail object pointer");
r = -EBADMSG;
goto fail;
}
@@ -911,13 +899,13 @@ int journal_file_verify(
r = journal_file_object_verify(f, p, o);
if (r < 0) {
- error(p, "invalid object contents: %s", strerror(-r));
+ error(p, "Envalid object contents: %s", strerror(-r));
goto fail;
}
if ((o->object.flags & OBJECT_COMPRESSED_XZ) &&
(o->object.flags & OBJECT_COMPRESSED_LZ4)) {
- error(p, "objected with double compression");
+ error(p, "Objected with double compression");
r = -EINVAL;
goto fail;
}
@@ -950,7 +938,7 @@ int journal_file_verify(
case OBJECT_ENTRY:
if (JOURNAL_HEADER_SEALED(f->header) && n_tags <= 0) {
- error(p, "first entry before first tag");
+ error(p, "First entry before first tag");
r = -EBADMSG;
goto fail;
}
@@ -960,21 +948,21 @@ int journal_file_verify(
goto fail;
if (le64toh(o->entry.realtime) < last_tag_realtime) {
- error(p, "older entry after newer tag");
+ error(p, "Older entry after newer tag");
r = -EBADMSG;
goto fail;
}
if (!entry_seqnum_set &&
le64toh(o->entry.seqnum) != le64toh(f->header->head_entry_seqnum)) {
- error(p, "head entry sequence number incorrect");
+ error(p, "Head entry sequence number incorrect");
r = -EBADMSG;
goto fail;
}
if (entry_seqnum_set &&
entry_seqnum >= le64toh(o->entry.seqnum)) {
- error(p, "entry sequence number out of synchronization");
+ error(p, "Entry sequence number out of synchronization");
r = -EBADMSG;
goto fail;
}
@@ -985,7 +973,7 @@ int journal_file_verify(
if (entry_monotonic_set &&
sd_id128_equal(entry_boot_id, o->entry.boot_id) &&
entry_monotonic > le64toh(o->entry.monotonic)) {
- error(p, "entry timestamp out of synchronization");
+ error(p, "Entry timestamp out of synchronization");
r = -EBADMSG;
goto fail;
}
@@ -996,7 +984,7 @@ int journal_file_verify(
if (!entry_realtime_set &&
le64toh(o->entry.realtime) != le64toh(f->header->head_entry_realtime)) {
- error(p, "head entry realtime timestamp incorrect");
+ error(p, "Head entry realtime timestamp incorrect");
r = -EBADMSG;
goto fail;
}
@@ -1009,7 +997,7 @@ int journal_file_verify(
case OBJECT_DATA_HASH_TABLE:
if (n_data_hash_tables > 1) {
- error(p, "more than one data hash table");
+ error(p, "More than one data hash table");
r = -EBADMSG;
goto fail;
}
@@ -1026,14 +1014,14 @@ int journal_file_verify(
case OBJECT_FIELD_HASH_TABLE:
if (n_field_hash_tables > 1) {
- error(p, "more than one field hash table");
+ error(p, "More than one field hash table");
r = -EBADMSG;
goto fail;
}
if (le64toh(f->header->field_hash_table_offset) != p + offsetof(HashTableObject, items) ||
le64toh(f->header->field_hash_table_size) != le64toh(o->object.size) - offsetof(HashTableObject, items)) {
- error(p, "header fields for field hash table invalid");
+ error(p, "Header fields for field hash table invalid");
r = -EBADMSG;
goto fail;
}
@@ -1048,7 +1036,7 @@ int journal_file_verify(
if (p == le64toh(f->header->entry_array_offset)) {
if (found_main_entry_array) {
- error(p, "more than one main entry array");
+ error(p, "More than one main entry array");
r = -EBADMSG;
goto fail;
}
@@ -1061,19 +1049,19 @@ int journal_file_verify(
case OBJECT_TAG:
if (!JOURNAL_HEADER_SEALED(f->header)) {
- error(p, "tag object in file without sealing");
+ error(p, "Tag object in file without sealing");
r = -EBADMSG;
goto fail;
}
if (le64toh(o->tag.seqnum) != n_tags + 1) {
- error(p, "tag sequence number out of synchronization");
+ error(p, "Tag sequence number out of synchronization");
r = -EBADMSG;
goto fail;
}
if (le64toh(o->tag.epoch) < last_epoch) {
- error(p, "epoch sequence out of synchronization");
+ error(p, "Epoch sequence out of synchronization");
r = -EBADMSG;
goto fail;
}
@@ -1082,7 +1070,7 @@ int journal_file_verify(
if (f->seal) {
uint64_t q, rt;
- debug(p, "checking tag %"PRIu64"...", le64toh(o->tag.seqnum));
+ debug(p, "Checking tag %"PRIu64"...", le64toh(o->tag.seqnum));
rt = f->fss_start_usec + o->tag.epoch * f->fss_interval_usec;
if (entry_realtime_set && entry_realtime >= rt + f->fss_interval_usec) {
@@ -1129,7 +1117,7 @@ int journal_file_verify(
goto fail;
if (memcmp(o->tag.tag, gcry_md_read(f->hmac, 0), TAG_LENGTH) != 0) {
- error(p, "tag failed verification");
+ error(p, "Tag failed verification");
r = -EBADMSG;
goto fail;
}
@@ -1160,60 +1148,60 @@ int journal_file_verify(
};
if (!found_last && le64toh(f->header->tail_object_offset) != 0) {
- error(le64toh(f->header->tail_object_offset), "tail object pointer dead");
+ error(le64toh(f->header->tail_object_offset), "Tail object pointer dead");
r = -EBADMSG;
goto fail;
}
if (n_objects != le64toh(f->header->n_objects)) {
- error(offsetof(Header, n_objects), "object number mismatch");
+ error(offsetof(Header, n_objects), "Object number mismatch");
r = -EBADMSG;
goto fail;
}
if (n_entries != le64toh(f->header->n_entries)) {
- error(offsetof(Header, n_entries), "entry number mismatch");
+ error(offsetof(Header, n_entries), "Entry number mismatch");
r = -EBADMSG;
goto fail;
}
if (JOURNAL_HEADER_CONTAINS(f->header, n_data) &&
n_data != le64toh(f->header->n_data)) {
- error(offsetof(Header, n_data), "data number mismatch");
+ error(offsetof(Header, n_data), "Data number mismatch");
r = -EBADMSG;
goto fail;
}
if (JOURNAL_HEADER_CONTAINS(f->header, n_fields) &&
n_fields != le64toh(f->header->n_fields)) {
- error(offsetof(Header, n_fields), "field number mismatch");
+ error(offsetof(Header, n_fields), "Field number mismatch");
r = -EBADMSG;
goto fail;
}
if (JOURNAL_HEADER_CONTAINS(f->header, n_tags) &&
n_tags != le64toh(f->header->n_tags)) {
- error(offsetof(Header, n_tags), "tag number mismatch");
+ error(offsetof(Header, n_tags), "Tag number mismatch");
r = -EBADMSG;
goto fail;
}
if (JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays) &&
n_entry_arrays != le64toh(f->header->n_entry_arrays)) {
- error(offsetof(Header, n_entry_arrays), "entry array number mismatch");
+ error(offsetof(Header, n_entry_arrays), "Entry array number mismatch");
r = -EBADMSG;
goto fail;
}
if (!found_main_entry_array && le64toh(f->header->entry_array_offset) != 0) {
- error(0, "missing entry array");
+ error(0, "Missing entry array");
r = -EBADMSG;
goto fail;
}
if (entry_seqnum_set &&
entry_seqnum != le64toh(f->header->tail_entry_seqnum)) {
- error(offsetof(Header, tail_entry_seqnum), "invalid tail seqnum");
+ error(offsetof(Header, tail_entry_seqnum), "Invalid tail seqnum");
r = -EBADMSG;
goto fail;
}
@@ -1221,13 +1209,13 @@ int journal_file_verify(
if (entry_monotonic_set &&
(!sd_id128_equal(entry_boot_id, f->header->boot_id) ||
entry_monotonic != le64toh(f->header->tail_entry_monotonic))) {
- error(0, "invalid tail monotonic timestamp");
+ error(0, "Invalid tail monotonic timestamp");
r = -EBADMSG;
goto fail;
}
if (entry_realtime_set && entry_realtime != le64toh(f->header->tail_entry_realtime)) {
- error(0, "invalid tail realtime timestamp");
+ error(0, "Invalid tail realtime timestamp");
r = -EBADMSG;
goto fail;
}
--
2.5.0

View File

@ -0,0 +1,25 @@
From 0e19c2116c7bdd2f2dddc1dd2cdf9a4c350665c7 Mon Sep 17 00:00:00 2001
From: Lidong Zhong <lzhong@suse.com>
Date: Fri, 24 Jul 2015 16:37:17 +0800
Subject: [PATCH 20/47] udev: fix parameter process
---
src/udev/udevd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index e27fb1f..0553f20 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1432,7 +1432,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "c:de:DtN:hV", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "c:de:Dt:N:hV", options, NULL)) >= 0) {
int r;
switch (c) {
--
2.5.0

View File

@ -0,0 +1,55 @@
From 3b2e469ea0e551f2cf7dd4f1bd597b7277ccbef0 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 28 Jul 2015 11:31:45 +0200
Subject: [PATCH 21/47] mount: remove obsolete -n
It seems that systemd still uses legacy -n option. The option has been
originally designed to avoid write to /etc/mtab during boot when root
FS is not ready or read-only.
This is not necessary for long time, because /etc/mtab is not a real
file (it's symlink) and write to the file is impossible. All utils
should be able to detect the symlink and ignore mtab. This concept is
supported for very long time before systemd.
The userspase mount options are currently maintained by libmount
(mount(8) and mount.nfs) in /run/mount) which is tmpfs initialized
during early boot.
---
src/core/mount.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 87c4088..6a40417 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -834,8 +834,6 @@ static void mount_enter_unmounting(Mount *m) {
m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT;
r = exec_command_set(m->control_command, UMOUNT_PATH, m->where, NULL);
- if (r >= 0 && UNIT(m)->manager->running_as == MANAGER_SYSTEM)
- r = exec_command_append(m->control_command, "-n", NULL);
if (r < 0)
goto fail;
@@ -886,8 +884,6 @@ static void mount_enter_mounting(Mount *m) {
r = exec_command_set(m->control_command, MOUNT_PATH,
m->parameters_fragment.what, m->where, NULL);
- if (r >= 0 && UNIT(m)->manager->running_as == MANAGER_SYSTEM)
- r = exec_command_append(m->control_command, "-n", NULL);
if (r >= 0 && m->sloppy_options)
r = exec_command_append(m->control_command, "-s", NULL);
if (r >= 0 && m->parameters_fragment.fstype)
@@ -934,8 +930,6 @@ static void mount_enter_remounting(Mount *m) {
r = exec_command_set(m->control_command, MOUNT_PATH,
m->parameters_fragment.what, m->where,
"-o", o, NULL);
- if (r >= 0 && UNIT(m)->manager->running_as == MANAGER_SYSTEM)
- r = exec_command_append(m->control_command, "-n", NULL);
if (r >= 0 && m->sloppy_options)
r = exec_command_append(m->control_command, "-s", NULL);
if (r >= 0 && m->parameters_fragment.fstype)
--
2.5.0

View File

@ -0,0 +1,64 @@
From 7af9382c2dcadebd7633ed858bd6baf211f3d9c0 Mon Sep 17 00:00:00 2001
From: Lidong Zhong <lzhong@suse.com>
Date: Tue, 28 Jul 2015 19:07:05 +0800
Subject: [PATCH 22/47] udev: avoid coredump when initializing udev builtins
If one of the macros(HAVE_BLKID/HAVE_KMOD/HAVE_ACL) is not
defined, there will be a coredump
---
src/udev/udev-builtin.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index fabc653..88d1acf 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -52,7 +52,7 @@ void udev_builtin_init(struct udev *udev) {
return;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (builtins[i]->init)
+ if (builtins[i] && builtins[i]->init)
builtins[i]->init(udev);
initialized = true;
@@ -65,7 +65,7 @@ void udev_builtin_exit(struct udev *udev) {
return;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (builtins[i]->exit)
+ if (builtins[i] && builtins[i]->exit)
builtins[i]->exit(udev);
initialized = false;
@@ -75,7 +75,7 @@ bool udev_builtin_validate(struct udev *udev) {
unsigned int i;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (builtins[i]->validate && builtins[i]->validate(udev))
+ if (builtins[i] && builtins[i]->validate && builtins[i]->validate(udev))
return true;
return false;
}
@@ -84,7 +84,8 @@ void udev_builtin_list(struct udev *udev) {
unsigned int i;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- fprintf(stderr, " %-14s %s\n", builtins[i]->name, builtins[i]->help);
+ if (builtins[i])
+ fprintf(stderr, " %-14s %s\n", builtins[i]->name, builtins[i]->help);
}
const char *udev_builtin_name(enum udev_builtin_cmd cmd) {
@@ -105,7 +106,7 @@ enum udev_builtin_cmd udev_builtin_lookup(const char *command) {
if (pos)
pos[0] = '\0';
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (streq(builtins[i]->name, name))
+ if (builtins[i] && streq(builtins[i]->name, name))
return i;
return UDEV_BUILTIN_MAX;
}
--
2.5.0

View File

@ -0,0 +1,46 @@
From 1c6e7a4ab586ebb221002c8881e0b44560d1b09d Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 28 Jul 2015 13:58:40 +0200
Subject: [PATCH 23/47] udev: check more builtins[] pointers before
dereferencing
Fix some more locations where pointers from builtins[] are dereferenced
before checking. Related to 8cacf69b1.
---
src/udev/udev-builtin.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 88d1acf..3ebefa8 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -89,10 +89,16 @@ void udev_builtin_list(struct udev *udev) {
}
const char *udev_builtin_name(enum udev_builtin_cmd cmd) {
+ if (!builtins[cmd])
+ return NULL;
+
return builtins[cmd]->name;
}
bool udev_builtin_run_once(enum udev_builtin_cmd cmd) {
+ if (!builtins[cmd])
+ return -EOPNOTSUPP;
+
return builtins[cmd]->run_once;
}
@@ -116,6 +122,9 @@ int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, const c
int argc;
char *argv[128];
+ if (!builtins[cmd])
+ return -EOPNOTSUPP;
+
/* we need '0' here to reset the internal state */
optind = 0;
strscpy(arg, sizeof(arg), command);
--
2.5.0

View File

@ -0,0 +1,27 @@
From 45a257393eb491da230a14ea3b670e2343f3c8f0 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 28 Jul 2015 14:38:31 +0200
Subject: [PATCH 24/47] udev: Fix udev_builtin_run_once()
Honour the boolean return value type.
This was an oversight in f89d10ae4.
---
src/udev/udev-builtin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 3ebefa8..4f62525 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -97,7 +97,7 @@ const char *udev_builtin_name(enum udev_builtin_cmd cmd) {
bool udev_builtin_run_once(enum udev_builtin_cmd cmd) {
if (!builtins[cmd])
- return -EOPNOTSUPP;
+ return false;
return builtins[cmd]->run_once;
}
--
2.5.0

View File

@ -0,0 +1,29 @@
From 81d1be927e0db5eb838d85c2a55c9ffbaafa8792 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Fri, 31 Jul 2015 15:33:49 +0200
Subject: [PATCH 25/47] timesyncd: remove RLIMIT_NPROC
NSS plugins might create additional threads. Remove the limit, we cannot
really make any assumptions here.
---
src/timesync/timesyncd.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index b030206..7b4178c 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -113,10 +113,6 @@ int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
- /* We need one process for ourselves, plus one thread for the asynchronous resolver */
- if (setrlimit(RLIMIT_NPROC, &RLIMIT_MAKE_CONST(2)) < 0)
- log_warning_errno(errno, "Failed to lower RLIMIT_NPROC to 2: %m");
-
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, -1) >= 0);
r = manager_new(&m);
--
2.5.0

View File

@ -0,0 +1,29 @@
From d0ccb132e6da2f3c31f17437d70745c30af1df61 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 5 Aug 2015 11:31:52 +0300
Subject: [PATCH 26/47] journald: fix count of object meta fields
There are 12 object meta fields created in dispatch_message_real(), but
we only allocated space for 11. Fix this.
Fixes #866.
---
src/journal/journald-server.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index 559d100..d954c51 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -144,7 +144,7 @@ typedef struct Server {
#define N_IOVEC_META_FIELDS 20
#define N_IOVEC_KERNEL_FIELDS 64
#define N_IOVEC_UDEV_FIELDS 32
-#define N_IOVEC_OBJECT_FIELDS 11
+#define N_IOVEC_OBJECT_FIELDS 12
void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority, pid_t object_pid);
void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,4);
--
2.5.0

View File

@ -0,0 +1,36 @@
From 33def8a0cd165ba77d6d88134c198ad4bbb44944 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Wed, 5 Aug 2015 20:33:48 +0200
Subject: [PATCH 27/47] udev: uaccess - do not log error when device node
disappears
https://github.com/systemd/systemd/issues/875
---
src/udev/udev-builtin-uaccess.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c
index 99bb91a..43bab8a 100644
--- a/src/udev/udev-builtin-uaccess.c
+++ b/src/udev/udev-builtin-uaccess.c
@@ -56,7 +56,7 @@ static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool
r = devnode_acl(path, true, false, 0, true, uid);
if (r < 0) {
- log_error_errno(r, "Failed to apply ACL on %s: %m", path);
+ log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, r, "Failed to apply ACL on %s: %m", path);
goto finish;
}
@@ -70,7 +70,7 @@ finish:
/* Better be safe than sorry and reset ACL */
k = devnode_acl(path, true, false, 0, false, 0);
if (k < 0) {
- log_error_errno(k, "Failed to apply ACL on %s: %m", path);
+ log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, k, "Failed to apply ACL on %s: %m", path);
if (r >= 0)
r = k;
}
--
2.5.0

View File

@ -0,0 +1,28 @@
From 7172a79bd8e8f8e04548905ccd68d3990347104d Mon Sep 17 00:00:00 2001
From: reverendhomer <mk.43.ecko@gmail.com>
Date: Sat, 8 Aug 2015 09:49:39 +0300
Subject: [PATCH 28/47] Coverity #1299015
bus can never be NULL due to assert
---
src/libsystemd/sd-bus/bus-message.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 983e2f6..5843886 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -608,8 +608,8 @@ static sd_bus_message *message_new(sd_bus *bus, uint8_t type) {
m->header = (struct bus_header*) ((uint8_t*) m + ALIGN(sizeof(struct sd_bus_message)));
m->header->endian = BUS_NATIVE_ENDIAN;
m->header->type = type;
- m->header->version = bus ? bus->message_version : 1;
- m->allow_fds = !bus || bus->can_fds || (bus->state != BUS_HELLO && bus->state != BUS_RUNNING);
+ m->header->version = bus->message_version;
+ m->allow_fds = bus->can_fds || (bus->state != BUS_HELLO && bus->state != BUS_RUNNING);
m->root_container.need_offsets = BUS_MESSAGE_IS_GVARIANT(m);
m->bus = sd_bus_ref(bus);
--
2.5.0

View File

@ -0,0 +1,32 @@
From 7693e8f755ba38797f659b32108375b1314f0dec Mon Sep 17 00:00:00 2001
From: reverendhomer <mk.43.ecko@gmail.com>
Date: Sat, 8 Aug 2015 09:54:10 +0300
Subject: [PATCH 29/47] Coverity #1299013
event cannot be NULL due to assert
---
src/import/pull-tar.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c
index a6605d2..71b8908 100644
--- a/src/import/pull-tar.c
+++ b/src/import/pull-tar.c
@@ -127,13 +127,7 @@ int tar_pull_new(
i->grow_machine_directory = path_startswith(i->image_root, "/var/lib/machines");
- if (event)
- i->event = sd_event_ref(event);
- else {
- r = sd_event_default(&i->event);
- if (r < 0)
- return r;
- }
+ i->event = sd_event_ref(event);
r = curl_glue_new(&i->glue, i->event);
if (r < 0)
--
2.5.0

View File

@ -0,0 +1,35 @@
From 3be473032ef69c211b56bcfb9a558837d4ad8334 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Tue, 18 Aug 2015 16:26:11 +0200
Subject: [PATCH 30/47] journal: fix json output of unicode characters
---
src/shared/logs-show.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 068da46..8550f10 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -575,7 +575,6 @@ void json_escape(
assert(p);
if (!(flags & OUTPUT_SHOW_ALL) && l >= JSON_THRESHOLD)
-
fputs("null", f);
else if (!utf8_is_printable(p, l)) {
@@ -605,8 +604,8 @@ void json_escape(
fputc(*p, f);
} else if (*p == '\n')
fputs("\\n", f);
- else if (*p < ' ')
- fprintf(f, "\\u%04x", *p);
+ else if ((uint8_t) *p < ' ')
+ fprintf(f, "\\u%04x", (uint8_t) *p);
else
fputc(*p, f);
--
2.5.0

View File

@ -0,0 +1,33 @@
From 612d18e4b329cb362d494ddf28553ae82406f01d Mon Sep 17 00:00:00 2001
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Date: Tue, 18 Aug 2015 14:41:24 -0400
Subject: [PATCH 31/47] logind: use open_terminal() instead of open()
The open_terminal() function adds retries in case a terminal
is in the process of being closed when we open it, and should
generally be used to open a terminal. We especially need it
for code that a subsequent commit adds that reopens the terminal
at session shut-down time; such races would be more likely in
that case.
Found by Ray Strode.
---
src/login/logind-session.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 6a450b0..a8e667b 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -975,7 +975,7 @@ static int session_open_vt(Session *s) {
return s->vtfd;
sprintf(path, "/dev/tty%u", s->vtnr);
- s->vtfd = open(path, O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY);
+ s->vtfd = open_terminal(path, O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY);
if (s->vtfd < 0)
return log_error_errno(errno, "cannot open VT %s of session %s: %m", path, s->id);
--
2.5.0

View File

@ -0,0 +1,44 @@
From 89a1609edd48f08e4227baa2890b96a936cfadb8 Mon Sep 17 00:00:00 2001
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Date: Tue, 18 Aug 2015 15:19:05 -0400
Subject: [PATCH 32/47] logind: get a fresh file descriptor to clean up a VT
When the controlling process exits, any existing file descriptors
for that FD will be marked as hung-up and ioctls on them will
file with EIO. To work around this, open a new file descriptor
for the VT we want to clean up.
Thanks to Ray Strode for help in sorting out the problem and
coming up with a fix!
https://github.com/systemd/systemd/issues/989
---
src/login/logind-session.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index a8e667b..9abdf62 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -1039,7 +1039,18 @@ void session_restore_vt(Session *s) {
int vt, kb = K_XLATE;
struct vt_mode mode = { 0 };
+ /* We need to get a fresh handle to the virtual terminal,
+ * since the old file-descriptor is potentially in a hung-up
+ * state after the controlling process exited; we do a
+ * little dance to avoid having the terminal be available
+ * for reuse before we've cleaned it up.
+ */
+ int old_fd = s->vtfd;
+ s->vtfd = -1;
+
vt = session_open_vt(s);
+ safe_close(old_fd);
+
if (vt < 0)
return;
--
2.5.0

View File

@ -0,0 +1,36 @@
From 52f69bd986957e875883760a240983ab0925de87 Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Date: Wed, 19 Aug 2015 10:03:58 +0000
Subject: [PATCH 33/47] timedatectl: assert timezone is not null in setenv()
call.
setenv is declared as:
extern int setenv (const char *__name, const char *__value, int __replace)
__THROW __nonnull ((2));
And i->timezone can be NULL, if for example /etc/localtime is
missing. Previously that worked, but now result in a libc dumping
core, as seen with gcc 2.22, due to:
https://sourceware.org/ml/glibc-cvs/2015-q2/msg00075.html
---
src/timedate/timedatectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 240578b..8ec6adb 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
old_tz = strdupa(tz);
/* Set the new $TZ */
- if (setenv("TZ", i->timezone, true) < 0)
+ if (i->timezone && setenv("TZ", i->timezone, true) < 0)
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
else
tzset();
--
2.5.0

View File

@ -0,0 +1,28 @@
From f489997fcb7e2d93ba46279f5a628006bbac88e9 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 20 Aug 2015 12:16:13 +0200
Subject: [PATCH 34/47] timedatectl: when no timezone is set consider UTC the
default
This fixes #993, and ensures that the libc does not consider any
old timezone information into account, that was set earlier.
---
src/timedate/timedatectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 8ec6adb..1c3f03c 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
old_tz = strdupa(tz);
/* Set the new $TZ */
- if (i->timezone && setenv("TZ", i->timezone, true) < 0)
+ if (setenv("TZ", isempty(i->timezone) ? "UTC" : i->timezone, true) < 0)
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
else
tzset();
--
2.5.0

View File

@ -0,0 +1,27 @@
From f58e843b388f10748e686ff5b7491d912bf3ecd0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 21 Aug 2015 15:28:01 +0200
Subject: [PATCH 35/47] core: downgrade "Module inserted" message for kmod to
DEBUG
Closes #919.
---
src/core/kmod-setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index fc6d2f4..2068ffd 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -112,7 +112,7 @@ int kmod_setup(void) {
r = kmod_module_probe_insert_module(mod, KMOD_PROBE_APPLY_BLACKLIST, NULL, NULL, NULL, NULL);
if (r == 0)
- log_info("Inserted module '%s'", kmod_module_get_name(mod));
+ log_debug("Inserted module '%s'", kmod_module_get_name(mod));
else if (r == KMOD_PROBE_APPLY_BLACKLIST)
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
else {
--
2.5.0

View File

@ -0,0 +1,77 @@
From d167b3653665d5d617f02e877e1f9e38e5a05a6c Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Date: Wed, 26 Aug 2015 12:07:31 +0900
Subject: [PATCH 37/47] selinux: fix regression of systemctl subcommands when
absolute unit file paths are specified
The commit 4938696301a914ec26bcfc60bb99a1e9624e3789 overlooked the
fact that unit files can be specified as unit file paths, not unit
file names, wrongly passing a unit file path to the 1st argument of
manager_load_unit() that handles it as a unit file name. As a result,
the following 4 systemctl subcommands:
enable
disable
reenable
link
mask
unmask
fail with the following error message:
# systemctl enable /usr/lib/systemd/system/kdump.service
Failed to execute operation: Unit name /usr/lib/systemd/system/kdump.service is not valid.
# systemctl disable /usr/lib/systemd/system/kdump.service
Failed to execute operation: Unit name /usr/lib/systemd/system/kdump.service is not valid.
# systemctl reenable /usr/lib/systemd/system/kdump.service
Failed to execute operation: Unit name /usr/lib/systemd/system/kdump.service is not valid.
# cp /usr/lib/systemd/system/kdump.service /tmp/
# systemctl link /tmp/kdump.service
Failed to execute operation: Unit name /tmp/kdump.service is not valid.
# systemctl mask /usr/lib/systemd/system/kdump.service
Failed to execute operation: Unit name /usr/lib/systemd/system/kdump.service is not valid.
# systemctl unmask /usr/lib/systemd/system/kdump.service
Failed to execute operation: Unit name /usr/lib/systemd/system/kdump.service is not valid.
To fix the issue, first check whether a unit file is passed as a unit
file name or a unit file path, and then pass the unit file to the
appropreate argument of manager_load_unit().
By the way, even with this commit mask and unmask reject unit file
paths as follows and this is a correct behavior:
# systemctl mask /usr/lib/systemd/system/kdump.service
Failed to execute operation: Invalid argument
# systemctl unmask /usr/lib/systemd/system/kdump.service
Failed to execute operation: Invalid argument
---
src/core/selinux-access.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 50a90b0..2ecfa40 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -38,6 +38,7 @@
#include "selinux-util.h"
#include "audit-fd.h"
#include "strv.h"
+#include "path-util.h"
static bool initialized = false;
@@ -302,7 +303,10 @@ int mac_selinux_unit_access_check_strv(
int r;
STRV_FOREACH(i, units) {
- r = manager_load_unit(m, *i, NULL, error, &u);
+ if (is_path(*i))
+ r = manager_load_unit(m, NULL, *i, error, &u);
+ else
+ r = manager_load_unit(m, *i, NULL, error, &u);
if (r < 0)
return r;
r = mac_selinux_unit_access_check(u, message, permission, error);
--
2.5.0

View File

@ -0,0 +1,26 @@
From 04e4cc1c948ed6309219e302a35ac617649fea7c Mon Sep 17 00:00:00 2001
From: Robin Hack <rhack@redhat.com>
Date: Mon, 31 Aug 2015 11:45:09 +0200
Subject: [PATCH 38/47] socket: fix setsockopt call. SOL_SOCKET changed to
SOL_TCP.
---
src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/socket.c b/src/core/socket.c
index 693cbc6..70518bd 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -839,7 +839,7 @@ static void socket_apply_socket_options(Socket *s, int fd) {
if (s->keep_alive_cnt) {
int value = s->keep_alive_cnt;
- if (setsockopt(fd, SOL_SOCKET, TCP_KEEPCNT, &value, sizeof(value)) < 0)
+ if (setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &value, sizeof(value)) < 0)
log_unit_warning_errno(UNIT(s), errno, "TCP_KEEPCNT failed: %m");
}
--
2.5.0

View File

@ -0,0 +1,29 @@
From 9f334e7740a00e91f05b4b91c20f2bc152db3ea2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 31 Aug 2015 13:07:24 +0200
Subject: [PATCH 39/47] sd-event: improve debug message when we fail to remove
and fd from an epoll
Let's help users to debug issues with epoll fd removal by printing the
name of the event source.
---
src/libsystemd/sd-event/sd-event.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 76964aa..3459f50 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -481,7 +481,8 @@ static void source_io_unregister(sd_event_source *s) {
return;
r = epoll_ctl(s->event->epoll_fd, EPOLL_CTL_DEL, s->io.fd, NULL);
- assert_log(r >= 0);
+ if (r < 0)
+ log_debug_errno(errno, "Failed to remove source %s from epoll: %m", strna(s->description));
s->io.registered = false;
}
--
2.5.0

View File

@ -0,0 +1,92 @@
From 01fafd4fd6456c02921979ed634441a2c2c63f22 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Tue, 1 Sep 2015 16:02:58 +0200
Subject: [PATCH 40/47] selinux: always use *_raw API from libselinux
When mcstransd* is running non-raw functions will return translated SELinux
context. Problem is that libselinux will cache this information and in the
future it will return same context even though mcstransd maybe not running at
that time. If you then check with such context against SELinux policy then
selinux_check_access may fail depending on whether mcstransd is running or not.
To workaround this problem/bug in libselinux, we should always get raw context
instead. Most users will not notice because result of access check is logged
only in debug mode.
* SELinux context translation service, which will translates labels to human
readable form
---
src/basic/selinux-util.c | 10 +++++-----
src/core/selinux-access.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c
index 7c58985..a39a0f7 100644
--- a/src/basic/selinux-util.c
+++ b/src/basic/selinux-util.c
@@ -199,11 +199,11 @@ int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(&mycon);
+ r = getcon_raw(&mycon);
if (r < 0)
return -errno;
- r = getfilecon(exe, &fcon);
+ r = getfilecon_raw(exe, &fcon);
if (r < 0)
return -errno;
@@ -225,7 +225,7 @@ int mac_selinux_get_our_label(char **label) {
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(label);
+ r = getcon_raw(label);
if (r < 0)
return -errno;
#endif
@@ -249,7 +249,7 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(&mycon);
+ r = getcon_raw(&mycon);
if (r < 0)
return -errno;
@@ -260,7 +260,7 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *
if (!exec_label) {
/* If there is no context set for next exec let's use context
of target executable */
- r = getfilecon(exe, &fcon);
+ r = getfilecon_raw(exe, &fcon);
if (r < 0)
return -errno;
}
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 2ecfa40..011644b 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -246,7 +246,7 @@ int mac_selinux_generic_access_check(
if (path) {
/* Get the file context of the unit file */
- r = getfilecon(path, &fcon);
+ r = getfilecon_raw(path, &fcon);
if (r < 0) {
r = sd_bus_error_setf(error, SD_BUS_ERROR_ACCESS_DENIED, "Failed to get file context on %s.", path);
goto finish;
@@ -254,7 +254,7 @@ int mac_selinux_generic_access_check(
tclass = "service";
} else {
- r = getcon(&fcon);
+ r = getcon_raw(&fcon);
if (r < 0) {
r = sd_bus_error_setf(error, SD_BUS_ERROR_ACCESS_DENIED, "Failed to get current context.");
goto finish;
--
2.5.0

View File

@ -0,0 +1,68 @@
From 04c428f42c40f1689041d9e6e8de3f06744acf3f Mon Sep 17 00:00:00 2001
From: Evgeny Vereshchagin <evvers@ya.ru>
Date: Wed, 2 Sep 2015 01:43:32 +0000
Subject: [PATCH 41/47] virt: detect parallels virtualization
inspired by http://people.redhat.com/~rjones/virt-what/
see:
* http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=a5ed33ef3e4bfa3281c9589eccac4d92dff1babe;hb=HEAD#l200
* http://git.annexia.org/?p=virt-what.git;a=blob;f=virt-what.in;h=a5ed33ef3e4bfa3281c9589eccac4d92dff1babe;hb=HEAD#l253
---
man/systemd-detect-virt.xml | 7 ++++++-
src/basic/virt.c | 6 ++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml
index 40755a2..9ea9141 100644
--- a/man/systemd-detect-virt.xml
+++ b/man/systemd-detect-virt.xml
@@ -88,7 +88,7 @@
</thead>
<tbody>
<row>
- <entry morerows="8">VM</entry>
+ <entry morerows="9">VM</entry>
<entry><varname>qemu</varname></entry>
<entry>QEMU software virtualization</entry>
</row>
@@ -134,6 +134,11 @@
</row>
<row>
+ <entry><varname>parallels</varname></entry>
+ <entry>Parallels Desktop, Parallels Server</entry>
+ </row>
+
+ <row>
<entry morerows="5">container</entry>
<entry><varname>openvz</varname></entry>
<entry>OpenVZ/Virtuozzo</entry>
diff --git a/src/basic/virt.c b/src/basic/virt.c
index a8d2671..4a4bebd 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -156,7 +156,8 @@ static int detect_vm_dmi(const char **_id) {
"VMW\0" "vmware\0"
"innotek GmbH\0" "oracle\0"
"Xen\0" "xen\0"
- "Bochs\0" "bochs\0";
+ "Bochs\0" "bochs\0"
+ "Parallels\0" "parallels\0";
unsigned i;
for (i = 0; i < ELEMENTSOF(dmi_vendors); i++) {
@@ -244,8 +245,9 @@ int detect_vm(const char **id) {
r = detect_vm_dmi(&_id);
/* kvm with and without Virtualbox */
+ /* Parallels exports KVMKVMKVM leaf */
if (streq_ptr(_id_cpuid, "kvm")) {
- if (r > 0 && streq(_id, "oracle"))
+ if (r > 0 && (streq(_id, "oracle") || streq(_id, "parallels")))
goto finish;
_id = _id_cpuid;
--
2.5.0

View File

@ -0,0 +1,38 @@
From 7390da4b25fb32f2c6b1f743dda477e50078e5b2 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Tue, 25 Aug 2015 14:12:19 +0200
Subject: [PATCH 42/47] udev: net_id - support predictable ifnames on virtio
buses
Virtio buses are undeterministically enumerated, so we cannot use them as a basis
for deterministic naming (see bf81e792f3c0). However, we are guaranteed that there
is only ever one virtio bus for every parent device, so we can simply skip over
the virtio buses when naming the devices.
---
src/udev/udev-builtin-net_id.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 6e7e127..589f1f7 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -280,8 +280,16 @@ static int names_pci(struct udev_device *dev, struct netnames *names) {
assert(names);
parent = udev_device_get_parent(dev);
+
+ /* there can only ever be one virtio bus per parent device, so we can
+ safely ignore any virtio buses. see
+ <http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030331.html> */
+ while (parent && streq_ptr("virtio", udev_device_get_subsystem(parent)))
+ parent = udev_device_get_parent(parent);
+
if (!parent)
return -ENOENT;
+
/* check if our direct parent is a PCI device with no other bus in-between */
if (streq_ptr("pci", udev_device_get_subsystem(parent))) {
names->type = NET_PCI;
--
2.5.0

View File

@ -0,0 +1,27 @@
From e82c575ba143e061e93e13e0ad7b6c7c2b7c481b Mon Sep 17 00:00:00 2001
From: Tom Lyon <pugs@drivescale.com>
Date: Mon, 21 Sep 2015 14:36:32 -0700
Subject: [PATCH 43/47] Fixup WWN bytes for big-endian systems
---
src/udev/ata_id/ata_id.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index 7ba0b7f..158eae7 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -485,6 +485,10 @@ int main(int argc, char *argv[])
disk_identify_fixup_uint16(identify.byte, 90); /* time required for enhanced SECURITY ERASE UNIT */
disk_identify_fixup_uint16(identify.byte, 91); /* current APM values */
disk_identify_fixup_uint16(identify.byte, 94); /* current AAM value */
+ disk_identify_fixup_uint16(identify.byte, 108); /* wwn */
+ disk_identify_fixup_uint16(identify.byte, 109); /* wwn */
+ disk_identify_fixup_uint16(identify.byte, 110); /* wwn */
+ disk_identify_fixup_uint16(identify.byte, 111); /* wwn */
disk_identify_fixup_uint16(identify.byte, 128); /* device lock function */
disk_identify_fixup_uint16(identify.byte, 217); /* nominal media rotation rate */
memcpy(&id, identify.byte, sizeof id);
--
2.5.0

View File

@ -0,0 +1,26 @@
From ffaf97ab478310ecf4598334d057afbdae4d1283 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Wed, 23 Sep 2015 19:23:21 +0200
Subject: [PATCH 44/47] units: run ldconfig also when cache is unpopulated
---
units/ldconfig.service | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/units/ldconfig.service b/units/ldconfig.service
index f9691e2..994edd9 100644
--- a/units/ldconfig.service
+++ b/units/ldconfig.service
@@ -12,7 +12,8 @@ DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=sysinit.target shutdown.target systemd-update-done.service
-ConditionNeedsUpdate=/etc
+ConditionNeedsUpdate=|/etc
+ConditionFileNotEmpty=|!/etc/ld.so.cache
[Service]
Type=oneshot
--
2.5.0

View File

@ -0,0 +1,47 @@
From d22d9301ece9e6cffc5db8266afb3b99df32306c Mon Sep 17 00:00:00 2001
From: Krzysztof Kotlenga <k.kotlenga@sims.pl>
Date: Thu, 24 Sep 2015 00:34:51 +0200
Subject: [PATCH 45/47] sd-event: fix prepare priority queue comparison
function
Otherwise a disabled event source can get swapped with an enabled one
and cause a severe sd-event malfunction.
http://lists.freedesktop.org/archives/systemd-devel/2015-September/034356.html
---
src/libsystemd/sd-event/sd-event.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 3459f50..6127888 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -231,6 +231,12 @@ static int prepare_prioq_compare(const void *a, const void *b) {
assert(x->prepare);
assert(y->prepare);
+ /* Enabled ones first */
+ if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF)
+ return -1;
+ if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF)
+ return 1;
+
/* Move most recently prepared ones last, so that we can stop
* preparing as soon as we hit one that has already been
* prepared in the current iteration */
@@ -239,12 +245,6 @@ static int prepare_prioq_compare(const void *a, const void *b) {
if (x->prepare_iteration > y->prepare_iteration)
return 1;
- /* Enabled ones first */
- if (x->enabled != SD_EVENT_OFF && y->enabled == SD_EVENT_OFF)
- return -1;
- if (x->enabled == SD_EVENT_OFF && y->enabled != SD_EVENT_OFF)
- return 1;
-
/* Lower priority values first */
if (x->priority < y->priority)
return -1;
--
2.5.0

View File

@ -0,0 +1,36 @@
From cd12ff2291f5bd529a8d83bb76726194d3daaf13 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 24 Sep 2015 22:25:43 +0200
Subject: [PATCH 46/47] Revert "core: one step back again, for nspawn we
actually can't wait for cgroups running empty since systemd will get exactly
zero notifications about it"
This reverts commit 743970d2ea6d08aa7c7bff8220f6b7702f2b1db7.
---
src/core/unit.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 0a66a6a..db0fca0 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3557,15 +3557,7 @@ int unit_kill_context(
log_unit_warning_errno(u, r, "Failed to kill control group: %m");
} else if (r > 0) {
- /* FIXME: For now, we will not wait for the
- * cgroup members to die, simply because
- * cgroup notification is unreliable. It
- * doesn't work at all in containers, and
- * outside of containers it can be confused
- * easily by leaving directories in the
- * cgroup. */
-
- /* wait_for_exit = true; */
+ wait_for_exit = true;
if (c->send_sighup && k != KILL_KILL) {
set_free(pid_set);
--
2.5.0

View File

@ -0,0 +1,26 @@
From cf0b36ff2d70b7fd4f64ce95517bdcebdb4dbf93 Mon Sep 17 00:00:00 2001
From: Fedora systemd team <systemd-maint@redhat.com>
Date: Thu, 24 Sep 2015 23:28:14 +0200
Subject: [PATCH 47/47] Pass pointer to unit object instead of unit id
Related: #1195761
---
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 db0fca0..5dbbef7 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1676,7 +1676,7 @@ static void unit_check_binds_to(Unit *u) {
}
assert(other);
- log_unit_info(u->id, "Unit %s is bound to inactive unit %s. Stopping, too.", u->id, other->id);
+ log_unit_info(u, "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. */
r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);
--
2.5.0

View File

@ -0,0 +1,66 @@
From 98bac6058c919071ba6b7860b925decacafdc822 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 25 Aug 2015 20:42:50 +0200
Subject: [PATCH] core: report root cgroup as "/" over the bus
Internally, the root cgroup is stored as the empty string in
Unit.cgroup_path, and "no cgroup" as NULL. Unfortunately, D-Bus does not
know a NULL concept, hence when reporting the cgroup to clients we
should turn the root cgroup into "/", and leave the empty string for the
"no cgroup" case.
This should make sure that "systemctl status -- -.slice" works correctly
and shows the entire cgroup tree.
---
src/core/dbus-unit.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 1892725..0a9effd 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -697,10 +697,40 @@ static int property_get_cpu_usage(
return sd_bus_message_append(reply, "t", ns);
}
+static int property_get_cgroup(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *error) {
+
+ Unit *u = userdata;
+ const char *t;
+
+ assert(bus);
+ assert(reply);
+ assert(u);
+
+ /* Three cases: a) u->cgroup_path is NULL, in which case the
+ * unit has no control group, which we report as the empty
+ * string. b) u->cgroup_path is the empty string, which
+ * indicates the root cgroup, which we report as "/". c) all
+ * other cases we report as-is. */
+
+ if (u->cgroup_path)
+ t = isempty(u->cgroup_path) ? "/" : u->cgroup_path;
+ else
+ t = "";
+
+ return sd_bus_message_append(reply, "s", t);
+}
+
const sd_bus_vtable bus_unit_cgroup_vtable[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("Slice", "s", property_get_slice, 0, 0),
- SD_BUS_PROPERTY("ControlGroup", "s", NULL, offsetof(Unit, cgroup_path), 0),
+ SD_BUS_PROPERTY("ControlGroup", "s", property_get_cgroup, 0, 0),
SD_BUS_PROPERTY("MemoryCurrent", "t", property_get_current_memory, 0, 0),
SD_BUS_PROPERTY("CPUUsageNSec", "t", property_get_cpu_usage, 0, 0),
SD_BUS_VTABLE_END
--
2.4.3

View File

@ -0,0 +1,36 @@
From cc85d56245a21e458dbc955fbf94fa9b3bfb9e33 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Fri, 10 Jul 2015 14:53:08 +0200
Subject: [PATCH 033/261] logind: allow greeters to take over VTs
Make sure a greeter can forcefully spawn a session on a VT that is
in-use. A recent patch prevented this (this used to be possible for all
session types) as it is highly fragile. However, as it turns out,
greeters seem to rely on that feature. Therefore, make sure we allow it
explicitly for greeters.
---
src/login/logind-dbus.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index cd9cab7..ca435df 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -699,9 +699,12 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus
* after the user-session and want the user-session to take
* over the VT. We need to support this for
* backwards-compatibility, so make sure we allow new sessions
- * on a VT that a greeter is running on.
+ * on a VT that a greeter is running on. Furthermore, to allow
+ * re-logins, we have to allow a greeter to take over a used VT for
+ * the exact same reasons.
*/
- if (vtnr > 0 &&
+ if (c != SESSION_GREETER &&
+ vtnr > 0 &&
vtnr < m->seat0->position_count &&
m->seat0->positions[vtnr] &&
m->seat0->positions[vtnr]->class != SESSION_GREETER)
--
2.4.3

View File

@ -0,0 +1,141 @@
From e6494a07cbbfa93dd83782fa1f8554aa4d2353bd Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Fri, 10 Jul 2015 15:08:24 +0200
Subject: [PATCH 034/261] logind: rename 'pos' to 'position'
Spell out the proper name. Use 'pos' over 'position', and also update the
logind state file to do the same. Note that this breaks live updates.
However, we only save 'POSITION' on non-seat0, so this shouldn't bother
anyone for real. If you run multi-seat setups, you better restart a
machine on updates, anyway.
---
src/login/logind-seat.c | 18 +++++++++---------
src/login/logind-session.c | 10 +++++-----
src/login/logind-session.h | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index fb5d076..9d5287a 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -290,8 +290,8 @@ int seat_switch_to_next(Seat *s) {
return -EINVAL;
start = 1;
- if (s->active && s->active->pos > 0)
- start = s->active->pos;
+ if (s->active && s->active->position > 0)
+ start = s->active->position;
for (i = start + 1; i < s->position_count; ++i)
if (s->positions[i])
@@ -311,8 +311,8 @@ int seat_switch_to_previous(Seat *s) {
return -EINVAL;
start = 1;
- if (s->active && s->active->pos > 0)
- start = s->active->pos;
+ if (s->active && s->active->position > 0)
+ start = s->active->position;
for (i = start - 1; i > 0; --i)
if (s->positions[i])
@@ -472,9 +472,9 @@ int seat_stop_sessions(Seat *s, bool force) {
void seat_evict_position(Seat *s, Session *session) {
Session *iter;
- unsigned int pos = session->pos;
+ unsigned int pos = session->position;
- session->pos = 0;
+ session->position = 0;
if (pos == 0)
return;
@@ -486,7 +486,7 @@ void seat_evict_position(Seat *s, Session *session) {
* position (eg., during gdm->session transition), so let's look
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
- if (iter->pos == pos) {
+ if (iter->position == pos) {
s->positions[pos] = iter;
break;
}
@@ -504,7 +504,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
seat_evict_position(s, session);
- session->pos = pos;
+ session->position = pos;
if (pos > 0 && !s->positions[pos])
s->positions[pos] = session;
}
@@ -512,7 +512,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
static void seat_assign_position(Seat *s, Session *session) {
unsigned int pos;
- if (session->pos > 0)
+ if (session->position > 0)
return;
for (pos = 1; pos < s->position_count; ++pos)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 6a450b0..45f4c09 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -264,7 +264,7 @@ int session_save(Session *s) {
fprintf(f, "VTNR=%u\n", s->vtnr);
if (!s->vtnr)
- fprintf(f, "POS=%u\n", s->pos);
+ fprintf(f, "POSITION=%u\n", s->position);
if (s->leader > 0)
fprintf(f, "LEADER="PID_FMT"\n", s->leader);
@@ -302,7 +302,7 @@ int session_load(Session *s) {
*seat = NULL,
*vtnr = NULL,
*state = NULL,
- *pos = NULL,
+ *position = NULL,
*leader = NULL,
*type = NULL,
*class = NULL,
@@ -329,7 +329,7 @@ int session_load(Session *s) {
"DESKTOP", &s->desktop,
"VTNR", &vtnr,
"STATE", &state,
- "POS", &pos,
+ "POSITION", &position,
"LEADER", &leader,
"TYPE", &type,
"CLASS", &class,
@@ -388,10 +388,10 @@ int session_load(Session *s) {
if (!s->seat || !seat_has_vts(s->seat))
s->vtnr = 0;
- if (pos && s->seat) {
+ if (position && s->seat) {
unsigned int npos;
- safe_atou(pos, &npos);
+ safe_atou(position, &npos);
seat_claim_position(s->seat, s, npos);
}
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index 4bf739a..b8565eb 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -70,7 +70,7 @@ struct Session {
Manager *manager;
const char *id;
- unsigned int pos;
+ unsigned int position;
SessionType type;
SessionClass class;
--
2.4.3

View File

@ -0,0 +1,164 @@
From 559b5cc2734bdd968c1c56ad1dc6fff08b8b30ba Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 11 Jul 2015 17:00:26 -0300
Subject: [PATCH 043/261] logind: bring bus policy up-to-date
A while back we opened up all of logind's bus calls to unprivileged
users, via PK. However, the dbus1 policy wasn't updated accordingly.
With this change, the dbus1 policy is opened up for all bus calls that
should be available to unprivileged clients.
(also rearranges some calls in the vtable, to make more sense, and be in
line with the order in the bus policy file)
Fixes #471.
---
src/login/logind-dbus.c | 4 +-
src/login/org.freedesktop.login1.conf | 72 +++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index ca435df..049e33e 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2449,8 +2449,6 @@ const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD("PowerOff", "b", NULL, method_poweroff, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Reboot", "b", NULL, method_reboot, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Suspend", "b", NULL, method_suspend, SD_BUS_VTABLE_UNPRIVILEGED),
- SD_BUS_METHOD("ScheduleShutdown", "st", NULL, method_schedule_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
- SD_BUS_METHOD("CancelScheduledShutdown", NULL, "b", method_cancel_scheduled_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Hibernate", "b", NULL, method_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("HybridSleep", "b", NULL, method_hybrid_sleep, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("CanPowerOff", NULL, "s", method_can_poweroff, SD_BUS_VTABLE_UNPRIVILEGED),
@@ -2458,6 +2456,8 @@ const sd_bus_vtable manager_vtable[] = {
SD_BUS_METHOD("CanSuspend", NULL, "s", method_can_suspend, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("CanHibernate", NULL, "s", method_can_hibernate, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("CanHybridSleep", NULL, "s", method_can_hybrid_sleep, SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD("ScheduleShutdown", "st", NULL, method_schedule_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD("CancelScheduledShutdown", NULL, "b", method_cancel_scheduled_shutdown, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("Inhibit", "ssss", "h", method_inhibit, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("CanRebootToFirmwareSetup", NULL, "s", method_can_reboot_to_firmware_setup, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_METHOD("SetRebootToFirmwareSetup", "b", NULL, method_set_reboot_to_firmware_setup, SD_BUS_VTABLE_UNPRIVILEGED),
diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
index 0ad7880..d8deb7b 100644
--- a/src/login/org.freedesktop.login1.conf
+++ b/src/login/org.freedesktop.login1.conf
@@ -90,6 +90,42 @@
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Manager"
+ send_member="LockSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="UnlockSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="LockSessions"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="UnlockSessions"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="KillSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="KillUser"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="TerminateSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="TerminateUser"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="TerminateSeat"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
send_member="PowerOff"/>
<allow send_destination="org.freedesktop.login1"
@@ -130,6 +166,14 @@
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Manager"
+ send_member="ScheduleShutdown"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="CancelScheduledShutdown"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
send_member="CanRebootToFirmwareSetup"/>
<allow send_destination="org.freedesktop.login1"
@@ -146,6 +190,10 @@
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Seat"
+ send_member="Terminate"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
send_member="ActivateSession"/>
<allow send_destination="org.freedesktop.login1"
@@ -162,14 +210,30 @@
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Session"
+ send_member="Terminate"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
send_member="Activate"/>
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Session"
+ send_member="Lock"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="Unlock"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
send_member="SetIdleHint"/>
<allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Session"
+ send_member="Kill"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
send_member="TakeControl"/>
<allow send_destination="org.freedesktop.login1"
@@ -188,6 +252,14 @@
send_interface="org.freedesktop.login1.Session"
send_member="PauseDeviceComplete"/>
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.User"
+ send_member="Terminate"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.User"
+ send_member="Kill"/>
+
<allow receive_sender="org.freedesktop.login1"/>
</policy>
--
2.4.3

View File

@ -0,0 +1,41 @@
From 6b62bbbc7b53bee11778d27d18e9506d9b42d4ba Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 11 Jul 2015 17:29:48 -0300
Subject: [PATCH 044/261] logind: some firmware implementations remove
OsIndications if it is unset
We shouldn't fall over that, and just assume it is 0 in this case.
Fixes #499.
---
src/shared/efivars.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 0d6ecf5..347cd30 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -125,7 +125,19 @@ static int get_os_indications(uint64_t *os_indication) {
return r;
r = efi_get_variable(EFI_VENDOR_GLOBAL, "OsIndications", NULL, &v, &s);
- if (r < 0)
+ if (r == -ENOENT) {
+ /* Some firmware implementations that do support
+ * OsIndications and report that with
+ * OsIndicationsSupported will remove the
+ * OsIndications variable when it is unset. Let's
+ * pretend it's 0 then, to hide this implementation
+ * detail. Note that this call will return -ENOENT
+ * then only if the support for OsIndications is
+ * missing entirely, as determined by
+ * efi_reboot_to_firmware_supported() above. */
+ *os_indication = 0;
+ return 0;
+ } else if (r < 0)
return r;
else if (s != sizeof(uint64_t))
return -EINVAL;
--
2.4.3

View File

@ -0,0 +1,41 @@
From da770c386f8cc6efd3430ebab4e0707a4bb06c16 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Thu, 16 Jul 2015 18:18:01 +0200
Subject: [PATCH 085/261] logind: prefer new sessions over older ones on VT
switches
Our seat->positions[] array keeps track of the 'preferred' session on a
VT. The only situation this is used, is to select the session to activate
when a VT is activated. In the normal case, there's only one session per
VT so the selection is trivial.
Older greeters, however, implement take-overs when they start sessions on
the same VT that the greeter ran on. We recently limited such take-overs
to VTs where a greeter is running on, to force people to never share VTs
in new code that is written.
For legacy reasons, we need to be compatible to old greeters, though.
Hence, we allow those greeters to implement take-over. In such take-overs,
however, we should really make sure that the new sessions gets preferred
over the old one under all circumstances. Hence, make sure we override
the previous preferred session with a new session.
---
src/login/logind-seat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 9d5287a..1179ce9 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -505,7 +505,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
seat_evict_position(s, session);
session->position = pos;
- if (pos > 0 && !s->positions[pos])
+ if (pos > 0)
s->positions[pos] = session;
}
--
2.4.3

View File

@ -0,0 +1,29 @@
From 281033284352ed7651e84d228dad780dc2ef299f Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Thu, 16 Jul 2015 18:46:12 +0200
Subject: [PATCH 087/261] logind: never select closing sessions for a VT
If a session is in closing state (and already got rid of its VT), then
never re-select it for that VT. There is no reason why we should grant
something to a session that is already going away *AND* already got rid
of exactly that.
---
src/login/logind-seat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 1179ce9..495ec50 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -486,7 +486,7 @@ void seat_evict_position(Seat *s, Session *session) {
* position (eg., during gdm->session transition), so let's look
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
- if (iter->position == pos) {
+ if (iter->position == pos && session_get_state(iter) != SESSION_CLOSING) {
s->positions[pos] = iter;
break;
}
--
2.4.3

View File

@ -0,0 +1,42 @@
From 10189fd6be0f547d75bc857860f3ecbbdbc447a6 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Fri, 31 Jul 2015 16:52:29 +0200
Subject: [PATCH 261/261] logind: release VT-positions when closing sessions
Make sure we release VT-positions when a session is closed. Otherwise,
lingering sessions will occupy VTs and prevent next logins from
succeeding.
Note that we already release session-devices when closing a session, so
there cannot be anyone using the VT anymore.
---
src/login/logind-session.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 2537d02..9a2da79 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -636,6 +636,9 @@ int session_stop(Session *s, bool force) {
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
+ if (s->seat)
+ seat_evict_position(s->seat, s);
+
/* We are going down, don't care about FIFOs anymore */
session_remove_fifo(s);
@@ -672,6 +675,9 @@ int session_finalize(Session *s) {
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
+ if (s->seat)
+ seat_evict_position(s->seat, s);
+
/* Kill session devices */
while ((sd = hashmap_first(s->devices)))
session_device_free(sd);
--
2.4.3

View File

@ -0,0 +1,56 @@
From fa5147fc7c5fcc26d742f87f63a6216bd88ea091 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Fri, 4 Dec 2015 21:33:42 +0100
Subject: [PATCH 01/12] user-sessions: make sure /run/nologin has correct
SELinux label
(cherry picked from commit ea4e6292af593b3b631560ac5139ad1f7442d881)
Resolves: #1287592
---
src/user-sessions/user-sessions.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/user-sessions/user-sessions.c b/src/user-sessions/user-sessions.c
index 1c31769..dc27723 100644
--- a/src/user-sessions/user-sessions.c
+++ b/src/user-sessions/user-sessions.c
@@ -22,7 +22,9 @@
#include <unistd.h>
#include <errno.h>
+#include "fileio-label.h"
#include "log.h"
+#include "selinux-util.h"
#include "util.h"
#include "fileio.h"
@@ -39,6 +41,8 @@ int main(int argc, char*argv[]) {
umask(0022);
+ mac_selinux_init(NULL);
+
if (streq(argv[1], "start")) {
int r = 0;
@@ -65,7 +69,7 @@ int main(int argc, char*argv[]) {
} else if (streq(argv[1], "stop")) {
int r;
- r = write_string_file_atomic("/run/nologin", "System is going down.");
+ r = write_string_file_atomic_label("/run/nologin", "System is going down.");
if (r < 0) {
log_error_errno(r, "Failed to create /run/nologin: %m");
return EXIT_FAILURE;
@@ -76,5 +80,7 @@ int main(int argc, char*argv[]) {
return EXIT_FAILURE;
}
+ mac_selinux_finish();
+
return EXIT_SUCCESS;
}
--
2.5.0

View File

@ -0,0 +1,28 @@
From f8e8050017326f83fc2be3a8e7a344e795b1430d Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Fri, 4 Dec 2015 22:29:38 +0100
Subject: [PATCH 02/12] login: make sure /run/nologin has correct SELinux label
(cherry picked from commit 716cff4b459017028ddb4460cdfdcd09acb36dff)
Resolves: #1287592
---
src/login/logind-dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 291f307..1c1011c 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1774,7 +1774,7 @@ static int nologin_timeout_handler(
log_info("Creating /run/nologin, blocking further logins...");
- r = write_string_file_atomic("/run/nologin", "System is going down.");
+ r = write_string_file_atomic_label("/run/nologin", "System is going down.");
if (r < 0)
log_error_errno(r, "Failed to create /run/nologin: %m");
else
--
2.5.0

View File

@ -0,0 +1,44 @@
From 87c3c33f022344d007d181e62267671a09605f84 Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Tue, 10 Nov 2015 13:05:48 +0100
Subject: [PATCH 03/12] man/journalctl: mention systemd.time(7) where
appropriate
Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1182661
(cherry picked from commit 20b2aec031f79018d290b8f42ab6c3e1116f2d89)
Resolves: #1182661
---
man/journalctl.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/man/journalctl.xml b/man/journalctl.xml
index ca93364..a49c87d 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -554,7 +554,10 @@
respectively. <literal>now</literal> refers to the current
time. Finally, relative times may be specified, prefixed with
<literal>-</literal> or <literal>+</literal>, referring to
- times before or after the current time, respectively.</para>
+ times before or after the current time, respectively. For complete
+ time and date specification, see
+ <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
+ </para>
</listitem>
</varlistentry>
@@ -836,7 +839,8 @@
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>coredumpctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
--
2.5.0

View File

@ -0,0 +1,57 @@
From f88ff4551822931baf9f6b03f59e49d69c950885 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Wed, 15 Jul 2015 12:30:08 +0200
Subject: [PATCH 04/12] sd-device: never return NULL+0
It is highly confusing if a getter function returns 0, but the value is
set to NULL. This, right now, triggers assertions as code relies on the
returned values to be non-NULL.
Like with sd-bus-creds and friends, return 0 only if a value is actually
available.
Discussed with Tom, and actually fixes real bugs as in #512.
(cherry picked from commit bf4c113e179650c07a8f95a14d71f365dbfe66e4)
Resolves: #1238285
---
src/libsystemd/sd-device/sd-device.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index b274f71..7cea5a0 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -791,6 +791,9 @@ _public_ int sd_device_get_subsystem(sd_device *device, const char **ret) {
device->subsystem_set = true;
}
+ if (!device->subsystem)
+ return -ENOENT;
+
*ret = device->subsystem;
return 0;
@@ -908,6 +911,9 @@ _public_ int sd_device_get_driver(sd_device *device, const char **ret) {
return log_debug_errno(r, "sd-device: could not set driver for %s: %m", device->devpath);
}
+ if (!device->driver)
+ return -ENOENT;
+
*ret = device->driver;
return 0;
@@ -1002,6 +1008,8 @@ _public_ int sd_device_get_sysname(sd_device *device, const char **ret) {
return r;
}
+ assert_return(device->sysname, -ENOENT);
+
*ret = device->sysname;
return 0;
--
2.5.0

View File

@ -0,0 +1,33 @@
From c6ab40306733c31e5f2f2d56b3fb199e6b4bfda2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Jul 2015 02:10:32 +0200
Subject: [PATCH 05/12] journalctl: properly detect empty journal files
When we encounter a journal file with exactly zero entries, print a nice
message and exit, and don't print a weird error message.
(cherry picked from commit 02ab86c732576a71179ce12e97d44c289833236d)
Resolves: #1255619
---
src/journal/journalctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 2d6ecfb..073cc77 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -2066,6 +2066,10 @@ int main(int argc, char *argv[]) {
log_error_errno(r, "Failed to iterate through journal: %m");
goto finish;
}
+ if (r == 0) {
+ printf("-- No entries --\n");
+ goto finish;
+ }
if (!arg_follow)
pager_open_if_enabled();
--
2.5.0

View File

@ -0,0 +1,95 @@
From a814fa3f3a2067a17a6698d2fcb6230774d0f981 Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Fri, 2 Oct 2015 11:00:19 +0200
Subject: [PATCH 06/12] import: hash URL in paths if they are too long
https://bugzilla.redhat.com/show_bug.cgi?id=1266775
(cherry picked from commit 9818005de6cc6f525be8aa62a2b8593a7c72e798)
Resolves: #1266775
---
src/import/pull-common.c | 44 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 652277e..84611cb 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -31,8 +31,10 @@
#include "pull-common.h"
#include "process-util.h"
#include "signal-util.h"
+#include "siphash24.h"
#define FILENAME_ESCAPE "/.#\"\'"
+#define HASH_URL_THRESHOLD_LENGTH (_POSIX_PATH_MAX - 16)
int pull_find_old_etags(const char *url, const char *image_root, int dt, const char *prefix, const char *suffix, char ***etags) {
_cleanup_free_ char *escaped_url = NULL;
@@ -142,8 +144,21 @@ int pull_make_local_copy(const char *final, const char *image_root, const char *
return 0;
}
+static int hash_url(const char *url, char **ret) {
+ uint64_t h;
+ static const sd_id128_t k = SD_ID128_ARRAY(df,89,16,87,01,cc,42,30,98,ab,4a,19,a6,a5,63,4f);
+
+ assert(url);
+
+ siphash24((uint8_t *) &h, url, strlen(url), k.bytes);
+ if (asprintf(ret, "%"PRIx64, h) < 0)
+ return -ENOMEM;
+
+ return 0;
+}
+
int pull_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret) {
- _cleanup_free_ char *escaped_url = NULL;
+ _cleanup_free_ char *escaped_url = NULL, *escaped_etag = NULL;
char *path;
assert(url);
@@ -157,18 +172,35 @@ int pull_make_path(const char *url, const char *etag, const char *image_root, co
return -ENOMEM;
if (etag) {
- _cleanup_free_ char *escaped_etag = NULL;
-
escaped_etag = xescape(etag, FILENAME_ESCAPE);
if (!escaped_etag)
return -ENOMEM;
+ }
- path = strjoin(image_root, "/", strempty(prefix), escaped_url, ".", escaped_etag, strempty(suffix), NULL);
- } else
- path = strjoin(image_root, "/", strempty(prefix), escaped_url, strempty(suffix), NULL);
+ path = strjoin(image_root, "/", strempty(prefix), escaped_url, escaped_etag ? "." : "",
+ strempty(escaped_etag), strempty(suffix), NULL);
if (!path)
return -ENOMEM;
+ /* URLs might make the path longer than the maximum allowed length for a file name.
+ * When that happens, a URL hash is used instead. Paths returned by this function
+ * can be later used with tempfn_random() which adds 16 bytes to the resulting name. */
+ if (strlen(path) >= HASH_URL_THRESHOLD_LENGTH) {
+ _cleanup_free_ char *hash = NULL;
+ int r;
+
+ free(path);
+
+ r = hash_url(url, &hash);
+ if (r < 0)
+ return r;
+
+ path = strjoin(image_root, "/", strempty(prefix), hash, escaped_etag ? "." : "",
+ strempty(escaped_etag), strempty(suffix), NULL);
+ if (!path)
+ return -ENOMEM;
+ }
+
*ret = path;
return 0;
}
--
2.5.0

View File

@ -0,0 +1,35 @@
From 2c4f4e407fad772552e82129399173adef1e8e53 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 3 Oct 2015 11:23:52 +0200
Subject: [PATCH 07/12] nspawn: fix --image= when nspawn is run as service
nspawn needs access to /dev/loop to implement --image=, hence grant that
in the service file.
Fixes #1446.
(cherry picked from commit 988a47964283b6a72f5ce117f287ebeb12e26d2d)
Resolves: #1266776
---
units/systemd-nspawn@.service.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/units/systemd-nspawn@.service.in b/units/systemd-nspawn@.service.in
index 074b916..110f1a6 100644
--- a/units/systemd-nspawn@.service.in
+++ b/units/systemd-nspawn@.service.in
@@ -35,5 +35,10 @@ DeviceAllow=/dev/net/tun rwm
DeviceAllow=/dev/pts/ptmx rw
DeviceAllow=char-pts rw
+# nspawn itself needs access to /dev/loop-control and /dev/loop, to
+# implement the --image= option. Add these here, too.
+DeviceAllow=/dev/loop-control rw
+DeviceAllow=block-loop rw
+
[Install]
WantedBy=machines.target
--
2.5.0

View File

@ -0,0 +1,33 @@
From c99a4a60f5ef8a46d8d0841c2e3b72d73611c602 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 22 Oct 2015 00:39:57 +0200
Subject: [PATCH 08/12] units: also whitelist "blkext" block devices for nspawn
service
/dev/loop*p* block devices are of the "blkext" subsystem, not of loop,
hence whitelist this too.
Fixes #1446
(cherry picked from commit a2c90f05f11c01a9f9faf3efb3ec0e05acebd75f)
Resolves: #1266776
---
units/systemd-nspawn@.service.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/units/systemd-nspawn@.service.in b/units/systemd-nspawn@.service.in
index 110f1a6..60f0014 100644
--- a/units/systemd-nspawn@.service.in
+++ b/units/systemd-nspawn@.service.in
@@ -39,6 +39,7 @@ DeviceAllow=char-pts rw
# implement the --image= option. Add these here, too.
DeviceAllow=/dev/loop-control rw
DeviceAllow=block-loop rw
+DeviceAllow=block-blkext rw
[Install]
WantedBy=machines.target
--
2.5.0

View File

@ -0,0 +1,67 @@
From 3fd5f2d43442105cd5208c46e3e91e33553ae80d Mon Sep 17 00:00:00 2001
From: Richard Maw <richard.maw@codethink.co.uk>
Date: Fri, 24 Jul 2015 09:29:46 +0000
Subject: [PATCH 09/12] unquote_first_word: parse ` '' ` as an empty argument
instead of no argument
(cherry picked from commit 14e685c29d5b317b815e3e9f056648027852b07e)
Resolves: #1278475
---
src/basic/util.c | 14 ++++++++++----
src/test/test-util.c | 11 +++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/basic/util.c b/src/basic/util.c
index dffb4a2..d6ab781 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -5193,13 +5193,19 @@ int unquote_first_word(const char **p, char **ret, UnquoteFlags flags) {
case VALUE:
if (c == 0)
goto finish;
- else if (c == '\'')
+ else if (c == '\'') {
+ if (!GREEDY_REALLOC(s, allocated, sz+1))
+ return -ENOMEM;
+
state = SINGLE_QUOTE;
- else if (c == '\\')
+ } else if (c == '\\')
state = VALUE_ESCAPE;
- else if (c == '\"')
+ else if (c == '\"') {
+ if (!GREEDY_REALLOC(s, allocated, sz+1))
+ return -ENOMEM;
+
state = DOUBLE_QUOTE;
- else if (strchr(WHITESPACE, c))
+ } else if (strchr(WHITESPACE, c))
state = SPACE;
else {
if (!GREEDY_REALLOC(s, allocated, sz+2))
diff --git a/src/test/test-util.c b/src/test/test-util.c
index ad9ea3b..41eaa49 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -1398,6 +1398,17 @@ static void test_unquote_first_word(void) {
assert_se(streq(t, "\\w+\b"));
free(t);
assert_se(p == original + 5);
+
+ p = original = "-N ''";
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, "-N"));
+ free(t);
+ assert_se(p == original + 3);
+
+ assert_se(unquote_first_word(&p, &t, UNQUOTE_CUNESCAPE) > 0);
+ assert_se(streq(t, ""));
+ free(t);
+ assert_se(p == original + 5);
}
static void test_unquote_first_word_and_warn(void) {
--
2.5.0

View File

@ -0,0 +1,55 @@
From d3d5865931637112cd80fe5c95bcbf894b283a45 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Sat, 5 Sep 2015 12:56:04 +0200
Subject: [PATCH 10/12] login: fix NULL-deref on wall_message
We treat an empty wall-message equal to a NULL wall-message since:
commit 5744f59a3ee883ef3a78214bd5236157acdc35ba
Author: Lennart Poettering <lennart@poettering.net>
Date: Fri Sep 4 10:34:47 2015 +0200
logind: treat an empty wall message like a NULL one
Fix the shutdown scheduler to not deref a NULL pointer, but properly
check for an empty wall-message.
Fixes: #1120
(cherry picked from commit 3d1c455f9a898e7427b642800644ae7142dc7557)
Resolves: #1279156
---
src/login/logind-dbus.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 1c1011c..c180ce1 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1795,9 +1795,11 @@ static int update_schedule_file(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to create shutdown subdirectory: %m");
- t = cescape(m->wall_message);
- if (!t)
- return log_oom();
+ if (!isempty(m->wall_message)) {
+ t = cescape(m->wall_message);
+ if (!t)
+ return log_oom();
+ }
r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path);
if (r < 0)
@@ -1813,7 +1815,7 @@ static int update_schedule_file(Manager *m) {
m->enable_wall_messages,
m->scheduled_shutdown_type);
- if (!isempty(m->wall_message))
+ if (t)
fprintf(f, "WALL_MESSAGE=%s\n", t);
(void) fflush_and_check(f);
--
2.5.0

View File

@ -0,0 +1,37 @@
From 8e32c9b7b26ff6f33e7bcec5f7a036e4133da6b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 7 Dec 2015 00:09:12 -0500
Subject: [PATCH 11/12] libudev: simplify udev_device_ensure_usec_initialized a
bit
(cherry picked from commit 90b33a2746ef9a409e5b70ea6ef363941c671c1d)
Resolves: #1283971
---
src/libudev/libudev-device-private.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c
index 4b9c053..fa9bd9e 100644
--- a/src/libudev/libudev-device-private.c
+++ b/src/libudev/libudev-device-private.c
@@ -137,14 +137,10 @@ gid_t udev_device_get_devnode_gid(struct udev_device *udev_device) {
}
void udev_device_ensure_usec_initialized(struct udev_device *udev_device, struct udev_device *udev_device_old) {
- sd_device *device_old = NULL;
-
assert(udev_device);
- if (udev_device_old)
- device_old = udev_device_old->device;
-
- device_ensure_usec_initialized(udev_device->device, device_old);
+ device_ensure_usec_initialized(udev_device->device,
+ udev_device_old ? udev_device_old->device : NULL);
}
char **udev_device_get_properties_envp(struct udev_device *udev_device) {
--
2.5.0

View File

@ -0,0 +1,40 @@
From f3d44aa4e5d440c4051ce8a77fb60cbdfb5442a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 7 Dec 2015 00:10:15 -0500
Subject: [PATCH 12/12] udev: fix NULL deref when executing rules
We quite obviously check whether event->dev_db is nonnull, and
right after that call a function which asserts the same. Move
the call under the same if.
https://bugzilla.redhat.com/show_bug.cgi?id=1283971
(cherry picked from commit 9eba69df1cd37c564e414165fd6e6314543427d9)
Resolves: #1283971
---
src/udev/udev-event.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 4761222..eb5e74f 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -862,11 +862,11 @@ void udev_event_execute_rules(struct udev_event *event,
/* disable watch during event processing */
if (major(udev_device_get_devnum(dev)) != 0)
udev_watch_end(event->udev, event->dev_db);
- }
- if (major(udev_device_get_devnum(dev)) == 0 &&
- streq(udev_device_get_action(dev), "move"))
- udev_device_copy_properties(dev, event->dev_db);
+ if (major(udev_device_get_devnum(dev)) == 0 &&
+ streq(udev_device_get_action(dev), "move"))
+ udev_device_copy_properties(dev, event->dev_db);
+ }
udev_rules_apply_to_event(rules, event,
timeout_usec, timeout_warn_usec,
--
2.5.0

View File

@ -0,0 +1,42 @@
From f56439ec3647962da92d130580c24b3d51c26019 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Wed, 22 Jul 2015 22:34:57 -0400
Subject: [PATCH 1/4] nspawn: Don't pass uid mount option for devpts
Mounting devpts with a uid breaks pty allocation with recent glibc
versions, which expect that the kernel will set the correct owner for
user-allocated ptys.
The kernel seems to be smart enough to use the correct uid for root when
we switch to a user namespace.
This resolves #337.
---
src/nspawn/nspawn.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 198de30..9c8ffac 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1785,15 +1785,13 @@ static int setup_pts(const char *dest) {
#ifdef HAVE_SELINUX
if (arg_selinux_apifs_context)
(void) asprintf(&options,
- "newinstance,ptmxmode=0666,mode=620,uid=" UID_FMT ",gid=" GID_FMT ",context=\"%s\"",
- arg_uid_shift,
+ "newinstance,ptmxmode=0666,mode=620,gid=" GID_FMT ",context=\"%s\"",
arg_uid_shift + TTY_GID,
arg_selinux_apifs_context);
else
#endif
(void) asprintf(&options,
- "newinstance,ptmxmode=0666,mode=620,uid=" UID_FMT ",gid=" GID_FMT,
- arg_uid_shift,
+ "newinstance,ptmxmode=0666,mode=620,gid=" GID_FMT,
arg_uid_shift + TTY_GID);
if (!options)
--
2.5.0

View File

@ -0,0 +1,48 @@
From c025384103a9852f852d075337d1e2066253889f Mon Sep 17 00:00:00 2001
From: Stef Walter <stefw@redhat.com>
Date: Fri, 14 Aug 2015 16:38:41 +0200
Subject: [PATCH 2/4] journalctl: make sure 'journalctl -f -t unmatched' blocks
Previously the following command:
$ journalctl -f -t unmatchedtag12345
... would block when called with criteria that did not match any
journal lines. Once log lines appeared that matched the criteria
they were displayed.
Commit 02ab86c732576a71179ce12e97d44c289833236d broke this
behavior and the journal was not followed, but the command
exits with '-- No entries --' displayed.
This commit fixes the issue.
More information downstream:
https://bugzilla.redhat.com/show_bug.cgi?id=1253649
---
src/journal/journalctl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 073cc77..5c058dd 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -2067,8 +2067,12 @@ int main(int argc, char *argv[]) {
goto finish;
}
if (r == 0) {
- printf("-- No entries --\n");
- goto finish;
+ if (arg_follow)
+ need_seek = true;
+ else {
+ printf("-- No entries --\n");
+ goto finish;
+ }
}
if (!arg_follow)
--
2.5.0

View File

@ -0,0 +1,26 @@
From 32ea8df8a957bec913087cb9c34f662d7d890fc1 Mon Sep 17 00:00:00 2001
From: Evgeny Vereshchagin <evvers@ya.ru>
Date: Tue, 17 Nov 2015 06:06:52 +0000
Subject: [PATCH 3/4] journalctl: don't print -- No entries -- in quiet mode
---
src/journal/journalctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 5c058dd..a8e0f01 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -2070,7 +2070,8 @@ int main(int argc, char *argv[]) {
if (arg_follow)
need_seek = true;
else {
- printf("-- No entries --\n");
+ if (!arg_quiet)
+ printf("-- No entries --\n");
goto finish;
}
}
--
2.5.0

View File

@ -0,0 +1,54 @@
From f33ab8bf8d6bfd6de8da3dc305ca61be8e1d6747 Mon Sep 17 00:00:00 2001
From: Maxim Mikityanskiy <maxtram95@gmail.com>
Date: Sat, 22 Aug 2015 11:33:32 +0300
Subject: [PATCH 4/4] sd-device: fix enumeration of devices without subsystem
Prior to commit c32eb440bab953a0169cd207dfef5cad16dfb340, libudev's
function udev_enumerate_scan_devices() had behaved differently. If
parent match was added with udev_enumerate_add_match_parent(),
udev_enumerate_scan_devices() did not return error if some child devices
had no subsystem symlink in sysfs. An example of such devices is USB
endpoints /sys/bus/usb/devices/*/ep_*. If there was a parent match
against USB device, old implementation of udev_enumerate_scan_devices()
did not treat ep_* device directories without subsystem symlink as error
and just ignored them, but new implementation returns -ENOENT (also
ignoring these devices) though correctly enumerates all other matching
devices.
To compare, you could look at 96df036fe3d25525a44f5efdb2fc8560e82e6cfd,
in src/libudev/libudev-enumerate.c, function parent_add_child():
if (!match_subsystem(enumerate, udev_device_get_subsystem(dev)))
goto nomatch;
udev_device_get_subsystem() was returning NULL, match_subsystem() was
returning false, and USB endpoint device was ignored.
New parent_add_child() from src/libsystemd/sd-device/device-enumerator.c
checks return value of sd_device_get_subsystem() and fails if subsystem
was not found. Absence of subsystem symlink should not be really treated
as error because all enumerations of children of USB devices will fail
with -ENOENT. This new behavior also breaks system-config-printer.
So restore old behavior and treat absence of subsystem symlink as no
match.
---
src/libsystemd/sd-device/device-enumerator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
index 7fd77e9..5eb37e1 100644
--- a/src/libsystemd/sd-device/device-enumerator.c
+++ b/src/libsystemd/sd-device/device-enumerator.c
@@ -719,6 +719,8 @@ static int parent_add_child(sd_device_enumerator *enumerator, const char *path)
return r;
r = sd_device_get_subsystem(device, &subsystem);
+ if (r == -ENOENT)
+ return 0;
if (r < 0)
return r;
--
2.5.0

View File

@ -0,0 +1,201 @@
From efe0b569cdf0633968870042283a2b4a4b60de38 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 23 Sep 2015 17:27:39 +0200
Subject: [PATCH 1/5] units: increase watchdog timeout to 3min for all our
services
Apparently, disk IO issues are more frequent than we hope, and 1min
waiting for disk IO happens, so let's increase the watchdog timeout a
bit, for all our services.
See #1353 for an example where this triggers.
(cherry picked from commit c2fc2c2560f0ca0fab383753c065e45d76f465e5)
jsynacek: I would say "Resolves: #1300212" here, but recent reports
(see bugs 1301433, 1301434, 1301435, 1301436, 1301437) against rawhide
(F24) seem to be caused by the same issue, yet the timeout is already
set to 3 minutes.
---
units/systemd-hostnamed.service.in | 2 +-
units/systemd-importd.service.in | 2 +-
units/systemd-journal-remote.service.in | 2 +-
units/systemd-journal-upload.service.in | 2 +-
units/systemd-journald.service.in | 2 +-
units/systemd-localed.service.in | 2 +-
units/systemd-logind.service.in | 2 +-
units/systemd-machined.service.in | 2 +-
units/systemd-networkd.service.m4.in | 2 +-
units/systemd-resolved.service.m4.in | 2 +-
units/systemd-timedated.service.in | 2 +-
units/systemd-timesyncd.service.in | 2 +-
units/systemd-udevd.service.in | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/units/systemd-hostnamed.service.in b/units/systemd-hostnamed.service.in
index cc88ecd..b7079e4 100644
--- a/units/systemd-hostnamed.service.in
+++ b/units/systemd-hostnamed.service.in
@@ -14,7 +14,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/hostnamed
ExecStart=@rootlibexecdir@/systemd-hostnamed
BusName=org.freedesktop.hostname1
CapabilityBoundingSet=CAP_SYS_ADMIN
-WatchdogSec=1min
+WatchdogSec=3min
PrivateTmp=yes
PrivateDevices=yes
PrivateNetwork=yes
diff --git a/units/systemd-importd.service.in b/units/systemd-importd.service.in
index 403f153..d3238cf 100644
--- a/units/systemd-importd.service.in
+++ b/units/systemd-importd.service.in
@@ -14,5 +14,5 @@ ExecStart=@rootlibexecdir@/systemd-importd
BusName=org.freedesktop.import1
CapabilityBoundingSet=CAP_CHOWN CAP_FOWNER CAP_FSETID CAP_MKNOD CAP_SETFCAP CAP_SYS_ADMIN CAP_SETPCAP CAP_DAC_OVERRIDE
NoNewPrivileges=yes
-WatchdogSec=1min
+WatchdogSec=3min
KillMode=mixed
diff --git a/units/systemd-journal-remote.service.in b/units/systemd-journal-remote.service.in
index 4a898d6..2928a23 100644
--- a/units/systemd-journal-remote.service.in
+++ b/units/systemd-journal-remote.service.in
@@ -18,7 +18,7 @@ Group=systemd-journal-remote
PrivateTmp=yes
PrivateDevices=yes
PrivateNetwork=yes
-WatchdogSec=10min
+WatchdogSec=3min
[Install]
Also=systemd-journal-remote.socket
diff --git a/units/systemd-journal-upload.service.in b/units/systemd-journal-upload.service.in
index b2e3c76..a757673 100644
--- a/units/systemd-journal-upload.service.in
+++ b/units/systemd-journal-upload.service.in
@@ -15,7 +15,7 @@ ExecStart=@rootlibexecdir@/systemd-journal-upload \
User=systemd-journal-upload
PrivateTmp=yes
PrivateDevices=yes
-WatchdogSec=20min
+WatchdogSec=3min
# If there are many split up journal files we need a lot of fds to
# access them all and combine
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
index a3540c6..41bfde5 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -22,7 +22,7 @@ RestartSec=0
NotifyAccess=all
StandardOutput=null
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE
-WatchdogSec=1min
+WatchdogSec=3min
FileDescriptorStoreMax=1024
# Increase the default a bit in order to allow many simultaneous
diff --git a/units/systemd-localed.service.in b/units/systemd-localed.service.in
index bfa0978..9b13f90 100644
--- a/units/systemd-localed.service.in
+++ b/units/systemd-localed.service.in
@@ -14,7 +14,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/localed
ExecStart=@rootlibexecdir@/systemd-localed
BusName=org.freedesktop.locale1
CapabilityBoundingSet=
-WatchdogSec=1min
+WatchdogSec=3min
PrivateTmp=yes
PrivateDevices=yes
PrivateNetwork=yes
diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
index f087e99..ff04913 100644
--- a/units/systemd-logind.service.in
+++ b/units/systemd-logind.service.in
@@ -24,7 +24,7 @@ Restart=always
RestartSec=0
BusName=org.freedesktop.login1
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG
-WatchdogSec=1min
+WatchdogSec=3min
# Increase the default a bit in order to allow many simultaneous
# logins since we keep one fd open per session.
diff --git a/units/systemd-machined.service.in b/units/systemd-machined.service.in
index 19c3395..eddbe1d 100644
--- a/units/systemd-machined.service.in
+++ b/units/systemd-machined.service.in
@@ -16,7 +16,7 @@ After=machine.slice
ExecStart=@rootlibexecdir@/systemd-machined
BusName=org.freedesktop.machine1
CapabilityBoundingSet=CAP_KILL CAP_SYS_PTRACE CAP_SYS_ADMIN CAP_SETGID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE
-WatchdogSec=1min
+WatchdogSec=3min
# Note that machined cannot be placed in a mount namespace, since it
# needs access to the host's mount namespace in order to implement the
diff --git a/units/systemd-networkd.service.m4.in b/units/systemd-networkd.service.m4.in
index 64d9130..b7c633b 100644
--- a/units/systemd-networkd.service.m4.in
+++ b/units/systemd-networkd.service.m4.in
@@ -30,7 +30,7 @@ ExecStart=@rootlibexecdir@/systemd-networkd
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER
ProtectSystem=full
ProtectHome=yes
-WatchdogSec=1min
+WatchdogSec=3min
[Install]
WantedBy=multi-user.target
diff --git a/units/systemd-resolved.service.m4.in b/units/systemd-resolved.service.m4.in
index dce5402..c674b27 100644
--- a/units/systemd-resolved.service.m4.in
+++ b/units/systemd-resolved.service.m4.in
@@ -23,7 +23,7 @@ ExecStart=@rootlibexecdir@/systemd-resolved
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER
ProtectSystem=full
ProtectHome=yes
-WatchdogSec=1min
+WatchdogSec=3min
[Install]
WantedBy=multi-user.target
diff --git a/units/systemd-timedated.service.in b/units/systemd-timedated.service.in
index fe5ccb4..0c9599d 100644
--- a/units/systemd-timedated.service.in
+++ b/units/systemd-timedated.service.in
@@ -14,7 +14,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/timedated
ExecStart=@rootlibexecdir@/systemd-timedated
BusName=org.freedesktop.timedate1
CapabilityBoundingSet=CAP_SYS_TIME
-WatchdogSec=1min
+WatchdogSec=3min
PrivateTmp=yes
ProtectSystem=yes
ProtectHome=yes
diff --git a/units/systemd-timesyncd.service.in b/units/systemd-timesyncd.service.in
index 8219c95..a856dad 100644
--- a/units/systemd-timesyncd.service.in
+++ b/units/systemd-timesyncd.service.in
@@ -27,7 +27,7 @@ PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
-WatchdogSec=1min
+WatchdogSec=3min
[Install]
WantedBy=sysinit.target
diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
index e7216d6..79f28c8 100644
--- a/units/systemd-udevd.service.in
+++ b/units/systemd-udevd.service.in
@@ -23,4 +23,4 @@ RestartSec=0
ExecStart=@rootlibexecdir@/systemd-udevd
MountFlags=slave
KillMode=mixed
-WatchdogSec=1min
+WatchdogSec=3min
--
2.5.0

View File

@ -0,0 +1,38 @@
From 11600220d6fa867b0ed4371be61cc0976779d777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 30 Nov 2015 21:00:04 -0500
Subject: [PATCH 2/5] core: do not warn about Wants depencencies on masked
units
When masking is used to prevent a unit from being loaded,
every transaction with dependent units would generate a warning.
Downgrade this warning to debug level.
transaction_add_job_and_dependencies only generated a few return
values found in the table in bus_common_errors.c, and EADDRNOTAVAIL
is not one of them, so do not try to suppress EADDRNOTAVAIL.
https://bugzilla.redhat.com/show_bug.cgi?id=1278264
(cherry picked from commit e43cec8e055da9aaa65c8553c436bdad3e27ddf1)
Resolves: #1278264
---
src/core/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 090103f..38836ef 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -964,7 +964,7 @@ int transaction_add_job_and_dependencies(
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, false, ignore_order, e);
if (r < 0) {
log_unit_full(dep,
- r == -EADDRNOTAVAIL ? LOG_DEBUG : LOG_WARNING, r,
+ r == -EBADR /* unit masked */ ? LOG_DEBUG : LOG_WARNING, r,
"Cannot add dependency job, ignoring: %s",
bus_error_message(e, r));
sd_bus_error_free(e);
--
2.5.0

View File

@ -0,0 +1,44 @@
From 93bd765797dab24b98d06a8043e297d6aaa171d4 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Thu, 14 Jan 2016 09:25:18 +0100
Subject: [PATCH 3/5] transaction: downgrade warnings about wanted unit which
are not found
If a unit was pulled by a Wants= dependency but its unit file was not
present then we logged this as an error.
However Wants= might be used to configure a soft/optional dependency
on another unit, ie. start an optional service only if it's installed
otherwise simply skip it. In this case emitting an error doesn't look
appropriate.
But it's still an error if the optional dependency exists but its
activation fails for any reasons.
(cherry picked from commit f14637fc19c449502af0209d1862e4f829c5cb47)
Resolves: #1278264
---
src/core/transaction.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 38836ef..e5cfb9a 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -963,9 +963,10 @@ int transaction_add_job_and_dependencies(
SET_FOREACH(dep, ret->unit->dependencies[UNIT_WANTS], i) {
r = transaction_add_job_and_dependencies(tr, JOB_START, dep, ret, false, false, false, false, ignore_order, e);
if (r < 0) {
+ /* unit masked and unit not found are not considered as errors. */
log_unit_full(dep,
- r == -EBADR /* unit masked */ ? LOG_DEBUG : LOG_WARNING, r,
- "Cannot add dependency job, ignoring: %s",
+ r == -EBADR || r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
+ r, "Cannot add dependency job, ignoring: %s",
bus_error_message(e, r));
sd_bus_error_free(e);
}
--
2.5.0

View File

@ -0,0 +1,61 @@
From 2060f971a96f70c8608595ba3e91d1b0e6f728ac Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 4 Jan 2016 13:54:11 +1000
Subject: [PATCH 4/5] hwdb: add axis ranges and resolution for Dell Lattitude
E6220
https://bugzilla.redhat.com/show_bug.cgi?id=1293576
(cherry picked from commit 75e60eea5853620fbb32efb5e7b7982aef374357)
Resolves: #1293576
---
hwdb/60-evdev.hwdb | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb
index 815ac24..fb4675a 100644
--- a/hwdb/60-evdev.hwdb
+++ b/hwdb/60-evdev.hwdb
@@ -84,6 +84,39 @@ evdev:input:b0003v05ACp025b*
EVDEV_ABS_36=::92
#########################################
+# ASUS
+#########################################
+# Asus K52JT
+evdev:name:ETPS/2 Elantech Touchpad:dmi:bvn*:bvr*:bd*:svnASUSTeKComputerInc.:pnK52JT:*
+ EVDEV_ABS_00=::18
+ EVDEV_ABS_01=::16
+ EVDEV_ABS_35=::18
+ EVDEV_ABS_36=::16
+
+#########################################
+# Dell
+#########################################
+
+# Dell Vostro 1510
+evdev:name:AlpsPS/2 ALPS GlidePoint*:dmi:bvn*:bvr*:bd*:svnDellInc.:pnVostro1510*
+ EVDEV_ABS_00=::14
+ EVDEV_ABS_01=::18
+
+# Dell Inspiron N5040
+evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnInspironN5040*
+ EVDEV_ABS_00=25:2000:22
+ EVDEV_ABS_01=0:1351:28
+ EVDEV_ABS_35=25:2000:22
+ EVDEV_ABS_36=0:1351:28
+
+# Dell Latitude E6220
+evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6220*
+ EVDEV_ABS_00=76:1815:22
+ EVDEV_ABS_01=131:1330:30
+ EVDEV_ABS_35=76:1815:22
+ EVDEV_ABS_36=131:1330:30
+
+#########################################
# Google
#########################################
--
2.5.0

View File

@ -0,0 +1,208 @@
From f19e9a19f5e59869673609fde8deba80e48f42bc Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 6 Aug 2015 16:50:54 +0300
Subject: [PATCH 5/5] machined: rework state tracking logic for machines
This splits up the stopping logic for machines into two steps: first on
machine_stop() we begin with the shutdown of a machine by queuing the
stop method call for it. Then, in machine_finalize() we actually remove
the rest of its runtime context. This mimics closely how sessions are
handled in logind.
This also reworks the GC logic to strictly check the current state of
the machine unit, rather than shortcutting a few cases, like for example
assuming that UnitRemoved really means a machine is gone (which it isn't
since Reloading might trigger it, see #376).
Fixes #376.
(cherry picked from commit 49f3fffd94591bdf2bd6c2233a9300daeab79566)
Resolves: #1297225
---
src/machine/machine.c | 32 +++++++++++++++++++++-----------
src/machine/machine.h | 2 ++
src/machine/machined-dbus.c | 39 ++++-----------------------------------
src/machine/machined.c | 10 +++++++++-
4 files changed, 36 insertions(+), 47 deletions(-)
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 05fc4f8..7c449ff 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -421,7 +421,19 @@ static int machine_stop_scope(Machine *m) {
}
int machine_stop(Machine *m) {
- int r = 0, k;
+ int r;
+ assert(m);
+
+ r = machine_stop_scope(m);
+
+ m->stopping = true;
+
+ machine_save(m);
+
+ return r;
+}
+
+int machine_finalize(Machine *m) {
assert(m);
if (m->started)
@@ -432,20 +444,15 @@ int machine_stop(Machine *m) {
LOG_MESSAGE("Machine %s terminated.", m->name),
NULL);
- /* Kill cgroup */
- k = machine_stop_scope(m);
- if (k < 0)
- r = k;
-
machine_unlink(m);
machine_add_to_gc_queue(m);
- if (m->started)
+ if (m->started) {
machine_send_signal(m, false);
+ m->started = false;
+ }
- m->started = false;
-
- return r;
+ return 0;
}
bool machine_check_gc(Machine *m, bool drop_not_started) {
@@ -476,8 +483,11 @@ void machine_add_to_gc_queue(Machine *m) {
MachineState machine_get_state(Machine *s) {
assert(s);
+ if (s->stopping)
+ return MACHINE_CLOSING;
+
if (s->scope_job)
- return s->started ? MACHINE_OPENING : MACHINE_CLOSING;
+ return MACHINE_OPENING;
return MACHINE_RUNNING;
}
diff --git a/src/machine/machine.h b/src/machine/machine.h
index bbe5217..74a311c 100644
--- a/src/machine/machine.h
+++ b/src/machine/machine.h
@@ -83,6 +83,7 @@ struct Machine {
bool in_gc_queue:1;
bool started:1;
+ bool stopping:1;
sd_bus_message *create_message;
@@ -101,6 +102,7 @@ bool machine_check_gc(Machine *m, bool drop_not_started);
void machine_add_to_gc_queue(Machine *m);
int machine_start(Machine *m, sd_bus_message *properties, sd_bus_error *error);
int machine_stop(Machine *m);
+int machine_finalize(Machine *m);
int machine_save(Machine *m);
int machine_load(Machine *m);
int machine_kill(Machine *m, KillWho who, int signo);
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 0e971a6..755c218 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -908,8 +908,9 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
machine_send_create_reply(machine, &e);
}
- } else
- machine_save(machine);
+ }
+
+ machine_save(machine);
}
machine_add_to_gc_queue(machine);
@@ -918,7 +919,7 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err
int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_free_ char *unit = NULL;
- const char *path, *interface;
+ const char *path;
Manager *m = userdata;
Machine *machine;
int r;
@@ -942,36 +943,6 @@ int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_err
if (!machine)
return 0;
- r = sd_bus_message_read(message, "s", &interface);
- if (r < 0) {
- bus_log_parse_error(r);
- return 0;
- }
-
- if (streq(interface, "org.freedesktop.systemd1.Unit")) {
- struct properties {
- char *active_state;
- char *sub_state;
- } properties = {};
-
- const struct bus_properties_map map[] = {
- { "ActiveState", "s", NULL, offsetof(struct properties, active_state) },
- { "SubState", "s", NULL, offsetof(struct properties, sub_state) },
- {}
- };
-
- r = bus_message_map_properties_changed(message, map, &properties);
- if (r < 0)
- bus_log_parse_error(r);
- else if (streq_ptr(properties.active_state, "inactive") ||
- streq_ptr(properties.active_state, "failed") ||
- streq_ptr(properties.sub_state, "auto-restart"))
- machine_release_unit(machine);
-
- free(properties.active_state);
- free(properties.sub_state);
- }
-
machine_add_to_gc_queue(machine);
return 0;
}
@@ -995,9 +966,7 @@ int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *er
if (!machine)
return 0;
- machine_release_unit(machine);
machine_add_to_gc_queue(machine);
-
return 0;
}
diff --git a/src/machine/machined.c b/src/machine/machined.c
index 9bfe2ad..1eeeaf1 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -247,8 +247,16 @@ void manager_gc(Manager *m, bool drop_not_started) {
LIST_REMOVE(gc_queue, m->machine_gc_queue, machine);
machine->in_gc_queue = false;
- if (!machine_check_gc(machine, drop_not_started)) {
+ /* First, if we are not closing yet, initiate stopping */
+ if (!machine_check_gc(machine, drop_not_started) &&
+ machine_get_state(machine) != MACHINE_CLOSING)
machine_stop(machine);
+
+ /* Now, the stop stop probably made this referenced
+ * again, but if it didn't, then it's time to let it
+ * go entirely. */
+ if (!machine_check_gc(machine, drop_not_started)) {
+ machine_finalize(machine);
machine_free(machine);
}
}
--
2.5.0

View File

@ -0,0 +1,193 @@
From 202413f3d165af3535af0a307f15da392c8c0665 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Jan 2016 19:48:29 +0100
Subject: [PATCH 1/6] tests: don't abbreviate function names needlessly
THis is otherwise really hard to read...
(cherry picked from commit 218685865a3a7457cb220d20b8f339618cd1d488)
Related: #1288851
---
src/test/test-unit-name.c | 112 +++++++++++++++++++++++-----------------------
1 file changed, 56 insertions(+), 56 deletions(-)
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index e5405fb..399d519 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -63,26 +63,26 @@ static void test_unit_name_is_valid(void) {
assert_se(!unit_name_is_valid("@piep.service", UNIT_NAME_ANY));
}
-static void test_u_n_r_i_one(const char *pattern, const char *repl, const char *expected, int ret) {
+static void test_unit_name_replace_instance_one(const char *pattern, const char *repl, const char *expected, int ret) {
_cleanup_free_ char *t = NULL;
assert_se(unit_name_replace_instance(pattern, repl, &t) == ret);
puts(strna(t));
assert_se(streq_ptr(t, expected));
}
-static void test_u_n_r_i(void) {
+static void test_unit_name_replace_instance(void) {
puts("-------------------------------------------------");
- test_u_n_r_i_one("foo@.service", "waldo", "foo@waldo.service", 0);
- test_u_n_r_i_one("foo@xyz.service", "waldo", "foo@waldo.service", 0);
- test_u_n_r_i_one("xyz", "waldo", NULL, -EINVAL);
- test_u_n_r_i_one("", "waldo", NULL, -EINVAL);
- test_u_n_r_i_one("foo.service", "waldo", NULL, -EINVAL);
- test_u_n_r_i_one(".service", "waldo", NULL, -EINVAL);
- test_u_n_r_i_one("foo@", "waldo", NULL, -EINVAL);
- test_u_n_r_i_one("@bar", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one("foo@.service", "waldo", "foo@waldo.service", 0);
+ test_unit_name_replace_instance_one("foo@xyz.service", "waldo", "foo@waldo.service", 0);
+ test_unit_name_replace_instance_one("xyz", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one("", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one("foo.service", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one(".service", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one("foo@", "waldo", NULL, -EINVAL);
+ test_unit_name_replace_instance_one("@bar", "waldo", NULL, -EINVAL);
}
-static void test_u_n_f_p_one(const char *path, const char *suffix, const char *expected, int ret) {
+static void test_unit_name_from_path_one(const char *path, const char *suffix, const char *expected, int ret) {
_cleanup_free_ char *t = NULL;
assert_se(unit_name_from_path(path, suffix, &t) == ret);
@@ -97,19 +97,19 @@ static void test_u_n_f_p_one(const char *path, const char *suffix, const char *e
}
}
-static void test_u_n_f_p(void) {
+static void test_unit_name_from_path(void) {
puts("-------------------------------------------------");
- test_u_n_f_p_one("/waldo", ".mount", "waldo.mount", 0);
- test_u_n_f_p_one("/waldo/quuix", ".mount", "waldo-quuix.mount", 0);
- test_u_n_f_p_one("/waldo/quuix/", ".mount", "waldo-quuix.mount", 0);
- test_u_n_f_p_one("", ".mount", "-.mount", 0);
- test_u_n_f_p_one("/", ".mount", "-.mount", 0);
- test_u_n_f_p_one("///", ".mount", "-.mount", 0);
- test_u_n_f_p_one("/foo/../bar", ".mount", NULL, -EINVAL);
- test_u_n_f_p_one("/foo/./bar", ".mount", NULL, -EINVAL);
+ test_unit_name_from_path_one("/waldo", ".mount", "waldo.mount", 0);
+ test_unit_name_from_path_one("/waldo/quuix", ".mount", "waldo-quuix.mount", 0);
+ test_unit_name_from_path_one("/waldo/quuix/", ".mount", "waldo-quuix.mount", 0);
+ test_unit_name_from_path_one("", ".mount", "-.mount", 0);
+ test_unit_name_from_path_one("/", ".mount", "-.mount", 0);
+ test_unit_name_from_path_one("///", ".mount", "-.mount", 0);
+ test_unit_name_from_path_one("/foo/../bar", ".mount", NULL, -EINVAL);
+ test_unit_name_from_path_one("/foo/./bar", ".mount", NULL, -EINVAL);
}
-static void test_u_n_f_p_i_one(const char *pattern, const char *path, const char *suffix, const char *expected, int ret) {
+static void test_unit_name_from_path_instance_one(const char *pattern, const char *path, const char *suffix, const char *expected, int ret) {
_cleanup_free_ char *t = NULL;
assert_se(unit_name_from_path_instance(pattern, path, suffix, &t) == ret);
@@ -125,38 +125,38 @@ static void test_u_n_f_p_i_one(const char *pattern, const char *path, const char
}
}
-static void test_u_n_f_p_i(void) {
+static void test_unit_name_from_path_instance(void) {
puts("-------------------------------------------------");
- test_u_n_f_p_i_one("waldo", "/waldo", ".mount", "waldo@waldo.mount", 0);
- test_u_n_f_p_i_one("waldo", "/waldo////quuix////", ".mount", "waldo@waldo-quuix.mount", 0);
- test_u_n_f_p_i_one("waldo", "/", ".mount", "waldo@-.mount", 0);
- test_u_n_f_p_i_one("waldo", "", ".mount", "waldo@-.mount", 0);
- test_u_n_f_p_i_one("waldo", "///", ".mount", "waldo@-.mount", 0);
- test_u_n_f_p_i_one("waldo", "..", ".mount", NULL, -EINVAL);
- test_u_n_f_p_i_one("waldo", "/foo", ".waldi", NULL, -EINVAL);
- test_u_n_f_p_i_one("wa--ldo", "/--", ".mount", "wa--ldo@\\x2d\\x2d.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "/waldo", ".mount", "waldo@waldo.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "/waldo////quuix////", ".mount", "waldo@waldo-quuix.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "/", ".mount", "waldo@-.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "", ".mount", "waldo@-.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "///", ".mount", "waldo@-.mount", 0);
+ test_unit_name_from_path_instance_one("waldo", "..", ".mount", NULL, -EINVAL);
+ test_unit_name_from_path_instance_one("waldo", "/foo", ".waldi", NULL, -EINVAL);
+ test_unit_name_from_path_instance_one("wa--ldo", "/--", ".mount", "wa--ldo@\\x2d\\x2d.mount", 0);
}
-static void test_u_n_t_p_one(const char *unit, const char *path, int ret) {
+static void test_unit_name_to_path_one(const char *unit, const char *path, int ret) {
_cleanup_free_ char *p = NULL;
assert_se(unit_name_to_path(unit, &p) == ret);
assert_se(streq_ptr(path, p));
}
-static void test_u_n_t_p(void) {
- test_u_n_t_p_one("home.mount", "/home", 0);
- test_u_n_t_p_one("home-lennart.mount", "/home/lennart", 0);
- test_u_n_t_p_one("home-lennart-.mount", NULL, -EINVAL);
- test_u_n_t_p_one("-home-lennart.mount", NULL, -EINVAL);
- test_u_n_t_p_one("-home--lennart.mount", NULL, -EINVAL);
- test_u_n_t_p_one("home-..-lennart.mount", NULL, -EINVAL);
- test_u_n_t_p_one("", NULL, -EINVAL);
- test_u_n_t_p_one("home/foo", NULL, -EINVAL);
+static void test_unit_name_to_path(void) {
+ test_unit_name_to_path_one("home.mount", "/home", 0);
+ test_unit_name_to_path_one("home-lennart.mount", "/home/lennart", 0);
+ test_unit_name_to_path_one("home-lennart-.mount", NULL, -EINVAL);
+ test_unit_name_to_path_one("-home-lennart.mount", NULL, -EINVAL);
+ test_unit_name_to_path_one("-home--lennart.mount", NULL, -EINVAL);
+ test_unit_name_to_path_one("home-..-lennart.mount", NULL, -EINVAL);
+ test_unit_name_to_path_one("", NULL, -EINVAL);
+ test_unit_name_to_path_one("home/foo", NULL, -EINVAL);
}
-static void test_u_n_m_one(const char *pattern, const char *expect, int ret) {
+static void test_unit_name_mangle_one(const char *pattern, const char *expect, int ret) {
_cleanup_free_ char *t = NULL;
assert_se(unit_name_mangle(pattern, UNIT_NAME_NOGLOB, &t) == ret);
@@ -173,17 +173,17 @@ static void test_u_n_m_one(const char *pattern, const char *expect, int ret) {
}
}
-static void test_u_n_m(void) {
+static void test_unit_name_mangle(void) {
puts("-------------------------------------------------");
- test_u_n_m_one("foo.service", "foo.service", 0);
- test_u_n_m_one("/home", "home.mount", 1);
- test_u_n_m_one("/dev/sda", "dev-sda.device", 1);
- test_u_n_m_one("üxknürz.service", "\\xc3\\xbcxkn\\xc3\\xbcrz.service", 1);
- test_u_n_m_one("foobar-meh...waldi.service", "foobar-meh...waldi.service", 0);
- test_u_n_m_one("_____####----.....service", "_____\\x23\\x23\\x23\\x23----.....service", 1);
- test_u_n_m_one("_____##@;;;,,,##----.....service", "_____\\x23\\x23@\\x3b\\x3b\\x3b\\x2c\\x2c\\x2c\\x23\\x23----.....service", 1);
- test_u_n_m_one("xxx@@@@/////\\\\\\\\\\yyy.service", "xxx@@@@-----\\\\\\\\\\yyy.service", 1);
- test_u_n_m_one("", NULL, -EINVAL);
+ test_unit_name_mangle_one("foo.service", "foo.service", 0);
+ test_unit_name_mangle_one("/home", "home.mount", 1);
+ test_unit_name_mangle_one("/dev/sda", "dev-sda.device", 1);
+ test_unit_name_mangle_one("üxknürz.service", "\\xc3\\xbcxkn\\xc3\\xbcrz.service", 1);
+ test_unit_name_mangle_one("foobar-meh...waldi.service", "foobar-meh...waldi.service", 0);
+ test_unit_name_mangle_one("_____####----.....service", "_____\\x23\\x23\\x23\\x23----.....service", 1);
+ test_unit_name_mangle_one("_____##@;;;,,,##----.....service", "_____\\x23\\x23@\\x3b\\x3b\\x3b\\x2c\\x2c\\x2c\\x23\\x23----.....service", 1);
+ test_unit_name_mangle_one("xxx@@@@/////\\\\\\\\\\yyy.service", "xxx@@@@-----\\\\\\\\\\yyy.service", 1);
+ test_unit_name_mangle_one("", NULL, -EINVAL);
}
static int test_unit_printf(void) {
@@ -459,11 +459,11 @@ static void test_unit_name_path_unescape(void) {
int main(int argc, char* argv[]) {
int rc = 0;
test_unit_name_is_valid();
- test_u_n_r_i();
- test_u_n_f_p();
- test_u_n_f_p_i();
- test_u_n_m();
- test_u_n_t_p();
+ test_unit_name_replace_instance();
+ test_unit_name_from_path();
+ test_unit_name_from_path_instance();
+ test_unit_name_mangle();
+ test_unit_name_to_path();
TEST_REQ_RUNNING_SYSTEMD(rc = test_unit_printf());
test_unit_instance_is_valid();
test_unit_prefix_is_valid();
--
2.5.0

View File

@ -0,0 +1,163 @@
From 523abe6fb5160861889858319ccd97fba5bae9a7 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Jan 2016 20:25:10 +0100
Subject: [PATCH 2/6] basic: don't append suffixes to unit name glob
expressions
When the user specifies "foo*" as unit name glob expression, we shouldn't turn this into "foo*.service". Hence: only
append a suffix if the specified string isn't a glob expression.
Fixes: #2397
(cherry picked from commit 2aaafcf57048983b2b76d6325f333e50aca4a3a3)
Resolves: #1288851
---
src/basic/unit-name.c | 44 +++++++++++++++++++++++++++++++++-----------
src/test/test-unit-name.c | 32 +++++++++++++++++++-------------
2 files changed, 52 insertions(+), 24 deletions(-)
diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
index bf52463..70db7a3 100644
--- a/src/basic/unit-name.c
+++ b/src/basic/unit-name.c
@@ -29,10 +29,22 @@
#include "def.h"
#include "strv.h"
+/* Characters valid in a unit name. */
#define VALID_CHARS \
- DIGITS LETTERS \
+ DIGITS \
+ LETTERS \
":-_.\\"
+/* The same, but also permits the single @ character that may appear */
+#define VALID_CHARS_WITH_AT \
+ "@" \
+ VALID_CHARS
+
+/* All chars valid in a unit name glob */
+#define VALID_CHARS_GLOB \
+ VALID_CHARS_WITH_AT \
+ "[]!-*?"
+
bool unit_name_is_valid(const char *n, UnitNameFlags flags) {
const char *e, *i, *at;
@@ -596,7 +608,7 @@ static char *do_escape_mangle(const char *f, UnitNameMangle allow_globs, char *t
/* We'll only escape the obvious characters here, to play
* safe. */
- valid_chars = allow_globs == UNIT_NAME_GLOB ? "@" VALID_CHARS "[]!-*?" : "@" VALID_CHARS;
+ valid_chars = allow_globs == UNIT_NAME_GLOB ? VALID_CHARS_GLOB : VALID_CHARS_WITH_AT;
for (; *f; f++) {
if (*f == '/')
@@ -631,15 +643,15 @@ int unit_name_mangle_with_suffix(const char *name, UnitNameMangle allow_globs, c
if (!unit_suffix_is_valid(suffix))
return -EINVAL;
- if (unit_name_is_valid(name, UNIT_NAME_ANY)) {
- /* No mangling necessary... */
- s = strdup(name);
- if (!s)
- return -ENOMEM;
+ /* Already a fully valid unit name? If so, no mangling is necessary... */
+ if (unit_name_is_valid(name, UNIT_NAME_ANY))
+ goto good;
- *ret = s;
- return 0;
- }
+ /* Already a fully valid globbing expression? If so, no mangling is necessary either... */
+ if (allow_globs == UNIT_NAME_GLOB &&
+ string_is_glob(name) &&
+ in_charset(name, VALID_CHARS_GLOB))
+ goto good;
if (is_device_path(name)) {
r = unit_name_from_path(name, ".device", ret);
@@ -664,11 +676,21 @@ int unit_name_mangle_with_suffix(const char *name, UnitNameMangle allow_globs, c
t = do_escape_mangle(name, allow_globs, s);
*t = 0;
- if (unit_name_to_type(s) < 0)
+ /* Append a suffix if it doesn't have any, but only if this is not a glob, so that we can allow "foo.*" as a
+ * valid glob. */
+ if ((allow_globs != UNIT_NAME_GLOB || !string_is_glob(s)) && unit_name_to_type(s) < 0)
strcpy(t, suffix);
*ret = s;
return 1;
+
+good:
+ s = strdup(name);
+ if (!s)
+ return -ENOMEM;
+
+ *ret = s;
+ return 0;
}
int slice_build_parent_slice(const char *slice, char **ret) {
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 399d519..31870ed 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -156,34 +156,40 @@ static void test_unit_name_to_path(void) {
test_unit_name_to_path_one("home/foo", NULL, -EINVAL);
}
-static void test_unit_name_mangle_one(const char *pattern, const char *expect, int ret) {
+static void test_unit_name_mangle_one(UnitNameMangle allow_globs, const char *pattern, const char *expect, int ret) {
_cleanup_free_ char *t = NULL;
- assert_se(unit_name_mangle(pattern, UNIT_NAME_NOGLOB, &t) == ret);
+ assert_se(unit_name_mangle(pattern, allow_globs, &t) == ret);
puts(strna(t));
assert_se(streq_ptr(t, expect));
if (t) {
_cleanup_free_ char *k = NULL;
- assert_se(unit_name_is_valid(t, UNIT_NAME_ANY));
+ assert_se(unit_name_is_valid(t, UNIT_NAME_ANY) ||
+ (allow_globs == UNIT_NAME_GLOB && string_is_glob(t)));
- assert_se(unit_name_mangle(t, UNIT_NAME_NOGLOB, &k) == 0);
+ assert_se(unit_name_mangle(t, allow_globs, &k) == 0);
assert_se(streq_ptr(t, k));
}
}
static void test_unit_name_mangle(void) {
puts("-------------------------------------------------");
- test_unit_name_mangle_one("foo.service", "foo.service", 0);
- test_unit_name_mangle_one("/home", "home.mount", 1);
- test_unit_name_mangle_one("/dev/sda", "dev-sda.device", 1);
- test_unit_name_mangle_one("üxknürz.service", "\\xc3\\xbcxkn\\xc3\\xbcrz.service", 1);
- test_unit_name_mangle_one("foobar-meh...waldi.service", "foobar-meh...waldi.service", 0);
- test_unit_name_mangle_one("_____####----.....service", "_____\\x23\\x23\\x23\\x23----.....service", 1);
- test_unit_name_mangle_one("_____##@;;;,,,##----.....service", "_____\\x23\\x23@\\x3b\\x3b\\x3b\\x2c\\x2c\\x2c\\x23\\x23----.....service", 1);
- test_unit_name_mangle_one("xxx@@@@/////\\\\\\\\\\yyy.service", "xxx@@@@-----\\\\\\\\\\yyy.service", 1);
- test_unit_name_mangle_one("", NULL, -EINVAL);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "foo.service", "foo.service", 0);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "/home", "home.mount", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "/dev/sda", "dev-sda.device", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "üxknürz.service", "\\xc3\\xbcxkn\\xc3\\xbcrz.service", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "foobar-meh...waldi.service", "foobar-meh...waldi.service", 0);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "_____####----.....service", "_____\\x23\\x23\\x23\\x23----.....service", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "_____##@;;;,,,##----.....service", "_____\\x23\\x23@\\x3b\\x3b\\x3b\\x2c\\x2c\\x2c\\x23\\x23----.....service", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "xxx@@@@/////\\\\\\\\\\yyy.service", "xxx@@@@-----\\\\\\\\\\yyy.service", 1);
+ test_unit_name_mangle_one(UNIT_NAME_NOGLOB, "", NULL, -EINVAL);
+
+ test_unit_name_mangle_one(UNIT_NAME_GLOB, "foo.service", "foo.service", 0);
+ test_unit_name_mangle_one(UNIT_NAME_GLOB, "foo", "foo.service", 1);
+ test_unit_name_mangle_one(UNIT_NAME_GLOB, "foo*", "foo*", 0);
+ test_unit_name_mangle_one(UNIT_NAME_GLOB, "ü*", "\\xc3\\xbc*", 1);
}
static int test_unit_printf(void) {
--
2.5.0

View File

@ -0,0 +1,72 @@
From ea7a3a783f8c9f49f5aedae9574fd70d9c9074ec Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Jan 2016 19:50:04 +0100
Subject: [PATCH 3/6] man: document that unit file globbing only operates on
primary unit names
See: #2397
(cherry picked from commit 1f00ededc7451933e23a95597804897b37fa88d6)
Related: #1288851
---
man/systemctl.xml | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 66a0900..50e8ce0 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -658,14 +658,11 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<para>Start (activate) one or more units specified on the
command line.</para>
- <para>Note that glob patterns operate on a list of currently
- loaded units. Units which are not active and are not in a
- failed state usually are not loaded, and would not be
- matched by any pattern. In addition, in case of
- instantiated units, systemd is often unaware of the
- instance name until the instance has been started. Therefore,
- using glob patterns with <command>start</command>
- has limited usefulness.</para>
+ <para>Note that glob patterns operate on the set of primary names of currently loaded units. Units which
+ are not active and are not in a failed state usually are not loaded, and will not be matched by any
+ pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
+ the instance has been started. Therefore, using glob patterns with <command>start</command> has limited
+ usefulness. Also, secondary alias names of units are not considered.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -1701,11 +1698,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
are equivalent to:
<programlisting># systemctl status dev-sda.device
# systemctl status home.mount</programlisting>
- In the second case, shell-style globs will be matched against
- currently loaded units; literal unit names, with or without
- a suffix, will be treated as in the first case. This means that
- literal unit names always refer to exactly one unit, but globs
- may match zero units and this is not considered an error.</para>
+ In the second case, shell-style globs will be matched against the primary names of all currently loaded units;
+ literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
+ names always refer to exactly one unit, but globs may match zero units and this is not considered an
+ error.</para>
<para>Glob patterns use
<citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
@@ -1713,11 +1709,12 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
<literal>*</literal>, <literal>?</literal>,
<literal>[]</literal> may be used. See
<citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
- for more details. The patterns are matched against the names of
+ for more details. The patterns are matched against the primary names of
currently loaded units, and patterns which do not match anything
are silently skipped. For example:
<programlisting># systemctl stop sshd@*.service</programlisting>
- will stop all <filename>sshd@.service</filename> instances.
+ will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
+ loaded are not considered for glob expansion.
</para>
<para>For unit file commands, the specified
--
2.5.0

View File

@ -0,0 +1,56 @@
From ae6d86c079a73eeb6554b37ec57436d748527b02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 26 Jan 2016 17:05:38 -0500
Subject: [PATCH 4/6] ask-password-api: only emit a star on valid unicode
codepoint
https://bugzilla.redhat.com/show_bug.cgi?id=1301984
(cherry picked from commit f3149d57b6e4c9e9abd3525c5266e0e258e8572d)
Resolves: #1301984
---
src/shared/ask-password-api.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index 3941605..f26b28f 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -39,6 +39,7 @@
#include "terminal-util.h"
#include "signal-util.h"
#include "ask-password-api.h"
+#include "utf8.h"
static void backspace_chars(int ttyfd, size_t p) {
@@ -60,8 +61,8 @@ int ask_password_tty(
char **_passphrase) {
struct termios old_termios, new_termios;
- char passphrase[LINE_MAX], *x;
- size_t p = 0;
+ char passphrase[LINE_MAX + 1] = {}, *x;
+ size_t p = 0, codepoint = 0;
int r;
_cleanup_close_ int ttyfd = -1, notify = -1;
struct pollfd pollfd[2];
@@ -221,8 +222,13 @@ int ask_password_tty(
passphrase[p++] = c;
- if (!silent_mode && ttyfd >= 0)
- loop_write(ttyfd, echo ? &c : "*", 1, false);
+ if (!silent_mode && ttyfd >= 0) {
+ n = utf8_encoded_valid_unichar(passphrase + codepoint);
+ if (n >= 0) {
+ codepoint = p;
+ loop_write(ttyfd, echo ? &c : "*", 1, false);
+ }
+ }
dirty = true;
}
--
2.5.0

View File

@ -0,0 +1,251 @@
From d2686a718564c0873e2ed7138e7a31471279c1ec Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 18 Nov 2015 13:37:30 +0100
Subject: [PATCH 5/6] core: add new RandomSec= setting for time units
This allows configuration of a random time on top of the elapse events,
in order to spread time events in a network evenly across a range.
(cherry picked from commit 744c7693751830149ae78fdaf95c6c6f99d59f07)
Resolves: #1303552
---
man/systemd.timer.xml | 43 ++++++++++++++++++++++++++++++-----
src/core/dbus-timer.c | 17 ++++++++++++++
src/core/load-fragment-gperf.gperf.m4 | 1 +
src/core/timer.c | 32 +++++++++++++++++++++++++-
src/core/timer.h | 1 +
src/shared/bus-util.c | 31 +++++++++++++++++++++++++
6 files changed, 118 insertions(+), 7 deletions(-)
diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml
index 20890f2..bdd14d8 100644
--- a/man/systemd.timer.xml
+++ b/man/systemd.timer.xml
@@ -180,13 +180,12 @@
<varname>OnUnitInactiveSec=</varname> and ending the time
configured with <varname>AccuracySec=</varname> later. Within
this time window, the expiry time will be placed at a
- host-specific, randomized but stable position that is
+ host-specific, randomized, but stable position that is
synchronized between all local timer units. This is done in
- order to distribute the wake-up time in networked
- installations, as well as optimizing power consumption to
- suppress unnecessary CPU wake-ups. To get best accuracy, set
- this option to 1us. Note that the timer is still subject to
- the timer slack configured via
+ order to optimize power consumption to suppress unnecessary
+ CPU wake-ups. To get best accuracy, set this option to
+ 1us. Note that the timer is still subject to the timer slack
+ configured via
<citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>'s
<varname>TimerSlackNSec=</varname> setting. See
<citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>
@@ -194,6 +193,38 @@
this value as high as possible and as low as
necessary.</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>RandomSec=</varname></term>
+
+ <listitem><para>Delay the timer by a randomly selected, evenly
+ distributed amount of time between 0 and the specified time
+ value. Defaults to 0, indicating that no randomized delay
+ shall be applied. Each timer unit will determine this delay
+ randomly each time it is started, and the delay will simply be
+ added on top of the next determined elapsing time. This is
+ useful to stretch dispatching of similarly configured timer
+ events over a certain amount time, to avoid that they all fire
+ at the same time, possibly resulting in resource
+ congestion. Note the relation to
+ <varname>AccuracySec=</varname> above: the latter allows the
+ service manager to coalesce timer events within a specified
+ time range in order to minimize wakeups, the former does the
+ opposite: it stretches timer events over a time range, to make
+ it unlikely that they fire simultaneously. If
+ <varname>RandomSec=</varname> and
+ <varname>AccuracySec=</varname> are used in conjunction, first
+ the a randomized time is added, and the result is then
+ possibly shifted further to coalesce it with other timer
+ events possibly happening on the system. As mentioned above
+ <varname>AccuracySec=</varname> defaults to 1min and
+ <varname>RandomSec=</varname> to 0, thus encouraging
+ coalescing of timer events. In order to optimally stretch
+ timer events over a certain range of time, make sure to set
+ <varname>RandomSec=</varname> to a higher value, and
+ <varname>AccuracySec=1us</varname>.</para></listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>Unit=</varname></term>
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index 74a9914..7875bf6 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -179,6 +179,7 @@ const sd_bus_vtable bus_timer_vtable[] = {
BUS_PROPERTY_DUAL_TIMESTAMP("LastTriggerUSec", offsetof(Timer, last_trigger), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Timer, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("AccuracyUSec", "t", bus_property_get_usec, offsetof(Timer, accuracy_usec), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RandomUSec", "t", bus_property_get_usec, offsetof(Timer, random_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Persistent", "b", bus_property_get_bool, offsetof(Timer, persistent), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("WakeSystem", "b", bus_property_get_bool, offsetof(Timer, wake_system), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_VTABLE_END
@@ -282,6 +283,22 @@ static int bus_timer_set_transient_property(
return 1;
+ } else if (streq(name, "RandomUSec")) {
+ usec_t u = 0;
+
+ r = sd_bus_message_read(message, "t", &u);
+ if (r < 0)
+ return r;
+
+ if (mode != UNIT_CHECK) {
+ char time[FORMAT_TIMESPAN_MAX];
+
+ t->random_usec = u;
+ unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomSec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC));
+ }
+
+ return 1;
+
} else if (streq(name, "WakeSystem")) {
int b;
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index aae81c8..270b069 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -335,6 +335,7 @@ Timer.OnUnitInactiveSec, config_parse_timer, 0,
Timer.Persistent, config_parse_bool, 0, offsetof(Timer, persistent)
Timer.WakeSystem, config_parse_bool, 0, offsetof(Timer, wake_system)
Timer.AccuracySec, config_parse_sec, 0, offsetof(Timer, accuracy_usec)
+Timer.RandomSec, config_parse_sec, 0, offsetof(Timer, random_usec)
Timer.Unit, config_parse_trigger_unit, 0, 0
m4_dnl
Path.PathExists, config_parse_path_spec, 0, 0
diff --git a/src/core/timer.c b/src/core/timer.c
index 7f4a2eb..cf50f03 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -25,6 +25,7 @@
#include "unit-name.h"
#include "timer.h"
#include "dbus-timer.h"
+#include "random-util.h"
#include "special.h"
#include "bus-util.h"
#include "bus-error.h"
@@ -305,6 +306,28 @@ static usec_t monotonic_to_boottime(usec_t t) {
return 0;
}
+static void add_random(Timer *t, usec_t *v) {
+ char s[FORMAT_TIMESPAN_MAX];
+ usec_t add;
+
+ assert(t);
+ assert(*v);
+
+ if (t->random_usec == 0)
+ return;
+ if (*v == USEC_INFINITY)
+ return;
+
+ add = random_u64() % t->random_usec;
+
+ if (*v + add < *v) /* overflow */
+ *v = (usec_t) -2; /* Highest possible value, that is not USEC_INFINITY */
+ else
+ *v += add;
+
+ log_unit_info(UNIT(t), "Adding %s random time.", format_timespan(s, sizeof(s), add, 0));
+}
+
static void timer_enter_waiting(Timer *t, bool initial) {
bool found_monotonic = false, found_realtime = false;
usec_t ts_realtime, ts_monotonic;
@@ -420,8 +443,12 @@ static void timer_enter_waiting(Timer *t, bool initial) {
if (found_monotonic) {
char buf[FORMAT_TIMESPAN_MAX];
+ usec_t left;
- log_unit_debug(UNIT(t), "Monotonic timer elapses in %s.", format_timespan(buf, sizeof(buf), t->next_elapse_monotonic_or_boottime > ts_monotonic ? t->next_elapse_monotonic_or_boottime - ts_monotonic : 0, 0));
+ add_random(t, &t->next_elapse_monotonic_or_boottime);
+
+ left = t->next_elapse_monotonic_or_boottime > ts_monotonic ? t->next_elapse_monotonic_or_boottime - ts_monotonic : 0;
+ log_unit_debug(UNIT(t), "Monotonic timer elapses in %s.", format_timespan(buf, sizeof(buf), left, 0));
if (t->monotonic_event_source) {
r = sd_event_source_set_time(t->monotonic_event_source, t->next_elapse_monotonic_or_boottime);
@@ -454,6 +481,9 @@ static void timer_enter_waiting(Timer *t, bool initial) {
if (found_realtime) {
char buf[FORMAT_TIMESTAMP_MAX];
+
+ add_random(t, &t->next_elapse_realtime);
+
log_unit_debug(UNIT(t), "Realtime timer elapses at %s.", format_timestamp(buf, sizeof(buf), t->next_elapse_realtime));
if (t->realtime_event_source) {
diff --git a/src/core/timer.h b/src/core/timer.h
index 9d919e4..415a71b 100644
--- a/src/core/timer.h
+++ b/src/core/timer.h
@@ -68,6 +68,7 @@ struct Timer {
Unit meta;
usec_t accuracy_usec;
+ usec_t random_usec;
LIST_HEAD(TimerValue, values);
usec_t next_elapse_realtime;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 11350da..b1f598a 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1374,6 +1374,37 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
return bus_log_create_error(r);
return 0;
+
+ } else if (streq(field, "EnvironmentFile")) {
+
+ r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "EnvironmentFiles");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_append(m, "v", "a(sb)", 1,
+ eq[0] == '-' ? eq + 1 : eq,
+ eq[0] == '-');
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ return 0;
+
+ } else if (streq(field, "RandomSec")) {
+ usec_t t;
+
+ r = parse_sec(eq, &t);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse RandomSec= parameter: %s", eq);
+
+ r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "RandomUSec");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_append(m, "v", "t", t);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ return 0;
}
r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, field);
--
2.5.0

View File

@ -0,0 +1,122 @@
From 631a626cee4f80368fec05f11c4e6cab637256b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 26 Nov 2015 16:32:41 -0500
Subject: [PATCH 6/6] core: rename Random* to RandomizedDelay*
The name RandomSec is too generic: "Sec" just specifies the default
unit type, and "Random" by itself is not enough. Rename to something
that should give the user general idea what the setting does without
looking at documentation.
(cherry picked from commit 6f5d79986a9c98b9cacc83f865fed957e4e6e4e6)
Related: #1303552
---
man/systemd.timer.xml | 8 ++++----
src/core/dbus-timer.c | 6 +++---
src/core/load-fragment-gperf.gperf.m4 | 2 +-
src/shared/bus-util.c | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml
index bdd14d8..ab83b2c 100644
--- a/man/systemd.timer.xml
+++ b/man/systemd.timer.xml
@@ -195,7 +195,7 @@
</varlistentry>
<varlistentry>
- <term><varname>RandomSec=</varname></term>
+ <term><varname>RandomizedDelaySec=</varname></term>
<listitem><para>Delay the timer by a randomly selected, evenly
distributed amount of time between 0 and the specified time
@@ -212,16 +212,16 @@
time range in order to minimize wakeups, the former does the
opposite: it stretches timer events over a time range, to make
it unlikely that they fire simultaneously. If
- <varname>RandomSec=</varname> and
+ <varname>RandomizedDelaySec=</varname> and
<varname>AccuracySec=</varname> are used in conjunction, first
the a randomized time is added, and the result is then
possibly shifted further to coalesce it with other timer
events possibly happening on the system. As mentioned above
<varname>AccuracySec=</varname> defaults to 1min and
- <varname>RandomSec=</varname> to 0, thus encouraging
+ <varname>RandomizedDelaySec=</varname> to 0, thus encouraging
coalescing of timer events. In order to optimally stretch
timer events over a certain range of time, make sure to set
- <varname>RandomSec=</varname> to a higher value, and
+ <varname>RandomizedDelaySec=</varname> to a higher value, and
<varname>AccuracySec=1us</varname>.</para></listitem>
</varlistentry>
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index 7875bf6..270cd27 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -179,7 +179,7 @@ const sd_bus_vtable bus_timer_vtable[] = {
BUS_PROPERTY_DUAL_TIMESTAMP("LastTriggerUSec", offsetof(Timer, last_trigger), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Timer, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("AccuracyUSec", "t", bus_property_get_usec, offsetof(Timer, accuracy_usec), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("RandomUSec", "t", bus_property_get_usec, offsetof(Timer, random_usec), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RandomizedDelayUSec", "t", bus_property_get_usec, offsetof(Timer, random_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Persistent", "b", bus_property_get_bool, offsetof(Timer, persistent), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("WakeSystem", "b", bus_property_get_bool, offsetof(Timer, wake_system), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_VTABLE_END
@@ -283,7 +283,7 @@ static int bus_timer_set_transient_property(
return 1;
- } else if (streq(name, "RandomUSec")) {
+ } else if (streq(name, "RandomizedDelayUSec")) {
usec_t u = 0;
r = sd_bus_message_read(message, "t", &u);
@@ -294,7 +294,7 @@ static int bus_timer_set_transient_property(
char time[FORMAT_TIMESPAN_MAX];
t->random_usec = u;
- unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomSec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC));
+ unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomizedDelaySec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC));
}
return 1;
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index 270b069..2b37641 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -335,7 +335,7 @@ Timer.OnUnitInactiveSec, config_parse_timer, 0,
Timer.Persistent, config_parse_bool, 0, offsetof(Timer, persistent)
Timer.WakeSystem, config_parse_bool, 0, offsetof(Timer, wake_system)
Timer.AccuracySec, config_parse_sec, 0, offsetof(Timer, accuracy_usec)
-Timer.RandomSec, config_parse_sec, 0, offsetof(Timer, random_usec)
+Timer.RandomizedDelaySec, config_parse_sec, 0, offsetof(Timer, random_usec)
Timer.Unit, config_parse_trigger_unit, 0, 0
m4_dnl
Path.PathExists, config_parse_path_spec, 0, 0
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index b1f598a..f19633a 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1389,14 +1389,14 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
return 0;
- } else if (streq(field, "RandomSec")) {
+ } else if (streq(field, "RandomizedDelaySec")) {
usec_t t;
r = parse_sec(eq, &t);
if (r < 0)
- return log_error_errno(r, "Failed to parse RandomSec= parameter: %s", eq);
+ return log_error_errno(r, "Failed to parse RandomizedDelaySec= parameter: %s", eq);
- r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "RandomUSec");
+ r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, "RandomizedDelayUSec");
if (r < 0)
return bus_log_create_error(r);
--
2.5.0

View File

@ -0,0 +1,37 @@
From 2c3f5a607188d876b3dcfb0075dab79eda914803 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jul 2016 15:33:13 +0200
Subject: [PATCH] macros.systemd.in: add %systemd_ordering (#3776)
To remove the hard dependency on systemd, for packages, which function
without a running systemd the %systemd_ordering macro can be used to
ensure ordering in the rpm transaction. %systemd_ordering makes sure,
the systemd rpm is installed prior to the package, so the %pre/%post
scripts can execute the systemd parts.
Installing systemd afterwards though, does not result in the same outcome.
(cherry picked from commit 2424b6bd716f0c1c3bf3406b1fd1a16ba1b6a556)
---
src/core/macros.systemd.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in
index 2cace3d3ba..f3089cbcc9 100644
--- a/src/core/macros.systemd.in
+++ b/src/core/macros.systemd.in
@@ -36,6 +36,12 @@ Requires(preun): systemd \
Requires(postun): systemd \
%{nil}
+%systemd_ordering \
+OrderWithRequires(post): systemd \
+OrderWithRequires(preun): systemd \
+OrderWithRequires(postun): systemd \
+%{nil}
+
%systemd_post() \
if [ $1 -eq 1 ] ; then \
# Initial installation \
--
2.9.0

View File

@ -0,0 +1,48 @@
From 619c8d786f8441dfe7fd9787533be8dfb9cc8a14 Mon Sep 17 00:00:00 2001
From: Fedora systemd team <systemd-maint@redhat.com>
Date: Sat, 1 Oct 2016 11:23:32 -0400
Subject: [PATCH] Fix notification assert and return value from handler
---
src/core/manager.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/core/manager.c b/src/core/manager.c
index a1f37bbbb3..ea92e7aebf 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1484,7 +1484,6 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, char *
assert(m);
assert(u);
assert(buf);
- assert(n > 0);
tags = strv_split(buf, "\n\r");
if (!tags) {
@@ -1538,10 +1537,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
n = recvmsg(m->notify_fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
if (n < 0) {
- if (errno == EAGAIN || errno == EINTR)
- break;
+ if (!IN_SET(errno, EAGAIN, EINTR))
+ log_error("Failed to receive notification message: %m");
- return -errno;
+ return 0;
}
CMSG_FOREACH(cmsg, &msghdr) {
@@ -1564,7 +1563,8 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
r = fdset_new_array(&fds, fd_array, n_fds);
if (r < 0) {
close_many(fd_array, n_fds);
- return log_oom();
+ log_oom();
+ return 0;
}
}
--
2.9.0

View File

@ -0,0 +1,31 @@
From 1f74d99193e7d2b0546e641aba25259d9a646e5d Mon Sep 17 00:00:00 2001
From: Jorge Niedbalski <jorge.niedbalski@canonical.com>
Date: Wed, 28 Sep 2016 18:25:50 -0300
Subject: [PATCH] If the notification message length is 0, ignore the message
(#4237)
Fixes #4234.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
---
src/core/manager.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/core/manager.c b/src/core/manager.c
index f36cf5e320..6bd32ed920 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1557,6 +1557,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
return -errno;
}
+ if (n == 0) {
+ log_debug("Got zero-length notification message. Ignoring.");
+ return 0;
+ }
CMSG_FOREACH(cmsg, &msghdr) {
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
--
2.9.0

View File

@ -1,43 +1,54 @@
From 0256bbe384f243dbbcfbe87200c9d8613a992ecb Mon Sep 17 00:00:00 2001
From 019766177baf70d5a4f688adb768b07f28fd90a9 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(+)
src/kernel-install/kernel-install | 47 +++++++++++++++++++++++++++++++++++++++
1 file changed, 47 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 3ae1d77..f1c74de
index 3ae1d77..041f526
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -71,6 +71,42 @@ fi
@@ -71,6 +71,53 @@ 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)
+ if [[ "${KERNEL_DIR}" != "/boot" ]]; then
+ for i in \
+ "$KERNEL_IMAGE" \
+ "$KERNEL_DIR"/System.map \
+ "$KERNEL_DIR"/config \
+ "$KERNEL_DIR"/zImage.stub \
+ "$KERNEL_DIR"/dtb \
+ ; do
+ [[ -e "$i" ]] || continue
+ if [ -d "$i" ]; then
+ cp -a "$i" -t "/boot/${i##*/}-${KERNEL_VERSION}"
+ else
+ cp -a "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
+ fi
+ command -v restorecon &>/dev/null && \
+ restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
+ done
+ # hmac is .vmlinuz-<version>.hmac so needs a special treatment
+ i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
+ if [[ -e "$i" ]]; then
+ cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
+ command -v restorecon &>/dev/null && \
+ restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
+ fi
+ fi
+ /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 $?
@ -59,5 +70,5 @@ index 3ae1d77..f1c74de
read MACHINE_ID < /etc/machine-id
fi
--
2.0.4
2.7.0

View File

@ -13,7 +13,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 222
Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist}
Release: 17%{?gitcommit:.git%{gitcommit}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -35,6 +35,91 @@ Source9: 20-yama-ptrace.conf
# Patch series is available from http://cgit.freedesktop.org/systemd/systemd-stable/log/?h=v220-stable
# GIT_DIR=~/src/systemd/.git git format-patch-ab -M -N --no-signature v220..v220-stable
# i=1; for p in 0*patch;do printf "Patch%04d: %s\n" $i $p; ((i++));done
Patch0001: 0001-tmpfiles-downgrade-errors-when-a-file-system-does-no.patch
Patch0002: 0002-load-fragment-fix-segv-on-parse-error.patch
Patch0003: 0003-man-clarify-that-unknown-escapes-must-be-escaped.patch
Patch0005: 0001-selinux-fix-missing-SELinux-unit-access-check.patch
Patch0006: 0002-install-make-unit_file_get_list-aware-of-UNIT_FILE_I.patch
Patch0007: 0003-journal-gatewayd-fix-tmpfile-logic.patch
Patch0008: 0004-resolved-fix-marshalling-of-RRSIG-records.patch
Patch0009: 0005-Reload-manager-defaults-at-daemon-reload.patch
Patch0010: 0006-basic-util.c-fopen_temporary-close-fd-if-failed.patch
Patch0011: 0007-tmpfiles-don-t-recursively-descend-into-journal-dire.patch
Patch0012: 0008-units-emergency.service-wait-for-plymouth-to-shut-do.patch
Patch0013: 0009-core-include-unit-in-path-state-transition-debug-log.patch
Patch0014: 0010-util-make-sure-we-don-t-clobber-errno-in-error-path.patch
Patch0015: 0011-sd-boot-ignore-missing-etc-machine-id.patch
Patch0016: 0012-virt-handle-Virtualbox-5.0-with-kvm-hypervisor.patch
Patch0017: 0013-copy-when-we-recursively-copy-a-directory-tree-copy-.patch
Patch0018: 0014-fileio-get_status_field-don-t-clobber-arg-on-OOM.patch
Patch0019: 0015-journal-verify-don-t-hit-SIGFPE-when-determining-pro.patch
Patch0020: 0016-journal-avoid-mapping-empty-data-and-field-hash-tabl.patch
Patch0021: 0017-journal-when-verifying-journal-files-handle-empty-on.patch
Patch0022: 0018-journal-explain-the-error-when-we-find-a-non-DATA-ob.patch
Patch0023: 0019-journal-uppercase-first-character-in-verify-error-me.patch
Patch0024: 0020-udev-fix-parameter-process.patch
Patch0025: 0021-mount-remove-obsolete-n.patch
Patch0026: 0022-udev-avoid-coredump-when-initializing-udev-builtins.patch
Patch0027: 0023-udev-check-more-builtins-pointers-before-dereferenci.patch
Patch0028: 0024-udev-Fix-udev_builtin_run_once.patch
Patch0029: 0025-timesyncd-remove-RLIMIT_NPROC.patch
Patch0030: 0026-journald-fix-count-of-object-meta-fields.patch
Patch0031: 0027-udev-uaccess-do-not-log-error-when-device-node-disap.patch
Patch0032: 0028-Coverity-1299015.patch
Patch0033: 0029-Coverity-1299013.patch
Patch0034: 0030-journal-fix-json-output-of-unicode-characters.patch
Patch0035: 0031-logind-use-open_terminal-instead-of-open.patch
Patch0036: 0032-logind-get-a-fresh-file-descriptor-to-clean-up-a-VT.patch
Patch0037: 0033-timedatectl-assert-timezone-is-not-null-in-setenv-ca.patch
Patch0038: 0034-timedatectl-when-no-timezone-is-set-consider-UTC-the.patch
Patch0039: 0035-core-downgrade-Module-inserted-message-for-kmod-to-D.patch
Patch0041: 0037-selinux-fix-regression-of-systemctl-subcommands-when.patch
Patch0042: 0038-socket-fix-setsockopt-call.-SOL_SOCKET-changed-to-SO.patch
Patch0043: 0039-sd-event-improve-debug-message-when-we-fail-to-remov.patch
Patch0044: 0040-selinux-always-use-_raw-API-from-libselinux.patch
Patch0045: 0041-virt-detect-parallels-virtualization.patch
Patch0046: 0042-udev-net_id-support-predictable-ifnames-on-virtio-bu.patch
Patch0047: 0043-Fixup-WWN-bytes-for-big-endian-systems.patch
Patch0048: 0044-units-run-ldconfig-also-when-cache-is-unpopulated.patch
Patch0049: 0045-sd-event-fix-prepare-priority-queue-comparison-funct.patch
Patch0050: 0046-Revert-core-one-step-back-again-for-nspawn-we-actual.patch
Patch0051: 0048-core-report-root-cgroup-as-over-the-bus.patch
Patch0052: 0049-logind-allow-greeters-to-take-over-VTs.patch
Patch0053: 0050-logind-rename-pos-to-position.patch
Patch0054: 0051-logind-bring-bus-policy-up-to-date.patch
Patch0055: 0052-logind-some-firmware-implementations-remove-OsIndica.patch
Patch0056: 0053-logind-prefer-new-sessions-over-older-ones-on-VT-swi.patch
Patch0057: 0057-user-sessions-make-sure-run-nologin-has-correct-SELi.patch
Patch0058: 0058-login-make-sure-run-nologin-has-correct-SELinux-labe.patch
Patch0059: 0059-man-journalctl-mention-systemd.time-7-where-appropri.patch
Patch0060: 0060-sd-device-never-return-NULL-0.patch
Patch0061: 0061-journalctl-properly-detect-empty-journal-files.patch
Patch0062: 0062-import-hash-URL-in-paths-if-they-are-too-long.patch
Patch0063: 0063-nspawn-fix-image-when-nspawn-is-run-as-service.patch
Patch0064: 0064-units-also-whitelist-blkext-block-devices-for-nspawn.patch
Patch0065: 0065-unquote_first_word-parse-as-an-empty-argument-instea.patch
Patch0066: 0066-login-fix-NULL-deref-on-wall_message.patch
Patch0067: 0067-libudev-simplify-udev_device_ensure_usec_initialized.patch
Patch0068: 0068-udev-fix-NULL-deref-when-executing-rules.patch
Patch0069: 0054-logind-never-select-closing-sessions-for-a-VT.patch
Patch0070: 0055-logind-release-VT-positions-when-closing-sessions.patch
Patch0071: 0071-nspawn-Don-t-pass-uid-mount-option-for-devpts.patch
Patch0072: 0072-journalctl-make-sure-journalctl-f-t-unmatched-blocks.patch
Patch0073: 0073-journalctl-don-t-print-No-entries-in-quiet-mode.patch
Patch0074: 0074-sd-device-fix-enumeration-of-devices-without-subsyst.patch
Patch0075: 0075-units-increase-watchdog-timeout-to-3min-for-all-our-.patch
Patch0076: 0076-core-do-not-warn-about-Wants-depencencies-on-masked-.patch
Patch0077: 0077-transaction-downgrade-warnings-about-wanted-unit-whi.patch
Patch0078: 0078-hwdb-add-axis-ranges-and-resolution-for-Dell-Lattitu.patch
Patch0079: 0079-machined-rework-state-tracking-logic-for-machines.patch
Patch0080: 0080-tests-don-t-abbreviate-function-names-needlessly.patch
Patch0081: 0081-basic-don-t-append-suffixes-to-unit-name-glob-expres.patch
Patch0082: 0082-man-document-that-unit-file-globbing-only-operates-o.patch
Patch0083: 0083-ask-password-api-only-emit-a-star-on-valid-unicode-c.patch
Patch0084: 0084-core-add-new-RandomSec-setting-for-time-units.patch
Patch0085: 0085-core-rename-Random-to-RandomizedDelay.patch
Patch0086: 0086-macros.systemd.in-add-systemd_ordering-3776.patch
Patch0087: 0087-Fix-notification-assert-and-return-value-from-handle.patch
# kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch
@ -116,6 +201,8 @@ Obsoletes: systemd-sysv < 206
Provides: systemd-sysv = 206
Conflicts: initscripts < 9.56.1
Conflicts: fedora-release < 23-0.12
# https://bugzilla.redhat.com/show_bug.cgi?id=1226908
Conflicts: chkconfig < 1.5
%description
systemd is a system and service manager for Linux, compatible with
@ -397,8 +484,10 @@ ln -s /usr/lib/systemd/system/rsyslog.service /etc/systemd/system/syslog.service
# Remove spurious /etc/fstab entries from very old installations
# https://bugzilla.redhat.com/show_bug.cgi?id=1009023
grep -v -E -q '^(devpts|tmpfs|sysfs|proc)' /etc/fstab || \
sed -i.rpm.bak -r '/^devpts\s+\/dev\/pts\s+devpts\s+defaults\s+/d; /^tmpfs\s+\/dev\/shm\s+tmpfs\s+defaults\s+/d; /^sysfs\s+\/sys\s+sysfs\s+defaults\s+/d; /^proc\s+\/proc\s+proc\s+defaults\s+/d' /etc/fstab || :
if [ -e /etc/fstab ]; then
grep -v -E -q '^(devpts|tmpfs|sysfs|proc)' /etc/fstab || \
sed -i.rpm.bak -r '/^devpts\s+\/dev\/pts\s+devpts\s+defaults\s+/d; /^tmpfs\s+\/dev\/shm\s+tmpfs\s+defaults\s+/d; /^sysfs\s+\/sys\s+sysfs\s+defaults\s+/d; /^proc\s+\/proc\s+proc\s+defaults\s+/d' /etc/fstab || :
fi
# Replace obsolete keymaps
# https://bugzilla.redhat.com/show_bug.cgi?id=1151958
@ -488,7 +577,7 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g
getent group systemd-journal-remote >/dev/null 2>&1 || groupadd -r systemd-journal-remote 2>&1 || :
getent passwd systemd-journal-remote >/dev/null 2>&1 || useradd -r -l -g systemd-journal-remote -d /%{_localstatedir}/log/journal/remote -s /sbin/nologin -c "Journal Remote" systemd-journal-remote >/dev/null 2>&1 || :
getent group systemd-journal-upload >/dev/null 2>&1 || groupadd -r systemd-journal-upload 2>&1 || :
getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd-journal-upload -d /%{_localstatedir}/log/journal/upload -s /sbin/nologin -c "Journal Upload" systemd-journal-upload >/dev/null 2>&1 || :
getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd-journal-upload -G systemd-journal -d /%{_localstatedir}/log/journal/upload -s /sbin/nologin -c "Journal Upload" systemd-journal-upload >/dev/null 2>&1 || :
%post journal-gateway
%systemd_post systemd-journal-gatewayd.socket systemd-journal-gatewayd.service
@ -545,7 +634,7 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
%dir %{_datadir}/pkgconfig
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%dir %attr(2755,root,systemd-journal) %{_localstatedir}/log/journal
%dir %attr(2755,root,systemd-journal) %verify(not mode) %{_localstatedir}/log/journal
%dir %{_localstatedir}/lib/systemd
%dir %{_localstatedir}/lib/systemd/catalog
%ghost %dir %{_localstatedir}/lib/systemd/coredump
@ -767,6 +856,79 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
/usr/lib/firewalld/services/*
%changelog
* Thu Sep 29 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 229-17
- Denial-of-service bug against pid1 (#1380286)
* Wed Aug 17 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 222-16
- Ignore the access mode on /var/log/journal (#1317570)
- Add %%systemd_ordering macro
* Thu Feb 11 2016 Jan Synáček <jsynacek@redhat.com> - 222-15
- various fixes in kernel-install (#1244057)
* Mon Feb 1 2016 Jan Synáček <jsynacek@redhat.com> - 222-14
- Stopping services using glob patterns does not work as stated in man page (#1288851)
- systemd asking for password on boot: ask_password_tty() prints multiple asterisks when typing special characters (#1301984)
- RFE: Please provide option RandomSec= to systemd timer (#1303552)
* Mon Jan 25 2016 Jan Synáček <jsynacek@redhat.com> - 222-13
- units: increase watchdog timeout to 3min for all our services
+ Mitigates the problem described in #1300212.
- transaction: downgrade warnings about wanted unit which are not found (#1278264)
- hwdb: add axis ranges and resolution for Dell Lattitude E6220 (#1293576)
- machined: rework state tracking logic for machines (#1297225)
* Thu Jan 7 2016 Jan Synáček <jsynacek@redhat.com> - 222-12
- Terminal multiplexers (tmux, screen) are broken in systemd-nspawn containers (#1282626)
- Regression: journalctl -f broken (again) with initially empty filter result (#1292805)
- Journalctl says "no entries" even when told to be quiet (#1293062)
- udev_enumerate_scan_devices() broken when used with udev_enumerate_add_match_parent() (#1295979)
* Tue Jan 5 2016 Jan Synáček <jsynacek@redhat.com> - 222-11
- re-apply patches that were removed by mistake (#1263208)
* Mon Dec 14 2015 Jan Synáček <jsynacek@redhat.com> - 222-10
- do not assume fstab is present (#1281606)
* Mon Dec 14 2015 Jan Synáček <jsynacek@redhat.com> - 222-9
- udev: fix NULL deref when executing rules (#1283971)
- libudev: simplify udev_device_ensure_usec_initialized a (#1283971)
- login: fix NULL-deref on wall_message (#1279156)
- unquote_first_word: parse ` '' ` as an empty argument (#1278475)
- units: also whitelist "blkext" block devices for nspawn (#1266776)
- nspawn: fix --image= when nspawn is run as service (#1266776)
- import: hash URL in paths if they are too long (#1266775)
- journalctl: properly detect empty journal files (#1255619)
- sd-device: never return NULL+0 (#1238285)
- man/journalctl: mention systemd.time(7) where (#1182661)
- login: make sure /run/nologin has correct SELinux label (#1287592)
- user-sessions: make sure /run/nologin has correct (#1287592)
* Mon Oct 19 2015 Jan Synáček <jsynacek@redhat.com> - 222-8
- remove the fix for Corsair K70 Keyboard introduced in 222-3 (#1267225)
* Mon Oct 5 2015 Jan Synáček <jsynacek@redhat.com> - 222-7
- systemctl shows the full cgroup hierarchy when doing status of a disabled or non-existing unit (#1268601)
- it's not possible to log in again shortly after log out (#1263208)
+ related logind bugfixes
* Fri Sep 25 2015 Michal Sekletar <msekleta@redhat.com> - 222-6
- Scope units will not get killed immediately during shutdown (#1170765)
- Fix comparison function for priority queue (#1202598)
- Conflict with chkconfig < 1.5 (#1226908)
- Assorted bugfixes
* Fri Sep 18 2015 Adam Miller <maxamillion@fedoraproject.org> - 222-5
- Re-revert patch from walters that breaks Atomic/OSTree (#1195761)
* Fri Sep 18 2015 Jan Synáček <jsynacek@redhat.com> - 222-4
- Fix: user systemd-journal-upload should be in systemd-journal group (#1262743)
* Thu Sep 17 2015 Jan Synáček <jsynacek@redhat.com> - 222-3
- Fix: systemd-tmpfiles-setup.service fails on 23 Alpha RC1 Server (#1250737)
- Fix: Upgrading from 22 to 23 by fedup fails (#1251334)
- Fix: Corsair K70 keyboard 'pipe' key not functioning correctly (#1262132)
* Thu Jul 9 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 222-2
- Remove python subpackages (python-systemd in now standalone)