SHA256
1
0
forked from pool/systemd

Accepting request 149703 from home:fcrozat:branches:Base:System

- Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly
  (bnc#798620).
- Update crypt-loop-file.patch to correctly detect crypto loop
  files (bnc#799514).
- Add journalctl-remove-leftover-message.patch: remove debug
  message in systemctl.
- Add job-avoid-recursion-when-cancelling.patch: prevent potential
  recursion when cancelling a service.
- Add sysctl-parse-all-keys.patch: ensure sysctl file is fully
  parsed.
- Add journal-fix-cutoff-max-date.patch: fix computation of cutoff
  max date for journal.
- Add reword-rescue-mode-hints.patch: reword rescue prompt.
- Add improve-overflow-checks.patch: improve time overflow checks.
- Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour
  with symlinks.
- Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure
  hostnamectl requires an argument when called with set-hostname
  option.
- Add agetty-overrides-term.patch: pass correctly terminal type to
  agetty.
- Add check-for-empty-strings-in-strto-conversions.patch: better
  check for empty strings in strto* conversions.
- Add strv-cleanup-error-path-loops.patch: cleanup strv on error
  path.
- Add cryptsetup-handle-plain.patch: correctly handle "plain"
  option in cryptsetup.
- Add fstab-generator-improve-error-message.patch: improve error
  message in fstab-generator.
- Add delta-accept-t-option.patch: accept -t option in

OBS-URL: https://build.opensuse.org/request/show/149703
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=331
This commit is contained in:
Robert Milasan 2013-01-23 13:44:07 +00:00 committed by Git OBS Bridge
parent 6c729cff07
commit b8b836245b
53 changed files with 3259 additions and 7 deletions

View File

@ -0,0 +1,47 @@
From 2161de72c517d34d1ceb9b4c1a300f0b54ce5a9c Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Mon, 29 Oct 2012 21:59:34 +0100
Subject: [PATCH] units: agetty overrides TERM
Environment=TERM=... has no effect on agetty who sets it by itself. To
really set TERM to a specified value, it has to be given on the command
line.
https://bugzilla.redhat.com/show_bug.cgi?id=870622
---
units/getty@.service.m4 | 3 +--
units/serial-getty@.service.m4 | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
index b5875ce..810c23f 100644
--- a/units/getty@.service.m4
+++ b/units/getty@.service.m4
@@ -43,9 +43,8 @@ IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0
[Service]
-Environment=TERM=linux
# the VT is cleared by TTYVTDisallocate
-ExecStart=-/sbin/agetty --noclear %I 38400
+ExecStart=-/sbin/agetty --noclear %I 38400 linux
Type=idle
Restart=always
RestartSec=0
diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
index a6bbd71..c411dc1 100644
--- a/units/serial-getty@.service.m4
+++ b/units/serial-getty@.service.m4
@@ -39,8 +39,7 @@ Before=getty.target
IgnoreOnIsolate=yes
[Service]
-Environment=TERM=vt102
-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
+ExecStart=-/sbin/agetty -s %I 115200,38400,9600 vt102
Type=idle
Restart=always
RestartSec=0
--
1.7.10.4

View File

@ -0,0 +1,95 @@
From f3910003bce32ebdc1dbb71fd9ca2d4b8352b563 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 30 Oct 2012 10:29:40 +0100
Subject: [PATCH] shared, libsystemd-daemon: check for empty strings in
strto*l conversions
strtol() and friends may set EINVAL if no conversion was performed, but
they are not required to do so. In practice they don't. We need to check
for it.
https://bugzilla.redhat.com/show_bug.cgi?id=870577
---
src/libsystemd-daemon/sd-daemon.c | 4 ++--
src/shared/conf-parser.c | 2 +-
src/shared/util.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c
index 863ac75..480db3b 100644
--- a/src/libsystemd-daemon/sd-daemon.c
+++ b/src/libsystemd-daemon/sd-daemon.c
@@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) {
goto finish;
}
- if (!p || *p || l <= 0) {
+ if (!p || p == e || *p || l <= 0) {
r = -EINVAL;
goto finish;
}
@@ -112,7 +112,7 @@ _sd_export_ int sd_listen_fds(int unset_environment) {
goto finish;
}
- if (!p || *p) {
+ if (!p || p == e || *p) {
r = -EINVAL;
goto finish;
}
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 4bf3147..9f5c07c 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -865,7 +865,7 @@ int config_parse_mode(
errno = 0;
l = strtol(rvalue, &x, 8);
- if (!x || *x || errno) {
+ if (!x || x == rvalue || *x || errno) {
log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue);
return 0;
}
diff --git a/src/shared/util.c b/src/shared/util.c
index 8ec83e4..23832fe 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -377,7 +377,7 @@ int safe_atou(const char *s, unsigned *ret_u) {
errno = 0;
l = strtoul(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
if ((unsigned long) (unsigned) l != l)
@@ -397,7 +397,7 @@ int safe_atoi(const char *s, int *ret_i) {
errno = 0;
l = strtol(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
if ((long) (int) l != l)
@@ -417,7 +417,7 @@ int safe_atollu(const char *s, long long unsigned *ret_llu) {
errno = 0;
l = strtoull(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
*ret_llu = l;
@@ -434,7 +434,7 @@ int safe_atolli(const char *s, long long int *ret_lli) {
errno = 0;
l = strtoll(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
*ret_lli = l;
--
1.7.10.4

View File

@ -0,0 +1,30 @@
From 7e1a84f55244ca78093b1dabc58683bc0e7f4304 Mon Sep 17 00:00:00 2001
From: Oleksii Shevchuk <alxchk@gmail.com>
Date: Sat, 3 Nov 2012 21:52:02 +0200
Subject: [PATCH] core: interpret \; token in ExecStart as escaped ;
Some commands (like 'find') take a semicolon as separate arg. With
current parser implementation there is no way to pass one.
Patch adds token \;
---
src/core/load-fragment.c | 2 ++
src/test/test-unit-file.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 5803044..4dc5c52 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -483,6 +483,8 @@ int config_parse_exec(
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
if (strncmp(w, ";", MAX(l, 1U)) == 0)
break;
+ else if (strncmp(w, "\\;", MAX(l, 1U)) == 0)
+ w ++;
if (honour_argv0 && w == rvalue) {
assert(!path);
--
1.7.10.4

View File

@ -0,0 +1,210 @@
From c040936be2a4c77e9465cffae47d77d5ec14fb49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 19 Nov 2012 16:02:45 +0100
Subject: [PATCH] core/load-fragment: be more precise in error messages
Whenever a message fails, mention the offending word, instead
of just giving the whole line. If one bad word causes just this
word to be rejected, print only the word. If one bad word causes
the whole line to be rejected, print the whole line too.
https://bugs.freedesktop.org/show_bug.cgi?id=56874
---
src/core/load-fragment.c | 69 +++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 38 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 6759255..01f9484 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -86,7 +86,7 @@ int config_parse_unit_deps(
assert(rvalue);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL;
int r;
t = strndup(w, l);
@@ -94,15 +94,13 @@ int config_parse_unit_deps(
return -ENOMEM;
k = unit_name_printf(u, t);
- free(t);
if (!k)
return -ENOMEM;
r = unit_add_dependency_by_name(u, d, k, NULL, true);
if (r < 0)
- log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s", filename, line, k, strerror(-r));
-
- free(k);
+ log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s",
+ filename, line, k, strerror(-r));
}
return 0;
@@ -757,22 +755,25 @@ int config_parse_exec_cpu_affinity(
assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t;
+ char _cleanup_free_ *t = NULL;
int r;
unsigned cpu;
- if (!(t = strndup(w, l)))
+ t = strndup(w, l);
+ if (!t)
return -ENOMEM;
r = safe_atou(t, &cpu);
- free(t);
- if (!(c->cpuset))
- if (!(c->cpuset = cpu_set_malloc(&c->cpuset_ncpus)))
+ if (!c->cpuset) {
+ c->cpuset = cpu_set_malloc(&c->cpuset_ncpus);
+ if (!c->cpuset)
return -ENOMEM;
+ }
if (r < 0 || cpu >= c->cpuset_ncpus) {
- log_error("[%s:%u] Failed to parse CPU affinity, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse CPU affinity %s, ignoring: %s",
+ filename, line, t, rvalue);
return 0;
}
@@ -849,7 +850,8 @@ int config_parse_exec_secure_bits(
else if (first_word(w, "noroot-locked"))
c->secure_bits |= SECURE_NOROOT_LOCKED;
else {
- log_error("[%s:%u] Failed to parse secure bits, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse secure bits, ignoring: %s",
+ filename, line, rvalue);
return 0;
}
}
@@ -890,7 +892,7 @@ int config_parse_bounding_set(
* interface. */
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t;
+ char _cleanup_free_ *t = NULL;
int r;
cap_value_t cap;
@@ -899,10 +901,9 @@ int config_parse_bounding_set(
return -ENOMEM;
r = cap_from_name(t, &cap);
- free(t);
-
if (r < 0) {
- log_error("[%s:%u] Failed to parse capability bounding set, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse capability in bounding set, ignoring: %s",
+ filename, line, t);
continue;
}
@@ -968,7 +969,7 @@ int config_parse_unit_cgroup(
char *state;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL, *ku = NULL;
int r;
t = strndup(w, l);
@@ -976,22 +977,17 @@ int config_parse_unit_cgroup(
return -ENOMEM;
k = unit_full_printf(u, t);
- free(t);
-
if (!k)
return -ENOMEM;
- t = cunescape(k);
- free(k);
-
- if (!t)
+ ku = cunescape(k);
+ if (!ku)
return -ENOMEM;
- r = unit_add_cgroup_from_text(u, t);
- free(t);
-
+ r = unit_add_cgroup_from_text(u, ku);
if (r < 0) {
- log_error("[%s:%u] Failed to parse cgroup value, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse cgroup value %s, ignoring: %s",
+ filename, line, k, rvalue);
return 0;
}
}
@@ -1351,33 +1347,30 @@ int config_parse_service_sockets(
assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL;
t = strndup(w, l);
if (!t)
return -ENOMEM;
k = unit_name_printf(UNIT(s), t);
- free(t);
-
if (!k)
return -ENOMEM;
if (!endswith(k, ".socket")) {
- log_error("[%s:%u] Unit must be of type socket, ignoring: %s", filename, line, rvalue);
- free(k);
+ log_error("[%s:%u] Unit must be of type socket, ignoring: %s",
+ filename, line, k);
continue;
}
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_WANTS, UNIT_AFTER, k, NULL, true);
if (r < 0)
- log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s", filename, line, k, strerror(-r));
+ log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s",
+ filename, line, k, strerror(-r));
r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k, NULL, true);
if (r < 0)
return r;
-
- free(k);
}
return 0;
@@ -2105,17 +2098,17 @@ int config_parse_syscall_filter(
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
int id;
- char *t;
+ char _cleanup_free_ *t = NULL;
t = strndup(w, l);
if (!t)
return -ENOMEM;
id = syscall_from_name(t);
- free(t);
if (id < 0) {
- log_error("[%s:%u] Failed to parse syscall, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse syscall, ignoring: %s",
+ filename, line, t);
continue;
}
--
1.7.10.4

View File

@ -0,0 +1,22 @@
From 348a25edbb87ee4e67aa79fcb97a2bc1b5c11c7b Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 19 Dec 2012 14:38:53 +0100
Subject: [PATCH] coredumpctl: check return of strndup
---
src/journal/coredumpctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/coredumpctl.c
===================================================================
--- systemd-195.orig/src/journal/coredumpctl.c
+++ systemd-195/src/journal/coredumpctl.c
@@ -222,7 +222,7 @@ static int retrieve(sd_journal *j, const
assert(len >= field);
*var = strndup((const char*)data + field, len - field);
- if (!var)
+ if (!*var)
return log_oom();
return 0;

View File

@ -0,0 +1,34 @@
From 1cda32b8a29750720872d3525084ac67b88e066f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 23 Nov 2012 14:16:39 +0100
Subject: [PATCH] cryptsetup-generator: state file name in error messages
---
src/cryptsetup/cryptsetup-generator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index ef16fbc..6e7b707 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -108,7 +108,7 @@ static int create_disk(
f = fopen(p, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", p);
goto fail;
}
@@ -160,7 +160,7 @@ static int create_disk(
if (ferror(f)) {
r = -errno;
- log_error("Failed to write file: %m");
+ log_error("Failed to write file %s: %m", p);
goto fail;
}
--
1.7.10.4

View File

@ -0,0 +1,29 @@
From adc40dc2f670a6298cce918fb318ba6a4b80c306 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Wed, 21 Nov 2012 12:30:47 +0100
Subject: [PATCH] cryptsetup: fix nofail support
This was documented in the man page and supported in the generator,
but systemd-cryptestup itself would fail with this option.
systemd-cryptsetup should ignore 'nofail', as it does with 'noauto'.
---
src/cryptsetup/cryptsetup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 56a3b50..f332843 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -62,7 +62,7 @@ static int parse_one_option(const char *option) {
assert(option);
/* Handled outside of this tool */
- if (streq(option, "noauto"))
+ if (streq(option, "noauto") || streq(option, "nofail"))
return 0;
if (startswith(option, "cipher=")) {
--
1.7.10.4

View File

@ -1,7 +1,7 @@
Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
Index: systemd-195/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-190.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-190/src/cryptsetup/cryptsetup-generator.c
--- systemd-195.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-195/src/cryptsetup/cryptsetup-generator.c
@@ -136,7 +136,7 @@ static int create_disk(
const char *password,
const char *options) {
@ -11,7 +11,7 @@ Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
int r;
FILE *f = NULL;
bool noauto, nofail;
@@ -168,11 +168,51 @@ static int create_disk(
@@ -168,11 +168,63 @@ static int create_disk(
goto fail;
}
@ -21,13 +21,25 @@ Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
- log_error("Failed to allocate device name.");
- goto fail;
+ if (!startswith(device,"/dev/")) {
+ d = unit_name_from_path_instance("cryptsetup", name, ".path");
+ char *e;
+
+ d = strdup(n);
+ if (!d) {
+ r = -ENOMEM;
+ log_error("Failed to allocate path name.");
+ goto fail;
+ }
+
+ e = endswith(d,".service");
+ if (!e) {
+ r = -ENOMEM;
+ log_error("Failed to modify path name.");
+ goto fail;
+ }
+
+ *e = 0;
+
+ d = strcat(d,".path");
+ if (asprintf(&path_file, "%s/%s", arg_dest, d) < 0) {
+ r = -ENOMEM;
+ log_error("Failed to allocate unit file name.");
@ -37,7 +49,7 @@ Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
+ f = fopen(path_file, "wxe");
+ if (!f) {
+ r = -errno;
+ log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", path_file);
+ goto fail;
+ }
+
@ -68,7 +80,7 @@ Index: systemd-190/src/cryptsetup/cryptsetup-generator.c
}
f = fopen(p, "wxe");
@@ -298,6 +338,7 @@ fail:
@@ -298,6 +350,7 @@ fail:
free(n);
free(d);
free(e);

View File

@ -0,0 +1,71 @@
From 65343c749441322d1e65e8bb5d433b6fee8c28bf Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Tue, 6 Nov 2012 09:49:27 -0500
Subject: [PATCH] cryptsetup: hash=plain means don't use a hash
"plain" is a semantic value that cryptsetup(8) uses to describe a plain
dm-crypt volume that does not use a hash. Catch this value earlier and
ensure that a NULL params.hash is passed to crypt_format to avoid
passing an invalid hash type to the libcryptsetup backend.
FDO bug #56593.
---
src/cryptsetup/cryptsetup.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 916509a..e8ba3f0 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -342,7 +342,12 @@ int main(int argc, char *argv[]) {
opt_tries = opt_tries > 0 ? opt_tries : 3;
opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
- hash = opt_hash ? opt_hash : "ripemd160";
+ if (opt_hash) {
+ /* plain isn't a real hash type. it just means "use no hash" */
+ if (!streq(opt_hash, "plain"))
+ hash = opt_hash;
+ } else
+ hash = "ripemd160";
if (opt_cipher) {
size_t l;
@@ -463,7 +468,7 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
&params);
- pass_volume_key = streq(hash, "plain");
+ pass_volume_key = !!hash;
}
if (k < 0) {
--
1.7.10.4
From 8db9d8c2a4ef9806c286e258f9932a0972dc2375 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Tue, 6 Nov 2012 10:17:18 -0500
Subject: [PATCH] cryptsetup: fix inverted comparison in pass_volume_key
---
src/cryptsetup/cryptsetup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index e8ba3f0..56a3b50 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -468,7 +468,8 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
&params);
- pass_volume_key = !!hash;
+ /* hash == NULL implies the user passed "plain" */
+ pass_volume_key = (hash == NULL);
}
if (k < 0) {
--
1.7.10.4

View File

@ -0,0 +1,27 @@
From 377ec8bf1907a1a227d195cc3721c4acbad19213 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Wed, 14 Nov 2012 00:18:02 +0100
Subject: [PATCH] delta.c: fix option '-t'
Both the help and man page claims that it accepts -t with an argument
so let's do that.
---
src/delta/delta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/delta/delta.c b/src/delta/delta.c
index cc34208..a65cea5 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -352,7 +352,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 1);
assert(argv);
- while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "ht:", options, NULL)) >= 0) {
switch (c) {
--
1.7.10.4

View File

@ -0,0 +1,27 @@
From 7d0c710d72f8a6e5c6909c65700aa088c53aebc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Bartoszkiewicz?= <mbartoszkiewicz@gmail.com>
Date: Sat, 12 Jan 2013 23:05:52 +0100
Subject: [PATCH] core: do not make sockets dependent on lo
/sys/subsystem/net/devices/lo is never considered active, so sockets
with BindToDevice=lo would never be activated.
---
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 fcbcdbe..d755040 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -308,7 +308,7 @@ static int socket_add_device_link(Socket *s) {
assert(s);
- if (!s->bind_to_device)
+ if (!s->bind_to_device || streq(s->bind_to_device, "lo"))
return 0;
if (asprintf(&t, "/sys/subsystem/net/devices/%s", s->bind_to_device) < 0)
--
1.7.10.4

24
fix-bad-mem-access.patch Normal file
View File

@ -0,0 +1,24 @@
From 86ed7ec58b9b6a0907bbb3b8d07c930e52915de0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 17 Jan 2013 17:38:00 +0100
Subject: [PATCH] util: fix bad memory access
---
src/shared/util.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 0161f3e..8e14096 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -439,7 +439,6 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
if (!fgets(line, sizeof(line), f)) {
r = feof(f) ? -EIO : -errno;
- fclose(f);
return r;
}
--
1.7.10.4

View File

@ -0,0 +1,48 @@
From ac97e2c559f5d386a332aba4a24bf9930cdb1c51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 19 Nov 2012 16:36:38 +0100
Subject: [PATCH] core/load-fragment: fix (potential) bad memory access
strncmp() could be used with size bigger then the size of the string,
because MAX was used instead of MIN.
If failing, print just the offending mount flag.
---
src/core/load-fragment.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 01f9484..6933e1a 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1101,15 +1101,22 @@ int config_parse_exec_mount_flags(
assert(rvalue);
assert(data);
- FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (strncmp(w, "shared", MAX(l, 6U)) == 0)
+ FOREACH_WORD_SEPARATOR(w, l, rvalue, ", ", state) {
+ char _cleanup_free_ *t;
+
+ t = strndup(w, l);
+ if (!t)
+ return -ENOMEM;
+
+ if (streq(t, "shared"))
flags |= MS_SHARED;
- else if (strncmp(w, "slave", MAX(l, 5U)) == 0)
+ else if (streq(t, "slave"))
flags |= MS_SLAVE;
- else if (strncmp(w, "private", MAX(l, 7U)) == 0)
+ else if (streq(w, "private"))
flags |= MS_PRIVATE;
else {
- log_error("[%s:%u] Failed to parse mount flags, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse mount flag %s, ignoring: %s",
+ filename, line, t, rvalue);
return 0;
}
}
--
1.7.10.4

View File

@ -0,0 +1,33 @@
From b61e88162a6ce0c30da6984b0120959701283daa Mon Sep 17 00:00:00 2001
From: Olivier Brunel <i.am.jack.mail@gmail.com>
Date: Sat, 13 Oct 2012 14:24:15 +0200
Subject: [PATCH] swap: fix swap behaviour with symlinks
Starting a swap unit pointing to (What) a symlink (e.g. /dev/mapper/swap
or /dev/disk/by-uuid/...) would have said unit marked active, following
the one using the "actual" device (/dev/{dm-1,sda3}), but that new unit
would be seen as inactive.
Since all requests to stop swap units would follow/redirect to it,
and it is seen inactive, nothing would be done (swapoff never called).
This is because this unit would be treated twice in
swap_process_new_swap, the second call to swap_add_one causing it to
eventually be marked inactive.
---
src/core/swap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: systemd-195/src/core/swap.c
===================================================================
--- systemd-195.orig/src/core/swap.c
+++ systemd-195/src/core/swap.c
@@ -415,7 +415,8 @@ static int swap_process_new_swap(Manager
return -ENOMEM;
dn = udev_device_get_devnode(d);
- if (dn)
+ /* Skip dn==device, since that case will be handled below */
+ if (dn && !streq(dn, device))
r = swap_add_one(m, dn, device, prio, false, false, set_flags);
/* Add additional units for all symlinks */

View File

@ -0,0 +1,50 @@
From 67ab5f761f9b854d8ce85f9ee47b298e497f8bd9 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Tue, 27 Nov 2012 01:09:28 +0100
Subject: [PATCH] fstab-generator: make error more helpful in case of
duplicates in fstab
Traditional sysvinit systems would not complain about duplicates in
fstab. Rather it (through monut -a) would mount one fs on top of another,
in effect the last entry taking precedent.
In systemd, the first entry takes precedent, all subsequent ones are
ignored and an error is printed.
The change of behavior and the source of this error message was causing
some confusion, so give a hint what migt be wrong.
---
src/fstab-generator/fstab-generator.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 7b3bf11..ba55f2c 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,10 @@ static int add_swap(const char *what, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create swap unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -254,7 +257,10 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create mount unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
--
1.7.10.4

View File

@ -0,0 +1,115 @@
From 40b8acd039cf1ea00167017e63d9c0a773002f0e Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 9 Nov 2012 12:00:46 +0100
Subject: [PATCH] fstab-generator: more specific error messages
---
src/fstab-generator/fstab-generator.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 251a346..62053b7 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,7 @@ static int add_swap(const char *what, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -138,7 +138,7 @@ static int add_swap(const char *what, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", unit);
r = -errno;
goto finish;
}
@@ -152,7 +152,7 @@ static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -171,7 +171,7 @@ static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -262,7 +262,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -306,7 +306,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", unit);
r = -errno;
goto finish;
}
@@ -320,7 +320,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -342,7 +342,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -367,7 +367,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(automount_unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", automount_unit);
goto finish;
}
@@ -386,7 +386,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", automount_unit);
r = -errno;
goto finish;
}
@@ -400,7 +400,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(automount_unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
--
1.7.10.4

View File

@ -0,0 +1,25 @@
From f9ea108e7c3544c03822277a1112a48dc62f6ed4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 24 Dec 2012 13:01:00 +0100
Subject: [PATCH] fstab-generator: properly detect bind mounts
This kinda undoes a83cbaccd03c3f28e47e9330f4a22ff65ce4b561 and
1d634e21b453f3c80d7c6c4bd90a6b84e42a3d2a but corrects the original code
to compare the mount type with "bind" rather than the mount options.
---
src/fstab-generator/fstab-generator.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Index: systemd-195/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ systemd-195/src/fstab-generator/fstab-generator.c
@@ -199,7 +199,7 @@ static bool mount_is_bind(struct mntent
return
hasmntopt(me, "bind") ||
- streq(me->mnt_opts, "bind");
+ streq(me->mnt_type, "bind");
}
static bool mount_is_network(struct mntent *me) {

View File

@ -0,0 +1,32 @@
From f09a7d25545b5e3a2dd3dfc1ff7ebc8560a3354c Mon Sep 17 00:00:00 2001
From: Olivier Brunel <i.am.jack.mail@gmail.com>
Date: Mon, 5 Nov 2012 00:28:45 +0100
Subject: [PATCH] systemd: highlight ordering cycle deletions
Having unit(s) removed/not started, even if it solved the issue and allowed
to boot successfully, should still be considered an error, as something
clearly isn't right.
This patch elevates the log message from warning to error, and adds a status
message to make things more obvious.
---
src/core/transaction.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 4bce942..ee6992a 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -374,7 +374,8 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
if (delete) {
- log_warning("Breaking ordering cycle by deleting job %s/%s", delete->unit->id, job_type_to_string(delete->type));
+ log_error("Breaking ordering cycle by deleting job %s/%s", delete->unit->id, job_type_to_string(delete->type));
+ status_printf(ANSI_HIGHLIGHT_RED_ON " SKIP " ANSI_HIGHLIGHT_OFF, true, "Ordering cycle found, skip %s", unit_description(delete->unit));
transaction_delete_unit(tr, delete->unit);
return -EAGAIN;
}
--
1.7.10.4

View File

@ -0,0 +1,27 @@
From 59f432ea6d6d441d0af7c76c37e80730c8df473a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 15 Nov 2012 22:47:04 +0100
Subject: [PATCH] hostnamectl: fix parsing of --no-ask-password
---
src/hostname/hostnamectl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index b7ae5cc..265c7ec 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -403,6 +403,10 @@ static int parse_argv(int argc, char *argv[]) {
arg_set_static = true;
break;
+ case ARG_NO_ASK_PASSWORD:
+ arg_ask_password = false;
+ break;
+
case '?':
return -EINVAL;
--
1.7.10.4

View File

@ -0,0 +1,26 @@
From f36d7992ef9588e24feaae5bb3d103ca63af71bd Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Mon, 29 Oct 2012 20:54:26 +0100
Subject: [PATCH] hostnamectl: do not choke on set-hostname with no argument
https://bugzilla.redhat.com/show_bug.cgi?id=871172
---
src/hostname/hostnamectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index 1d448bd..e7b2b49 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -430,7 +430,7 @@ static int hostnamectl_main(DBusConnection *bus, int argc, char *argv[], DBusErr
int (* const dispatch)(DBusConnection *bus, char **args, unsigned n);
} verbs[] = {
{ "status", LESS, 1, show_status },
- { "set-hostname", LESS, 2, set_hostname },
+ { "set-hostname", EQUAL, 2, set_hostname },
{ "set-icon-name", EQUAL, 2, set_icon_name },
};
--
1.7.10.4

View File

@ -0,0 +1,105 @@
From 3dd8ee8fa693597663b0338235becbb0b7a9520c Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 25 Oct 2012 16:16:17 +0200
Subject: [PATCH] util: fix possible integer overflows
---
src/shared/util.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/shared/util.c b/src/shared/util.c
index 2d4a4c1..e2f8b1f 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -148,6 +148,9 @@ usec_t timespec_load(const struct timespec *ts) {
ts->tv_nsec == (long) -1)
return (usec_t) -1;
+ if (USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec))
+ return (usec_t) -1;
+
return
(usec_t) ts->tv_sec * USEC_PER_SEC +
(usec_t) ts->tv_nsec / NSEC_PER_USEC;
@@ -175,6 +178,9 @@ usec_t timeval_load(const struct timeval *tv) {
tv->tv_usec == (suseconds_t) -1)
return (usec_t) -1;
+ if (USEC_PER_SEC > (UINT64_MAX - tv->tv_usec) / (usec_t) tv->tv_sec)
+ return (usec_t) -1;
+
return
(usec_t) tv->tv_sec * USEC_PER_SEC +
(usec_t) tv->tv_usec;
--
1.7.10.4
From 49371bb50e0fe6e9e90309a20006bcfd9e2fa8f4 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Mon, 29 Oct 2012 15:49:34 -0400
Subject: [PATCH] util: avoid divide by zero FPE
In early userspace, if kernel initialization happens extremely quickly,
a call to systemd-timestamp can potentially result in division by zero.
Ensure that the check in timespec_load, which only makes sense if tv_sec
is greater than zero, is guarded by this condition.
---
src/shared/util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index e2f8b1f..9a45e60 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -148,7 +148,8 @@ usec_t timespec_load(const struct timespec *ts) {
ts->tv_nsec == (long) -1)
return (usec_t) -1;
- if (USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec))
+ if (ts->tv_sec > 0 &&
+ USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec))
return (usec_t) -1;
return
--
1.7.10.4
From fd09c93de9337c3df566180d04368353bb3662e7 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Mon, 29 Oct 2012 21:04:47 +0100
Subject: [PATCH] util: improve overflow checks
commit 49371bb fixed the observed division by zero, but missed another
occurrence of the same bug. It was also not the optimal fix. We can
simply make the divisor a constant by swapping it with the compared
value.
---
src/shared/util.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 9a45e60..8ec83e4 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -148,8 +148,7 @@ usec_t timespec_load(const struct timespec *ts) {
ts->tv_nsec == (long) -1)
return (usec_t) -1;
- if (ts->tv_sec > 0 &&
- USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec))
+ if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC)
return (usec_t) -1;
return
@@ -179,7 +178,7 @@ usec_t timeval_load(const struct timeval *tv) {
tv->tv_usec == (suseconds_t) -1)
return (usec_t) -1;
- if (USEC_PER_SEC > (UINT64_MAX - tv->tv_usec) / (usec_t) tv->tv_sec)
+ if ((usec_t) tv->tv_sec > (UINT64_MAX - tv->tv_usec) / USEC_PER_SEC)
return (usec_t) -1;
return
--
1.7.10.4

View File

@ -0,0 +1,48 @@
From 1abc85b8d026a2d72442b0edaee5213d0ee73c1f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Thu, 25 Oct 2012 02:31:49 +0200
Subject: [PATCH] job: avoid recursion into transaction code from job
cancelation
I hit an "assert(j->installed)" failure in transaction_apply(). Looking
into the backtrace I saw what happened:
1. The system was booting. var.mount/start was an installed job.
2. I pressed Ctrl+Alt+Del.
3. reboot.target was going to be isolated.
4. transaction_apply() proceeded to install a var.mount/stop job.
5. job_install() canceled the conflicting start job.
6. Depending jobs ended recursively with JOB_DEPENDENCY, among them was
local-fs.target/start.
7. Its OnFailure action triggered - emergency.target was now going to be
isolated.
8. We recursed back into transaction_apply() where the half-installed
var.mount/stop job confused us.
Recursing from job installation back into the transaction code cannot be
a good idea. Avoid the problem by canceling the conflicting job
non-recursively in job_install(). I don't think we'll miss anything by
not recursing here. After all, we are called from transaction_apply().
We will not be installing just this one job, but all jobs from a
transaction. All requirement dependencies will be included in it and
will be installed separately. Every transaction job will get a chance
to cancel its own conflicting installed job.
---
src/core/job.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/job.c b/src/core/job.c
index cb5674b..f08b8cb 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -180,7 +180,7 @@ Job* job_install(Job *j) {
if (uj) {
if (j->type != JOB_NOP && job_type_is_conflicting(uj->type, j->type))
- job_finish_and_invalidate(uj, JOB_CANCELED, true);
+ job_finish_and_invalidate(uj, JOB_CANCELED, false);
else {
/* not conflicting, i.e. mergeable */
--
1.7.10.4

View File

@ -0,0 +1,34 @@
From 0f91dd8749c1a1ec308cc645269be92166413e38 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 26 Oct 2012 01:07:41 +0200
Subject: [PATCH] journal: properly determine cutoff max date
---
src/journal/sd-journal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 09b0eb8..d5d2d78 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2121,7 +2121,7 @@ _public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
if (from)
*from = MIN(fr, *from);
if (to)
- *to = MIN(t, *to);
+ *to = MAX(t, *to);
}
}
@@ -2160,7 +2160,7 @@ _public_ int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot
if (from)
*from = MIN(fr, *from);
if (to)
- *to = MIN(t, *to);
+ *to = MAX(t, *to);
}
}
--
1.7.10.4

View File

@ -0,0 +1,65 @@
From ee55db41442ad8055f5a84a339b1e0e22bc037c4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 20 Nov 2012 21:25:26 +0100
Subject: [PATCH] journal-send: always send SYSLOG_IDENTIFIER, if we have it
https://bugzilla.redhat.com/show_bug.cgi?id=872193
---
src/journal/journal-send.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index 7a91569..bd8f887 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -219,6 +219,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
* be a tmpfs, and one that is available from early boot on
* and where unprivileged users can create files. */
char path[] = "/dev/shm/journal.XXXXXX";
+ bool have_syslog_identifier = false;
if (_unlikely_(!iov))
return -EINVAL;
@@ -228,7 +229,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
saved_errno = errno;
- w = alloca(sizeof(struct iovec) * n * 5);
+ w = alloca(sizeof(struct iovec) * n * 5 + 3);
l = alloca(sizeof(uint64_t) * n);
for (i = 0; i < n; i++) {
@@ -245,6 +246,9 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
goto finish;
}
+ have_syslog_identifier =
+ have_syslog_identifier || (c == iov[i].iov_base + 17 && memcmp(iov[i].iov_base, "SYSLOG_IDENTIFIER", 17) == 0);
+
nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len);
if (nl) {
if (_unlikely_(nl < c)) {
@@ -280,6 +284,20 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
IOVEC_SET_STRING(w[j++], "\n");
}
+ if (!have_syslog_identifier &&
+ string_is_safe(program_invocation_short_name)) {
+
+ /* Implicitly add program_invocation_short_name, if it
+ * is not set explicitly. We only do this for
+ * program_invocation_short_name, and nothing else
+ * since everything else is much nicer to retrieve
+ * from the outside. */
+
+ IOVEC_SET_STRING(w[j++], "SYSLOG_IDENTIFIER=");
+ IOVEC_SET_STRING(w[j++], program_invocation_short_name);
+ IOVEC_SET_STRING(w[j++], "\n");
+ }
+
fd = journal_fd();
if (_unlikely_(fd < 0)) {
r = fd;
--
1.7.10.4

View File

@ -0,0 +1,38 @@
From 244692cbfb46df5ff79d07da8fb848a1165bd2fb Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@googlemail.com>
Date: Sun, 13 Jan 2013 12:28:38 +0100
Subject: [PATCH] journalctl: quit on I/O error
This makes journalctl quit on ferror() conditions on stdout. It fixes an
annoying bug if you pipe its output through 'less' and press 'q'. Without
this fix journalctl will continue reading all journal data until EOF which
can take quite some time. For instance on my machine:
david-nb ~ # time journalctl | wc -l
327240
real 1m13.039s
user 1m0.217s
sys 0m10.467s
However, expected behavior is journalctl to quit when its pager closed the
output pipe.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
src/journal/journalctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/journalctl.c
===================================================================
--- systemd-195.orig/src/journal/journalctl.c
+++ systemd-195/src/journal/journalctl.c
@@ -1035,7 +1035,7 @@ int main(int argc, char *argv[]) {
on_tty() * OUTPUT_COLOR;
r = output_journal(stdout, j, arg_output, 0, flags);
- if (r < 0)
+ if (r < 0 || ferror(stdout))
goto finish;
need_seek = true;

View File

@ -0,0 +1,25 @@
From db87a36e74ff26d1046a451ee086c9a2c4113d12 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 24 Oct 2012 01:05:55 +0200
Subject: [PATCH] journalctl: remove left-over log message
---
src/journal/journalctl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index d1338d2..0f20448 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -547,8 +547,6 @@ static int add_priorities(sd_journal *j) {
if (arg_priorities & (1 << i)) {
match[sizeof(match)-2] = '0' + i;
- log_info("adding match %s", match);
-
r = sd_journal_add_match(j, match, strlen(match));
if (r < 0) {
log_error("Failed to add match: %s", strerror(-r));
--
1.7.10.4

View File

@ -0,0 +1,27 @@
From 71c015969233c21ea38b1e63993d02fe171df672 Mon Sep 17 00:00:00 2001
From: Lekensteyn <lekensteyn@gmail.com>
Date: Thu, 15 Nov 2012 12:17:03 +0100
Subject: [PATCH] journalctl: require argument for --priority
This fixes a segfault due to a missing value for --priority. -p is
unaffected because it is specified in the getopt_long parameter list.
---
src/journal/journalctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index cccd8a7..011a11b 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -157,7 +157,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "this-boot", no_argument, NULL, 'b' },
{ "directory", required_argument, NULL, 'D' },
{ "header", no_argument, NULL, ARG_HEADER },
- { "priority", no_argument, NULL, 'p' },
+ { "priority", required_argument, NULL, 'p' },
{ "setup-keys", no_argument, NULL, ARG_SETUP_KEYS },
{ "interval", required_argument, NULL, ARG_INTERVAL },
{ "verify", no_argument, NULL, ARG_VERIFY },
--
1.7.10.4

View File

@ -0,0 +1,25 @@
From a9f4815da56b8efc519595c3d8a78fe064fa8d69 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Fri, 26 Oct 2012 00:28:23 +0200
Subject: [PATCH] udev: kmod - fix typo
---
src/udev/udev-builtin-kmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c
index 1df055b..aacdff8 100644
--- a/src/udev/udev-builtin-kmod.c
+++ b/src/udev/udev-builtin-kmod.c
@@ -75,7 +75,7 @@ static int builtin_kmod(struct udev_device *dev, int argc, char *argv[], bool te
struct udev *udev = udev_device_get_udev(dev);
int i;
- if (ctx)
+ if (!ctx)
return 0;
if (argc < 3 || strcmp(argv[1], "load")) {
--
1.7.10.4

View File

@ -0,0 +1,26 @@
From e68893075083a7461b1572233d23fdb23541d630 Mon Sep 17 00:00:00 2001
From: Michael Terry <michael.terry@canonical.com>
Date: Fri, 14 Dec 2012 09:02:13 -0500
Subject: [PATCH] libudev: validate 'udev' argument to udev_enumerate_new()
https://bugs.freedesktop.org/show_bug.cgi?id=58289
---
src/libudev/libudev-enumerate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index 1729655..6a5f4e0 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -81,6 +81,8 @@ _public_ struct udev_enumerate *udev_enumerate_new(struct udev *udev)
{
struct udev_enumerate *udev_enumerate;
+ if (udev == NULL)
+ return NULL;
udev_enumerate = calloc(1, sizeof(struct udev_enumerate));
if (udev_enumerate == NULL)
return NULL;
--
1.7.10.4

View File

@ -0,0 +1,27 @@
From 6b2b6f30e38d67b032d6bdc6b47ae05e143e96c5 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 12 Dec 2012 22:24:04 +0100
Subject: [PATCH] localectl: fix dbus call arguments in set_x11_keymap
Fixes an assertion failure in the dbus lib.
https://bugzilla.redhat.com/show_bug.cgi?id=882212
---
src/locale/localectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index fa73bca..383a17d 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -537,7 +537,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) {
layout = args[1];
model = n > 2 ? args[2] : "";
variant = n > 3 ? args[3] : "";
- options = n > 3 ? args[4] : "";
+ options = n > 4 ? args[4] : "";
b = arg_convert;
return bus_method_call_with_reply(
--
1.7.10.4

View File

@ -0,0 +1,163 @@
From 17d33cecaa762f7e43200307328af5e9135e2091 Mon Sep 17 00:00:00 2001
From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Sat, 5 Jan 2013 01:29:53 +0100
Subject: [PATCH] localectl: support systems without locale-archive
Not all systems ships with locales inside /usr/lib/locale-archive, some
prefer to have locale data as individual subdirectories of /usr/lib/locale.
(A notable example of this is OpenEmbeddded, and OSes deriving from it
like gnome-ostree).
Given that glibc supports both ways, localectl should too.
---
src/locale/localectl.c | 101 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 16 deletions(-)
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 5d35f9c..b3acb3e 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -266,7 +266,7 @@ finish:
return r;
}
-static int list_locales(DBusConnection *bus, char **args, unsigned n) {
+static int add_locales_from_archive(Set *locales) {
/* Stolen from glibc... */
struct locarhead {
@@ -304,21 +304,15 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
const struct namehashent *e;
const void *p = MAP_FAILED;
_cleanup_close_ int fd = -1;
- _cleanup_strv_free_ char **l = NULL;
- char **j;
- Set *locales;
size_t sz = 0;
struct stat st;
unsigned i;
int r;
- locales = set_new(string_hash_func, string_compare_func);
- if (!locales)
- return log_oom();
-
fd = open("/usr/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC);
if (fd < 0) {
- log_error("Failed to open locale archive: %m");
+ if (errno != ENOENT)
+ log_error("Failed to open locale archive: %m");
r = -errno;
goto finish;
}
@@ -380,15 +374,93 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
}
}
+ r = 0;
+
+ finish:
+ if (p != MAP_FAILED)
+ munmap((void*) p, sz);
+
+ return r;
+}
+
+static int add_locales_from_libdir (Set *locales) {
+ DIR *dir;
+ struct dirent *entry;
+ int r;
+
+ dir = opendir("/usr/lib/locale");
+ if (!dir) {
+ log_error("Failed to open locale directory: %m");
+ r = -errno;
+ goto finish;
+ }
+
+ errno = 0;
+ while ((entry = readdir(dir))) {
+ char *z;
+
+ if (entry->d_type != DT_DIR)
+ continue;
+
+ if (ignore_file(entry->d_name))
+ continue;
+
+ z = strdup(entry->d_name);
+ if (!z) {
+ r = log_oom();
+ goto finish;
+ }
+
+ r = set_put(locales, z);
+ if (r < 0) {
+ free(z);
+
+ if (r != -EEXIST) {
+ log_error("Failed to add locale: %s", strerror(-r));
+ goto finish;
+ }
+ }
+
+ errno = 0;
+ }
+
+ if (errno != 0) {
+ log_error("Failed to read locale directory: %m");
+ r = -errno;
+ goto finish;
+ }
+
+ r = 0;
+
+ finish:
+ closedir(dir);
+ return r;
+}
+
+static int list_locales(DBusConnection *bus, char **args, unsigned n) {
+ Set *locales;
+ _cleanup_strv_free_ char **l = NULL;
+ char **j;
+ int r;
+
+ locales = set_new(string_hash_func, string_compare_func);
+ if (!locales)
+ return log_oom();
+
+ r = add_locales_from_archive(locales);
+ if (r < 0 && r != -ENOENT)
+ goto finish;
+
+ r = add_locales_from_libdir(locales);
+ if (r < 0)
+ goto finish;
+
l = set_get_strv(locales);
if (!l) {
r = log_oom();
goto finish;
}
- set_free(locales);
- locales = NULL;
-
strv_sort(l);
pager_open_if_enabled();
@@ -399,10 +471,7 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
r = 0;
finish:
- if (p != MAP_FAILED)
- munmap((void*) p, sz);
-
- set_free_free(locales);
+ set_free(locales);
return r;
}
--
1.7.10.4

View File

@ -0,0 +1,59 @@
From 955f9bde9ba6d9f0a7364d5cb7c0cee951d5caab Mon Sep 17 00:00:00 2001
From: Oleg Samarin <osamarin68@gmail.com>
Date: Sat, 5 Jan 2013 20:33:37 +0400
Subject: [PATCH] logind: Capability of making seats without framebuffer
devices
file logind.c: The seat is now activated by any device with udev tag "seat-master"
file 71-seat.rules.in: All framebuffer devices have this tag
---
src/login/71-seat.rules.in | 2 +-
src/login/logind.c | 12 ++----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/login/71-seat.rules.in b/src/login/71-seat.rules.in
index f554d7f..4f1a9a5 100644
--- a/src/login/71-seat.rules.in
+++ b/src/login/71-seat.rules.in
@@ -10,7 +10,7 @@ ACTION=="remove", GOTO="seat_end"
TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat"
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"
-SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat"
+SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat", TAG+="seat-master"
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
# 'Plugable' USB hub, sound, network, graphics adapter
diff --git a/src/login/logind.c b/src/login/logind.c
index 6438631..6776229 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -459,11 +459,7 @@ int manager_enumerate_devices(Manager *m) {
goto finish;
}
- r = udev_enumerate_add_match_subsystem(e, "graphics");
- if (r < 0)
- goto finish;
-
- r = udev_enumerate_add_match_tag(e, "seat");
+ r = udev_enumerate_add_match_tag(e, "seat-master");
if (r < 0)
goto finish;
@@ -1295,11 +1291,7 @@ static int manager_connect_udev(Manager *m) {
if (!m->udev_seat_monitor)
return -ENOMEM;
- r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat");
- if (r < 0)
- return r;
-
- r = udev_monitor_filter_add_match_subsystem_devtype(m->udev_seat_monitor, "graphics", NULL);
+ r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat-master");
if (r < 0)
return r;
--
1.7.10.4

View File

@ -0,0 +1,33 @@
From 1ca04b87979b2add53ebb8a7fdf13c34fb6c2743 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 14 Jan 2013 21:40:38 +0100
Subject: [PATCH] logind: ignore non-tty/non-x11 session when checking if
there are other sessions before shutting down
https://bugzilla.redhat.com/show_bug.cgi?id=890827
---
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 77a06f2..d64debe 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -979,9 +979,12 @@ static int have_multiple_sessions(
assert(m);
- /* Check for other users' sessions. Greeter sessions do not count. */
+ /* Check for other users' sessions. Greeter sessions do not
+ * count, and non-login sessions do not count either. */
HASHMAP_FOREACH(session, m->sessions, i)
- if (session->class == SESSION_USER && session->user->uid != uid)
+ if (session->class == SESSION_USER &&
+ (session->type == SESSION_TTY || session->type == SESSION_X11) &&
+ session->user->uid != uid)
return true;
return false;
--
1.7.10.4

View File

@ -0,0 +1,57 @@
From 0ad1271f564b9c956685938167f7ea8c301e835e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sun, 23 Dec 2012 22:31:17 +0100
Subject: [PATCH] pam: properly handle SSH logins lacking the PAM tty field
---
src/login/pam-module.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 08a9328..e6764a1 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -322,7 +322,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
struct passwd *pw;
bool kill_processes = false, debug = false;
- const char *username, *id, *object_path, *runtime_path, *service = NULL, *tty = NULL, *display = NULL, *remote_user = NULL, *remote_host = NULL, *seat = NULL, *type, *class, *cvtnr = NULL;
+ const char *username, *id, *object_path, *runtime_path, *service = NULL, *tty = NULL, *display = NULL, *remote_user = NULL, *remote_host = NULL, *seat = NULL, *type = NULL, *class, *cvtnr = NULL;
char **controllers = NULL, **reset_controllers = NULL, **kill_only_users = NULL, **kill_exclude_users = NULL;
DBusError error;
uint32_t uid, pid;
@@ -453,9 +453,17 @@ _public_ PAM_EXTERN int pam_sm_open_session(
display = tty;
tty = "";
} else if (streq(tty, "cron")) {
- /* cron has been setting PAM_TTY to "cron" for a very long time
- * and it cannot stop doing that for compatibility reasons. */
+ /* cron has been setting PAM_TTY to "cron" for a very
+ * long time and it probably shouldn't stop doing that
+ * for compatibility reasons. */
tty = "";
+ type = "unspecified";
+ } else if (streq(tty, "ssh")) {
+ /* ssh has been setting PAM_TTY to "ssh" for a very
+ * long time and probably shouldn't stop doing that
+ * for compatibility reasons. */
+ tty = "";
+ type ="tty";
}
/* If this fails vtnr will be 0, that's intended */
@@ -469,8 +477,9 @@ _public_ PAM_EXTERN int pam_sm_open_session(
get_seat_from_display(display, NULL, &vtnr);
}
- type = !isempty(display) ? "x11" :
- !isempty(tty) ? "tty" : "unspecified";
+ if (!type)
+ type = !isempty(display) ? "x11" :
+ !isempty(tty) ? "tty" : "unspecified";
class = pam_getenv(handle, "XDG_SESSION_CLASS");
if (isempty(class))
--
1.7.10.4

View File

@ -0,0 +1,157 @@
From 565d91fdf198b88f7c2d72c67cfc6c30341a3596 Mon Sep 17 00:00:00 2001
From: Michal Vyskocil <mvyskocil@suse.cz>
Date: Fri, 18 Jan 2013 10:05:10 +0100
Subject: [PATCH] util: continuation support for load_env_file
Variable definitions can be written on more than one line - if each ends
with a backslash, then is concatenated with a previous one. Only
backslash and unix end of line (\n) are treated as a continuation.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=58083
[zj: squashed two patches together; cleaned up grammar; removed
comment about ignoring trailing backslash -- it is not ignored.]
Document continuation support in systemd.exec
---
man/systemd.exec.xml | 8 +++++---
src/shared/util.c | 43 ++++++++++++++++++++++++++++++++++++++-----
2 files changed, 43 insertions(+), 8 deletions(-)
Index: systemd-195/man/systemd.exec.xml
===================================================================
--- systemd-195.orig/man/systemd.exec.xml
+++ systemd-195/man/systemd.exec.xml
@@ -282,9 +282,11 @@
contain new-line separated variable
assignments. Empty lines and lines
starting with ; or # will be ignored,
- which may be used for commenting. The
- parser strips leading and
- trailing whitespace from the values
+ which may be used for commenting. A line
+ ending with a backslash will be concatenated
+ with the following one, allowing multiline variable
+ definitions. The parser strips leading
+ and trailing whitespace from the values
of assignments, unless you use
double quotes (").
The
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -876,33 +876,55 @@ fail:
return r;
}
-int load_env_file(
- const char *fname,
- char ***rl) {
-
- FILE *f;
- char **m = NULL;
- int r;
+int load_env_file(const char *fname,
+ char ***rl) {
+
+ FILE _cleanup_fclose_ *f;
+ char *b;
+ char _cleanup_free_ *c = NULL;
+ char _cleanup_strv_free_ **m = NULL;
assert(fname);
assert(rl);
- if (!(f = fopen(fname, "re")))
+ f = fopen(fname, "re");
+ if (!f)
return -errno;
while (!feof(f)) {
- char l[LINE_MAX], *p, *u;
+ char l[LINE_MAX], *p, *u, *cs;
char **t;
if (!fgets(l, sizeof(l), f)) {
- if (feof(f))
+ if (!feof(f))
+ return -errno;
+ else if (!c)
break;
+ }
- r = -errno;
- goto finish;
+ cs = endswith(l, "\\\n");
+ if (cs) {
+ *cs = '\0';
+ b = strappend(c, l);
+ if (!b)
+ return log_oom();
+
+ free(c);
+ c = b;
+ *l = '\0';
+ continue;
}
- p = strstrip(l);
+ if (c) {
+ b = strappend(c, l);
+ if (!b)
+ return log_oom();
+
+ free(c);
+ c = b;
+ }
+
+ p = strstrip(c ? c : l);
if (!*p)
continue;
@@ -910,35 +932,27 @@ int load_env_file(
if (strchr(COMMENTS, *p))
continue;
- if (!(u = normalize_env_assignment(p))) {
- r = log_oom();
- goto finish;
- }
+ u = normalize_env_assignment(p);
+ if (!u)
+ return log_oom();
+
+ free(c);
+ c = NULL;
t = strv_append(m, u);
free(u);
- if (!t) {
- r = log_oom();
- goto finish;
- }
+ if (!t)
+ return log_oom();
strv_free(m);
m = t;
}
- r = 0;
-
*rl = m;
m = NULL;
-finish:
- if (f)
- fclose(f);
-
- strv_free(m);
-
- return r;
+ return 0;
}
int write_env_file(const char *fname, char **l) {

View File

@ -0,0 +1,27 @@
From c9c7aef24f9750bbd51d2c13beff66473d96bf3c Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 13 Dec 2012 14:59:39 +0100
Subject: [PATCH] path-util: set pointer to null after calling free()
In cases where path_strv_canonicalize() returns NULL, strv_free() is
called afterwards and it will call free() on pointers which were freed
already in path_strv_canonicalize()
---
src/shared/path-util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 70c8a8a..dd12d3d 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) {
t = path_make_absolute_cwd(*s);
free(*s);
+ *s = NULL;
if (!t) {
enomem = true;
--
1.7.10.4

View File

@ -0,0 +1,30 @@
From aa6eba407be2c23882bf41a1beafbbd1352f7ab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 23 Oct 2012 16:32:12 +0200
Subject: [PATCH] units: reword rescue mode hints
Do not suggest to the user that commands can be issued before
logging in.
sulogin prints it own message, which mentions ^D, so there's no need
to repeat it here.
---
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 1815f9d..129a831 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -16,7 +16,7 @@ Before=shutdown.target
Environment=HOME=/root
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -b" to view system logs. Type "systemctl reboot" to reboot.'
+ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -b" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
ExecStart=-/sbin/sulogin
ExecStopPost=@SYSTEMCTL@ --fail --no-block default
Type=idle
--
1.7.10.4

View File

@ -0,0 +1,48 @@
From fbeefb45ac1a257a0c5af975ad26d68ed6c39fda Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 14 Jan 2013 21:05:17 +0100
Subject: [PATCH] service: for Type=forking services, ignore exit status of
main process depending on ExecStart's ignore setting
https://bugzilla.redhat.com/show_bug.cgi?id=860464
---
src/core/service.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/core/service.c b/src/core/service.c
index 8e9e112..7eaac0d 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2926,15 +2926,25 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
s->main_pid = 0;
exec_status_exit(&s->main_exec_status, &s->exec_context, pid, code, status);
- /* If this is not a forking service than the main
- * process got started and hence we copy the exit
- * status so that it is recorded both as main and as
- * control process exit status */
if (s->main_command) {
+ /* If this is not a forking service than the
+ * main process got started and hence we copy
+ * the exit status so that it is recorded both
+ * as main and as control process exit
+ * status */
+
s->main_command->exec_status = s->main_exec_status;
if (s->main_command->ignore)
f = SERVICE_SUCCESS;
+ } else if (s->exec_command[SERVICE_EXEC_START]) {
+
+ /* If this is a forked process, then we should
+ * ignore the return value if this was
+ * configured for the starter process */
+
+ if (s->exec_command[SERVICE_EXEC_START]->ignore)
+ f = SERVICE_SUCCESS;
}
log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG : LOG_NOTICE,
--
1.7.10.4

View File

@ -0,0 +1,35 @@
From 0c08f5cde749bd2818475e487109cd0d413452df Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 16 Jan 2013 03:51:56 +0100
Subject: [PATCH] shutdown: in the final umount loop don't use MNT_FORCE
MNT_FORCE is honoured by NFS and FUSE and allows unmounting of the FS
even if consumers still use it. For our brute-force loop we rely on
EBUSY being reported as long as a file system is still used by a
loopback device or suchlike. Hence, drop MNT_FORCE to make EBUSY
reliable.
---
src/core/umount.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index 96232d3..c7b6cee 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -442,9 +442,11 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
)
continue;
- /* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
+ /* Trying to umount. We don't force here since we rely
+ * on busy NFS and FUSE file systems to return EBUSY
+ * until we closed everything on top of them. */
log_info("Unmounting %s.", m->path);
- if (umount2(m->path, MNT_FORCE) == 0) {
+ if (umount2(m->path, 0) == 0) {
if (changed)
*changed = true;
--
1.7.10.4

View File

@ -0,0 +1,37 @@
From bdffb521d01a2e2bc342154d74cb519755c52c25 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Wed, 16 Jan 2013 04:35:54 +0100
Subject: [PATCH] shutdown: ignore loop devices without a backing file
---
src/core/umount.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/core/umount.c b/src/core/umount.c
index c7b6cee..f0f2711 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -233,6 +233,7 @@ static int loopback_list_get(MountPoint **head) {
udev_list_entry_foreach(item, first) {
MountPoint *lb;
struct udev_device *d;
+ const char *backing;
char *loop;
const char *dn;
@@ -241,6 +242,12 @@ static int loopback_list_get(MountPoint **head) {
goto finish;
}
+ backing = udev_device_get_sysattr_value(d, "loop/backing_file");
+ if (!backing) {
+ udev_device_unref(d);
+ continue;
+ }
+
if (!(dn = udev_device_get_devnode(d))) {
udev_device_unref(d);
continue;
--
1.7.10.4

273
shutdown-improvements.patch Normal file
View File

@ -0,0 +1,273 @@
From 2569a5ce16638d99f1ebaaa7774d183496d8b8e8 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 7 Dec 2012 17:28:30 +0100
Subject: [PATCH] shutdown: downgrade a warning
All messages of the kind "not all done, %d left" are log_info, except
the one for DM devices. Make it info too.
---
src/core/shutdown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 4bb4b4d..192746a 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -233,7 +233,7 @@ int main(int argc, char *argv[]) {
if (r == 0)
need_dm_detach = false;
else if (r > 0)
- log_warning("Not all DM devices detached, %d left.", r);
+ log_info("Not all DM devices detached, %d left.", r);
else
log_error("Failed to detach DM devices: %s", strerror(-r));
}
--
1.7.10.4
From c678406681d32d56730b9e9c002d5500d7aa7f8b Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 7 Dec 2012 17:34:21 +0100
Subject: [PATCH] umount: fix check for DM changed
delete_dm() returns 0 on success. The check for "r > 0" was likely
a copy&paste error from the loopback code where "r > 0" makes sense.
---
src/core/umount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index f6c520e..8776807 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -536,7 +536,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
if ((r = delete_dm(m->devnum)) >= 0) {
- if (r > 0 && changed)
+ if (changed)
*changed = true;
mount_point_free(head, m);
--
1.7.10.4
From bce93b7ac7642426039863493694d8c12812e2a7 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 7 Dec 2012 17:44:50 +0100
Subject: [PATCH] shutdown, umount: logging improvements
In bugreports about hangs during the late shutdown we are often missing
important information - what were we trying to unmount/detach when it hung.
Instead of printing what we successfully unmounted, print what we are
going to unmount/detach. And add messages to mark the completion of
categories (mount/swap/loop/DM).
---
src/core/shutdown.c | 20 ++++++++++++--------
src/core/umount.c | 15 +++++++++------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 192746a..6783008 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -197,9 +197,10 @@ int main(int argc, char *argv[]) {
if (need_umount) {
log_info("Unmounting file systems.");
r = umount_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_umount = false;
- else if (r > 0)
+ log_info("All filesystems unmounted.");
+ } else if (r > 0)
log_info("Not all file systems unmounted, %d left.", r);
else
log_error("Failed to unmount file systems: %s", strerror(-r));
@@ -208,9 +209,10 @@ int main(int argc, char *argv[]) {
if (need_swapoff) {
log_info("Disabling swaps.");
r = swapoff_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_swapoff = false;
- else if (r > 0)
+ log_info("All swaps disabled.");
+ } else if (r > 0)
log_info("Not all swaps are turned off, %d left.", r);
else
log_error("Failed to turn off swaps: %s", strerror(-r));
@@ -219,9 +221,10 @@ int main(int argc, char *argv[]) {
if (need_loop_detach) {
log_info("Detaching loop devices.");
r = loopback_detach_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_loop_detach = false;
- else if (r > 0)
+ log_info("All loop devices detached.");
+ } else if (r > 0)
log_info("Not all loop devices detached, %d left.", r);
else
log_error("Failed to detach loop devices: %s", strerror(-r));
@@ -230,9 +233,10 @@ int main(int argc, char *argv[]) {
if (need_dm_detach) {
log_info("Detaching DM devices.");
r = dm_detach_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_dm_detach = false;
- else if (r > 0)
+ log_info("All DM devices detached.");
+ } else if (r > 0)
log_info("Not all DM devices detached, %d left.", r);
else
log_error("Failed to detach DM devices: %s", strerror(-r));
diff --git a/src/core/umount.c b/src/core/umount.c
index 8776807..fd90d9f 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -443,8 +443,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
continue;
/* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
+ log_info("Unmounting %s.", m->path);
if (umount2(m->path, MNT_FORCE) == 0) {
- log_info("Unmounted %s.", m->path);
if (changed)
*changed = true;
@@ -465,6 +465,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
+ log_info("Disabling swap %s.", m->path);
if (swapoff(m->path) == 0) {
if (changed)
*changed = true;
@@ -500,8 +501,9 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- if ((r = delete_loopback(m->path)) >= 0) {
-
+ log_info("Deleting loopback %s.", m->path);
+ r = delete_loopback(m->path);
+ if (r >= 0) {
if (r > 0 && changed)
*changed = true;
@@ -534,14 +536,15 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- if ((r = delete_dm(m->devnum)) >= 0) {
-
+ log_info("Deleting DM %u:%u.", major(m->devnum), minor(m->devnum));
+ r = delete_dm(m->devnum);
+ if (r >= 0) {
if (changed)
*changed = true;
mount_point_free(head, m);
} else {
- log_warning("Could not delete dm %s: %m", m->path);
+ log_warning("Could not delete DM %s: %m", m->path);
n_failed++;
}
}
--
1.7.10.4
From 735e0712710a1dc26da0febafb91b242b2687f3f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 7 Dec 2012 18:02:43 +0100
Subject: [PATCH] shutdown, umount: use verbs consistently
Mounts are "unmounted".
Swaps are "deactivated", not "turned off" nor "disabled".
Loop and DM devices are "detached", not "deleted".
Especially the deleting sounded a bit scary.
---
src/core/shutdown.c | 8 ++++----
src/core/umount.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 6783008..0b0e0c3 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -207,15 +207,15 @@ int main(int argc, char *argv[]) {
}
if (need_swapoff) {
- log_info("Disabling swaps.");
+ log_info("Deactivating swaps.");
r = swapoff_all(&changed);
if (r == 0) {
need_swapoff = false;
- log_info("All swaps disabled.");
+ log_info("All swaps deactivated.");
} else if (r > 0)
- log_info("Not all swaps are turned off, %d left.", r);
+ log_info("Not all swaps deactivated, %d left.", r);
else
- log_error("Failed to turn off swaps: %s", strerror(-r));
+ log_error("Failed to deactivate swaps: %s", strerror(-r));
}
if (need_loop_detach) {
diff --git a/src/core/umount.c b/src/core/umount.c
index fd90d9f..96232d3 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -465,7 +465,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
- log_info("Disabling swap %s.", m->path);
+ log_info("Deactivating swap %s.", m->path);
if (swapoff(m->path) == 0) {
if (changed)
*changed = true;
@@ -501,7 +501,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- log_info("Deleting loopback %s.", m->path);
+ log_info("Detaching loopback %s.", m->path);
r = delete_loopback(m->path);
if (r >= 0) {
if (r > 0 && changed)
@@ -509,7 +509,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
mount_point_free(head, m);
} else {
- log_warning("Could not delete loopback %s: %m", m->path);
+ log_warning("Could not detach loopback %s: %m", m->path);
n_failed++;
}
}
@@ -536,7 +536,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- log_info("Deleting DM %u:%u.", major(m->devnum), minor(m->devnum));
+ log_info("Detaching DM %u:%u.", major(m->devnum), minor(m->devnum));
r = delete_dm(m->devnum);
if (r >= 0) {
if (changed)
@@ -544,7 +544,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
mount_point_free(head, m);
} else {
- log_warning("Could not delete DM %s: %m", m->path);
+ log_warning("Could not detach DM %s: %m", m->path);
n_failed++;
}
}
--
1.7.10.4

View File

@ -0,0 +1,26 @@
From 10f70492aea211981e4bdbe58dd7ea110e05cd16 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 20 Nov 2012 00:19:00 +0100
Subject: [PATCH] socket: improve error message when we cannot spawn the
socket's service unit
---
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 c095981..f4f40af 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1542,7 +1542,7 @@ static void socket_enter_running(Socket *s, int cfd) {
return;
fail:
- log_warning("%s failed to queue socket startup job: %s", UNIT(s)->id, bus_error(&error, r));
+ log_warning("%s failed to queue service startup job (Maybe the service file is missing or not a %s unit?): %s", UNIT(s)->id, cfd >= 0 ? "template" : "non-template", bus_error(&error, r));
socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES);
if (cfd >= 0)
--
1.7.10.4

View File

@ -0,0 +1,32 @@
From 80cba3795da3a43b27cbb219d7daf7d6f049b079 Mon Sep 17 00:00:00 2001
From: Dimitrios Apostolou <jimis@gmx.net>
Date: Wed, 19 Dec 2012 22:32:52 +0100
Subject: [PATCH] socket: Too many incoming connections
Hello list,
some socket activated service gave me the error message you can see on
the subject, maybe systemd should be more verbose in that case.
Thanks,
Dimitris
---
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 9b5bcb6..49e795e 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1484,7 +1484,7 @@ static void socket_enter_running(Socket *s, int cfd) {
Service *service;
if (s->n_connections >= s->max_connections) {
- log_warning("Too many incoming connections (%u)", s->n_connections);
+ log_warning("%s: Too many incoming connections (%u)", UNIT(s)->id, s->n_connections);
close_nointr_nofail(cfd);
return;
}
--
1.7.10.4

View File

@ -0,0 +1,238 @@
From 1fd8d04e384ae2066c02129b033c6be509edfd67 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 30 Oct 2012 18:29:45 +0100
Subject: [PATCH] strv: cleanup error path loops
https://bugzilla.redhat.com/show_bug.cgi?id=858799
---
src/shared/strv.c | 100 ++++++++++++++++++++++++++---------------------------
1 file changed, 49 insertions(+), 51 deletions(-)
diff --git a/src/shared/strv.c b/src/shared/strv.c
index 1b8e27b..6b76d0e 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -75,25 +75,21 @@ void strv_freep(char ***l) {
char **strv_copy(char **l) {
char **r, **k;
- k = r = new(char*, strv_length(l)+1);
- if (!k)
+ k = r = new(char*, strv_length(l) + 1);
+ if (!r)
return NULL;
if (l)
- for (; *l; k++, l++)
- if (!(*k = strdup(*l)))
- goto fail;
+ for (; *l; k++, l++) {
+ *k = strdup(*l);
+ if (!*k) {
+ strv_free(r);
+ return NULL;
+ }
+ }
*k = NULL;
return r;
-
-fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
- return NULL;
}
unsigned strv_length(char **l) {
@@ -163,13 +159,7 @@ char **strv_new_ap(const char *x, va_list ap) {
return a;
fail:
-
- for (; i > 0; i--)
- if (a[i-1])
- free(a[i-1]);
-
- free(a);
-
+ strv_free(a);
return NULL;
}
@@ -265,16 +255,21 @@ char **strv_split(const char *s, const char *separator) {
FOREACH_WORD_SEPARATOR(w, l, s, separator, state)
n++;
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
i = 0;
- FOREACH_WORD_SEPARATOR(w, l, s, separator, state)
- if (!(r[i++] = strndup(w, l))) {
+ FOREACH_WORD_SEPARATOR(w, l, s, separator, state) {
+ r[i] = strndup(w, l);
+ if (!r[i]) {
strv_free(r);
return NULL;
}
+ i++;
+ }
+
r[i] = NULL;
return r;
}
@@ -292,15 +287,19 @@ char **strv_split_quoted(const char *s) {
FOREACH_WORD_QUOTED(w, l, s, state)
n++;
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
i = 0;
- FOREACH_WORD_QUOTED(w, l, s, state)
- if (!(r[i++] = cunescape_length(w, l))) {
+ FOREACH_WORD_QUOTED(w, l, s, state) {
+ r[i] = cunescape_length(w, l);
+ if (!r[i]) {
strv_free(r);
return NULL;
}
+ i++;
+ }
r[i] = NULL;
return r;
@@ -323,7 +322,8 @@ char *strv_join(char **l, const char *separator) {
n += strlen(*s);
}
- if (!(r = new(char, n+1)))
+ r = new(char, n+1);
+ if (!r)
return NULL;
e = r;
@@ -352,22 +352,21 @@ char **strv_append(char **l, const char *s) {
if (!r)
return NULL;
- for (k = r; *l; k++, l++)
- if (!(*k = strdup(*l)))
+ for (k = r; *l; k++, l++) {
+ *k = strdup(*l);
+ if (!*k)
goto fail;
+ }
- if (!(*(k++) = strdup(s)))
+ k[0] = strdup(s);
+ if (!k[0])
goto fail;
- *k = NULL;
+ k[1] = NULL;
return r;
fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
+ strv_free(r);
return NULL;
}
@@ -462,7 +461,8 @@ static int env_append(char **r, char ***k, char **a) {
else
free(*j);
- if (!(*j = strdup(*a)))
+ *j = strdup(*a);
+ if (!*j)
return -ENOMEM;
}
@@ -484,7 +484,8 @@ char **strv_env_merge(unsigned n_lists, ...) {
}
va_end(ap);
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
k = r;
@@ -503,11 +504,7 @@ char **strv_env_merge(unsigned n_lists, ...) {
fail:
va_end(ap);
-
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
+ strv_free(r);
return NULL;
}
@@ -619,7 +616,8 @@ char **strv_env_set(char **x, const char *p) {
/* Overrides the env var setting of p, returns a new copy */
- if (!(r = new(char*, strv_length(x)+2)))
+ r = new(char*, strv_length(x)+2);
+ if (!r)
return NULL;
k = r;
@@ -634,11 +632,7 @@ char **strv_env_set(char **x, const char *p) {
return r;
fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
+ strv_free(r);
return NULL;
}
@@ -698,7 +692,8 @@ char **strv_parse_nulstr(const char *s, size_t l) {
if (s[l-1] != 0)
c++;
- if (!(v = new0(char*, c+1)))
+ v = new0(char*, c+1);
+ if (!v)
return NULL;
p = s;
@@ -707,11 +702,14 @@ char **strv_parse_nulstr(const char *s, size_t l) {
e = memchr(p, 0, s + l - p);
- if (!(v[i++] = strndup(p, e ? e - p : s + l - p))) {
+ v[i] = strndup(p, e ? e - p : s + l - p);
+ if (!v[i]) {
strv_free(v);
return NULL;
}
+ i++;
+
if (!e)
break;
--
1.7.10.4

View File

@ -0,0 +1,26 @@
From 91b32fa987a4a50faf3d8561b28b6c9d5150adef Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 25 Oct 2012 16:16:19 +0200
Subject: [PATCH] sysctl: parse all keys in a config file
https://bugzilla.redhat.com/show_bug.cgi?id=869779
---
src/sysctl/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index a68d67f..035e0ec 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -178,7 +178,7 @@ static int parse_file(const char *path, bool ignore_enoent) {
free(property);
free(new_value);
- if (r != -EEXIST)
+ if (r != 0)
goto finish;
}
}
--
1.7.10.4

View File

@ -0,0 +1,28 @@
From d255133d8edc84662d2370a77414505a800d1922 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 12 Jan 2013 00:00:22 +0100
Subject: [PATCH] systemctl: don't hit an assert if we try to reboot and dbus
is dead
https://bugzilla.redhat.com/show_bug.cgi?id=889624
---
src/systemctl/systemctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0def1a2..bfa4d45 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1738,6 +1738,9 @@ static int reboot_with_logind(DBusConnection *bus, enum action a) {
const char *method;
dbus_bool_t interactive = true;
+ if (!bus)
+ return -EIO;
+
polkit_agent_open_if_enabled();
switch (a) {
--
1.7.10.4

49
systemctl-options.patch Normal file
View File

@ -0,0 +1,49 @@
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -5239,6 +5239,7 @@ static int runlevel_main(void) {
int main(int argc, char*argv[]) {
int r, retval = EXIT_FAILURE;
+ char **to_free = NULL;
DBusConnection *bus = NULL;
DBusError error;
@@ -5247,6 +5248,27 @@ int main(int argc, char*argv[]) {
log_parse_environment();
log_open();
+ if (secure_getenv("SYSTEMCTL_OPTIONS")) {
+ char **parsed_systemctl_options = strv_split_quoted(getenv("SYSTEMCTL_OPTIONS"));
+
+ if (*parsed_systemctl_options && **parsed_systemctl_options) {
+ char **k,**a;
+ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
+ new_argv[0] = strdup(argv[0]);
+ for (k = new_argv+1, a = parsed_systemctl_options; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ for (a = argv+1; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ *k = NULL;
+ argv = new_argv;
+ argc = strv_length(new_argv);
+ strv_free (parsed_systemctl_options);
+ to_free = new_argv;
+ }
+ }
+
r = parse_argv(argc, argv);
if (r < 0)
goto finish;
@@ -5348,6 +5370,8 @@ finish:
strv_free(arg_property);
+ strv_free(to_free);
+
pager_close();
ask_password_agent_close();
polkit_agent_close();

View File

@ -0,0 +1,39 @@
From 4b9d3dc9748ec3f52a71b06f851f4398462a1c60 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Thu, 6 Dec 2012 16:20:10 +0100
Subject: [PATCH] systemctl: verbose message on missing [Install]
People still don't understand what the message implies.
We have to be more verbose (or more intelligent and detect some of the
cases automatically, but that's not so easy).
https://bugzilla.redhat.com/show_bug.cgi?id=884438
---
src/systemctl/systemctl.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 6d01756..3abd7dc 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3782,7 +3782,16 @@ static int enable_unit(DBusConnection *bus, char **args) {
}
if (carries_install_info == 0)
- log_warning("The unit files have no [Install] section. They are not meant to be enabled using systemctl.");
+ log_warning(
+"The unit files have no [Install] section. They are not meant to be enabled\n"
+"using systemctl.\n"
+"Possible reasons for having this kind of units are:\n"
+"1) A unit may be statically enabled by being symlinked from another unit's\n"
+" .wants/ or .requires/ directory.\n"
+"2) A unit's purpose may be to act as a helper for some other unit which has\n"
+" a requirement dependency on it.\n"
+"3) A unit may be started when needed via activation (socket, path, timer,\n"
+" D-Bus, udev, scripted systemctl call, ...).\n");
finish:
if (m)
--
1.7.10.4

View File

@ -0,0 +1,37 @@
From 7009eec20823add711e0aa452bdf9dfdd677fa4f Mon Sep 17 00:00:00 2001
From: Anders Olofsson <anders.olofsson@axis.com>
Date: Mon, 19 Nov 2012 15:25:36 +0100
Subject: [PATCH] shared/utils: systemd-cgls shows 'n/a' when piping output
-1 was used to signal failure, but the type was unsigned.
https://bugs.freedesktop.org/show_bug.cgi?id=56644
---
src/shared/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 4cf928f..d771d32 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3803,7 +3803,7 @@ int fd_columns(int fd) {
unsigned columns(void) {
const char *e;
- unsigned c;
+ int c;
if (_likely_(cached_columns > 0))
return cached_columns;
@@ -3811,7 +3811,7 @@ unsigned columns(void) {
c = 0;
e = getenv("COLUMNS");
if (e)
- safe_atou(e, &c);
+ safe_atoi(e, &c);
if (c <= 0)
c = fd_columns(STDOUT_FILENO);
--
1.7.10.4

View File

@ -1,3 +1,95 @@
-------------------------------------------------------------------
Tue Jan 22 17:02:04 UTC 2013 - fcrozat@suse.com
- Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly
(bnc#798620).
- Update crypt-loop-file.patch to correctly detect crypto loop
files (bnc#799514).
- Add journalctl-remove-leftover-message.patch: remove debug
message in systemctl.
- Add job-avoid-recursion-when-cancelling.patch: prevent potential
recursion when cancelling a service.
- Add sysctl-parse-all-keys.patch: ensure sysctl file is fully
parsed.
- Add journal-fix-cutoff-max-date.patch: fix computation of cutoff
max date for journal.
- Add reword-rescue-mode-hints.patch: reword rescue prompt.
- Add improve-overflow-checks.patch: improve time overflow checks.
- Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour
with symlinks.
- Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure
hostnamectl requires an argument when called with set-hostname
option.
- Add agetty-overrides-term.patch: pass correctly terminal type to
agetty.
- Add check-for-empty-strings-in-strto-conversions.patch: better
check for empty strings in strto* conversions.
- Add strv-cleanup-error-path-loops.patch: cleanup strv on error
path.
- Add cryptsetup-handle-plain.patch: correctly handle "plain"
option in cryptsetup.
- Add fstab-generator-improve-error-message.patch: improve error
message in fstab-generator.
- Add delta-accept-t-option.patch: accept -t option in
systemd-delta.
- Add highlight-ordering-cycle-deletions.patch: highlight ordering
cycle deletions in logs.
- Add core-interpret-escaped-semicolon-as-escaped.patch: accept \;
in ExecStart.
- Add hostnamectl-fix-parsing-no-ask-password.patch: accept
no-ask-password in hostnamectl.
- Add systemd-cgls-fix-piping-output.patch: fix piping output of
systemd-cgls.
- Add core-load-fragment-improve-error-message.patch: improve error
message when parsing fragments.
- Add fix-potential-bad-mem-access.patch: fix potential bad memory
access.
- Add socket-improve-error-message.patch: improve error message in
socket handling.
- Add journal-send-always-send-syslog_identifier.patch: always send
syslog_identifier if available for journal.
- Add crypsetup-handle-nofail.patch: handle nofail in cryptsetup.
- Add crypsetup-generator-state-file-name-in-error-message.patch:
add filename in error message from crypsetup-generator.
- Add fstab-generator-error-message-on-duplicates.patch: improve
error message on duplicate in fstab-generator.
- Add systemctl-verbose-message-on-missing-install.patch: reword
missing install error message in systemctl.
- Add shutdown-improvements.patch: various improvements at
shutdown.
- Add localectl-fix-assertion.patch: fix assertion in localectl.
- Add path-util-fix-potential-crash.patch: fix potential crash in
path-util.
- Add coredumpctl-fix-crash.patch: fix crash in coredumpctl.
- Add socket-verbose-error-message.patch: add more verbose error
message in socket handling.
- Add pam-properly-handle-ssh-logins-without-pam-tty-field.patch:
handle properly ssh-logins without pam tty field.
- Add fstab-generator-properly-detect-bind-mounts.patch: properly
detect bind-mounts in fstab-generator.
- Add localectl-support-systems-without-locale-archive.patch:
localectl now supports systemd without locale-archive file.
- Add logind-capability-making-seats-without-fb.patch: allows
capability of making seats without fb.
- Add service-forking-ignore-exit-status-main-process.patch: ignore
exit-statis of main process when forking, if specified in unit
file.
- Add systemctl-no-assert-on-reboot-without-dbus.patch: don't
assert on reboot if dbus isn't there.
- Add logind-ignore-non-tty-non-x11-session-on-shutdown.patch:
ignore non tty non-x11 session on shutdown.
- Add journalctl-quit-on-io-error.patch: fix journalctl quit on io
error.
- Add do-not-make-sockets-dependent-on-lo.patch: do not make
sockets dependent on lo interface.
- Add shutdown-dont-force-mnt-force-on-final-umount.patch: don't
force MNT_FORCE on final umount at shutdown.
- Add shutdown-ignore-loop-devices-without-backing-file.patch:
ignore loop devices without backing file at shutdown.
- Add fix-bad-mem-access.patch: fix bad memory access
- Add parse-multiline-env-file.patch: correctly parse multiline
environment files (bnc#793411).
-------------------------------------------------------------------
Thu Jan 10 15:43:25 UTC 2013 - fcrozat@suse.com

View File

@ -137,6 +137,8 @@ Patch71: fix-debugshell.patch
Patch72: handle-root-uses-lang.patch
# PATCH-FIX-OPENSUSE multiple-sulogin.patch bnc#793182 fcrozat@suse.com -- handle multiple sulogin
Patch76: multiple-sulogin.patch
# PATCH-FIX-OPENSUSE systemctl-options.patch bnc#798620 fcrozat@suse.com -- handle SYSTEMCTL_OPTIONS environment variable
Patch77: systemctl-options.patch
# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
@ -164,6 +166,94 @@ Patch73: revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch
Patch74: detect-btrfs-ssd.patch
# PATCH-FIX-UPSTREAM timedated-donot-close-bogus-dbus-connection.patch crrodriguez@opensuse.org -- Fix assertion failure when dbus is gone.
Patch75: timedated-donot-close-bogus-dbus-connection.patch
# PATCH-FIX-UPSTREAM journalctl-remove-leftover-message.patch fcrozat@suse.com -- remove debug message in systemctl
Patch78: journalctl-remove-leftover-message.patch
# PATCH-FIX-UPSTREAM job-avoid-recursion-when-cancelling.patch fcrozat@suse.com -- prevent potential recursion when cancelling a service
Patch79: job-avoid-recursion-when-cancelling.patch
# PATCH-FIX-UPSTREAM sysctl-parse-all-keys.patch fcrozat@suse.com -- ensure sysctl file is fully parsed
Patch80: sysctl-parse-all-keys.patch
# PATCH-FIX-UPSTREAM journal-fix-cutoff-max-date.patch fcrozat@suse.com -- fix computation of cutoff max date for journal
Patch81: journal-fix-cutoff-max-date.patch
# PATCH-FIX-UPSTREAM reword-rescue-mode-hints.patch fcrozat@suse.com -- reword rescue prompt
Patch82: reword-rescue-mode-hints.patch
# PATCH-FIX-UPSTREAM improve-overflow-checks.patch fcrozat@suse.com -- improve time overflow checks
Patch83: improve-overflow-checks.patch
# PATCH-FIX-UPSTREAM fix-swap-behaviour-with-symlinks.patch fcrozat@suse.com -- fix swap behaviour with symlinks
Patch84: fix-swap-behaviour-with-symlinks.patch
# PATCH-FIX-UPSTREAM hostnamectl-fix-set-hostname-with-no-argument.patch fcrozat@suse.com -- ensure hostnamectl requires an argument when called with set-hostname option
Patch85: hostnamectl-fix-set-hostname-with-no-argument.patch
# PATCH-FIX-UPSTREAM agetty-overrides-term.patch fcrozat@suse.com -- pass correctly terminal type to agetty
Patch86: agetty-overrides-term.patch
# PATCH-FIX-UPSTREAM check-for-empty-strings-in-strto-conversions.patch fcrozat@suse.com -- better check for empty strings in strto* conversions
Patch87: check-for-empty-strings-in-strto-conversions.patch
# PATCH-FIX-UPSTREAM strv-cleanup-error-path-loops.patch fcrozat@suse.com -- cleanup strv on error path
Patch88: strv-cleanup-error-path-loops.patch
# PATCH-FIX-UPSTREAM cryptsetup-handle-plain.patch fcrozat@suse.com -- correctly handle "plain" option in cryptsetup
Patch89: cryptsetup-handle-plain.patch
# PATCH-FIX-UPSTREAM fstab-generator-improve-error-message.patch fcrozat@suse.com -- improve error message in fstab-generator
Patch90: fstab-generator-improve-error-message.patch
# PATCH-FIX-UPSTREAM delta-accept-t-option.patch fcrozat@suse.com -- accept -t option in systemd-delta
Patch91: delta-accept-t-option.patch
# PATCH-FIX-UPSTREAM highlight-ordering-cycle-deletions.patch fcrozat@suse.com -- highlight ordering cycle deletions in logs
Patch92: highlight-ordering-cycle-deletions.patch
# PATCH-FIX-UPSTREAM core-interpret-escaped-semicolon-as-escaped.patch fcrozat@suse.com -- accept \; in ExecStart
Patch93: core-interpret-escaped-semicolon-as-escaped.patch
# PATCH-FIX-UPSTREAM hostnamectl-fix-parsing-no-ask-password.patch fcrozat@suse.com -- accept no-ask-password in hostnamectl
Patch94: hostnamectl-fix-parsing-no-ask-password.patch
# PATCH-FIX-UPSTREAM systemd-cgls-fix-piping-output.patch fcrozat@suse.com -- fix piping output of systemd-cgls
Patch95: systemd-cgls-fix-piping-output.patch
# PATCH-FIX-UPSTREAM core-load-fragment-improve-error-message.patch fcrozat@suse.com -- improve error message when parsing fragments
Patch96: core-load-fragment-improve-error-message.patch
# PATCH-FIX-UPSTREAM fix-potential-bad-mem-access.patch fcrozat@suse.com -- fix potential bad memory access
Patch97: fix-potential-bad-mem-access.patch
# PATCH-FIX-UPSTREAM socket-improve-error-message.patch fcrozat@suse.com -- improve error message in socket handling
Patch98: socket-improve-error-message.patch
# PATCH-FIX-UPSTREAM journal-send-always-send-syslog_identifier.patch fcrozat@suse.com -- always send syslog_identifier if available for journal
Patch99: journal-send-always-send-syslog_identifier.patch
# PATCH-FIX-UPSTREAM crypsetup-handle-nofail.patch fcrozat@suse.com -- handle nofail in cryptsetup
Patch100: crypsetup-handle-nofail.patch
# PATCH-FIX-UPSTREAM crypsetup-generator-state-file-name-in-error-message.patch fcrozat@suse.com -- add filename in error message from crypsetup-generator
Patch101: crypsetup-generator-state-file-name-in-error-message.patch
# PATCH-FIX-UPSTREAM fstab-generator-error-message-on-duplicates.patch fcrozat@suse.com -- improve error message on duplicate in fstab-generator
Patch102: fstab-generator-error-message-on-duplicates.patch
# PATCH-FIX-UPSTREAM systemctl-verbose-message-on-missing-install.patch fcrozat@suse.com -- reword missing install error message in systemctl
Patch103: systemctl-verbose-message-on-missing-install.patch
# PATCH-FIX-UPSTREAM shutdown-improvements.patch fcrozat@suse.com -- various improvements at shutdown
Patch104: shutdown-improvements.patch
# PATCH-FIX-UPSTREAM localectl-fix-assertion.patch fcrozat@suse.com -- fix assertion in localectl
Patch105: localectl-fix-assertion.patch
# PATCH-FIX-UPSTREAM path-util-fix-potential-crash.patch fcrozat@suse.com -- fix potential crash in path-util
Patch106: path-util-fix-potential-crash.patch
# PATCH-FIX-UPSTREAM coredumpctl-fix-crash.patch fcrozat@suse.com -- fix crash in coredumpctl
Patch107: coredumpctl-fix-crash.patch
# PATCH-FIX-UPSTREAM socket-verbose-error-message.patch fcrozat@suse.com -- add more verbose error message in socket handling
Patch108: socket-verbose-error-message.patch
# PATCH-FIX-UPSTREAM pam-properly-handle-ssh-logins-without-pam-tty-field.patch fcrozat@suse.com -- handle properly ssh-logins without pam tty field
Patch109: pam-properly-handle-ssh-logins-without-pam-tty-field.patch
# PATCH-FIX-UPSTREAM fstab-generator-properly-detect-bind-mounts.patch fcrozat@suse.com -- properly detect bind-mounts in fstab-generator
Patch110: fstab-generator-properly-detect-bind-mounts.patch
# PATCH-FIX-UPSTREAM localectl-support-systems-without-locale-archive.patch fcrozat@suse.com -- localectl now supports systemd without locale-archive file
Patch111: localectl-support-systems-without-locale-archive.patch
# PATCH-FIX-UPSTREAM logind-capability-making-seats-without-fb.patch fcrozat@suse.com -- allows capability of making seats without fb
Patch112: logind-capability-making-seats-without-fb.patch
# PATCH-FIX-UPSTREAM service-forking-ignore-exit-status-main-process.patch fcrozat@suse.com -- ignore exit-statis of main process when forking, if specified in unit file
Patch113: service-forking-ignore-exit-status-main-process.patch
# PATCH-FIX-UPSTREAM systemctl-no-assert-on-reboot-without-dbus.patch fcrozat@suse.com -- don't assert on reboot if dbus isn't there
Patch114: systemctl-no-assert-on-reboot-without-dbus.patch
# PATCH-FIX-UPSTREAM logind-ignore-non-tty-non-x11-session-on-shutdown.patch fcrozat@suse.com -- ignore non tty non-x11 session on shutdown
Patch115: logind-ignore-non-tty-non-x11-session-on-shutdown.patch
# PATCH-FIX-UPSTREAM journalctl-quit-on-io-error.patch fcrozat@suse.com -- fix journalctl quit on io error
Patch116: journalctl-quit-on-io-error.patch
# PATCH-FIX-UPSTREAM do-not-make-sockets-dependent-on-lo.patch fcrozat@suse.com -- do not make sockets dependent on lo interface
Patch117: do-not-make-sockets-dependent-on-lo.patch
# PATCH-FIX-UPSTREAM shutdown-dont-force-mnt-force-on-final-umount.patch fcrozat@suse.com -- don't force MNT_FORCE on final umount at shutdown
Patch118: shutdown-dont-force-mnt-force-on-final-umount.patch
# PATCH-FIX-UPSTREAM shutdown-ignore-loop-devices-without-backing-file.patch fcrozat@suse.com -- ignore loop devices without backing file at shutdown
Patch119: shutdown-ignore-loop-devices-without-backing-file.patch
# PATCH-FIX-UPSTREAM fix-bad-mem-access.patch fcrozat@suse.com -- fix bad memory access
Patch120: fix-bad-mem-access.patch
# PATCH-FIX-UPSTREAM parse-multiline-env-file.patch fcrozat@suse.com bnc#793411 -- correctly parse multiline environment files
Patch121: parse-multiline-env-file.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-Reinstate-TIMEOUT-handling.patch
@ -417,6 +507,51 @@ cp %{SOURCE7} m4/
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
%patch78 -p1
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94 -p1
%patch95 -p1
%patch96 -p1
%patch97 -p1
%patch98 -p1
%patch99 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%build
autoreconf -fiv

View File

@ -1,3 +1,95 @@
-------------------------------------------------------------------
Tue Jan 22 17:02:04 UTC 2013 - fcrozat@suse.com
- Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly
(bnc#798620).
- Update crypt-loop-file.patch to correctly detect crypto loop
files (bnc#799514).
- Add journalctl-remove-leftover-message.patch: remove debug
message in systemctl.
- Add job-avoid-recursion-when-cancelling.patch: prevent potential
recursion when cancelling a service.
- Add sysctl-parse-all-keys.patch: ensure sysctl file is fully
parsed.
- Add journal-fix-cutoff-max-date.patch: fix computation of cutoff
max date for journal.
- Add reword-rescue-mode-hints.patch: reword rescue prompt.
- Add improve-overflow-checks.patch: improve time overflow checks.
- Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour
with symlinks.
- Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure
hostnamectl requires an argument when called with set-hostname
option.
- Add agetty-overrides-term.patch: pass correctly terminal type to
agetty.
- Add check-for-empty-strings-in-strto-conversions.patch: better
check for empty strings in strto* conversions.
- Add strv-cleanup-error-path-loops.patch: cleanup strv on error
path.
- Add cryptsetup-handle-plain.patch: correctly handle "plain"
option in cryptsetup.
- Add fstab-generator-improve-error-message.patch: improve error
message in fstab-generator.
- Add delta-accept-t-option.patch: accept -t option in
systemd-delta.
- Add highlight-ordering-cycle-deletions.patch: highlight ordering
cycle deletions in logs.
- Add core-interpret-escaped-semicolon-as-escaped.patch: accept \;
in ExecStart.
- Add hostnamectl-fix-parsing-no-ask-password.patch: accept
no-ask-password in hostnamectl.
- Add systemd-cgls-fix-piping-output.patch: fix piping output of
systemd-cgls.
- Add core-load-fragment-improve-error-message.patch: improve error
message when parsing fragments.
- Add fix-potential-bad-mem-access.patch: fix potential bad memory
access.
- Add socket-improve-error-message.patch: improve error message in
socket handling.
- Add journal-send-always-send-syslog_identifier.patch: always send
syslog_identifier if available for journal.
- Add crypsetup-handle-nofail.patch: handle nofail in cryptsetup.
- Add crypsetup-generator-state-file-name-in-error-message.patch:
add filename in error message from crypsetup-generator.
- Add fstab-generator-error-message-on-duplicates.patch: improve
error message on duplicate in fstab-generator.
- Add systemctl-verbose-message-on-missing-install.patch: reword
missing install error message in systemctl.
- Add shutdown-improvements.patch: various improvements at
shutdown.
- Add localectl-fix-assertion.patch: fix assertion in localectl.
- Add path-util-fix-potential-crash.patch: fix potential crash in
path-util.
- Add coredumpctl-fix-crash.patch: fix crash in coredumpctl.
- Add socket-verbose-error-message.patch: add more verbose error
message in socket handling.
- Add pam-properly-handle-ssh-logins-without-pam-tty-field.patch:
handle properly ssh-logins without pam tty field.
- Add fstab-generator-properly-detect-bind-mounts.patch: properly
detect bind-mounts in fstab-generator.
- Add localectl-support-systems-without-locale-archive.patch:
localectl now supports systemd without locale-archive file.
- Add logind-capability-making-seats-without-fb.patch: allows
capability of making seats without fb.
- Add service-forking-ignore-exit-status-main-process.patch: ignore
exit-statis of main process when forking, if specified in unit
file.
- Add systemctl-no-assert-on-reboot-without-dbus.patch: don't
assert on reboot if dbus isn't there.
- Add logind-ignore-non-tty-non-x11-session-on-shutdown.patch:
ignore non tty non-x11 session on shutdown.
- Add journalctl-quit-on-io-error.patch: fix journalctl quit on io
error.
- Add do-not-make-sockets-dependent-on-lo.patch: do not make
sockets dependent on lo interface.
- Add shutdown-dont-force-mnt-force-on-final-umount.patch: don't
force MNT_FORCE on final umount at shutdown.
- Add shutdown-ignore-loop-devices-without-backing-file.patch:
ignore loop devices without backing file at shutdown.
- Add fix-bad-mem-access.patch: fix bad memory access
- Add parse-multiline-env-file.patch: correctly parse multiline
environment files (bnc#793411).
-------------------------------------------------------------------
Thu Jan 10 15:43:25 UTC 2013 - fcrozat@suse.com

View File

@ -132,6 +132,8 @@ Patch71: fix-debugshell.patch
Patch72: handle-root-uses-lang.patch
# PATCH-FIX-OPENSUSE multiple-sulogin.patch bnc#793182 fcrozat@suse.com -- handle multiple sulogin
Patch76: multiple-sulogin.patch
# PATCH-FIX-OPENSUSE systemctl-options.patch bnc#798620 fcrozat@suse.com -- handle SYSTEMCTL_OPTIONS environment variable
Patch77: systemctl-options.patch
# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
@ -159,6 +161,94 @@ Patch73: revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch
Patch74: detect-btrfs-ssd.patch
# PATCH-FIX-UPSTREAM timedated-donot-close-bogus-dbus-connection.patch crrodriguez@opensuse.org -- Fix assertion failure when dbus is gone.
Patch75: timedated-donot-close-bogus-dbus-connection.patch
# PATCH-FIX-UPSTREAM journalctl-remove-leftover-message.patch fcrozat@suse.com -- remove debug message in systemctl
Patch78: journalctl-remove-leftover-message.patch
# PATCH-FIX-UPSTREAM job-avoid-recursion-when-cancelling.patch fcrozat@suse.com -- prevent potential recursion when cancelling a service
Patch79: job-avoid-recursion-when-cancelling.patch
# PATCH-FIX-UPSTREAM sysctl-parse-all-keys.patch fcrozat@suse.com -- ensure sysctl file is fully parsed
Patch80: sysctl-parse-all-keys.patch
# PATCH-FIX-UPSTREAM journal-fix-cutoff-max-date.patch fcrozat@suse.com -- fix computation of cutoff max date for journal
Patch81: journal-fix-cutoff-max-date.patch
# PATCH-FIX-UPSTREAM reword-rescue-mode-hints.patch fcrozat@suse.com -- reword rescue prompt
Patch82: reword-rescue-mode-hints.patch
# PATCH-FIX-UPSTREAM improve-overflow-checks.patch fcrozat@suse.com -- improve time overflow checks
Patch83: improve-overflow-checks.patch
# PATCH-FIX-UPSTREAM fix-swap-behaviour-with-symlinks.patch fcrozat@suse.com -- fix swap behaviour with symlinks
Patch84: fix-swap-behaviour-with-symlinks.patch
# PATCH-FIX-UPSTREAM hostnamectl-fix-set-hostname-with-no-argument.patch fcrozat@suse.com -- ensure hostnamectl requires an argument when called with set-hostname option
Patch85: hostnamectl-fix-set-hostname-with-no-argument.patch
# PATCH-FIX-UPSTREAM agetty-overrides-term.patch fcrozat@suse.com -- pass correctly terminal type to agetty
Patch86: agetty-overrides-term.patch
# PATCH-FIX-UPSTREAM check-for-empty-strings-in-strto-conversions.patch fcrozat@suse.com -- better check for empty strings in strto* conversions
Patch87: check-for-empty-strings-in-strto-conversions.patch
# PATCH-FIX-UPSTREAM strv-cleanup-error-path-loops.patch fcrozat@suse.com -- cleanup strv on error path
Patch88: strv-cleanup-error-path-loops.patch
# PATCH-FIX-UPSTREAM cryptsetup-handle-plain.patch fcrozat@suse.com -- correctly handle "plain" option in cryptsetup
Patch89: cryptsetup-handle-plain.patch
# PATCH-FIX-UPSTREAM fstab-generator-improve-error-message.patch fcrozat@suse.com -- improve error message in fstab-generator
Patch90: fstab-generator-improve-error-message.patch
# PATCH-FIX-UPSTREAM delta-accept-t-option.patch fcrozat@suse.com -- accept -t option in systemd-delta
Patch91: delta-accept-t-option.patch
# PATCH-FIX-UPSTREAM highlight-ordering-cycle-deletions.patch fcrozat@suse.com -- highlight ordering cycle deletions in logs
Patch92: highlight-ordering-cycle-deletions.patch
# PATCH-FIX-UPSTREAM core-interpret-escaped-semicolon-as-escaped.patch fcrozat@suse.com -- accept \; in ExecStart
Patch93: core-interpret-escaped-semicolon-as-escaped.patch
# PATCH-FIX-UPSTREAM hostnamectl-fix-parsing-no-ask-password.patch fcrozat@suse.com -- accept no-ask-password in hostnamectl
Patch94: hostnamectl-fix-parsing-no-ask-password.patch
# PATCH-FIX-UPSTREAM systemd-cgls-fix-piping-output.patch fcrozat@suse.com -- fix piping output of systemd-cgls
Patch95: systemd-cgls-fix-piping-output.patch
# PATCH-FIX-UPSTREAM core-load-fragment-improve-error-message.patch fcrozat@suse.com -- improve error message when parsing fragments
Patch96: core-load-fragment-improve-error-message.patch
# PATCH-FIX-UPSTREAM fix-potential-bad-mem-access.patch fcrozat@suse.com -- fix potential bad memory access
Patch97: fix-potential-bad-mem-access.patch
# PATCH-FIX-UPSTREAM socket-improve-error-message.patch fcrozat@suse.com -- improve error message in socket handling
Patch98: socket-improve-error-message.patch
# PATCH-FIX-UPSTREAM journal-send-always-send-syslog_identifier.patch fcrozat@suse.com -- always send syslog_identifier if available for journal
Patch99: journal-send-always-send-syslog_identifier.patch
# PATCH-FIX-UPSTREAM crypsetup-handle-nofail.patch fcrozat@suse.com -- handle nofail in cryptsetup
Patch100: crypsetup-handle-nofail.patch
# PATCH-FIX-UPSTREAM crypsetup-generator-state-file-name-in-error-message.patch fcrozat@suse.com -- add filename in error message from crypsetup-generator
Patch101: crypsetup-generator-state-file-name-in-error-message.patch
# PATCH-FIX-UPSTREAM fstab-generator-error-message-on-duplicates.patch fcrozat@suse.com -- improve error message on duplicate in fstab-generator
Patch102: fstab-generator-error-message-on-duplicates.patch
# PATCH-FIX-UPSTREAM systemctl-verbose-message-on-missing-install.patch fcrozat@suse.com -- reword missing install error message in systemctl
Patch103: systemctl-verbose-message-on-missing-install.patch
# PATCH-FIX-UPSTREAM shutdown-improvements.patch fcrozat@suse.com -- various improvements at shutdown
Patch104: shutdown-improvements.patch
# PATCH-FIX-UPSTREAM localectl-fix-assertion.patch fcrozat@suse.com -- fix assertion in localectl
Patch105: localectl-fix-assertion.patch
# PATCH-FIX-UPSTREAM path-util-fix-potential-crash.patch fcrozat@suse.com -- fix potential crash in path-util
Patch106: path-util-fix-potential-crash.patch
# PATCH-FIX-UPSTREAM coredumpctl-fix-crash.patch fcrozat@suse.com -- fix crash in coredumpctl
Patch107: coredumpctl-fix-crash.patch
# PATCH-FIX-UPSTREAM socket-verbose-error-message.patch fcrozat@suse.com -- add more verbose error message in socket handling
Patch108: socket-verbose-error-message.patch
# PATCH-FIX-UPSTREAM pam-properly-handle-ssh-logins-without-pam-tty-field.patch fcrozat@suse.com -- handle properly ssh-logins without pam tty field
Patch109: pam-properly-handle-ssh-logins-without-pam-tty-field.patch
# PATCH-FIX-UPSTREAM fstab-generator-properly-detect-bind-mounts.patch fcrozat@suse.com -- properly detect bind-mounts in fstab-generator
Patch110: fstab-generator-properly-detect-bind-mounts.patch
# PATCH-FIX-UPSTREAM localectl-support-systems-without-locale-archive.patch fcrozat@suse.com -- localectl now supports systemd without locale-archive file
Patch111: localectl-support-systems-without-locale-archive.patch
# PATCH-FIX-UPSTREAM logind-capability-making-seats-without-fb.patch fcrozat@suse.com -- allows capability of making seats without fb
Patch112: logind-capability-making-seats-without-fb.patch
# PATCH-FIX-UPSTREAM service-forking-ignore-exit-status-main-process.patch fcrozat@suse.com -- ignore exit-statis of main process when forking, if specified in unit file
Patch113: service-forking-ignore-exit-status-main-process.patch
# PATCH-FIX-UPSTREAM systemctl-no-assert-on-reboot-without-dbus.patch fcrozat@suse.com -- don't assert on reboot if dbus isn't there
Patch114: systemctl-no-assert-on-reboot-without-dbus.patch
# PATCH-FIX-UPSTREAM logind-ignore-non-tty-non-x11-session-on-shutdown.patch fcrozat@suse.com -- ignore non tty non-x11 session on shutdown
Patch115: logind-ignore-non-tty-non-x11-session-on-shutdown.patch
# PATCH-FIX-UPSTREAM journalctl-quit-on-io-error.patch fcrozat@suse.com -- fix journalctl quit on io error
Patch116: journalctl-quit-on-io-error.patch
# PATCH-FIX-UPSTREAM do-not-make-sockets-dependent-on-lo.patch fcrozat@suse.com -- do not make sockets dependent on lo interface
Patch117: do-not-make-sockets-dependent-on-lo.patch
# PATCH-FIX-UPSTREAM shutdown-dont-force-mnt-force-on-final-umount.patch fcrozat@suse.com -- don't force MNT_FORCE on final umount at shutdown
Patch118: shutdown-dont-force-mnt-force-on-final-umount.patch
# PATCH-FIX-UPSTREAM shutdown-ignore-loop-devices-without-backing-file.patch fcrozat@suse.com -- ignore loop devices without backing file at shutdown
Patch119: shutdown-ignore-loop-devices-without-backing-file.patch
# PATCH-FIX-UPSTREAM fix-bad-mem-access.patch fcrozat@suse.com -- fix bad memory access
Patch120: fix-bad-mem-access.patch
# PATCH-FIX-UPSTREAM parse-multiline-env-file.patch fcrozat@suse.com bnc#793411 -- correctly parse multiline environment files
Patch121: parse-multiline-env-file.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-Reinstate-TIMEOUT-handling.patch
@ -412,6 +502,51 @@ cp %{SOURCE7} m4/
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
%patch78 -p1
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94 -p1
%patch95 -p1
%patch96 -p1
%patch97 -p1
%patch98 -p1
%patch99 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%build
autoreconf -fiv