diff options
Diffstat (limited to 'core/systemd')
16 files changed, 819 insertions, 1 deletions
diff --git a/core/systemd/0001-login-fix-pos-array-allocation.patch b/core/systemd/0001-login-fix-pos-array-allocation.patch new file mode 100644 index 000000000..531f7982d --- /dev/null +++ b/core/systemd/0001-login-fix-pos-array-allocation.patch @@ -0,0 +1,52 @@ +From a1937e679f76758635d295287398abe526de2522 Mon Sep 17 00:00:00 2001 +From: David Herrmann <dh.herrmann@gmail.com> +Date: Tue, 25 Feb 2014 12:20:25 +0100 +Subject: [PATCH] login: fix pos-array allocation + +GREEDY_REALLOC takes a pointer to the real size, not the array-width as +argument. Therefore, our array is currently way to small to keep the seat +positions. + +Introduce GREEDY_REALLOC0_T() as typed version of GREEDY_REALLOC and store +the array-width instead of array-size. +--- + src/login/logind-seat.c | 2 +- + src/shared/util.h | 9 +++++++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c +index 631be5f..36ec7ed 100644 +--- a/src/login/logind-seat.c ++++ b/src/login/logind-seat.c +@@ -475,7 +475,7 @@ void seat_claim_position(Seat *s, Session *session, unsigned int pos) { + if (seat_has_vts(s)) + pos = session->vtnr; + +- if (!GREEDY_REALLOC0(s->positions, s->position_count, pos + 1)) ++ if (!GREEDY_REALLOC0_T(s->positions, s->position_count, pos + 1)) + return; + + seat_evict_position(s, session); +diff --git a/src/shared/util.h b/src/shared/util.h +index 9913fce..78b1444 100644 +--- a/src/shared/util.h ++++ b/src/shared/util.h +@@ -723,6 +723,15 @@ void* greedy_realloc0(void **p, size_t *allocated, size_t need); + #define GREEDY_REALLOC0(array, allocated, need) \ + greedy_realloc0((void**) &(array), &(allocated), sizeof((array)[0]) * (need)) + ++#define GREEDY_REALLOC0_T(array, count, need) \ ++ ({ \ ++ size_t _size = (count) * sizeof((array)[0]); \ ++ void *_ptr = GREEDY_REALLOC0((array), _size, (need)); \ ++ if (_ptr) \ ++ (count) = _size / sizeof((array)[0]); \ ++ _ptr; \ ++ }) ++ + static inline void _reset_errno_(int *saved_errno) { + errno = *saved_errno; + } +-- +1.9.0 + diff --git a/core/systemd/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch b/core/systemd/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch new file mode 100644 index 000000000..f499ed2c0 --- /dev/null +++ b/core/systemd/0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch @@ -0,0 +1,52 @@ +From 3e6b205f81e743c7354ccbc69eb45afbdbebe2dc Mon Sep 17 00:00:00 2001 +From: David Herrmann <dh.herrmann@gmail.com> +Date: Tue, 25 Feb 2014 13:08:24 +0100 +Subject: [PATCH] login: set pos-slot to fallback on pos-eviction + +If we evict a session position, we open the position slot for future +sessions. However, there might already be another session on the same +position if both were started on the same VT. This is currently done if +gdm spawns the session on its own Xserver. + +Hence, look for such a session on pos-eviction and claim the new slot +immediately. +--- + src/login/logind-seat.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c +index 36ec7ed..96cf08e 100644 +--- a/src/login/logind-seat.c ++++ b/src/login/logind-seat.c +@@ -459,6 +459,7 @@ int seat_stop_sessions(Seat *s, bool force) { + } + + void seat_evict_position(Seat *s, Session *session) { ++ Session *iter; + unsigned int pos = session->pos; + + session->pos = 0; +@@ -466,8 +467,19 @@ void seat_evict_position(Seat *s, Session *session) { + if (!pos) + return; + +- if (pos < s->position_count && s->positions[pos] == session) ++ if (pos < s->position_count && s->positions[pos] == session) { + s->positions[pos] = NULL; ++ ++ /* There might be another session claiming the same ++ * position (eg., during gdm->session transition), so lets look ++ * for it and set it on the free slot. */ ++ LIST_FOREACH(sessions_by_seat, iter, s->sessions) { ++ if (iter->pos == pos) { ++ s->positions[pos] = iter; ++ break; ++ } ++ } ++ } + } + + void seat_claim_position(Seat *s, Session *session, unsigned int pos) { +-- +1.9.0 + diff --git a/core/systemd/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch b/core/systemd/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch new file mode 100644 index 000000000..0745eb323 --- /dev/null +++ b/core/systemd/0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch @@ -0,0 +1,35 @@ +From 9c413373d2112055a0142ef522bf95af9b491b4a Mon Sep 17 00:00:00 2001 +From: "Jasper St. Pierre" <jstpierre@mecheye.net> +Date: Fri, 21 Feb 2014 18:23:17 -0500 +Subject: [PATCH] login: Allow calling org.freedesktop.login1.Seat.SwitchTo + +--- + src/login/org.freedesktop.login1.conf | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf +index d677f61..1318328 100644 +--- a/src/login/org.freedesktop.login1.conf ++++ b/src/login/org.freedesktop.login1.conf +@@ -141,6 +141,18 @@ + send_member="ActivateSession"/> + + <allow send_destination="org.freedesktop.login1" ++ send_interface="org.freedesktop.login1.Seat" ++ send_member="SwitchTo"/> ++ ++ <allow send_destination="org.freedesktop.login1" ++ send_interface="org.freedesktop.login1.Seat" ++ send_member="SwitchToPrevious"/> ++ ++ <allow send_destination="org.freedesktop.login1" ++ send_interface="org.freedesktop.login1.Seat" ++ send_member="SwitchToNext"/> ++ ++ <allow send_destination="org.freedesktop.login1" + send_interface="org.freedesktop.login1.Session" + send_member="Activate"/> + +-- +1.9.0 + diff --git a/core/systemd/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch b/core/systemd/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch new file mode 100644 index 000000000..318f3ec27 --- /dev/null +++ b/core/systemd/0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch @@ -0,0 +1,22 @@ +From b3e4387351c835766f96796a20d94971afea7d3b Mon Sep 17 00:00:00 2001 +From: Tomasz Torcz <tomek@pipebreaker.pl> +Date: Tue, 25 Feb 2014 12:43:55 +0100 +Subject: [PATCH] fix typo in iDRAC network interface name: irdac->idrac + +--- + hwdb/20-net-ifname.hwdb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hwdb/20-net-ifname.hwdb b/hwdb/20-net-ifname.hwdb +index 29d2633..2408dc1 100644 +--- a/hwdb/20-net-ifname.hwdb ++++ b/hwdb/20-net-ifname.hwdb +@@ -2,4 +2,4 @@ + + # Dell iDRAC Virtual USB NIC + usb:v413CpA102* +- ID_NET_NAME_FROM_DATABASE=irdac ++ ID_NET_NAME_FROM_DATABASE=idrac +-- +1.9.0 + diff --git a/core/systemd/0007-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch b/core/systemd/0007-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch new file mode 100644 index 000000000..420d24e58 --- /dev/null +++ b/core/systemd/0007-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch @@ -0,0 +1,70 @@ +From ff5f34d08c191c326c41a083745522383ac86cae Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <lennart@poettering.net> +Date: Wed, 26 Feb 2014 04:27:50 +0100 +Subject: [PATCH] mount: don't send out PropertiesChanged message if actually + nothing got changed + +--- + src/core/mount.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index b35e507..98812c9 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -1390,7 +1390,7 @@ static int mount_add_one( + _cleanup_free_ char *e = NULL, *w = NULL, *o = NULL, *f = NULL; + bool load_extras = false; + MountParameters *p; +- bool delete; ++ bool delete, changed = false; + Unit *u; + int r; + +@@ -1458,6 +1458,7 @@ static int mount_add_one( + } + + unit_add_to_load_queue(u); ++ changed = true; + } else { + delete = false; + +@@ -1476,6 +1477,7 @@ static int mount_add_one( + /* Load in the extras later on, after we + * finished initialization of the unit */ + load_extras = true; ++ changed = true; + } + } + +@@ -1488,10 +1490,16 @@ static int mount_add_one( + } + + p = &MOUNT(u)->parameters_proc_self_mountinfo; ++ ++ changed = changed || ++ !streq_ptr(p->options, options) || ++ !streq_ptr(p->what, what) || ++ !streq_ptr(p->fstype, fstype); ++ + if (set_flags) { + MOUNT(u)->is_mounted = true; + MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo; +- MOUNT(u)->just_changed = !streq_ptr(p->options, o); ++ MOUNT(u)->just_changed = changed; + } + + MOUNT(u)->from_proc_self_mountinfo = true; +@@ -1514,7 +1522,8 @@ static int mount_add_one( + goto fail; + } + +- unit_add_to_dbus_queue(u); ++ if (changed) ++ unit_add_to_dbus_queue(u); + + return 0; + +-- +1.9.0 + diff --git a/core/systemd/0008-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch b/core/systemd/0008-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch new file mode 100644 index 000000000..f0f6ffe09 --- /dev/null +++ b/core/systemd/0008-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch @@ -0,0 +1,51 @@ +From aef831369cd2a7a1bd4a58dd96ff8628ed6a85f9 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <lennart@poettering.net> +Date: Wed, 26 Feb 2014 04:28:37 +0100 +Subject: [PATCH] mount: don't fire PropertiesChanged signals for mounts that + are stopped + +--- + src/core/mount.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index 98812c9..7a92e1c 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -1679,20 +1679,20 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, + Mount *mount = MOUNT(u); + + if (!mount->is_mounted) { +- /* This has just been unmounted. */ + + mount->from_proc_self_mountinfo = false; + + switch (mount->state) { + + case MOUNT_MOUNTED: ++ /* This has just been unmounted by ++ * somebody else, follow the state ++ * change. */ + mount_enter_dead(mount, MOUNT_SUCCESS); + break; + + default: +- mount_set_state(mount, mount->state); + break; +- + } + + } else if (mount->just_mounted || mount->just_changed) { +@@ -1703,6 +1703,9 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents, + + case MOUNT_DEAD: + case MOUNT_FAILED: ++ /* This has just been mounted by ++ * somebody else, follow the state ++ * change. */ + mount_enter_mounted(mount, MOUNT_SUCCESS); + break; + +-- +1.9.0 + diff --git a/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch b/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch new file mode 100644 index 000000000..d64fe89cc --- /dev/null +++ b/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch @@ -0,0 +1,41 @@ +From 47d80904a1f72d559962cc5ad32fffd46672a34a Mon Sep 17 00:00:00 2001 +From: Uoti Urpala <uoti.urpala@pp1.inet.fi> +Date: Thu, 20 Feb 2014 03:00:09 +0200 +Subject: [PATCH] logs-show: fix corrupt output with empty messages + +If a message had zero length, journalctl would print no newline, and +two output lines would be concatenated. Fix. The problem was +introduced in commit 31f7bf199452 ("logs-show: print multiline +messages"). Affected short and verbose output modes. + +Before fix: + +Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit + +after: + +Feb 09 21:16:17 glyph dhclient[1323]: +Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit +--- + src/shared/logs-show.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c +index 61c3652..12d4a1c 100644 +--- a/src/shared/logs-show.c ++++ b/src/shared/logs-show.c +@@ -124,6 +124,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output + } + } + ++ /* A special case: make sure that we print a newline when ++ the message is empty. */ ++ if (message_len == 0) ++ fputs("\n", f); ++ + for (pos = message; + pos < message + message_len; + pos = end + 1, line++) { +-- +1.9.0 + diff --git a/core/systemd/0010-journalctl-refuse-extra-arguments-with-verify-and-si.patch b/core/systemd/0010-journalctl-refuse-extra-arguments-with-verify-and-si.patch new file mode 100644 index 000000000..259e1e3d4 --- /dev/null +++ b/core/systemd/0010-journalctl-refuse-extra-arguments-with-verify-and-si.patch @@ -0,0 +1,30 @@ +From 0b6b7c2004317da48e5bbd3078c5662d8f0061b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> +Date: Wed, 26 Feb 2014 23:01:43 -0500 +Subject: [PATCH] journalctl: refuse extra arguments with --verify and similar + +Positional arguments only make sense with the default action. +For other actions, complain instead of ignoring them silently. +--- + src/journal/journalctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c +index a328ba1..0619b25 100644 +--- a/src/journal/journalctl.c ++++ b/src/journal/journalctl.c +@@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) { + return -EINVAL; + } + ++ if (arg_action != ACTION_SHOW && optind < argc) { ++ log_error("Extraneous arguments starting with '%s'", argv[optind]); ++ return -EINVAL; ++ } ++ + return 1; + } + +-- +1.9.0 + diff --git a/core/systemd/0011-cdrom_id-use-the-old-MMC-fallback.patch b/core/systemd/0011-cdrom_id-use-the-old-MMC-fallback.patch new file mode 100644 index 000000000..793e63835 --- /dev/null +++ b/core/systemd/0011-cdrom_id-use-the-old-MMC-fallback.patch @@ -0,0 +1,54 @@ +From a14f14976094650e17d39f3a7d15a1c68c93c333 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn <lnykryn@redhat.com> +Date: Thu, 27 Feb 2014 11:06:37 +0100 +Subject: [PATCH] cdrom_id: use the old MMC fallback + +https://bugzilla.redhat.com/show_bug.cgi?id=1038015 +The problem seems to be that the your virtual DVD is emulating a really +old DVD device, and doing it kind of strangely. + +> dracut:# /lib/udev/cdrom_id --debug /dev/sr0 +> probing: '/dev/sr0' +> INQUIRY: [IMM ][Virtual CD/DVD ][0316] +> GET CONFIGURATION failed with SK=5h/ASC=24h/ACQ=00h + +So your virtual drive rejects the GET CONFIGURATION command as illegal. + +Other pre-MMC2 drives that don't accept this command usually return the +error +SK=5h,ASC=20h (invalid/unsupported command code), in which case cdrom_id +tries an older method, and then ID_CDROM_MEDIA_TRACK_COUNT_DATA gets set +and all the /dev/disk/by-label (etc) links get set up. + +The virtual drive returns the error SK=5h,ASC=24h (invalid field in +Command Descriptor Block), which cdrom_id doesn't handle, so it gives up +and the links never get made. + +The ideal solution would be to make the IMM to emulate a device that's +less than 15 years old, but I'm not going to hold my breath waiting for +that. + +So probably cdrom_id should also use the old MMC fallback when the error +is SK=5h,ASC=24h, and then all of this would work as expected. + +Suggested-by:Luca Miccini <lmiccini@redhat.com> +--- + src/udev/cdrom_id/cdrom_id.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c +index 93467c2..33b2bc3 100644 +--- a/src/udev/cdrom_id/cdrom_id.c ++++ b/src/udev/cdrom_id/cdrom_id.c +@@ -556,7 +556,7 @@ static int cd_profiles(struct udev *udev, int fd) + if ((err != 0)) { + info_scsi_cmd_err(udev, "GET CONFIGURATION", err); + /* handle pre-MMC2 drives which do not support GET CONFIGURATION */ +- if (SK(err) == 0x5 && ASC(err) == 0x20) { ++ if (SK(err) == 0x5 && (ASC(err) == 0x20 || ASC(err) == 0x24)) { + log_debug("drive is pre-MMC2 and does not support 46h get configuration command"); + log_debug("trying to work around the problem"); + ret = cd_profiles_old_mmc(udev, fd); +-- +1.9.0 + diff --git a/core/systemd/0012-nspawn-fix-detection-of-missing-proc-self-loginuid.patch b/core/systemd/0012-nspawn-fix-detection-of-missing-proc-self-loginuid.patch new file mode 100644 index 000000000..beebbb631 --- /dev/null +++ b/core/systemd/0012-nspawn-fix-detection-of-missing-proc-self-loginuid.patch @@ -0,0 +1,31 @@ +From 13e8ceb84e56907d73b6b07418deb37faaf0e66d Mon Sep 17 00:00:00 2001 +From: Tero Roponen <tero.roponen@gmail.com> +Date: Tue, 25 Feb 2014 17:19:35 +0200 +Subject: [PATCH] nspawn: fix detection of missing /proc/self/loginuid + +Running 'systemd-nspawn -D /srv/Fedora/' gave me this error: + Failed to read /proc/self/loginuid: No such file or directory + + Container Fedora failed with error code 1. + +This patch fixes the problem. +--- + src/nspawn/nspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index 1fe641b..92b6728 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -1349,7 +1349,7 @@ static int reset_audit_loginuid(void) { + return 0; + + r = read_one_line_file("/proc/self/loginuid", &p); +- if (r == -EEXIST) ++ if (r == -ENOENT) + return 0; + if (r < 0) { + log_error("Failed to read /proc/self/loginuid: %s", strerror(-r)); +-- +1.9.0 + diff --git a/core/systemd/0013-Fix-systemd-stdio-bridge-symlink.patch b/core/systemd/0013-Fix-systemd-stdio-bridge-symlink.patch new file mode 100644 index 000000000..efad81a2a --- /dev/null +++ b/core/systemd/0013-Fix-systemd-stdio-bridge-symlink.patch @@ -0,0 +1,28 @@ +From 8100c1a8f58b2fb5d97e156420a7e16562e93bc4 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sun, 2 Mar 2014 23:37:39 -0500 +Subject: [PATCH] Fix systemd-stdio-bridge symlink + +The symlink is created in bindir (/usr/bin), and points to a binary +which lives in rootlibexecdir (/lib/systemd or /usr/lib/systemd). A +relative symlink does not work here. +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 38445fb..e7134a2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1978,7 +1978,7 @@ systemd_bus_proxyd_LDADD = \ + + bus-proxyd-install-hook: + $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) +- $(AM_V_LN)$(LN_S) -f ../lib/systemd/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge ++ $(AM_V_LN)$(LN_S) -f $(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge + + bus-proxyd-uninstall-hook: + rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge +-- +1.9.0 + diff --git a/core/systemd/0014-execute-free-directory-path-if-we-fail-to-remove-it-.patch b/core/systemd/0014-execute-free-directory-path-if-we-fail-to-remove-it-.patch new file mode 100644 index 000000000..4a48353a4 --- /dev/null +++ b/core/systemd/0014-execute-free-directory-path-if-we-fail-to-remove-it-.patch @@ -0,0 +1,54 @@ +From 98b47d54ce946ad3524f84eb38d2413498a333dc Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <lennart@poettering.net> +Date: Mon, 3 Mar 2014 17:11:39 +0100 +Subject: [PATCH] execute: free directory path if we fail to remove it because + we cannot allocate a thread + +--- + src/core/execute.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/src/core/execute.c b/src/core/execute.c +index 9de6e87..3312885 100644 +--- a/src/core/execute.c ++++ b/src/core/execute.c +@@ -2713,6 +2713,8 @@ static void *remove_tmpdir_thread(void *p) { + } + + void exec_runtime_destroy(ExecRuntime *rt) { ++ int r; ++ + if (!rt) + return; + +@@ -2722,13 +2724,25 @@ void exec_runtime_destroy(ExecRuntime *rt) { + + if (rt->tmp_dir) { + log_debug("Spawning thread to nuke %s", rt->tmp_dir); +- asynchronous_job(remove_tmpdir_thread, rt->tmp_dir); ++ ++ r = asynchronous_job(remove_tmpdir_thread, rt->tmp_dir); ++ if (r < 0) { ++ log_warning("Failed to nuke %s: %s", rt->tmp_dir, strerror(-r)); ++ free(rt->tmp_dir); ++ } ++ + rt->tmp_dir = NULL; + } + + if (rt->var_tmp_dir) { + log_debug("Spawning thread to nuke %s", rt->var_tmp_dir); +- asynchronous_job(remove_tmpdir_thread, rt->var_tmp_dir); ++ ++ r = asynchronous_job(remove_tmpdir_thread, rt->var_tmp_dir); ++ if (r < 0) { ++ log_warning("Failed to nuke %s: %s", rt->var_tmp_dir, strerror(-r)); ++ free(rt->var_tmp_dir); ++ } ++ + rt->var_tmp_dir = NULL; + } + +-- +1.9.0 + diff --git a/core/systemd/0015-journal-assume-that-next-entry-is-after-previous-ent.patch b/core/systemd/0015-journal-assume-that-next-entry-is-after-previous-ent.patch new file mode 100644 index 000000000..0c3b014c9 --- /dev/null +++ b/core/systemd/0015-journal-assume-that-next-entry-is-after-previous-ent.patch @@ -0,0 +1,70 @@ +From fb099c8d2af6620db2709e826a258089d10cdfe8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> +Date: Thu, 27 Feb 2014 00:07:29 -0500 +Subject: [PATCH] journal: assume that next entry is after previous entry + +With a corrupted file, we can get in a situation where two entries +in the entry array point to the same object. Then journal_file_next_entry +will find the first one using generic_arrray_bisect, and try to move to +the second one, but since the address is the same, generic_array_get will +return the first one. journal_file_next_entry ends up in an infinite loop. + +https://bugzilla.redhat.com/show_bug.cgi?id=1047039 +--- + src/journal/journal-file.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c +index 5876733..0e1fc7f 100644 +--- a/src/journal/journal-file.c ++++ b/src/journal/journal-file.c +@@ -1359,7 +1359,7 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st + } + + typedef struct ChainCacheItem { +- uint64_t first; /* the array at the begin of the chain */ ++ uint64_t first; /* the array at the beginning of the chain */ + uint64_t array; /* the cached array */ + uint64_t begin; /* the first item in the cached array */ + uint64_t total; /* the total number of items in all arrays before this one in the chain */ +@@ -1945,7 +1945,7 @@ int journal_file_next_entry( + direction_t direction, + Object **ret, uint64_t *offset) { + +- uint64_t i, n; ++ uint64_t i, n, ofs; + int r; + + assert(f); +@@ -1986,10 +1986,24 @@ int journal_file_next_entry( + } + + /* And jump to it */ +- return generic_array_get(f, +- le64toh(f->header->entry_array_offset), +- i, +- ret, offset); ++ r = generic_array_get(f, ++ le64toh(f->header->entry_array_offset), ++ i, ++ ret, &ofs); ++ if (r <= 0) ++ return r; ++ ++ if (p > 0 && ++ (direction == DIRECTION_DOWN ? ofs <= p : ofs >= p)) { ++ log_debug("%s: entry array corrupted at entry %"PRIu64, ++ f->path, i); ++ return -EBADMSG; ++ } ++ ++ if (offset) ++ *offset = ofs; ++ ++ return 1; + } + + int journal_file_skip_entry( +-- +1.9.0 + diff --git a/core/systemd/0016-journal-forget-file-after-encountering-an-error.patch b/core/systemd/0016-journal-forget-file-after-encountering-an-error.patch new file mode 100644 index 000000000..e82f052e9 --- /dev/null +++ b/core/systemd/0016-journal-forget-file-after-encountering-an-error.patch @@ -0,0 +1,74 @@ +From a9a245c128af6c0418085062c60251bc51fa4a94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> +Date: Thu, 27 Feb 2014 00:11:54 -0500 +Subject: [PATCH] journal: forget file after encountering an error + +If we encounter an inconsistency in a file, let's just +ignore it. Otherwise, after previous patch, we would try, +and fail, to use this file in every invocation of sd_journal_next +or sd_journal_previous that happens afterwards. +--- + src/journal/sd-journal.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c +index ef455e9..b54bc21 100644 +--- a/src/journal/sd-journal.c ++++ b/src/journal/sd-journal.c +@@ -51,6 +51,8 @@ + + #define DEFAULT_DATA_THRESHOLD (64*1024) + ++static void remove_file_real(sd_journal *j, JournalFile *f); ++ + static bool journal_pid_changed(sd_journal *j) { + assert(j); + +@@ -885,6 +887,7 @@ static int real_journal_next(sd_journal *j, direction_t direction) { + r = next_beyond_location(j, f, direction, &o, &p); + if (r < 0) { + log_debug("Can't iterate through %s, ignoring: %s", f->path, strerror(-r)); ++ remove_file_real(j, f); + continue; + } else if (r == 0) + continue; +@@ -1339,7 +1342,7 @@ static int add_file(sd_journal *j, const char *prefix, const char *filename) { + } + + static int remove_file(sd_journal *j, const char *prefix, const char *filename) { +- char *path; ++ _cleanup_free_ char *path; + JournalFile *f; + + assert(j); +@@ -1351,10 +1354,17 @@ static int remove_file(sd_journal *j, const char *prefix, const char *filename) + return -ENOMEM; + + f = hashmap_get(j->files, path); +- free(path); + if (!f) + return 0; + ++ remove_file_real(j, f); ++ return 0; ++} ++ ++static void remove_file_real(sd_journal *j, JournalFile *f) { ++ assert(j); ++ assert(f); ++ + hashmap_remove(j->files, f->path); + + log_debug("File %s removed.", f->path); +@@ -1372,8 +1382,6 @@ static int remove_file(sd_journal *j, const char *prefix, const char *filename) + journal_file_close(f); + + j->current_invalidate_counter ++; +- +- return 0; + } + + static int add_directory(sd_journal *j, const char *prefix, const char *dirname) { +-- +1.9.0 + diff --git a/core/systemd/0017-core-correctly-unregister-PIDs-from-PID-hashtables.patch b/core/systemd/0017-core-correctly-unregister-PIDs-from-PID-hashtables.patch new file mode 100644 index 000000000..209a3fb75 --- /dev/null +++ b/core/systemd/0017-core-correctly-unregister-PIDs-from-PID-hashtables.patch @@ -0,0 +1,102 @@ +From bd44e61b0480712ec5585ff7b0295362a5f9dd36 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering <lennart@poettering.net> +Date: Thu, 6 Mar 2014 02:19:42 +0100 +Subject: [PATCH] core: correctly unregister PIDs from PID hashtables + +--- + src/core/unit.c | 42 ++++++++++++++++++------------------------ + 1 file changed, 18 insertions(+), 24 deletions(-) + +diff --git a/src/core/unit.c b/src/core/unit.c +index 2437ee3..85250ca 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -1704,11 +1704,11 @@ int unit_watch_pid(Unit *u, pid_t pid) { + /* Watch a specific PID. We only support one or two units + * watching each PID for now, not more. */ + +- r = hashmap_ensure_allocated(&u->manager->watch_pids1, trivial_hash_func, trivial_compare_func); ++ r = set_ensure_allocated(&u->pids, trivial_hash_func, trivial_compare_func); + if (r < 0) + return r; + +- r = set_ensure_allocated(&u->pids, trivial_hash_func, trivial_compare_func); ++ r = hashmap_ensure_allocated(&u->manager->watch_pids1, trivial_hash_func, trivial_compare_func); + if (r < 0) + return r; + +@@ -1737,7 +1737,17 @@ void unit_unwatch_pid(Unit *u, pid_t pid) { + set_remove(u->pids, LONG_TO_PTR(pid)); + } + +-static int watch_pids_in_path(Unit *u, const char *path) { ++void unit_unwatch_all_pids(Unit *u) { ++ assert(u); ++ ++ while (!set_isempty(u->pids)) ++ unit_unwatch_pid(u, PTR_TO_LONG(set_first(u->pids))); ++ ++ set_free(u->pids); ++ u->pids = NULL; ++} ++ ++static int unit_watch_pids_in_path(Unit *u, const char *path) { + _cleanup_closedir_ DIR *d = NULL; + _cleanup_fclose_ FILE *f = NULL; + int ret = 0, r; +@@ -1775,7 +1785,7 @@ static int watch_pids_in_path(Unit *u, const char *path) { + if (!p) + return -ENOMEM; + +- r = watch_pids_in_path(u, p); ++ r = unit_watch_pids_in_path(u, p); + if (r < 0 && ret >= 0) + ret = r; + } +@@ -1788,31 +1798,15 @@ static int watch_pids_in_path(Unit *u, const char *path) { + return ret; + } + +- + int unit_watch_all_pids(Unit *u) { + assert(u); + +- if (!u->cgroup_path) +- return -ENOENT; +- + /* Adds all PIDs from our cgroup to the set of PIDs we watch */ + +- return watch_pids_in_path(u, u->cgroup_path); +-} +- +-void unit_unwatch_all_pids(Unit *u) { +- Iterator i; +- void *e; +- +- assert(u); +- +- SET_FOREACH(e, u->pids, i) { +- hashmap_remove_value(u->manager->watch_pids1, e, u); +- hashmap_remove_value(u->manager->watch_pids2, e, u); +- } ++ if (!u->cgroup_path) ++ return -ENOENT; + +- set_free(u->pids); +- u->pids = NULL; ++ return unit_watch_pids_in_path(u, u->cgroup_path); + } + + void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2) { +@@ -1830,7 +1824,7 @@ void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2) { + continue; + + if (!pid_is_unwaited(pid)) +- set_remove(u->pids, e); ++ unit_unwatch_pid(u, pid); + } + } + +-- +1.9.0 + diff --git a/core/systemd/PKGBUILD b/core/systemd/PKGBUILD index e786d6197..0f913a380 100644 --- a/core/systemd/PKGBUILD +++ b/core/systemd/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=systemd pkgname=('systemd' 'systemd-sysvcompat') pkgver=210 -pkgrel=2 +pkgrel=3 arch=('i686' 'x86_64') url="http://www.freedesktop.org/wiki/Software/systemd" makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf' @@ -12,14 +12,66 @@ makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf' 'linux-api-headers' 'pam' 'python' 'python-lxml' 'quota-tools' 'xz') options=('strip' 'debug') source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz" + '0001-login-fix-pos-array-allocation.patch' + '0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch' + '0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch' + '0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch' + '0007-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch' + '0008-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch' + '0009-logs-show-fix-corrupt-output-with-empty-messages.patch' + '0010-journalctl-refuse-extra-arguments-with-verify-and-si.patch' + '0011-cdrom_id-use-the-old-MMC-fallback.patch' + '0012-nspawn-fix-detection-of-missing-proc-self-loginuid.patch' + '0013-Fix-systemd-stdio-bridge-symlink.patch' + '0014-execute-free-directory-path-if-we-fail-to-remove-it-.patch' + '0015-journal-assume-that-next-entry-is-after-previous-ent.patch' + '0016-journal-forget-file-after-encountering-an-error.patch' + '0017-core-correctly-unregister-PIDs-from-PID-hashtables.patch' 'initcpio-hook-udev' 'initcpio-install-systemd' 'initcpio-install-udev') md5sums=('03efddf8c9eca36d4d590f9967e7e818' + 'e64ade3fffc1e8fc5af0703135b389c4' + 'b619c45b2e973b9bd1cc85a66647a859' + '5265ac8a57f8b6438effd332c5a38e7e' + '0d047c3e44076fcefded5c2db31743d7' + 'c5bee064008abf23e5154768681944d2' + '11f93b3c02c268a16db95f69c3d8c459' + '43bc34b1e991dca2d9fb8b887e3b2d3d' + '2e4a5fc2b2cc2e64c3ade2f504763b81' + 'b55c5fb9dccb25085e199afc460ca011' + 'cc16a4ae58eb87a9739f183ed20e2290' + 'be17e74f25c70a2928fe16ce4fdb5a7e' + '4875226e16a893b82663691c6ae7c922' + '0180fbe462be9ca6a0da208ccb94844e' + 'c1182aee4a8baaf66d7a6b7a1347d60e' + '057ef5aa2089f0884151f22e7dbe4ed5' '29245f7a240bfba66e2b1783b63b6b40' '5e04f468a13ae2b9d6a9dfc77c49a7d1' 'bde43090d4ac0ef048e3eaee8202a407') +prepare() { + cd "$pkgname-$pkgver" + + patch -Np1 <../0001-login-fix-pos-array-allocation.patch + patch -Np1 <../0002-login-set-pos-slot-to-fallback-on-pos-eviction.patch + patch -Np1 <../0003-login-Allow-calling-org.freedesktop.login1.Seat.Swit.patch + patch -Np1 <../0004-fix-typo-in-iDRAC-network-interface-name-irdac-idrac.patch + patch -Np1 <../0007-mount-don-t-send-out-PropertiesChanged-message-if-ac.patch + patch -Np1 <../0008-mount-don-t-fire-PropertiesChanged-signals-for-mount.patch + patch -Np1 <../0009-logs-show-fix-corrupt-output-with-empty-messages.patch + patch -Np1 <../0010-journalctl-refuse-extra-arguments-with-verify-and-si.patch + patch -Np1 <../0011-cdrom_id-use-the-old-MMC-fallback.patch + patch -Np1 <../0012-nspawn-fix-detection-of-missing-proc-self-loginuid.patch + patch -Np1 <../0013-Fix-systemd-stdio-bridge-symlink.patch + patch -Np1 <../0014-execute-free-directory-path-if-we-fail-to-remove-it-.patch + patch -Np1 <../0015-journal-assume-that-next-entry-is-after-previous-ent.patch + patch -Np1 <../0016-journal-forget-file-after-encountering-an-error.patch + patch -Np1 <../0017-core-correctly-unregister-PIDs-from-PID-hashtables.patch + + autoreconf -fis +} + build() { cd "$pkgname-$pkgver" |