From 7f8b3d1d32b1eb4acd2ab02249d2a9d1f40e98dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 3 Jan 2018 15:57:11 +0100 Subject: [PATCH 1/5] man: drop --arch from debootstrap invocation Nowadays people use systemd on many different architectures, so we shouldn't presuppose that they are using amd64. debootstrap defaults to the native architecture and this should be good enough. --- man/systemd-nspawn.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index b3f8eb6518..ac19e5e7de 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -1114,7 +1114,7 @@ Spawn a shell in a container of a minimal Debian unstable distribution - # debootstrap --arch=amd64 unstable ~/debian-tree/ + # debootstrap unstable ~/debian-tree/ # systemd-nspawn -D ~/debian-tree/ This installs a minimal Debian unstable distribution into From 85f8fa4dee425679cdc0ec618855e4b8edc82d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Jan 2018 11:11:16 +0100 Subject: [PATCH 2/5] test-sizeof: also add uid_t We had gid_t, and pid_t, but not uid_t. Add for completeness. --- src/test/test-sizeof.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c index f472edcfa1..cc07dc3634 100644 --- a/src/test/test-sizeof.c +++ b/src/test/test-sizeof.c @@ -62,6 +62,7 @@ int main(void) { info(usec_t); info(__time_t); info(pid_t); + info(uid_t); info(gid_t); info(enum Enum); From 1893972894c197c1ac5999f8f555749bb673c262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Jan 2018 11:12:57 +0100 Subject: [PATCH 3/5] run: double free Introduced in f2b9f2c83e5b4035b22eb2f610531fce275bf55f. CID #1384218. --- src/run/run.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/run/run.c b/src/run/run.c index b018d1547e..0ff8db6b3e 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -120,7 +120,7 @@ static void help(void) { } static int add_timer_property(const char *name, const char *val) { - _cleanup_free_ char *p = NULL; + char *p; assert(name); assert(val); @@ -132,8 +132,6 @@ static int add_timer_property(const char *name, const char *val) { if (strv_consume(&arg_timer_property, p) < 0) return log_oom(); - p = NULL; - return 0; } From 1330648562c6924f846b869cc40125776fcd4e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Jan 2018 11:19:55 +0100 Subject: [PATCH 4/5] core: double free in bus_timer_set_transient_property Introduced in 3e3c5a4571d. CID #1384233. --- src/core/dbus-timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 900ed369dd..1eedf217fe 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -373,10 +373,8 @@ static int bus_timer_set_transient_property( unit_write_settingf(u, flags|UNIT_ESCAPE_SPECIFIERS, name, "%s=%s", name, str); v = new0(TimerValue, 1); - if (!v) { - calendar_spec_free(c); + if (!v) return -ENOMEM; - } v->base = TIMER_CALENDAR; v->calendar_spec = c; From 97149f405c69914919c510d08a09de0c3f4716cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Jan 2018 11:29:36 +0100 Subject: [PATCH 5/5] core: fix mac_selinux_setup return value check Introduced in 74da609f0d0f9112047dd746188469df3692ad4a. CID #1384210. --- src/core/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/main.c b/src/core/main.c index 66c2101b24..3fe4a173fe 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2182,7 +2182,7 @@ static int initialize_security( dual_timestamp_get(security_start_timestamp); - r = mac_selinux_setup(loaded_policy) < 0; + r = mac_selinux_setup(loaded_policy); if (r < 0) { *ret_error_message = "Failed to load SELinux policy"; return r;