![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community,
here is the log from the commit of package systemd for openSUSE:13.1 checked in at 2013-10-24 14:36:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.1/systemd (Old)
and /work/SRC/openSUSE:13.1/.systemd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd"
Changes:
--------
--- /work/SRC/openSUSE:13.1/systemd/systemd-mini.changes 2013-09-29 17:54:08.000000000 +0200
+++ /work/SRC/openSUSE:13.1/.systemd.new/systemd-mini.changes 2013-10-24 14:36:36.000000000 +0200
@@ -1,0 +2,161 @@
+Tue Oct 15 13:50:52 CEST 2013 - fcrozat@suse.com
+
+- Add
+ 0001-gpt-auto-generator-exit-immediately-if-in-container.patch:
+ don't start gpt auto-generator in container (git).
+- Add
+ 0001-manager-when-verifying-whether-clients-may-change-en.patch:
+ fix reload check in selinux case (git).
+- Add 0001-logind-fix-bus-introspection-data-for-TakeControl.patch:
+ fix introspection for TakeControl (git).
+- Add 0001-mount-check-for-NULL-before-reading-pm-what.patch: fix
+ crash when parsing some incorrect unit (git).
+- Add
+ 0001-shared-util-fix-off-by-one-error-in-tag_to_udev_node.patch:
+ Fix udev rules parsing (git).
+- Add
+ 0001-systemd-serialize-deserialize-forbid_restart-value.patch:
+ Fix incorrect deserialization for forbid_restart (git).
+- Add
+ 0001-core-unify-the-way-we-denote-serialization-attribute.patch:
+ Ensure forbid_restart is named like other attributes (git).
+- Add 0001-journald-fix-minor-memory-leak.patch: fix memleak in
+ journald (git).
+- Add
+ 0001-do-not-accept-garbage-from-acpi-firmware-performance.patch:
+ Improve ACPI firmware performance parsing (git).
+- Add
+ 0001-journald-remove-rotated-file-from-hashmap-when-rotat.patch:
+ Fix journal rotation (git).
+- Add
+ 0001-login-fix-invalid-free-in-sd_session_get_vt.patch:
+ Fix memory corruption in sd_session_get_vt (git).
+- Add 0001-login-make-sd_session_get_vt-actually-work.patch: Ensure
+ sd_session_get_vt returns correct value (git).
+- Add 0001-Never-call-qsort-on-potentially-NULL-arrays.patch: Don't
+ call qsort on NULL arrays (git).
+- Add 0001-dbus-common-avoid-leak-in-error-path.patch: Fix memleak
+ in dbus-common code (git).
+- Add 0001-drop-ins-check-return-value.patch: Fix return value for
+ drop-ins checks (git).
+- Add 0001-shared-util-Fix-glob_extend-argument.patch: Fix
+ glob_extend argument (git).
+- Add 0001-Fix-bad-assert-in-show_pid_array.patch: Fix bad assert
+ in show_pid_array (git).
+
+
+-------------------------------------------------------------------
+Thu Oct 3 08:43:51 UTC 2013 - fcrozat@suse.com
+
+- Add 0001-acpi-fptd-fix-memory-leak-in-acpi_get_boot_usec.patch:
+ fix acpi memleak.
+- Add
+ 0002-fix-lingering-references-to-var-lib-backlight-random.patch:
+ fix invalid path in documentation.
+- Add
+ 0003-acpi-make-sure-we-never-free-an-uninitialized-pointe.patch:
+ fix invalid memory free.
+- Add 0004-systemctl-fix-name-mangling-for-sysv-units.patch: fix
+ name mangling for sysv units.
+- Add
+ 0005-cryptsetup-fix-OOM-handling-when-parsing-mount-optio.patch:
+ fix OOM handling.
+- Add 0006-journald-add-missing-error-check.patch: add missing
+ error check.
+- Add 0007-bus-fix-potentially-uninitialized-memory-access.patch:
+ fix uninitialized memory access.
+- Add 0008-dbus-fix-return-value-of-dispatch_rqueue.patch: fix
+ return value.
+- Add 0009-modules-load-fix-error-handling.patch: fix error
+ handling.
+- Add 0010-efi-never-call-qsort-on-potentially-NULL-arrays.patch:
+ fix incorrect memory access.
+- Add 0011-strv-don-t-access-potentially-NULL-string-arrays.patch:
+ fix incorrect memory access.
+- Add
+ 0012-mkdir-pass-a-proper-function-pointer-to-mkdir_safe_i.patch:
+ fix invalid pointer.
+- Add
+ 0014-tmpfiles.d-include-setgid-perms-for-run-log-journal.patch:
+ fix permission on /run/log/journal.
+- Add
+ 0001-systemd-order-remote-mounts-from-mountinfo-before-re.patch:
+ order remote mount points properly before remote-fs.target.
+
+-------------------------------------------------------------------
+Wed Oct 2 14:10:41 UTC 2013 - hrvoje.senjan@gmail.com
+
+- Explicitly require pam-config for %post of the main package
+
+-------------------------------------------------------------------
+Wed Oct 2 08:03:30 UTC 2013 - fcrozat@suse.com
+
+- Release v208:
+ + logind gained support for facilitating privileged input and drm
+ devices access for unprivileged clients (helps Wayland /
+ kmscon).
+ + New kernel command line luks.options= allows to specify LUKS
+ options, when used with luks.uuid=
+ + tmpfileS.d snippets can uses specifier expansion in path names
+ (%m, %b, %H, %v).
+ + New tmpfiles.d command "m" introduced to change
+ owner/group/access mode of a file/directory only if it exists.
+ + MemorySoftLimit= cgroup settings is no longer supported
+ (underlying kernel cgroup attribute will disappear in the
+ future).
+ + memeory.use_hierarchy cgroup attribute is enabled for all
+ cgroups systemd creates in memory cgroup hierarchy.
+ + New filed _SYSTEMD_SLICE= is logged in journal messages related
+ to a slice.
+ + systemd-journald will no longer adjust the group of journal
+ files it creates to "systemd-journal" group. Permissions and
+ owernship is adjusted when package is upgraded.
+ + Backlight and random seed files are now stored in
+ /var/lib/systemd.
+ + Boot time performance measurements included ACPI 5.0 FPDT
+ informations if available.
+- Drop merged patches:
+ 0001-cgroup-add-the-missing-setting-of-variable-s-value.patch,
+ 0002-cgroup-correct-the-log-information.patch,
+ 0003-cgroup-fix-incorrectly-setting-memory-cgroup.patch,
+ 0004-random-seed-we-should-return-errno-of-failed-loop_wr.patch,
+ 0005-core-cgroup-first-print-then-free.patch,
+ 0006-swap-fix-reverse-dependencies.patch,
+ 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch,
+ 0009-polkit-Avoid-race-condition-in-scraping-proc.patch,
+ Fix-timeout-when-stopping-Type-notify-service.patch,
+ set-ignoreonisolate-noauto-cryptsetup.patch,
+ 0001-Fix-buffer-overrun-when-enumerating-files.patch,
+ 0007-libudev-fix-move_later-comparison.patch.
+- Refresh patches
+ remain_after_exit-initscript-heuristic-and-add-new-LSB-hea.patch,
+ delay-fsck-cryptsetup-after-md-dmraid-lvm-are-started.patch,
+ handle-root_uses_lang-value-in-etc-sysconfig-language.patch,
+ handle-SYSTEMCTL_OPTIONS-environment-variable.patch,
+ Revert-service-drop-support-for-SysV-scripts-for-the-early.patch.
+- Own more ghost files.
+- Do not run pam-config in systemd-mini %post.
+- Add after-local.service to run after.local late during the boot
+ process (bnc#778715).
+
+-------------------------------------------------------------------
+Tue Oct 1 17:09:01 UTC 2013 - fcrozat@suse.com
+
+- Update Fix-timeout-when-stopping-Type-notify-service.patch with
+ upstream fix.
+- No longer start ask-password-wall, was causing too much spam on
+ terminals (bnc#747783).
+
+-------------------------------------------------------------------
+Mon Sep 30 15:42:45 UTC 2013 - fcrozat@suse.com
+
+- Add set-ignoreonisolate-noauto-cryptsetup.patch: ensure noauto
+ encrypted mounts survives runlevel changes (bnc#843085).
+- Add 0001-Fix-buffer-overrun-when-enumerating-files.patch: fix
+ logind crash when /run/systemd/sessions was too big (bnc#840055,
+ initial fix from hpj@suse.com).
+- Update sysctl-handle-boot-sysctl.conf-kernel_release.patch to
+ only check for /boot/sysctl.conf-
From a0551d26ab5c6e0d5089b42a6319baef0e28ad92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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
From 7ff7394d9e4e9189c30fd018235e6b1728c6f2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 78b937b..901e71b 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 2f8be1b..275458c 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -761,7 +761,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 26af5b3..09e556d 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -772,3 +772,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 ++++++ 0001-acpi-fptd-fix-memory-leak-in-acpi_get_boot_usec.patch ++++++
From 7e326fb5b2c1a839bbe7f879c7efa2af2ed33420 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn
Date: Wed, 2 Oct 2013 13:39:49 +0200 Subject: [PATCH 01/15] 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 ++++++ 0001-core-unify-the-way-we-denote-serialization-attribute.patch ++++++
From 8d1a28020409ee4afea6ef8c1c4d3522a209284e Mon Sep 17 00:00:00 2001 From: Lennart Poettering
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 ++++++ 0001-dbus-common-avoid-leak-in-error-path.patch ++++++
From 74dcc2df7b2a340c3e1fe9e61e5c8deb324c83d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 ++++++ 0001-do-not-accept-garbage-from-acpi-firmware-performance.patch ++++++
From 6c7980093c4e39d07bf06484f96f489e236c7c29 Mon Sep 17 00:00:00 2001 From: Kay Sievers
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 ++++++ 0001-drop-ins-check-return-value.patch ++++++
From 6891529fe1176c046ece579807ff48e3191692f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 ++++++ 0001-gpt-auto-generator-exit-immediately-if-in-container.patch ++++++
From 9a5cb1371b6d8b0a04bd08665bcf9b06cb40c64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 ++++++ 0001-journald-fix-minor-memory-leak.patch ++++++
From 2ee0591d12b9e725c4585502285fd91cde682d9b Mon Sep 17 00:00:00 2001 From: Lennart Poettering
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 ++++++ 0001-journald-remove-rotated-file-from-hashmap-when-rotat.patch ++++++
From 2b98f75a63e6022bf74a7d678c47faa5208c794f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 ++++++ 0001-login-fix-invalid-free-in-sd_session_get_vt.patch ++++++
From 3f4fee033bf0f623de74f3e8a14c42b8ff81c36e Mon Sep 17 00:00:00 2001 From: David Herrmann
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 ++++++ 0001-login-make-sd_session_get_vt-actually-work.patch ++++++
From 0581dac2c146cef0f55841a4c136dc48409c8eaa Mon Sep 17 00:00:00 2001 From: David Herrmann
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 ++++++ 0001-logind-fix-bus-introspection-data-for-TakeControl.patch ++++++
From 660ea9620f7b8f99d08a2770d4e81acfd8aea02e Mon Sep 17 00:00:00 2001 From: Lennart Poettering
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 @@
"
From a316932f5a627c1ef78f568fd5dfa579f12e76b2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
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 ++++++ 0001-mount-check-for-NULL-before-reading-pm-what.patch ++++++
From 9c03872bc8fb2a381eafe7301ef9811b641686dd Mon Sep 17 00:00:00 2001 From: Dave Reisner
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 ++++++ 0001-shared-util-Fix-glob_extend-argument.patch ++++++
From a8ccacf5344c4434b1d5ff3837307acb8fcf93d2 Mon Sep 17 00:00:00 2001 From: Bastien Nocera
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 54dbace..1822770 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -4461,7 +4461,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 ++++++ 0001-shared-util-fix-off-by-one-error-in-tag_to_udev_node.patch ++++++
From 1d5989fd803d2019de0f6aaaf3cfb1cb2bbc3cdb Mon Sep 17 00:00:00 2001 From: Dave Reisner
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 82f4221..31cea79 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 ++++++ 0001-systemd-order-remote-mounts-from-mountinfo-before-re.patch ++++++
From 77009452cfd25208509b14ea985e81fdf9f7d40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?=
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 ++++++ 0001-systemd-serialize-deserialize-forbid_restart-value.patch ++++++
From 6aca9a587d4ad40b1c044f99e3714022201b9fd4 Mon Sep 17 00:00:00 2001 From: Sylvia Else
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 ++++++ 0002-fix-lingering-references-to-var-lib-backlight-random.patch ++++++
From 6c8c92fef72cf6a7ef7109a424ef82dbdc4f6952 Mon Sep 17 00:00:00 2001 From: Dave Reisner
Date: Wed, 2 Oct 2013 07:46:24 -0400 Subject: [PATCH 02/15] 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 ++++++ 0003-acpi-make-sure-we-never-free-an-uninitialized-pointe.patch ++++++
From 2c64a8d0caf84254e38f2e76528f2034d37da520 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 14:03:56 +0200 Subject: [PATCH 03/15] 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 ++++++ 0004-systemctl-fix-name-mangling-for-sysv-units.patch ++++++
From cbb13b2a538ece1c7ec3b210e2b36b47df2a13ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?=
Date: Wed, 2 Oct 2013 16:42:42 +0200 Subject: [PATCH 04/15] 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 ++++++ 0005-cryptsetup-fix-OOM-handling-when-parsing-mount-optio.patch ++++++
From 4b93637fd7dddb0a1518f35171998b2c7cd5c5bd Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:36:28 +0200 Subject: [PATCH 05/15] 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 ++++++ 0006-journald-add-missing-error-check.patch ++++++
From 8c92d4bbc7a538ada11d7e85016cce141beb0e6c Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:36:43 +0200 Subject: [PATCH 06/15] 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 ++++++ 0007-bus-fix-potentially-uninitialized-memory-access.patch ++++++
From f5f6e41a9ee008e1632f79ab3fa20beef7c2b613 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:37:11 +0200 Subject: [PATCH 07/15] 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 ++++++ 0008-dbus-fix-return-value-of-dispatch_rqueue.patch ++++++
From 2e8d788c2f90d062f208f8c57a97e7b33cb29f7d Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:37:30 +0200 Subject: [PATCH 08/15] 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 ++++++ 0009-modules-load-fix-error-handling.patch ++++++
From b857193b1def5172e3641ca1d5bc9e08ae81aac4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:37:44 +0200 Subject: [PATCH 09/15] 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 ++++++ 0010-efi-never-call-qsort-on-potentially-NULL-arrays.patch ++++++
From 62678deda2dcd43954bf02f783da01e48c7f8fce Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:38:09 +0200 Subject: [PATCH 10/15] 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 ++++++ 0011-strv-don-t-access-potentially-NULL-string-arrays.patch ++++++
From 5b4fb02d890d5c9777e9a6e798e0b8922a8a9fd8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:38:28 +0200 Subject: [PATCH 11/15] 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 ++++++ 0012-mkdir-pass-a-proper-function-pointer-to-mkdir_safe_i.patch ++++++
From 69c2b6be8fc607412a13cd0ea03a629b4965c816 Mon Sep 17 00:00:00 2001 From: Lennart Poettering
Date: Wed, 2 Oct 2013 19:38:52 +0200 Subject: [PATCH 12/15] 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 ++++++ 0014-tmpfiles.d-include-setgid-perms-for-run-log-journal.patch ++++++
From 7074fecf6747c9a6ad872cc87701481e8bece8b0 Mon Sep 17 00:00:00 2001 From: Dave Reisner
Date: Wed, 2 Oct 2013 15:35:16 -0400 Subject: [PATCH 14/15] 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
++++++ 1009-make-xsltproc-use-correct-ROFF-links.patch ++++++
--- systemd-208/man/custom-man.xsl
+++ systemd-208/man/custom-man.xsl 2013-10-21 09:23:31.030735259 +0000
@@ -61,4 +61,7 @@
xsl:text"
+