Backport fixes and hwdb until Oct. 21

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-10-21 19:35:36 -04:00
parent 7149931e9b
commit 794d16c8b7
54 changed files with 4518 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 3e4aca291a6ab914e08108acbd5d96600370c20d Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 2 Oct 2013 13:39:49 +0200
Subject: [PATCH] acpi-fptd: fix memory leak in acpi_get_boot_usec
---
src/shared/acpi-fpdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index b094f34..a7c83ed 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -81,7 +81,7 @@ struct acpi_fpdt_boot {
};
int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
- char *buf;
+ _cleanup_free_ char *buf;
struct acpi_table_header *tbl;
size_t l;
struct acpi_fpdt_header *rec;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,54 @@
From 80c0a135afe5d801903ac742c386a5468837175c Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Wed, 2 Oct 2013 07:46:24 -0400
Subject: [PATCH] fix lingering references to /var/lib/{backlight,random-seed}
This should have been part of ef5bfcf668e6029faa78534dfe.
---
man/systemd-backlight@.service.xml | 2 +-
man/systemd-random-seed.service.xml | 2 +-
units/systemd-backlight@.service.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/systemd-backlight@.service.xml b/man/systemd-backlight@.service.xml
index 2b73625..4318964 100644
--- a/man/systemd-backlight@.service.xml
+++ b/man/systemd-backlight@.service.xml
@@ -58,7 +58,7 @@
is a service that restores the display backlight
brightness at early-boot and saves it at shutdown. On
disk, the backlight brightness is stored in
- <filename>/var/lib/backlight/</filename>. Note that by
+ <filename>/var/lib/systemd/backlight/</filename>. Note that by
default, only firmware backlight devices are
saved/restored.</para>
</refsect1>
diff --git a/man/systemd-random-seed.service.xml b/man/systemd-random-seed.service.xml
index 8cd14b7..e5cd037 100644
--- a/man/systemd-random-seed.service.xml
+++ b/man/systemd-random-seed.service.xml
@@ -61,7 +61,7 @@
for details. Saving/restoring the random seed across
boots increases the amount of available entropy early
at boot. On disk the random seed is stored in
- <filename>/var/lib/random-seed</filename>.</para>
+ <filename>/var/lib/systemd/random-seed</filename>.</para>
</refsect1>
<refsect1>
diff --git a/units/systemd-backlight@.service.in b/units/systemd-backlight@.service.in
index b0e75db..5caa5d5 100644
--- a/units/systemd-backlight@.service.in
+++ b/units/systemd-backlight@.service.in
@@ -9,7 +9,7 @@
Description=Load/Save Screen Backlight Brightness of %I
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
-RequiresMountsFor=/var/lib/backlight
+RequiresMountsFor=/var/lib/systemd/backlight
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
Before=sysinit.target shutdown.target
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,25 @@
From 4294dcefec5bd85c17d671612fac3b4b8cd20eac Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 14:03:56 +0200
Subject: [PATCH] acpi: make sure we never free an uninitialized pointer
---
src/shared/acpi-fpdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index a7c83ed..af58c7c 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -81,7 +81,7 @@ struct acpi_fpdt_boot {
};
int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
- _cleanup_free_ char *buf;
+ _cleanup_free_ char *buf = NULL;
struct acpi_table_header *tbl;
size_t l;
struct acpi_fpdt_header *rec;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,134 @@
From 5103e16f5e12e1754a2dcfabafb7618eb15ccf98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= <vpavlin@redhat.com>
Date: Wed, 2 Oct 2013 16:42:42 +0200
Subject: [PATCH] systemctl: fix name mangling for sysv units
---
src/systemctl/systemctl.c | 45 ++++++++++++++++++---------------------------
1 file changed, 18 insertions(+), 27 deletions(-)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index bb7ada9..d75281f 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -4218,11 +4218,10 @@ static int set_environment(DBusConnection *bus, char **args) {
return 0;
}
-static int enable_sysv_units(char **args) {
+static int enable_sysv_units(const char *verb, char **args) {
int r = 0;
#if defined(HAVE_SYSV_COMPAT) && defined(HAVE_CHKCONFIG)
- const char *verb = args[0];
unsigned f = 1, t = 1;
LookupPaths paths = {};
@@ -4242,7 +4241,7 @@ static int enable_sysv_units(char **args) {
return r;
r = 0;
- for (f = 1; args[f]; f++) {
+ for (f = 0; args[f]; f++) {
const char *name;
_cleanup_free_ char *p = NULL, *q = NULL;
bool found_native = false, found_sysv;
@@ -4365,7 +4364,7 @@ finish:
lookup_paths_free(&paths);
/* Drop all SysV units */
- for (f = 1, t = 1; args[f]; f++) {
+ for (f = 0, t = 0; args[f]; f++) {
if (isempty(args[f]))
continue;
@@ -4423,16 +4422,16 @@ static int enable_unit(DBusConnection *bus, char **args) {
dbus_error_init(&error);
- r = enable_sysv_units(args);
- if (r < 0)
- return r;
-
if (!args[1])
return 0;
r = mangle_names(args+1, &mangled_names);
if (r < 0)
- goto finish;
+ return r;
+
+ r = enable_sysv_units(verb, mangled_names);
+ if (r < 0)
+ return r;
if (!bus || avoid_bus()) {
if (streq(verb, "enable")) {
@@ -4624,11 +4623,15 @@ static int unit_is_enabled(DBusConnection *bus, char **args) {
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
bool enabled;
char **name;
- char *n;
+ _cleanup_strv_free_ char **mangled_names = NULL;
dbus_error_init(&error);
- r = enable_sysv_units(args);
+ r = mangle_names(args+1, &mangled_names);
+ if (r < 0)
+ return r;
+
+ r = enable_sysv_units(args[0], mangled_names);
if (r < 0)
return r;
@@ -4636,16 +4639,10 @@ static int unit_is_enabled(DBusConnection *bus, char **args) {
if (!bus || avoid_bus()) {
- STRV_FOREACH(name, args+1) {
+ STRV_FOREACH(name, mangled_names) {
UnitFileState state;
- n = unit_name_mangle(*name);
- if (!n)
- return log_oom();
-
- state = unit_file_get_state(arg_scope, arg_root, n);
-
- free(n);
+ state = unit_file_get_state(arg_scope, arg_root, *name);
if (state < 0)
return state;
@@ -4660,13 +4657,9 @@ static int unit_is_enabled(DBusConnection *bus, char **args) {
}
} else {
- STRV_FOREACH(name, args+1) {
+ STRV_FOREACH(name, mangled_names) {
const char *s;
- n = unit_name_mangle(*name);
- if (!n)
- return log_oom();
-
r = bus_method_call_with_reply (
bus,
"org.freedesktop.systemd1",
@@ -4675,11 +4668,9 @@ static int unit_is_enabled(DBusConnection *bus, char **args) {
"GetUnitFileState",
&reply,
NULL,
- DBUS_TYPE_STRING, &n,
+ DBUS_TYPE_STRING, name,
DBUS_TYPE_INVALID);
- free(n);
-
if (r)
return r;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,48 @@
From 0f1ed3485115fd6bc7217658412ea6d7be511b5a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:36:28 +0200
Subject: [PATCH] cryptsetup: fix OOM handling when parsing mount options
---
src/cryptsetup/cryptsetup.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 22b5eea..769c3e4 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -74,7 +74,7 @@ static int parse_one_option(const char *option) {
t = strdup(option+7);
if (!t)
- return -ENOMEM;
+ return log_oom();
free(opt_cipher);
opt_cipher = t;
@@ -89,9 +89,10 @@ static int parse_one_option(const char *option) {
} else if (startswith(option, "tcrypt-keyfile=")) {
opt_type = CRYPT_TCRYPT;
- if (path_is_absolute(option+15))
- opt_tcrypt_keyfiles = strv_append(opt_tcrypt_keyfiles, strdup(option+15));
- else
+ if (path_is_absolute(option+15)) {
+ if (strv_extend(&opt_tcrypt_keyfiles, option + 15) < 0)
+ return log_oom();
+ } else
log_error("Key file path '%s' is not absolute. Ignoring.", option+15);
} else if (startswith(option, "keyfile-size=")) {
@@ -113,7 +114,7 @@ static int parse_one_option(const char *option) {
t = strdup(option+5);
if (!t)
- return -ENOMEM;
+ return log_oom();
free(opt_hash);
opt_hash = t;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,25 @@
From 71ff575fffcd22db42de59abbeaf150bcf6ac144 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:36:43 +0200
Subject: [PATCH] journald: add missing error check
---
src/journal/journal-file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 1236403..81c344f 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -907,6 +907,8 @@ static int journal_file_append_field(
osize = offsetof(Object, field.payload) + size;
r = journal_file_append_object(f, OBJECT_FIELD, osize, &o, &p);
+ if (r < 0)
+ return r;
o->field.hash = htole64(hash);
memcpy(o->field.payload, field, size);
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,34 @@
From f20403c231e9c7f5446066f01f2f5245238d978c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:37:11 +0200
Subject: [PATCH] bus: fix potentially uninitialized memory access
---
src/libsystemd-bus/bus-internal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd-bus/bus-internal.c b/src/libsystemd-bus/bus-internal.c
index 0e66f3d..cac948e 100644
--- a/src/libsystemd-bus/bus-internal.c
+++ b/src/libsystemd-bus/bus-internal.c
@@ -63,7 +63,7 @@ bool object_path_is_valid(const char *p) {
bool interface_name_is_valid(const char *p) {
const char *q;
- bool dot, found_dot;
+ bool dot, found_dot = false;
if (isempty(p))
return false;
@@ -103,7 +103,7 @@ bool interface_name_is_valid(const char *p) {
bool service_name_is_valid(const char *p) {
const char *q;
- bool dot, found_dot, unique;
+ bool dot, found_dot = false, unique;
if (isempty(p))
return false;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,30 @@
From 27d066e733e369873328e7bc0b67d91f07687cb0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:37:30 +0200
Subject: [PATCH] dbus: fix return value of dispatch_rqueue()
---
src/libsystemd-bus/sd-bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 3f766fb..db0880f 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -1215,11 +1215,11 @@ static int dispatch_rqueue(sd_bus *bus, sd_bus_message **m) {
if (r == 0)
return ret;
- r = 1;
+ ret = 1;
} while (!z);
*m = z;
- return 1;
+ return ret;
}
int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) {
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,27 @@
From 3afab028b6bdeadd32e2c87b6f5a64019945358f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:37:44 +0200
Subject: [PATCH] modules-load: fix error handling
---
src/modules-load/modules-load.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
index 7b19ee0..49ee420 100644
--- a/src/modules-load/modules-load.c
+++ b/src/modules-load/modules-load.c
@@ -302,8 +302,8 @@ int main(int argc, char *argv[]) {
STRV_FOREACH(i, arg_proc_cmdline_modules) {
k = load_module(ctx, *i);
- if (k < 0)
- r = EXIT_FAILURE;
+ if (k < 0 && r == 0)
+ r = k;
}
r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,26 @@
From e0cbed4dbb7c21798b5eecf3d326fb778c4d0be2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:38:09 +0200
Subject: [PATCH] efi: never call qsort on potentially NULL arrays
---
src/shared/efivars.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 1d5b6f9..c015b16 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -384,7 +384,8 @@ int efi_get_boot_options(uint16_t **options) {
list[count ++] = id;
}
- qsort(list, count, sizeof(uint16_t), cmp_uint16);
+ if (list)
+ qsort(list, count, sizeof(uint16_t), cmp_uint16);
*options = list;
return count;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,27 @@
From b430e6ff0580b962c0b36dd5817dac681c159a58 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:38:28 +0200
Subject: [PATCH] strv: don't access potentially NULL string arrays
---
src/shared/env-util.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
index 5e29629..7976881 100644
--- a/src/shared/env-util.c
+++ b/src/shared/env-util.c
@@ -405,7 +405,9 @@ char **strv_env_clean_log(char **e, const char *message) {
e[k++] = *p;
}
- e[k] = NULL;
+ if (e)
+ e[k] = NULL;
+
return e;
}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,25 @@
From 77c2f8448bc13bb796b9b8dbc93c684428ab38c2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 2 Oct 2013 19:38:52 +0200
Subject: [PATCH] mkdir: pass a proper function pointer to mkdir_safe_internal
---
src/shared/mkdir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
index b7e5c6e..43c6ea6 100644
--- a/src/shared/mkdir.c
+++ b/src/shared/mkdir.c
@@ -53,7 +53,7 @@ int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkd
}
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid) {
- return mkdir_safe_internal(path, mode, uid, gid, false);
+ return mkdir_safe_internal(path, mode, uid, gid, mkdir);
}
static int is_dir(const char* path) {
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,26 @@
From 4e1d571d8564b6383ced03316f0d84b96e1299a4 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Wed, 2 Oct 2013 15:35:16 -0400
Subject: [PATCH] tmpfiles.d: include setgid perms for /run/log/journal
4608af4333d0f7f5 set permissions for journal storage on persistent disk
but not the volatile storage.
ref: https://bugs.archlinux.org/task/37170
---
tmpfiles.d/systemd.conf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf
index b630440..a05c657 100644
--- a/tmpfiles.d/systemd.conf
+++ b/tmpfiles.d/systemd.conf
@@ -26,3 +26,5 @@ F /run/nologin 0644 - - - "System is booting up. See pam_nologin(8)"
m /var/log/journal 2755 root systemd-journal - -
m /var/log/journal/%m 2755 root systemd-journal - -
+m /run/log/journal 2755 root systemd-journal - -
+m /run/log/journal/%m 2755 root systemd-journal - -
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,169 @@
From 0a1d15d3b802128cc9be10c849c29b76a8fae3ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 2 Oct 2013 13:23:10 +0200
Subject: [PATCH] execute.c: always set $SHELL
In e6dca81 $SHELL was added to user@.service. Let's
instead provide it to all units which have a user.
---
TODO | 2 --
man/systemd.exec.xml | 21 +++++++++++++++++--
src/core/execute.c | 56 +++++++++++++++++---------------------------------
units/user@.service.in | 1 -
4 files changed, 38 insertions(+), 42 deletions(-)
diff --git a/TODO b/TODO
index 07269f4..425f673 100644
--- a/TODO
+++ b/TODO
@@ -54,8 +54,6 @@ CGroup Rework Completion:
Features:
-* set $SHELL where we set $HOME and $USER when User= is set of a service, drop its manual setting from user@.service
-
* we probably should replace the left-over uses of strv_append() and replace them by strv_push() or strv_extend()
* move config_parse_path_strv() out of conf-parser.c
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index f50161f..e213ec4 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -1021,10 +1021,13 @@
<varlistentry>
<term><varname>$USER</varname></term>
+ <term><varname>$LOGNAME</varname></term>
<term><varname>$HOME</varname></term>
+ <term><varname>$SHELL</varname></term>
- <listitem><para>User name and home
- directory. Set for the units which
+ <listitem><para>User name (twice), home
+ directory, and the login shell.
+ Set for the units which
have <varname>User=</varname> set,
which includes user
<command>systemd</command> instances.
@@ -1080,6 +1083,20 @@
<citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>$TERM</varname></term>
+
+ <listitem><para>Terminal type, set
+ only for units connected to a terminal
+ (<varname>StandardInput=tty</varname>,
+ <varname>StandardOutput=tty</varname>,
+ or
+ <varname>StandardError=tty</varname>).
+ See
+ <citerefentry><refentrytitle>termcap</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
+ </para></listitem>
+ </varlistentry>
</variablelist>
<para>Additional variables may be configured by the
diff --git a/src/core/execute.c b/src/core/execute.c
index a53ef48..3979f35 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1094,7 +1094,7 @@ int exec_spawn(ExecCommand *command,
if (pid == 0) {
int i, err;
sigset_t ss;
- const char *username = NULL, *home = NULL;
+ const char *username = NULL, *home = NULL, *shell = NULL;
uid_t uid = (uid_t) -1;
gid_t gid = (gid_t) -1;
_cleanup_strv_free_ char **our_env = NULL, **pam_env = NULL,
@@ -1277,7 +1277,7 @@ int exec_spawn(ExecCommand *command,
if (context->user) {
username = context->user;
- err = get_user_creds(&username, &uid, &gid, &home, NULL);
+ err = get_user_creds(&username, &uid, &gid, &home, &shell);
if (err < 0) {
r = EXIT_USER;
goto fail_child;
@@ -1462,46 +1462,28 @@ int exec_spawn(ExecCommand *command,
}
}
- our_env = new0(char*, 7);
- if (!our_env) {
+ our_env = new(char*, 8);
+ if (!our_env ||
+ (n_fds > 0 && (
+ asprintf(our_env + n_env++, "LISTEN_PID=%lu", (unsigned long) getpid()) < 0 ||
+ asprintf(our_env + n_env++, "LISTEN_FDS=%u", n_fds) < 0)) ||
+ (home && asprintf(our_env + n_env++, "HOME=%s", home) < 0) ||
+ (username && (
+ asprintf(our_env + n_env++, "LOGNAME=%s", username) < 0 ||
+ asprintf(our_env + n_env++, "USER=%s", username) < 0)) ||
+ (shell && asprintf(our_env + n_env++, "SHELL=%s", shell) < 0) ||
+ ((is_terminal_input(context->std_input) ||
+ context->std_output == EXEC_OUTPUT_TTY ||
+ context->std_error == EXEC_OUTPUT_TTY) && (
+ !(our_env[n_env++] = strdup(default_term_for_tty(tty_path(context))))))) {
+
err = -ENOMEM;
r = EXIT_MEMORY;
goto fail_child;
}
- if (n_fds > 0)
- if (asprintf(our_env + n_env++, "LISTEN_PID=%lu", (unsigned long) getpid()) < 0 ||
- asprintf(our_env + n_env++, "LISTEN_FDS=%u", n_fds) < 0) {
- err = -ENOMEM;
- r = EXIT_MEMORY;
- goto fail_child;
- }
-
- if (home)
- if (asprintf(our_env + n_env++, "HOME=%s", home) < 0) {
- err = -ENOMEM;
- r = EXIT_MEMORY;
- goto fail_child;
- }
-
- if (username)
- if (asprintf(our_env + n_env++, "LOGNAME=%s", username) < 0 ||
- asprintf(our_env + n_env++, "USER=%s", username) < 0) {
- err = -ENOMEM;
- r = EXIT_MEMORY;
- goto fail_child;
- }
-
- if (is_terminal_input(context->std_input) ||
- context->std_output == EXEC_OUTPUT_TTY ||
- context->std_error == EXEC_OUTPUT_TTY)
- if (!(our_env[n_env++] = strdup(default_term_for_tty(tty_path(context))))) {
- err = -ENOMEM;
- r = EXIT_MEMORY;
- goto fail_child;
- }
-
- assert(n_env <= 7);
+ our_env[n_env++] = NULL;
+ assert(n_env <= 8);
final_env = strv_env_merge(5,
environment,
diff --git a/units/user@.service.in b/units/user@.service.in
index 3718a57..3f8b59d 100644
--- a/units/user@.service.in
+++ b/units/user@.service.in
@@ -13,7 +13,6 @@ After=systemd-user-sessions.service
User=%I
PAMName=systemd-user
Type=notify
-Environment=SHELL=%s
ExecStart=-@rootlibexecdir@/systemd --user
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
Slice=user-%i.slice
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,45 @@
From f4c2f322509191d38f6e94fac06607d1dd99b4ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= <vpavlin@redhat.com>
Date: Thu, 3 Oct 2013 15:47:26 +0200
Subject: [PATCH] man: Improve the description of parameter X in tmpfiles.d
page
---
man/tmpfiles.d.xml | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index 9fc4b7c..e8b630d 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -184,15 +184,18 @@ L /tmp/foobar - - - - /dev/null</programlisting>
<varlistentry>
<term><varname>X</varname></term>
<listitem><para>Ignore a path
- during cleanup. Use this type
- to prevent path removal as
- controlled with the Age parameter.
- Note that if path is a directory,
- content of a directory is not
- excluded from clean-up, only
- directory itself. Lines of this
- type accept shell-style globs
- in place of normal path
+ during cleaning. Use this type
+ to exclude paths from clean-up
+ as controlled with the Age
+ parameter. Unlike x this
+ parameter will not exclude the
+ content if path is a directory,
+ but only directory itself.
+ Note that lines of this type do
+ not influence the effect of r
+ or R lines. Lines of this type
+ accept shell-style globs in
+ place of normal path
names.</para></listitem>
</varlistentry>
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,124 @@
From 669ac5ee25f166bdf688b06f96e8e8fd3cf9f43c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 28 Aug 2013 08:01:30 -0400
Subject: [PATCH] execute: more debugging messages
---
src/core/execute.c | 35 +++++++++++++++++++++--------------
src/login/pam-module.c | 3 ++-
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/src/core/execute.c b/src/core/execute.c
index 3979f35..3f7ca52 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -317,12 +317,12 @@ static int setup_input(const ExecContext *context, int socket_fd, bool apply_tty
case EXEC_INPUT_TTY_FAIL: {
int fd, r;
- if ((fd = acquire_terminal(
- tty_path(context),
- i == EXEC_INPUT_TTY_FAIL,
- i == EXEC_INPUT_TTY_FORCE,
- false,
- (usec_t) -1)) < 0)
+ fd = acquire_terminal(tty_path(context),
+ i == EXEC_INPUT_TTY_FAIL,
+ i == EXEC_INPUT_TTY_FORCE,
+ false,
+ (usec_t) -1);
+ if (fd < 0)
return fd;
if (fd != STDIN_FILENO) {
@@ -748,6 +748,7 @@ static int setup_pam(
char **e = NULL;
bool close_session = false;
pid_t pam_pid = 0, parent_pid;
+ int flags = 0;
assert(name);
assert(user);
@@ -760,6 +761,9 @@ static int setup_pam(
* daemon. We do things this way to ensure that the main PID
* of the daemon is the one we initially fork()ed. */
+ if (log_get_max_level() < LOG_PRI(LOG_DEBUG))
+ flags |= PAM_SILENT;
+
pam_code = pam_start(name, user, &conv, &handle);
if (pam_code != PAM_SUCCESS) {
handle = NULL;
@@ -772,11 +776,11 @@ static int setup_pam(
goto fail;
}
- pam_code = pam_acct_mgmt(handle, PAM_SILENT);
+ pam_code = pam_acct_mgmt(handle, flags);
if (pam_code != PAM_SUCCESS)
goto fail;
- pam_code = pam_open_session(handle, PAM_SILENT);
+ pam_code = pam_open_session(handle, flags);
if (pam_code != PAM_SUCCESS)
goto fail;
@@ -850,7 +854,7 @@ static int setup_pam(
/* If our parent died we'll end the session */
if (getppid() != parent_pid) {
- pam_code = pam_close_session(handle, PAM_DATA_SILENT);
+ pam_code = pam_close_session(handle, flags);
if (pam_code != PAM_SUCCESS)
goto child_finish;
}
@@ -858,7 +862,7 @@ static int setup_pam(
r = 0;
child_finish:
- pam_end(handle, pam_code | PAM_DATA_SILENT);
+ pam_end(handle, pam_code | flags);
_exit(r);
}
@@ -880,16 +884,19 @@ static int setup_pam(
return 0;
fail:
- if (pam_code != PAM_SUCCESS)
+ if (pam_code != PAM_SUCCESS) {
+ log_error("PAM failed: %s", pam_strerror(handle, pam_code));
err = -EPERM; /* PAM errors do not map to errno */
- else
+ } else {
+ log_error("PAM failed: %m");
err = -errno;
+ }
if (handle) {
if (close_session)
- pam_code = pam_close_session(handle, PAM_DATA_SILENT);
+ pam_code = pam_close_session(handle, flags);
- pam_end(handle, pam_code | PAM_DATA_SILENT);
+ pam_end(handle, pam_code | flags);
}
strv_free(e);
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 49296b5..973daf7 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -199,7 +199,8 @@ _public_ PAM_EXTERN int pam_sm_open_session(
dbus_error_init(&error);
- /* pam_syslog(handle, LOG_INFO, "pam-systemd initializing"); */
+ if (debug)
+ pam_syslog(handle, LOG_INFO, "pam-systemd initializing");
/* Make this a NOP on non-logind systems */
if (!logind_running())
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,40 @@
From d25cc648fed1d6902d07c74afd71458f971ab314 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 3 Oct 2013 22:13:01 -0400
Subject: [PATCH] gpt-auto-generator: exit immediately if in container
Otherwise we get an ugly warning when running systemd in
a container.
---
src/gpt-auto-generator/gpt-auto-generator.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index ca54925..d2b4213 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -38,6 +38,7 @@
#include "libudev.h"
#include "special.h"
#include "unit-name.h"
+#include "virt.h"
/* TODO:
*
@@ -481,6 +482,13 @@ int main(int argc, char *argv[]) {
umask(0022);
if (in_initrd()) {
+ log_debug("In initrd, exiting.");
+ r = 0;
+ goto finish;
+ }
+
+ if (detect_container(NULL) > 0) {
+ log_debug("In a container, exiting.");
r = 0;
goto finish;
}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,41 @@
From 095da7cd7cdb33cd5efe7a53c77862aa677045d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 3 Oct 2013 22:15:08 -0400
Subject: [PATCH] systemd: order remote mounts from mountinfo before
remote-fs.target
Usually the network is stopped before filesystems are umounted.
Ordering network filesystems before remote-fs.target means that their
unmounting will be performed earlier, and can terminate sucessfully.
https://bugs.freedesktop.org/show_bug.cgi?id=70002
---
src/core/mount.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 3d46557..93bfa99 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1440,6 +1440,9 @@ static int mount_add_one(
u = manager_get_unit(m, e);
if (!u) {
+ const char* const target =
+ fstype_is_network(fstype) ? SPECIAL_REMOTE_FS_TARGET : SPECIAL_LOCAL_FS_TARGET;
+
delete = true;
u = unit_new(m, sizeof(Mount));
@@ -1466,7 +1469,7 @@ static int mount_add_one(
goto fail;
}
- r = unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_LOCAL_FS_TARGET, NULL, true);
+ r = unit_add_dependency_by_name(u, UNIT_BEFORE, target, NULL, true);
if (r < 0)
goto fail;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,45 @@
From 8f84713d297fcba39b65e7409ec114009896c3ff Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 4 Oct 2013 17:01:37 +0200
Subject: [PATCH] manager: when verifying whether clients may change
environment using selinux check for "reload" rather "reboot"
This appears to be a copy/paste error.
---
src/core/dbus-manager.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 676a07f..8f4d017 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1397,7 +1397,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
_cleanup_strv_free_ char **l = NULL;
char **e = NULL;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
r = bus_parse_strv(message, &l);
if (r == -ENOMEM)
@@ -1424,7 +1424,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
_cleanup_strv_free_ char **l = NULL;
char **e = NULL;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
r = bus_parse_strv(message, &l);
if (r == -ENOMEM)
@@ -1452,7 +1452,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
char **f = NULL;
DBusMessageIter iter;
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
if (!dbus_message_iter_init(message, &iter))
goto oom;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,25 @@
From e25723afe5ebc4b05d5330a935bb654904eaf2f0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 4 Oct 2013 21:16:40 +0200
Subject: [PATCH] logind: fix bus introspection data for TakeControl()
---
src/login/logind-session-dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index 5f6bafb..be4e01c 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -41,7 +41,7 @@
" <arg name=\"who\" type=\"s\"/>\n" \
" <arg name=\"signal\" type=\"s\"/>\n" \
" </method>\n" \
- " <method name=\"TakeControl\"/>\n" \
+ " <method name=\"TakeControl\">\n" \
" <arg name=\"force\" type=\"b\"/>\n" \
" </method>\n" \
" <method name=\"ReleaseControl\"/>\n" \
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,29 @@
From 61ccd1762fa0f9a8ec9285a8a7367fc03bcc5982 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Fri, 4 Oct 2013 18:22:40 -0400
Subject: [PATCH] mount: check for NULL before reading pm->what
Since a57f7e2c828b85, a mount unit with garbage in it would cause
systemd to crash on loading it.
ref: https://bugs.freedesktop.org/show_bug.cgi?id=70148
---
src/core/mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 93bfa99..db055f0 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -182,7 +182,7 @@ static int mount_add_mount_links(Mount *m) {
* for the source path (if this is a bind mount) to be
* available. */
pm = get_mount_parameters_fragment(m);
- if (pm && path_is_absolute(pm->what)) {
+ if (pm && pm->what && path_is_absolute(pm->what)) {
r = unit_require_mounts_for(UNIT(m), pm->what);
if (r < 0)
return r;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,181 @@
From 47c666095e4ed827bbb15b6e58b760dc5dcd97ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 5 Oct 2013 13:09:43 -0400
Subject: [PATCH] core: do not add "what" to RequiresMountsFor for network
mounts
For cifs mount like //server/share, we would get
RequiresMountsFor=/server/share, which probably isn't
harmful, but quite confusing.
Unfortunately a bunch of static functions had to be moved
up, but patch is really one line.
---
src/core/mount.c | 137 ++++++++++++++++++++++++++++---------------------------
1 file changed, 70 insertions(+), 67 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index db055f0..70cd372 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -59,6 +59,72 @@ static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
[MOUNT_FAILED] = UNIT_FAILED
};
+static char* mount_test_option(const char *haystack, const char *needle) {
+ struct mntent me = { .mnt_opts = (char*) haystack };
+
+ assert(needle);
+
+ /* Like glibc's hasmntopt(), but works on a string, not a
+ * struct mntent */
+
+ if (!haystack)
+ return NULL;
+
+ return hasmntopt(&me, needle);
+}
+
+static bool mount_is_network(MountParameters *p) {
+ assert(p);
+
+ if (mount_test_option(p->options, "_netdev"))
+ return true;
+
+ if (p->fstype && fstype_is_network(p->fstype))
+ return true;
+
+ return false;
+}
+
+static bool mount_is_bind(MountParameters *p) {
+ assert(p);
+
+ if (mount_test_option(p->options, "bind"))
+ return true;
+
+ if (p->fstype && streq(p->fstype, "bind"))
+ return true;
+
+ if (mount_test_option(p->options, "rbind"))
+ return true;
+
+ if (p->fstype && streq(p->fstype, "rbind"))
+ return true;
+
+ return false;
+}
+
+static bool mount_is_auto(MountParameters *p) {
+ assert(p);
+
+ return !mount_test_option(p->options, "noauto");
+}
+
+static bool needs_quota(MountParameters *p) {
+ assert(p);
+
+ if (mount_is_network(p))
+ return false;
+
+ if (mount_is_bind(p))
+ return false;
+
+ return mount_test_option(p->options, "usrquota") ||
+ mount_test_option(p->options, "grpquota") ||
+ mount_test_option(p->options, "quota") ||
+ mount_test_option(p->options, "usrjquota") ||
+ mount_test_option(p->options, "grpjquota");
+}
+
static void mount_init(Unit *u) {
Mount *m = MOUNT(u);
@@ -182,7 +248,10 @@ static int mount_add_mount_links(Mount *m) {
* for the source path (if this is a bind mount) to be
* available. */
pm = get_mount_parameters_fragment(m);
- if (pm && pm->what && path_is_absolute(pm->what)) {
+ if (pm && pm->what &&
+ path_is_absolute(pm->what) &&
+ !mount_is_network(pm)) {
+
r = unit_require_mounts_for(UNIT(m), pm->what);
if (r < 0)
return r;
@@ -214,72 +283,6 @@ static int mount_add_mount_links(Mount *m) {
return 0;
}
-static char* mount_test_option(const char *haystack, const char *needle) {
- struct mntent me = { .mnt_opts = (char*) haystack };
-
- assert(needle);
-
- /* Like glibc's hasmntopt(), but works on a string, not a
- * struct mntent */
-
- if (!haystack)
- return NULL;
-
- return hasmntopt(&me, needle);
-}
-
-static bool mount_is_network(MountParameters *p) {
- assert(p);
-
- if (mount_test_option(p->options, "_netdev"))
- return true;
-
- if (p->fstype && fstype_is_network(p->fstype))
- return true;
-
- return false;
-}
-
-static bool mount_is_bind(MountParameters *p) {
- assert(p);
-
- if (mount_test_option(p->options, "bind"))
- return true;
-
- if (p->fstype && streq(p->fstype, "bind"))
- return true;
-
- if (mount_test_option(p->options, "rbind"))
- return true;
-
- if (p->fstype && streq(p->fstype, "rbind"))
- return true;
-
- return false;
-}
-
-static bool mount_is_auto(MountParameters *p) {
- assert(p);
-
- return !mount_test_option(p->options, "noauto");
-}
-
-static bool needs_quota(MountParameters *p) {
- assert(p);
-
- if (mount_is_network(p))
- return false;
-
- if (mount_is_bind(p))
- return false;
-
- return mount_test_option(p->options, "usrquota") ||
- mount_test_option(p->options, "grpquota") ||
- mount_test_option(p->options, "quota") ||
- mount_test_option(p->options, "usrjquota") ||
- mount_test_option(p->options, "grpjquota");
-}
-
static int mount_add_device_links(Mount *m) {
MountParameters *p;
bool device_wants_mount = false;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,47 @@
From 5b5f505ab485dd60fb608ffb2eecd755537f039f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 5 Oct 2013 22:47:52 -0400
Subject: [PATCH] utf8: fix utf8_is_printable
---
src/shared/utf8.c | 5 +++--
src/test/test-utf8.c | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/shared/utf8.c b/src/shared/utf8.c
index a8e28ac..31120af 100644
--- a/src/shared/utf8.c
+++ b/src/shared/utf8.c
@@ -141,14 +141,15 @@ bool utf8_is_printable(const char* str, size_t length) {
assert(str);
- for (p = (const uint8_t*) str; length; p++) {
+ for (p = (const uint8_t*) str; length;) {
int encoded_len = utf8_encoded_valid_unichar((const char *)p);
- int32_t val = utf8_encoded_to_unichar((const char*)p);
+ int val = utf8_encoded_to_unichar((const char*)p);
if (encoded_len < 0 || val < 0 || is_unicode_control(val))
return false;
length -= encoded_len;
+ p += encoded_len;
}
return true;
diff --git a/src/test/test-utf8.c b/src/test/test-utf8.c
index 7bd0db1..f0182ee 100644
--- a/src/test/test-utf8.c
+++ b/src/test/test-utf8.c
@@ -26,6 +26,7 @@ static void test_utf8_is_printable(void) {
assert_se(utf8_is_printable("ascii is valid\tunicode", 22));
assert_se(utf8_is_printable("\342\204\242", 3));
assert_se(!utf8_is_printable("\341\204", 2));
+ assert_se(utf8_is_printable("ąę", 4));
}
static void test_utf8_is_valid(void) {
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,50 @@
From c3d2db4dd65bf5127cbddec2edd931399ce5ebce Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sun, 6 Oct 2013 18:26:23 -0400
Subject: [PATCH] shared/util: fix off-by-one error in tag_to_udev_node
Triggered false negatives when encoding a string which needed every
character to be escaped, e.g. "LABEL=/".
---
src/shared/util.c | 2 +-
src/test/test-device-nodes.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 9be6acf..748f1bb 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3527,7 +3527,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
if (u == NULL)
return NULL;
- enc_len = strlen(u) * 4;
+ enc_len = strlen(u) * 4 + 1;
t = new(char, enc_len);
if (t == NULL)
return NULL;
diff --git a/src/test/test-device-nodes.c b/src/test/test-device-nodes.c
index 2f3dedb..59ba4be 100644
--- a/src/test/test-device-nodes.c
+++ b/src/test/test-device-nodes.c
@@ -26,7 +26,7 @@
/* helpers for test_encode_devnode_name */
static char *do_encode_string(const char *in) {
- size_t out_len = strlen(in) * 4;
+ size_t out_len = strlen(in) * 4 + 1;
char *out = malloc(out_len);
assert_se(out);
@@ -46,6 +46,8 @@ static void test_encode_devnode_name(void) {
assert_se(expect_encoded_as("pinkiepie", "pinkiepie"));
assert_se(expect_encoded_as("valíd\\ųtf8", "valíd\\x5cųtf8"));
assert_se(expect_encoded_as("s/ash/ng", "s\\x2fash\\x2fng"));
+ assert_se(expect_encoded_as("/", "\\x2f"));
+ assert_se(expect_encoded_as("!", "\\x21"));
}
int main(int argc, char *argv[]) {
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,51 @@
From adb4105cf7f0018d05696f96a1058041037c9243 Mon Sep 17 00:00:00 2001
From: Sylvia Else <sylviabz1@cryogenic.net>
Date: Sun, 6 Oct 2013 23:06:35 -0400
Subject: [PATCH] systemd: serialize/deserialize forbid_restart value
The Service type's forbid_restart field was not preserved by
serialization/deserialization, so the fact that the service should not
be restarted after stopping was lost.
If a systemctl stop foo command has been given, but the foo service
has not yet stopped, and then the systemctl --system daemon-reload was
given, then when the foo service eventually stopped, systemd would
restart it.
https://bugs.freedesktop.org/show_bug.cgi?id=69800
---
src/core/service.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/core/service.c b/src/core/service.c
index 6792024..98b1599 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2651,6 +2651,9 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
if (s->exec_context.var_tmp_dir)
unit_serialize_item(u, f, "var-tmp-dir", s->exec_context.var_tmp_dir);
+ if (s->forbid_restart)
+ unit_serialize_item(u, f, "forbid_restart", yes_no(s->forbid_restart));
+
return 0;
}
@@ -2787,6 +2790,14 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
return log_oom();
s->exec_context.var_tmp_dir = t;
+ } else if (streq(key, "forbid_restart")) {
+ int b;
+
+ b = parse_boolean(value);
+ if (b < 0)
+ log_debug_unit(u->id, "Failed to parse forbid_restart value %s", value);
+ else
+ s->forbid_restart = b;
} else
log_debug_unit(u->id, "Unknown serialization key '%s'", key);
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,40 @@
From 7d1f35a5838363c2d1981fc62f5bbcb43cbdc57c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 9 Oct 2013 00:13:55 +0200
Subject: [PATCH] core: unify the way we denote serialization attributes
---
src/core/service.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/core/service.c b/src/core/service.c
index 98b1599..96ed2d3 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2652,7 +2652,7 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
unit_serialize_item(u, f, "var-tmp-dir", s->exec_context.var_tmp_dir);
if (s->forbid_restart)
- unit_serialize_item(u, f, "forbid_restart", yes_no(s->forbid_restart));
+ unit_serialize_item(u, f, "forbid-restart", yes_no(s->forbid_restart));
return 0;
}
@@ -2790,12 +2790,12 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
return log_oom();
s->exec_context.var_tmp_dir = t;
- } else if (streq(key, "forbid_restart")) {
+ } else if (streq(key, "forbid-restart")) {
int b;
b = parse_boolean(value);
if (b < 0)
- log_debug_unit(u->id, "Failed to parse forbid_restart value %s", value);
+ log_debug_unit(u->id, "Failed to parse forbid-restart value %s", value);
else
s->forbid_restart = b;
} else
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,25 @@
From 85f4505eab750835fdfe022012bf7d33123bc940 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 9 Oct 2013 04:03:45 +0200
Subject: [PATCH] journald: fix minor memory leak
---
src/journal/journal-vacuum.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index c73ad8f..8d5effb 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -278,6 +278,8 @@ int journal_directory_vacuum(
} else if (errno != ENOENT)
log_warning("Failed to delete %s/%s: %m", directory, p);
+ free(p);
+
continue;
}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,42 @@
From 6381c0c4adc2d637ad53dd81cfeb73d7b4a2cbcb Mon Sep 17 00:00:00 2001
From: Martin Pitt <martinpitt@gnome.org>
Date: Wed, 9 Oct 2013 16:05:15 +0200
Subject: [PATCH] keymap: Fix Samsung 900X[34]C
It appears that it's not really the 900 vs. 940 or the X3 vs X4, but the
A/B/C/D suffix after that which makes the difference between the keymaps. On a
NP900X3C-A04RU you get
MODALIAS=dmi:bvn*:bvr*:bd*:svnSAMSUNGELECTRONICSCO.,LTD.:pn900X3C/900X3D/900X4C/900X4D:*
So change the matches to use AB vs. CDG as the differentiator.
Thanks to Anatoly Markov for reporting and testing!
---
hwdb/60-keyboard.hwdb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 20d398f..b497f92 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -904,6 +904,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*550P*:pvr*
KEYBOARD_KEY_a9=! # Fn Lock - Function lock off
keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*700Z*:pvr*
+keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*900X[34][CDG]*:pvr*
keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*940X3G*:pvr*
KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings
KEYBOARD_KEY_a0=!mute # Fn+F6 mute
@@ -915,7 +916,7 @@ keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*940X3G*:pvr*
# Series 9
keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*90X3A*:pvr*
-keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*900X[34]*:pvr*
+keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*900X[34][AB]*:pvr*
KEYBOARD_KEY_ce=! # Fn+F8 keyboard backlight up
KEYBOARD_KEY_8d=! # Fn+F7 keyboard backlight down
KEYBOARD_KEY_96=! # Fn+F1 performance mode (?)
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,33 @@
From 44d7510b31f3e9331a2c6b5518438697404655c6 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 10 Oct 2013 01:38:11 +0200
Subject: [PATCH] do not accept "garbage" from acpi firmware performance data
(FPDT)
00000000 46 42 50 54 38 00 00 00 02 00 30 02 00 00 00 00 |FBPT8.....0.....|
00000010 23 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |#E..............|
00000020 f5 6a 51 00 00 00 00 00 00 00 00 00 00 00 00 00 |.jQ.............|
00000030 00 00 00 00 00 00 00 00 70 74 61 6c 58 00 00 00 |........ptalX...|
---
src/shared/acpi-fpdt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index af58c7c..75648b4 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -146,6 +146,11 @@ int acpi_get_boot_usec(usec_t *loader_start, usec_t *loader_exit) {
if (brec.type != ACPI_FPDT_BOOT_REC)
return -EINVAL;
+ if (brec.startup_start == 0 || brec.exit_services_exit < brec.startup_start)
+ return -EINVAL;
+ if (brec.exit_services_exit > NSEC_PER_HOUR)
+ return -EINVAL;
+
if (loader_start)
*loader_start = brec.startup_start / 1000;
if (loader_exit)
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,39 @@
From c9cceff90794d452b16a5dd8d1c53cdb44f4a002 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Wed, 9 Oct 2013 22:13:13 -0400
Subject: [PATCH] journald: remove rotated file from hashmap when rotation
fails
Before, when the user journal file was rotated, journal_file_rotate
could close the old file and fail to open the new file. In that
case, we would leave the old (deallocated) file in the hashmap.
On subsequent accesses, we could retrieve this stale entry, leading
to a segfault.
When journal_file_rotate fails with the file pointer set to 0,
old file is certainly gone, and cannot be used anymore.
https://bugzilla.redhat.com/show_bug.cgi?id=890463
---
src/journal/journald-server.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 4f47eb1..e03e413 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -321,8 +321,10 @@ void server_rotate(Server *s) {
if (r < 0)
if (f)
log_error("Failed to rotate %s: %s", f->path, strerror(-r));
- else
+ else {
log_error("Failed to create user journal: %s", strerror(-r));
+ hashmap_remove(s->user_journals, k);
+ }
else {
hashmap_replace(s->user_journals, k, f);
server_fix_perms(s, f, PTR_TO_UINT32(k));
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,27 @@
From a72c398b5af558d231decbbf12c7990dbd38c682 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Thu, 10 Oct 2013 13:09:37 +0200
Subject: [PATCH] login: fix invalid free() in sd_session_get_vt()
We need to clear variables markes as _cleanup_free_. Otherwise, our
error-paths might corrupt random memory.
---
src/login/sd-login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 71d8c29..6c27dfe 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -350,7 +350,7 @@ _public_ int sd_session_get_tty(const char *session, char **tty) {
}
_public_ int sd_session_get_vt(const char *session, unsigned *vtnr) {
- _cleanup_free_ char *vtnr_string;
+ _cleanup_free_ char *vtnr_string = NULL;
unsigned u;
int r;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,27 @@
From 88a16dc6bd64267e4a0fbe58f2e8d273c096f1e5 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Thu, 10 Oct 2013 13:11:27 +0200
Subject: [PATCH] login: make sd_session_get_vt() actually work
We use VTNR, not VTNr as key. Until now sd_session_get_vt() just returns
an error.
---
src/login/sd-login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 6c27dfe..7e25041 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -354,7 +354,7 @@ _public_ int sd_session_get_vt(const char *session, unsigned *vtnr) {
unsigned u;
int r;
- r = session_get_string(session, "VTNr", &vtnr_string);
+ r = session_get_string(session, "VTNR", &vtnr_string);
if (r < 0)
return r;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,34 @@
From 2ef8bf3f6b44d2860b149ad09cf8aea3a4f1bd42 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sun, 13 Oct 2013 17:42:51 -0400
Subject: [PATCH] udevadm.xml: document --resolve-names option for test
And remove documentation of the --subsystem flag which doesn't actually
exist.
---
man/udevadm.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/man/udevadm.xml b/man/udevadm.xml
index d0b257d..b959216 100644
--- a/man/udevadm.xml
+++ b/man/udevadm.xml
@@ -462,9 +462,13 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--subsystem=<replaceable>string</replaceable></option></term>
+ <term><option>--resolve-names=<replaceable>early|late|never</replaceable></option></term>
<listitem>
- <para>The subsystem string.</para>
+ <para>Specify when udevadm should resolve names of users and groups.
+ When set to early (the default) names will be resolved when the
+ rules are parsed. When set to late names will be resolved for
+ every event. When set to never names will never be resolved and
+ all devices will be owned by root.</para>
</listitem>
</varlistentry>
<varlistentry>
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,385 @@
From 88bef035149080be5a83f90d91d5b13cec9749e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 11 Oct 2013 19:33:13 -0400
Subject: [PATCH] Never call qsort on potentially NULL arrays
This extends 62678ded 'efi: never call qsort on potentially
NULL arrays' to all other places where qsort is used and it
is not obvious that the count is non-zero.
---
src/analyze/systemd-analyze.c | 2 +-
src/cgtop/cgtop.c | 2 +-
src/core/namespace.c | 38 ++++++++++++++++++++------------------
src/journal/catalog.c | 2 +-
src/journal/journal-file.c | 2 +-
src/journal/journal-vacuum.c | 3 +--
src/journal/journalctl.c | 2 +-
src/libsystemd-bus/bus-match.c | 2 +-
src/libudev/libudev-enumerate.c | 2 +-
src/nss-myhostname/netlink.c | 3 ++-
src/readahead/readahead-collect.c | 39 ++++++++++++++++++++++-----------------
src/shared/cgroup-show.c | 2 ++
src/shared/conf-files.c | 2 +-
src/shared/efivars.c | 3 +--
src/shared/fileio.c | 1 +
src/shared/util.h | 12 ++++++++++++
src/systemctl/systemctl.c | 10 +++++-----
17 files changed, 74 insertions(+), 53 deletions(-)
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
index 27d063c..a4f15eb 100644
--- a/src/analyze/systemd-analyze.c
+++ b/src/analyze/systemd-analyze.c
@@ -768,7 +768,7 @@ static int list_dependencies_one(DBusConnection *bus, const char *name, unsigned
if (r < 0)
return r;
- qsort(deps, strv_length(deps), sizeof (char*), list_dependencies_compare);
+ qsort_safe(deps, strv_length(deps), sizeof (char*), list_dependencies_compare);
r = acquire_boot_times(bus, &boot);
if (r < 0)
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index cacf705..293a211 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -461,7 +461,7 @@ static int display(Hashmap *a) {
if (g->n_tasks_valid || g->cpu_valid || g->memory_valid || g->io_valid)
array[n++] = g;
- qsort(array, n, sizeof(Group*), group_compare);
+ qsort_safe(array, n, sizeof(Group*), group_compare);
/* Find the longest names in one run */
for (j = 0; j < n; j++) {
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 16b132b..936f368 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -222,7 +222,7 @@ int setup_namespace(char** read_write_dirs,
strv_length(read_only_dirs) +
strv_length(inaccessible_dirs) +
(private_tmp ? 2 : 0);
- BindMount *m, *mounts;
+ BindMount *m, *mounts = NULL;
int r = 0;
if (!mount_flags)
@@ -231,27 +231,29 @@ int setup_namespace(char** read_write_dirs,
if (unshare(CLONE_NEWNS) < 0)
return -errno;
- m = mounts = (BindMount *) alloca(n * sizeof(BindMount));
- if ((r = append_mounts(&m, read_write_dirs, READWRITE)) < 0 ||
- (r = append_mounts(&m, read_only_dirs, READONLY)) < 0 ||
- (r = append_mounts(&m, inaccessible_dirs, INACCESSIBLE)) < 0)
- return r;
+ if (n) {
+ m = mounts = (BindMount *) alloca(n * sizeof(BindMount));
+ if ((r = append_mounts(&m, read_write_dirs, READWRITE)) < 0 ||
+ (r = append_mounts(&m, read_only_dirs, READONLY)) < 0 ||
+ (r = append_mounts(&m, inaccessible_dirs, INACCESSIBLE)) < 0)
+ return r;
+
+ if (private_tmp) {
+ m->path = "/tmp";
+ m->mode = PRIVATE_TMP;
+ m++;
+
+ m->path = "/var/tmp";
+ m->mode = PRIVATE_VAR_TMP;
+ m++;
+ }
- if (private_tmp) {
- m->path = "/tmp";
- m->mode = PRIVATE_TMP;
- m++;
+ assert(mounts + n == m);
- m->path = "/var/tmp";
- m->mode = PRIVATE_VAR_TMP;
- m++;
+ qsort(mounts, n, sizeof(BindMount), mount_path_compare);
+ drop_duplicates(mounts, &n);
}
- assert(mounts + n == m);
-
- qsort(mounts, n, sizeof(BindMount), mount_path_compare);
- drop_duplicates(mounts, &n);
-
/* Remount / as SLAVE so that nothing now mounted in the namespace
shows up in the parent */
if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) < 0)
diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index 7738d24..90ca008 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -399,7 +399,7 @@ int catalog_update(const char* database, const char* root, const char* const* di
}
assert(n == hashmap_size(h));
- qsort(items, n, sizeof(CatalogItem), catalog_compare_func);
+ qsort_safe(items, n, sizeof(CatalogItem), catalog_compare_func);
r = write_catalog(database, h, sb, items, n);
if (r < 0)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 81c344f..425e38a 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1344,7 +1344,7 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
/* Order by the position on disk, in order to improve seek
* times for rotating media. */
- qsort(items, n_iovec, sizeof(EntryItem), entry_item_cmp);
+ qsort_safe(items, n_iovec, sizeof(EntryItem), entry_item_cmp);
r = journal_file_append_entry_internal(f, ts, xor_hash, items, n_iovec, seqnum, ret, offset);
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index 8d5effb..d4a1c6c 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -299,8 +299,7 @@ int journal_directory_vacuum(
n_list ++;
}
- if (n_list > 0)
- qsort(list, n_list, sizeof(struct vacuum_info), vacuum_compare);
+ qsort_safe(list, n_list, sizeof(struct vacuum_info), vacuum_compare);
for (i = 0; i < n_list; i++) {
struct statvfs ss;
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 9a2d255..0876ee6 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -755,7 +755,7 @@ static int get_relative_boot_id(sd_journal *j, sd_id128_t *boot_id, int relative
sd_journal_flush_matches(j);
}
- qsort(all_ids, count, sizeof(boot_id_t), boot_id_cmp);
+ qsort_safe(all_ids, count, sizeof(boot_id_t), boot_id_cmp);
if (sd_id128_equal(*boot_id, SD_ID128_NULL)) {
if (relative > (int) count || relative <= -(int)count)
diff --git a/src/libsystemd-bus/bus-match.c b/src/libsystemd-bus/bus-match.c
index 1411167..916682a 100644
--- a/src/libsystemd-bus/bus-match.c
+++ b/src/libsystemd-bus/bus-match.c
@@ -768,7 +768,7 @@ int bus_match_parse(
}
/* Order the whole thing, so that we always generate the same tree */
- qsort(components, n_components, sizeof(struct bus_match_component), match_component_compare);
+ qsort_safe(components, n_components, sizeof(struct bus_match_component), match_component_compare);
/* Check for duplicates */
for (i = 0; i+1 < n_components; i++)
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index 8146f27..e71d766 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -276,7 +276,7 @@ _public_ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enume
size_t move_later_prefix = 0;
udev_list_cleanup(&udev_enumerate->devices_list);
- qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
+ qsort_safe(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
max = udev_enumerate->devices_cur;
for (i = 0; i < max; i++) {
diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c
index b1ef912..47a41f5 100644
--- a/src/nss-myhostname/netlink.c
+++ b/src/nss-myhostname/netlink.c
@@ -197,7 +197,8 @@ finish:
return r;
}
- qsort(list, n_list, sizeof(struct address), address_compare);
+ if (n_list)
+ qsort(list, n_list, sizeof(struct address), address_compare);
*_list = list;
*_n_list = n_list;
diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c
index 32888ad..6b74866 100644
--- a/src/readahead/readahead-collect.c
+++ b/src/readahead/readahead-collect.c
@@ -536,8 +536,7 @@ done:
HASHMAP_FOREACH_KEY(q, p, files, i)
pack_file(pack, p, on_btrfs);
} else {
- struct item *ordered, *j;
- unsigned k, n;
+ unsigned n;
/* On rotating media, order things by the block
* numbers */
@@ -545,25 +544,31 @@ done:
log_debug("Ordering...");
n = hashmap_size(files);
- if (!(ordered = new(struct item, n))) {
- r = log_oom();
- goto finish;
- }
-
- j = ordered;
- HASHMAP_FOREACH_KEY(q, p, files, i) {
- memcpy(j, q, sizeof(struct item));
- j++;
- }
+ if (n) {
+ _cleanup_free_ struct item *ordered;
+ struct item *j;
+ unsigned k;
+
+ ordered = new(struct item, n);
+ if (!ordered) {
+ r = log_oom();
+ goto finish;
+ }
- assert(ordered + n == j);
+ j = ordered;
+ HASHMAP_FOREACH_KEY(q, p, files, i) {
+ memcpy(j, q, sizeof(struct item));
+ j++;
+ }
- qsort(ordered, n, sizeof(struct item), qsort_compare);
+ assert(ordered + n == j);
- for (k = 0; k < n; k++)
- pack_file(pack, ordered[k].path, on_btrfs);
+ qsort(ordered, n, sizeof(struct item), qsort_compare);
- free(ordered);
+ for (k = 0; k < n; k++)
+ pack_file(pack, ordered[k].path, on_btrfs);
+ } else
+ log_warning("No pack files");
}
log_debug("Finalizing...");
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index e971f36..cc44ab4 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -44,6 +44,8 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi
unsigned i, m, pid_width;
pid_t biggest = 0;
+ assert(n_pids > 0);
+
/* Filter duplicates */
m = 0;
for (i = 0; i < n_pids; i++) {
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 6d99739..ed4070c 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -127,7 +127,7 @@ static int conf_files_list_strv_internal(char ***strv, const char *suffix, const
return -ENOMEM;
}
- qsort(files, hashmap_size(fh), sizeof(char *), base_cmp);
+ qsort_safe(files, hashmap_size(fh), sizeof(char *), base_cmp);
*strv = files;
hashmap_free(fh);
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index c015b16..f3eb6a6 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -384,8 +384,7 @@ int efi_get_boot_options(uint16_t **options) {
list[count ++] = id;
}
- if (list)
- qsort(list, count, sizeof(uint16_t), cmp_uint16);
+ qsort_safe(list, count, sizeof(uint16_t), cmp_uint16);
*options = list;
return count;
diff --git a/src/shared/fileio.c b/src/shared/fileio.c
index 603a1c7..733b320 100644
--- a/src/shared/fileio.c
+++ b/src/shared/fileio.c
@@ -662,6 +662,7 @@ int get_status_field(const char *filename, const char *pattern, char **field) {
int r;
assert(filename);
+ assert(pattern);
assert(field);
r = read_full_file(filename, &status, NULL);
diff --git a/src/shared/util.h b/src/shared/util.h
index 1b845b3..222abe0 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -764,3 +764,15 @@ bool id128_is_valid(const char *s) _pure_;
void parse_user_at_host(char *arg, char **user, char **host);
int split_pair(const char *s, const char *sep, char **l, char **r);
+
+/**
+ * Normal qsort requires base to be nonnull. Here were require
+ * that only if nmemb > 0.
+ */
+static inline void qsort_safe(void *base, size_t nmemb, size_t size,
+ int (*compar)(const void *, const void *)) {
+ if (nmemb) {
+ assert(base);
+ qsort(base, nmemb, size, compar);
+ }
+}
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d75281f..036828b 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -471,7 +471,7 @@ static int list_units(DBusConnection *bus, char **args) {
if (r < 0)
return r;
- qsort(unit_infos, c, sizeof(struct unit_info), compare_unit_info);
+ qsort_safe(unit_infos, c, sizeof(struct unit_info), compare_unit_info);
output_units_list(unit_infos, c);
@@ -733,8 +733,8 @@ static int list_sockets(DBusConnection *bus, char **args) {
listen = triggered = NULL; /* avoid cleanup */
}
- qsort(socket_infos, cs, sizeof(struct socket_info),
- (__compar_fn_t) socket_info_compare);
+ qsort_safe(socket_infos, cs, sizeof(struct socket_info),
+ (__compar_fn_t) socket_info_compare);
output_sockets_list(socket_infos, cs);
@@ -1108,7 +1108,7 @@ static int list_dependencies_one(DBusConnection *bus, const char *name, int leve
if (r < 0)
return r;
- qsort(deps, strv_length(deps), sizeof (char*), list_dependencies_compare);
+ qsort_safe(deps, strv_length(deps), sizeof (char*), list_dependencies_compare);
STRV_FOREACH(c, deps) {
if (strv_contains(u, *c)) {
@@ -3532,7 +3532,7 @@ static int show_all(const char* verb,
if (r < 0)
return r;
- qsort(unit_infos, c, sizeof(struct unit_info), compare_unit_info);
+ qsort_safe(unit_infos, c, sizeof(struct unit_info), compare_unit_info);
for (u = unit_infos; u < unit_infos + c; u++) {
_cleanup_free_ char *p = NULL;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,71 @@
From 65f2e8e1f7a86e62630fd36e34609dc7fc09b474 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 11 Oct 2013 19:33:20 -0400
Subject: [PATCH] dbus-common: avoid leak in error path
src/shared/dbus-common.c:968:33: warning: Potential leak of memory pointed to by 'l'
return -EINVAL;
^~~~~~
---
src/shared/dbus-common.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c
index c727cae..3ba2d87 100644
--- a/src/shared/dbus-common.c
+++ b/src/shared/dbus-common.c
@@ -934,7 +934,7 @@ int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l) {
int bus_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l) {
DBusMessageIter sub, sub2;
unsigned n = 0, i = 0;
- char **l;
+ _cleanup_strv_free_ char **l = NULL;
assert(iter);
assert(_l);
@@ -953,6 +953,7 @@ int bus_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l) {
l = new(char*, n*2+1);
if (!l)
return -ENOMEM;
+ l[0] = NULL; /* make sure that l is properly terminated at all times */
dbus_message_iter_recurse(iter, &sub);
@@ -968,26 +969,25 @@ int bus_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l) {
return -EINVAL;
l[i] = strdup(a);
- if (!l[i]) {
- strv_free(l);
+ if (!l[i])
return -ENOMEM;
- }
+ i++;
- l[++i] = strdup(b);
- if (!l[i]) {
- strv_free(l);
+ l[i] = strdup(b);
+ if (!l[i])
return -ENOMEM;
- }
-
i++;
+
dbus_message_iter_next(&sub);
}
assert(i == n*2);
l[i] = NULL;
- if (_l)
+ if (_l) {
*_l = l;
+ l = NULL; /* avoid freeing */
+ }
return 0;
}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,29 @@
From 187ff3e80b8d6b447e584708d88a1858e154a348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 11 Oct 2013 19:33:36 -0400
Subject: [PATCH] drop-ins: check return value
If the function failed, nothing serious would happen
because unlink would probably return EFAULT, but this
would obscure the real error and is a bit sloppy.
---
src/core/unit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/core/unit.c b/src/core/unit.c
index 4b97710..1db7d06 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2908,6 +2908,9 @@ int unit_remove_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name) {
return 0;
r = drop_in_file(u, mode, name, &p, &q);
+ if (r < 0)
+ return r;
+
if (unlink(q) < 0)
r = errno == ENOENT ? 0 : -errno;
else
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,30 @@
From bb653097a1e0c5c2228cafda144814c42cd05da2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 12 Oct 2013 13:43:07 -0400
Subject: [PATCH] Make sure that we don't dereference NULL
The code was actually safe, because b should
never be null, because if rvalue is empty, a different
branch is taken. But we *do* check for NULL in the
loop above, so it's better to also check here for symmetry.
---
src/core/load-fragment.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 44920d6..f01843d 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1860,7 +1860,8 @@ int config_parse_documentation(const char *unit,
free(*a);
}
}
- *b = NULL;
+ if (b)
+ *b = NULL;
return r;
}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,24 @@
From 8d2f7d0ecc3b949f7f15934f3adb73e812866c59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 12 Oct 2013 19:50:54 -0400
Subject: [PATCH] gitignore: ignore clang --analyze output
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 5b38c0b..56e10a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -162,6 +162,7 @@
*.la
*.lo
*.o
+*.plist
*.stamp
*.pyc
__pycache__/
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,97 @@
From 83a4e0160b3756222b0c8e8d220c5cc07cc76a40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 13 Oct 2013 19:43:19 -0400
Subject: [PATCH] man: add more markup to udevadm(8)
---
man/udevadm.xml | 49 +++++++++++++++++++++++++++++++++----------------
1 file changed, 33 insertions(+), 16 deletions(-)
diff --git a/man/udevadm.xml b/man/udevadm.xml
index b959216..a1ffe42 100644
--- a/man/udevadm.xml
+++ b/man/udevadm.xml
@@ -61,9 +61,10 @@
</refsynopsisdiv>
<refsect1><title>Description</title>
- <para>udevadm expects a command and command specific options. It
- controls the runtime behavior of udev, requests kernel events,
- manages the event queue, and provides simple debugging mechanisms.</para>
+ <para><command>udevadm</command> expects a command and command
+ specific options. It controls the runtime behavior of
+ <command>systemd-udevd</command>, requests kernel events, manages
+ the event queue, and provides simple debugging mechanisms.</para>
</refsect1>
<refsect1><title>OPTIONS</title>
@@ -97,23 +98,37 @@
<varlistentry>
<term><option>--query=<replaceable>type</replaceable></option></term>
<listitem>
- <para>Query the database for specified type of device data. It needs the
- <option>--path</option> or <option>--name</option> to identify the specified
- device. Valid queries are:
- <command>name</command>, <command>symlink</command>, <command>path</command>,
- <command>property</command>, <command>all</command>.</para>
+ <para>Query the database for specified type of device
+ data. It needs the <option>--path</option> or
+ <option>--name</option> to identify the specified
+ device. Valid queries are: <constant>name</constant>,
+ <constant>symlink</constant>, <constant>path</constant>,
+ <constant>property</constant>,
+ <constant>all</constant>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--path=<replaceable>devpath</replaceable></option></term>
<listitem>
- <para>The devpath of the device to query.</para>
+ <para>The <filename>/sys</filename> path of the device to
+ query, e.g.
+ <filename><optional>/sys</optional>/class/block/sda</filename>.
+ Note that this option usually isn't very useful, since
+ <command>udev</command> can guess the type of the
+ argument, so <command>udevadm
+ --devpath=/class/block/sda</command> is equivalent to
+ <command>udevadm /sys/class/block/sda</command>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--name=<replaceable>file</replaceable></option></term>
<listitem>
- <para>The name of the device node or a symlink to query</para>
+ <para>The name of the device node or a symlink to query,
+ e.g. <filename><optional>/dev</optional>/sda</filename>.
+ Note that this option usually isn't very useful, since
+ <command>udev</command> can guess the type of the
+ argument, so <command>udevadm --name=sda</command> is
+ equivalent to <command>udevadm /dev/sda</command>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -462,13 +477,15 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--resolve-names=<replaceable>early|late|never</replaceable></option></term>
+ <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
<listitem>
- <para>Specify when udevadm should resolve names of users and groups.
- When set to early (the default) names will be resolved when the
- rules are parsed. When set to late names will be resolved for
- every event. When set to never names will never be resolved and
- all devices will be owned by root.</para>
+ <para>Specify when udevadm should resolve names of users
+ and groups. When set to <constant>early</constant> (the
+ default) names will be resolved when the rules are
+ parsed. When set to <constant>late</constant> names will
+ be resolved for every event. When set to
+ <constant>never</constant> names will never be resolved
+ and all devices will be owned by root.</para>
</listitem>
</varlistentry>
<varlistentry>
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,28 @@
From 4d2a7145666c91f0ba63dd5c6937b15339b42b0c Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 14 Oct 2013 08:15:51 +0200
Subject: [PATCH] shared/util: Fix glob_extend() argument
glob_extend() would completely fail to work, or return incorrect
data if it wasn't being passed the current getopt "optarg" variable
as it used the global variable, instead of the passed parameters.
---
src/shared/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 748f1bb..6c88040 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4391,7 +4391,7 @@ int glob_extend(char ***strv, const char *path) {
char **p;
errno = 0;
- k = glob(optarg, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
+ k = glob(path, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
if (k == GLOB_NOMATCH)
return -ENOENT;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,38 @@
From ce626319c273383a8f8d1a7d9f549f4d487699ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 14 Oct 2013 19:15:24 -0400
Subject: [PATCH] Fix bad assert in show_pid_array
This function should get the same treatment as other qsort uses
did in 7ff7394 "Never call qsort on potentially NULL arrays".
Reported-by: Oleksii Shevchuk <alxchk@gmail.com>
---
src/shared/cgroup-show.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index cc44ab4..aa0f017 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -44,8 +44,6 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi
unsigned i, m, pid_width;
pid_t biggest = 0;
- assert(n_pids > 0);
-
/* Filter duplicates */
m = 0;
for (i = 0; i < n_pids; i++) {
@@ -65,7 +63,7 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi
pid_width = DECIMAL_STR_WIDTH(biggest);
/* And sort */
- qsort(pids, n_pids, sizeof(pid_t), compare);
+ qsort_safe(pids, n_pids, sizeof(pid_t), compare);
if(flags & OUTPUT_FULL_WIDTH)
n_columns = 0;
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,70 @@
From 90144377494d06804b55b915e1321a2e85a957fe Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Tue, 15 Oct 2013 02:11:56 +0200
Subject: [PATCH] build-sys: libudev - get rid of the needless selinux linking
(again)
---
Makefile.am | 6 +-----
src/libudev/libudev.pc.in | 1 -
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 8d9c587..94d3358 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2141,9 +2141,7 @@ libudev_la_LDFLAGS = \
libudev_la_LIBADD = \
libsystemd-shared.la \
- libsystemd-label.la \
libsystemd-daemon-internal.la \
- $(RT_LIBS) \
libsystemd-id128-internal.la
pkgconfiglib_DATA += \
@@ -2315,7 +2313,6 @@ libudev_core_la_LIBADD = \
libudev-private.la \
libsystemd-label.la \
libsystemd-daemon-internal.la \
- $(RT_LIBS) \
libsystemd-shared.la \
$(BLKID_LIBS) \
$(KMOD_LIBS)
@@ -2377,6 +2374,7 @@ udevadm_SOURCES = \
udevadm_LDADD = \
libudev-core.la \
+ libsystemd-label.la \
libsystemd-shared.la
# Update hwdb on installation. Do not bother if installing
@@ -2704,7 +2702,6 @@ libsystemd_id128_la_LDFLAGS = \
libsystemd_id128_la_LIBADD = \
libsystemd-shared.la \
- libsystemd-label.la \
libsystemd-daemon-internal.la \
$(RT_LIBS)
@@ -2956,7 +2953,6 @@ libsystemd_journal_internal_la_CFLAGS = \
$(AM_CFLAGS)
libsystemd_journal_internal_la_LIBADD = \
- libsystemd-label.la \
libsystemd-audit.la \
libsystemd-daemon.la \
libudev.la \
diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in
index 2b183e9..a0f3f52 100644
--- a/src/libudev/libudev.pc.in
+++ b/src/libudev/libudev.pc.in
@@ -14,5 +14,4 @@ Name: libudev
Description: Library to access udev device information
Version: @VERSION@
Libs: -L${libdir} -ludev
-Libs.private: -lrt
Cflags: -I${includedir}
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,43 @@
From c028fc20a15e274f1bfa0febbc21d5ac5ea84be4 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Tue, 15 Oct 2013 02:26:37 +0200
Subject: [PATCH] build-sys: libsystemd-id128 - get rid of the needless selinux
linking (again)
$ ldd libsystemd-id128.so
linux-vdso.so.1 => (0x00007fffce377000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4de1fc1000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4de1db9000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4de1bb4000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4de17f5000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4de2406000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4de158f000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4de1371000)
$ ldd libsystemd-id128.so
linux-vdso.so.1 => (0x00007fff25187000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f41a3964000)
libc.so.6 => /lib64/libc.so.6 (0x00007f41a35a5000)
/lib64/ld-linux-x86-64.so.2 (0x00007f41a3d89000)
---
Makefile.am | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 94d3358..5382547 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2701,9 +2701,7 @@ libsystemd_id128_la_LDFLAGS = \
-Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
libsystemd_id128_la_LIBADD = \
- libsystemd-shared.la \
- libsystemd-daemon-internal.la \
- $(RT_LIBS)
+ libsystemd-shared.la
libsystemd_id128_internal_la_SOURCES = \
$(libsystemd_id128_la_SOURCES)
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,34 @@
From 7bd470024862982a74c3850686c99ccb29989fae Mon Sep 17 00:00:00 2001
From: Igor Zhbanov <i.zhbanov@samsung.com>
Date: Tue, 15 Oct 2013 14:35:13 +0400
Subject: [PATCH] Fix for SIGSEGV in systemd-bootchart on short-living
processes
The function svg_ps_bars() dereferencess NULL pointer in the line
endtime = ps->last->sampledata->sampletime;
because of partially initialized ps_struct (ps->last == NULL).
If some process terminates between scaning /proc directory in the log_sample()
function and reading additional information from /proc/PID/... files,
the files couldn't be read, the loop will be continued and partially
initialized structure returned.
---
src/bootchart/store.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index f8c97c2..7f86cfe 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -275,7 +275,7 @@ schedstat_next:
pscount++;
/* mark our first sample */
- ps->first = ps->sample;
+ ps->first = ps->last = ps->sample;
ps->sample->runtime = atoll(rt);
ps->sample->waittime = atoll(wt);
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,37 @@
From e31ed70d82d55fd8ed17fee4efe010575ed2ab2e Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 15 Oct 2013 08:58:50 +0200
Subject: [PATCH] man: document the -b special boot option
---
man/kernel-command-line.xml | 1 +
man/systemd.xml | 1 +
2 files changed, 2 insertions(+)
diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index cc267a3..abe68e5 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -123,6 +123,7 @@
</varlistentry>
<varlistentry>
+ <term><varname>-b</varname></term>
<term><varname>emergency</varname></term>
<term><varname>single</varname></term>
<term><varname>s</varname></term>
diff --git a/man/systemd.xml b/man/systemd.xml
index fe6e331..85c06d3 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -1149,6 +1149,7 @@
</varlistentry>
<varlistentry>
+ <term><varname>-b</varname></term>
<term><varname>emergency</varname></term>
<listitem><para>Boot into emergency
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,49 @@
From 8345f2e25909cc24628d99eee6674e8ab7ebdb20 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Tue, 15 Oct 2013 21:13:39 +0200
Subject: [PATCH] logind: allow unprivileged session-device access
The session-device/control API was introduced for unprivileged device
access from within a session. Add the required dbus policy to the default
logind policies.
Note: logind validates that only root and the user of a session can
use the API. Furthermore, only a single API user gets access at a time.
---
src/login/org.freedesktop.login1.conf | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
index 0407609..04e735e 100644
--- a/src/login/org.freedesktop.login1.conf
+++ b/src/login/org.freedesktop.login1.conf
@@ -148,6 +148,26 @@
send_interface="org.freedesktop.login1.Session"
send_member="SetIdleHint"/>
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="TakeControl"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="ReleaseControl"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="TakeDevice"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="ReleaseDevice"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
+ send_member="PauseDeviceComplete"/>
+
<allow receive_sender="org.freedesktop.login1"/>
</policy>
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,35 @@
From 0316e2ae1224abc57cffe8ec54326b4b55b0372e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 16 Oct 2013 02:49:54 +0200
Subject: [PATCH] rules: expose loop block devices to systemd
Since the kernel no longer exposes a large number of "dead" loop devices
it is OK to expose them now in systemd, so let's do that. This has the
benefit that mount dependencies on loop devices start to work.
---
rules/99-systemd.rules.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index bbb7d0c..3c99475 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -11,12 +11,12 @@ SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*", TAG+="systemd"
KERNEL=="vport*", TAG+="systemd"
-SUBSYSTEM=="block", KERNEL!="ram*|loop*", TAG+="systemd"
-SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
+SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd"
+SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
# Ignore encrypted devices with no identified superblock on it, since
# we are probably still calling mke2fs or mkswap on it.
-SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
+SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
# Ignore raid devices that are not yet assembled and started
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,38 @@
From 6e921d55d1a568bc8d6bf59907e673f7f56b9751 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 16 Oct 2013 02:51:24 +0200
Subject: [PATCH] rules: don't limit some of the rules to the "add" action
Devices should show up in systemd regardless whether the user invoked
"udevadm trigger" or not. Before this change some devices might have
suddenly disappeared due issuing that command.
Conflicts:
rules/99-systemd.rules.in
---
rules/99-systemd.rules.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index 3c99475..307f18f 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -53,12 +53,12 @@ ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sy
# Pull in backlight save/restore for all firmware backlight devices
-ACTION=="add", SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@$name.service"
+SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@$name.service"
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
-SUBSYSTEM=="module", KERNEL=="fuse", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount"
-SUBSYSTEM=="module", KERNEL=="configfs", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount"
+SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount"
+SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount"
LABEL="systemd_end"
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,37 @@
From 41d174a74c7c7ebcc5b00fe92ef4647f47551e96 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Thu, 17 Oct 2013 03:20:46 +0200
Subject: [PATCH] tmpfiles: log unaccessible FUSE mount points only as debug
message
---
src/tmpfiles/tmpfiles.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 8122d6a..239e56b 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -275,12 +275,15 @@ static int dir_cleanup(
continue;
if (fstatat(dirfd(d), dent->d_name, &s, AT_SYMLINK_NOFOLLOW) < 0) {
+ if (errno == ENOENT)
+ continue;
- if (errno != ENOENT) {
+ /* FUSE, NFS mounts, SELinux might return EACCES */
+ if (errno == EACCES)
+ log_debug("stat(%s/%s) failed: %m", p, dent->d_name);
+ else
log_error("stat(%s/%s) failed: %m", p, dent->d_name);
- r = -errno;
- }
-
+ r = -errno;
continue;
}
--
1.8.4.652.g0d6e0ce

1632
0050-hwdb-update.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
From 831f4f7266961f481f48da3461b332974c15e9f1 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Mon, 21 Oct 2013 03:49:03 +0200
Subject: [PATCH] rules: remove pointless MODE= settings
Changing the default MODE= for the group accessi, but not specifying
a GROUP= does not provide anything.
It disables the default logic that the mode switches to 0660 as soon
as a GROUP= is specifed, which make custom rules uneccesarily complicated.
https://bugs.freedesktop.org/show_bug.cgi?id=70665
---
rules/50-udev-default.rules | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
index f764789..679dfdf 100644
--- a/rules/50-udev-default.rules
+++ b/rules/50-udev-default.rules
@@ -20,9 +20,7 @@ KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP=
SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
-SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"
-SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640"
-SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0644"
+SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"
SUBSYSTEM=="video4linux", GROUP="video"
SUBSYSTEM=="misc", KERNEL=="agpgart", GROUP="video"
@@ -63,7 +61,7 @@ SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"
SUBSYSTEM=="aoe", GROUP="disk", MODE="0220"
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
-KERNEL=="rfkill", MODE="0644"
+KERNEL=="rfkill", MODE="0664"
KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,36 @@
From 5c56656c5f135dbb6549bd9d662bbb7d238638e2 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Mon, 21 Oct 2013 21:29:23 +0200
Subject: [PATCH] analyze: set white backgound
In programs like eog and gimp the transparant background did not
look very good.
https://bugs.freedesktop.org/show_bug.cgi?id=70720
---
src/analyze/systemd-analyze.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
index a4f15eb..9a69795 100644
--- a/src/analyze/systemd-analyze.c
+++ b/src/analyze/systemd-analyze.c
@@ -507,6 +507,7 @@ static int analyze_plot(DBusConnection *bus) {
/* style sheet */
svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n"
" rect { stroke-width: 1; stroke-opacity: 0; }\n"
+ " rect.background { fill: rgb(255,255,255); }\n"
" rect.activating { fill: rgb(255,0,0); fill-opacity: 0.7; }\n"
" rect.active { fill: rgb(200,150,150); fill-opacity: 0.7; }\n"
" rect.deactivating { fill: rgb(150,100,100); fill-opacity: 0.7; }\n"
@@ -528,6 +529,7 @@ static int analyze_plot(DBusConnection *bus) {
" text.sec { font-size: 10px; }\n"
" ]]>\n </style>\n</defs>\n\n");
+ svg("<rect class=\"background\" width=\"100%%\" height=\"100%%\" />\n");
svg("<text x=\"20\" y=\"50\">%s</text>", pretty_times);
svg("<text x=\"20\" y=\"30\">%s %s (%s %s) %s</text>",
isempty(osname) ? "Linux" : osname,
--
1.8.4.652.g0d6e0ce

View File

@ -0,0 +1,84 @@
From b8cc2a94ad07cf529258ef0dde4002d8e1166f25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 21 Oct 2013 18:53:57 -0400
Subject: [PATCH] shell-completion: dump has moved to systemd-analyze
Rename NO_OPTION to STANDALONE for consistency with other files.
---
shell-completion/bash/systemctl | 2 +-
shell-completion/bash/systemd-analyze | 4 ++--
shell-completion/zsh/_systemctl | 3 +--
shell-completion/zsh/_systemd-analyze | 1 +
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl
index e335ee8..eea4b6d 100644
--- a/shell-completion/bash/systemctl
+++ b/shell-completion/bash/systemctl
@@ -137,7 +137,7 @@ _systemctl () {
[JOBS]='cancel'
[SNAPSHOTS]='delete'
[ENVS]='set-environment unset-environment'
- [STANDALONE]='daemon-reexec daemon-reload default dump
+ [STANDALONE]='daemon-reexec daemon-reload default
emergency exit halt hibernate hybrid-sleep kexec list-jobs
list-sockets list-units list-unit-files poweroff reboot rescue
show-environment suspend get-default'
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 5bd6768..b65466b 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -31,7 +31,7 @@ _systemd_analyze() {
local OPTS='--help --version --system --user --from-pattern --to-pattern --order --require'
local -A VERBS=(
- [NO_OPTION]='time blame plot'
+ [STANDALONE]='time blame plot dump'
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[LOG_LEVEL]='set-log-level'
@@ -55,7 +55,7 @@ _systemd_analyze() {
if [[ -z $verb ]]; then
comps=${VERBS[*]}
- elif __contains_word "$verb" ${VERBS[NO_OPTION]}; then
+ elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
if [[ $cur = -* ]]; then
comps='--help --version --system --user'
fi
diff --git a/shell-completion/zsh/_systemctl b/shell-completion/zsh/_systemctl
index 298e97e..3959cd5 100644
--- a/shell-completion/zsh/_systemctl
+++ b/shell-completion/zsh/_systemctl
@@ -38,7 +38,6 @@
"is-enabled:Check whether unit files are enabled"
"list-jobs:List jobs"
"cancel:Cancel all, one, or more jobs"
- "dump:Dump server status"
"snapshot:Create a snapshot"
"delete:Remove one or more snapshots"
"show-environment:Dump environment"
@@ -264,7 +263,7 @@ done
(( $+functions[_systemctl_link] )) || _systemctl_link() { _files }
# no systemctl completion for:
-# [STANDALONE]='daemon-reexec daemon-reload default dump
+# [STANDALONE]='daemon-reexec daemon-reload default
# emergency exit halt kexec list-jobs list-units
# list-unit-files poweroff reboot rescue show-environment'
# [NAME]='snapshot load'
diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze
index 37c60f5..2eda5fe 100644
--- a/shell-completion/zsh/_systemd-analyze
+++ b/shell-completion/zsh/_systemd-analyze
@@ -15,6 +15,7 @@ _systemd_analyze_command(){
'critical-chain:Print a tree of the time critical chain of units'
'plot:Output SVG graphic showing service initialization'
'dot:Dump dependency graph (in dot(1) format)'
+ 'dump:Dump server status'
'set-log-level:Set systemd log threshold'
)
--
1.8.4.652.g0d6e0ce

View File

@ -16,7 +16,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 208
Release: 2%{?gitcommit:.git%{gitcommit}}%{?dist}
Release: 3%{?gitcommit:.git%{gitcommit}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -36,6 +36,60 @@ Source4: listen.conf
# Prevent accidental removal of the systemd package
Source6: yum-protect-systemd.conf
Patch01: 0001-acpi-fptd-fix-memory-leak-in-acpi_get_boot_usec.patch
Patch02: 0002-fix-lingering-references-to-var-lib-backlight-random.patch
Patch03: 0003-acpi-make-sure-we-never-free-an-uninitialized-pointe.patch
Patch04: 0004-systemctl-fix-name-mangling-for-sysv-units.patch
Patch05: 0005-cryptsetup-fix-OOM-handling-when-parsing-mount-optio.patch
Patch06: 0006-journald-add-missing-error-check.patch
Patch07: 0007-bus-fix-potentially-uninitialized-memory-access.patch
Patch08: 0008-dbus-fix-return-value-of-dispatch_rqueue.patch
Patch09: 0009-modules-load-fix-error-handling.patch
Patch10: 0010-efi-never-call-qsort-on-potentially-NULL-arrays.patch
Patch11: 0011-strv-don-t-access-potentially-NULL-string-arrays.patch
Patch12: 0012-mkdir-pass-a-proper-function-pointer-to-mkdir_safe_i.patch
Patch13: 0013-tmpfiles.d-include-setgid-perms-for-run-log-journal.patch
Patch14: 0014-execute.c-always-set-SHELL.patch
Patch15: 0015-man-Improve-the-description-of-parameter-X-in-tmpfil.patch
Patch16: 0016-execute-more-debugging-messages.patch
Patch17: 0017-gpt-auto-generator-exit-immediately-if-in-container.patch
Patch18: 0018-systemd-order-remote-mounts-from-mountinfo-before-re.patch
Patch19: 0019-manager-when-verifying-whether-clients-may-change-en.patch
Patch20: 0020-logind-fix-bus-introspection-data-for-TakeControl.patch
Patch21: 0021-mount-check-for-NULL-before-reading-pm-what.patch
Patch22: 0022-core-do-not-add-what-to-RequiresMountsFor-for-networ.patch
Patch23: 0023-utf8-fix-utf8_is_printable.patch
Patch24: 0024-shared-util-fix-off-by-one-error-in-tag_to_udev_node.patch
Patch25: 0025-systemd-serialize-deserialize-forbid_restart-value.patch
Patch26: 0026-core-unify-the-way-we-denote-serialization-attribute.patch
Patch27: 0027-journald-fix-minor-memory-leak.patch
Patch28: 0028-keymap-Fix-Samsung-900X-34-C.patch
Patch29: 0029-do-not-accept-garbage-from-acpi-firmware-performance.patch
Patch30: 0030-journald-remove-rotated-file-from-hashmap-when-rotat.patch
Patch31: 0031-login-fix-invalid-free-in-sd_session_get_vt.patch
Patch32: 0032-login-make-sd_session_get_vt-actually-work.patch
Patch33: 0033-udevadm.xml-document-resolve-names-option-for-test.patch
Patch34: 0034-Never-call-qsort-on-potentially-NULL-arrays.patch
Patch35: 0035-dbus-common-avoid-leak-in-error-path.patch
Patch36: 0036-drop-ins-check-return-value.patch
Patch37: 0037-Make-sure-that-we-don-t-dereference-NULL.patch
Patch38: 0038-gitignore-ignore-clang-analyze-output.patch
Patch39: 0039-man-add-more-markup-to-udevadm-8.patch
Patch40: 0040-shared-util-Fix-glob_extend-argument.patch
Patch41: 0041-Fix-bad-assert-in-show_pid_array.patch
Patch42: 0042-build-sys-libudev-get-rid-of-the-needless-selinux-li.patch
Patch43: 0043-build-sys-libsystemd-id128-get-rid-of-the-needless-s.patch
Patch44: 0044-Fix-for-SIGSEGV-in-systemd-bootchart-on-short-living.patch
Patch45: 0045-man-document-the-b-special-boot-option.patch
Patch46: 0046-logind-allow-unprivileged-session-device-access.patch
Patch47: 0047-rules-expose-loop-block-devices-to-systemd.patch
Patch48: 0048-rules-don-t-limit-some-of-the-rules-to-the-add-actio.patch
Patch49: 0049-tmpfiles-log-unaccessible-FUSE-mount-points-only-as-.patch
Patch50: 0050-hwdb-update.patch
Patch51: 0051-rules-remove-pointless-MODE-settings.patch
Patch52: 0052-analyze-set-white-backgound.patch
Patch53: 0053-shell-completion-dump-has-moved-to-systemd-analyze.patch
# kernel-install patch for grubby, drop if grubby is obsolete
Patch1000: kernel-install-grubby.patch
@ -674,6 +728,9 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g
%{_datadir}/systemd/gatewayd
%changelog
* Mon Oct 21 2013 Lennart Poettering <lpoetter@redhat.com - 208-3
- Backport a bunch of fixes and hwdb updates
* Wed Oct 2 2013 Lennart Poettering <lpoetter@redhat.com - 208-2
- Move old random seed and backlight files into the right place