diff options
Diffstat (limited to 'core/systemd')
6 files changed, 82 insertions, 211 deletions
diff --git a/core/systemd/0001-fix-lingering-references-to-var-lib-backlight-random.patch b/core/systemd/0001-fix-lingering-references-to-var-lib-backlight-random.patch new file mode 100644 index 000000000..49b960c81 --- /dev/null +++ b/core/systemd/0001-fix-lingering-references-to-var-lib-backlight-random.patch @@ -0,0 +1,54 @@ +From 6c8c92fef72cf6a7ef7109a424ef82dbdc4f6952 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 + diff --git a/core/systemd/0001-polkit-Avoid-race-condition-in-scraping-proc.patch b/core/systemd/0001-polkit-Avoid-race-condition-in-scraping-proc.patch deleted file mode 100644 index d3c09781c..000000000 --- a/core/systemd/0001-polkit-Avoid-race-condition-in-scraping-proc.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 72fd713962ca2c2450e23b01d9e22017a7e28fd4 Mon Sep 17 00:00:00 2001 -From: Colin Walters <walters@verbum.org> -Date: Thu, 22 Aug 2013 13:55:21 -0400 -Subject: [PATCH] polkit: Avoid race condition in scraping /proc - -If a calling process execve()s a setuid program, it can appear to be -uid 0. Since we're receiving requests over DBus, avoid this by simply -passing system-bus-name as a subject. ---- - src/shared/polkit.c | 31 +++++-------------------------- - 1 file changed, 5 insertions(+), 26 deletions(-) - -diff --git a/src/shared/polkit.c b/src/shared/polkit.c -index cea7074..1c5e9e3 100644 ---- a/src/shared/polkit.c -+++ b/src/shared/polkit.c -@@ -38,12 +38,8 @@ int verify_polkit( - - #ifdef ENABLE_POLKIT - DBusMessage *m = NULL, *reply = NULL; -- const char *unix_process = "unix-process", *pid = "pid", *starttime = "start-time", *cancel_id = ""; -+ const char *system_bus_name = "system-bus-name", *name = "name", *cancel_id = ""; - uint32_t flags = interactive ? 1 : 0; -- pid_t pid_raw; -- uint32_t pid_u32; -- unsigned long long starttime_raw; -- uint64_t starttime_u64; - DBusMessageIter iter_msg, iter_struct, iter_array, iter_dict, iter_variant; - int r; - dbus_bool_t authorized = FALSE, challenge = FALSE; -@@ -68,14 +64,6 @@ int verify_polkit( - - #ifdef ENABLE_POLKIT - -- pid_raw = bus_get_unix_process_id(c, sender, error); -- if (pid_raw == 0) -- return -EINVAL; -- -- r = get_starttime_of_pid(pid_raw, &starttime_raw); -- if (r < 0) -- return r; -- - m = dbus_message_new_method_call( - "org.freedesktop.PolicyKit1", - "/org/freedesktop/PolicyKit1/Authority", -@@ -86,22 +74,13 @@ int verify_polkit( - - dbus_message_iter_init_append(m, &iter_msg); - -- pid_u32 = (uint32_t) pid_raw; -- starttime_u64 = (uint64_t) starttime_raw; -- - if (!dbus_message_iter_open_container(&iter_msg, DBUS_TYPE_STRUCT, NULL, &iter_struct) || -- !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &unix_process) || -+ !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &system_bus_name) || - !dbus_message_iter_open_container(&iter_struct, DBUS_TYPE_ARRAY, "{sv}", &iter_array) || - !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) || -- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &pid) || -- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "u", &iter_variant) || -- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT32, &pid_u32) || -- !dbus_message_iter_close_container(&iter_dict, &iter_variant) || -- !dbus_message_iter_close_container(&iter_array, &iter_dict) || -- !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) || -- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &starttime) || -- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "t", &iter_variant) || -- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT64, &starttime_u64) || -+ !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &name) || -+ !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "s", &iter_variant) || -+ !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_STRING, &sender) || - !dbus_message_iter_close_container(&iter_dict, &iter_variant) || - !dbus_message_iter_close_container(&iter_array, &iter_dict) || - !dbus_message_iter_close_container(&iter_struct, &iter_array) || --- -1.8.4 - diff --git a/core/systemd/0001-swap-fix-reverse-dependencies.patch b/core/systemd/0001-swap-fix-reverse-dependencies.patch deleted file mode 100644 index 7e51918ab..000000000 --- a/core/systemd/0001-swap-fix-reverse-dependencies.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 90060fa6605446bef7078867423b691e4effa575 Mon Sep 17 00:00:00 2001 -From: Tom Gundersen <teg@jklm.no> -Date: Fri, 13 Sep 2013 14:46:18 +0200 -Subject: [PATCH] swap: fix reverse dependencies - -Make sure swap.target correctly requires/wants the swap units. - -This fixes https://bugs.freedesktop.org/show_bug.cgi?id=69291. - -Reported-by: Hussam Al-Tayeb ---- - src/core/swap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/core/swap.c b/src/core/swap.c -index 57d15eb..3950860 100644 ---- a/src/core/swap.c -+++ b/src/core/swap.c -@@ -220,7 +220,7 @@ static int swap_add_default_dependencies(Swap *s) { - } - - if (!noauto) { -- r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, (nofail ? UNIT_WANTED_BY : UNIT_REQUIRED_BY), -+ r = unit_add_two_dependencies_by_name_inverse(UNIT(s), UNIT_AFTER, (nofail ? UNIT_WANTS : UNIT_REQUIRES), - SPECIAL_SWAP_TARGET, NULL, true); - if (r < 0) - return r; --- -1.8.4 - diff --git a/core/systemd/0002-swap-create-.wants-symlink-to-auto-swap-devices.patch b/core/systemd/0002-swap-create-.wants-symlink-to-auto-swap-devices.patch deleted file mode 100644 index 4b8743464..000000000 --- a/core/systemd/0002-swap-create-.wants-symlink-to-auto-swap-devices.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 4e82fe5213bedcb70e25c0270e516d5f2706d8c8 Mon Sep 17 00:00:00 2001 -From: Tom Gundersen <teg@jklm.no> -Date: Mon, 16 Sep 2013 01:08:32 +0200 -Subject: [PATCH] swap: create .wants symlink to 'auto' swap devices - -As we load unit files lazily, we need to make sure something pulls in swap -units that should be started automatically, otherwise the default dependencies -will never be applied. - -This partially reinstates code removed in -commit 64347fc2b983f33e7efb0fd2bb44e133fb9f30f4. - -Also don't order swap devices after swap.target when they are 'nofail'. ---- - src/core/swap.c | 8 ++++++-- - src/fstab-generator/fstab-generator.c | 18 ++++++++++++++++-- - 2 files changed, 22 insertions(+), 4 deletions(-) - -diff --git a/src/core/swap.c b/src/core/swap.c -index 3950860..76c7d45 100644 ---- a/src/core/swap.c -+++ b/src/core/swap.c -@@ -220,8 +220,12 @@ static int swap_add_default_dependencies(Swap *s) { - } - - if (!noauto) { -- r = unit_add_two_dependencies_by_name_inverse(UNIT(s), UNIT_AFTER, (nofail ? UNIT_WANTS : UNIT_REQUIRES), -- SPECIAL_SWAP_TARGET, NULL, true); -+ if (nofail) -+ r = unit_add_dependency_by_name_inverse(UNIT(s), -+ UNIT_WANTS, SPECIAL_SWAP_TARGET, NULL, true); -+ else -+ r = unit_add_two_dependencies_by_name_inverse(UNIT(s), -+ UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SWAP_TARGET, NULL, true); - if (r < 0) - return r; - } -diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c -index 6ebe8aa..b73dfa4 100644 ---- a/src/fstab-generator/fstab-generator.c -+++ b/src/fstab-generator/fstab-generator.c -@@ -66,6 +66,7 @@ static int mount_find_pri(struct mntent *me, int *ret) { - static int add_swap(const char *what, struct mntent *me) { - _cleanup_free_ char *name = NULL, *unit = NULL, *lnk = NULL, *device = NULL; - _cleanup_fclose_ FILE *f = NULL; -+ bool noauto; - int r, pri = -1; - - assert(what); -@@ -77,6 +78,8 @@ static int add_swap(const char *what, struct mntent *me) { - return pri; - } - -+ noauto = !!hasmntopt(me, "noauto"); -+ - name = unit_name_from_path(what, ".swap"); - if (!name) - return log_oom(); -@@ -97,8 +100,7 @@ static int add_swap(const char *what, struct mntent *me) { - fprintf(f, - "# Automatically generated by systemd-fstab-generator\n\n" - "[Unit]\n" -- "SourcePath=/etc/fstab\n" -- "\n" -+ "SourcePath=/etc/fstab\n\n" - "[Swap]\n" - "What=%s\n", - what); -@@ -114,6 +116,18 @@ static int add_swap(const char *what, struct mntent *me) { - return -errno; - } - -+ if (!noauto) { -+ lnk = strjoin(arg_dest, "/" SPECIAL_SWAP_TARGET ".wants/", name, NULL); -+ if (!lnk) -+ return log_oom(); -+ -+ mkdir_parents_label(lnk, 0755); -+ if (symlink(unit, lnk) < 0) { -+ log_error("Failed to create symlink %s: %m", lnk); -+ return -errno; -+ } -+ } -+ - return 0; - } - --- -1.8.4 - diff --git a/core/systemd/PKGBUILD b/core/systemd/PKGBUILD index e5f054629..c828bc755 100644 --- a/core/systemd/PKGBUILD +++ b/core/systemd/PKGBUILD @@ -3,8 +3,8 @@ pkgbase=systemd pkgname=('systemd' 'systemd-sysvcompat') -pkgver=207 -pkgrel=5 +pkgver=208 +pkgrel=1 arch=('i686' 'x86_64') url="http://www.freedesktop.org/wiki/Software/systemd" makedepends=('acl' 'cryptsetup' 'dbus-core' 'docbook-xsl' 'gobject-introspection' 'gperf' @@ -15,30 +15,21 @@ source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz" 'initcpio-hook-udev' 'initcpio-install-systemd' 'initcpio-install-udev' - 0001-polkit-Avoid-race-condition-in-scraping-proc.patch - 0001-swap-fix-reverse-dependencies.patch - 0002-swap-create-.wants-symlink-to-auto-swap-devices.patch) -md5sums=('7799f3cc9d289b8db1c1fa56ae7ecd88' + '0001-fix-lingering-references-to-var-lib-backlight-random.patch') +md5sums=('df64550d92afbffb4f67a434193ee165' '29245f7a240bfba66e2b1783b63b6b40' '8b68b0218a3897d4d37a6ccf47914774' 'bde43090d4ac0ef048e3eaee8202a407' - '9eb0a46aa2a3a6d74117f9a174dbe168' - '182be4c729aaecde249b7b05b48a481f' - 'b54fbe35e2689ac36cda9ac4a5a86f24') + '1b191c4e7a209d322675fd199e3abc66') prepare() { cd "$pkgname-$pkgver" - - patch -Np1 <"$srcdir"/0001-swap-fix-reverse-dependencies.patch - patch -Np1 <"$srcdir"/0002-swap-create-.wants-symlink-to-auto-swap-devices.patch - patch -Np1 <"$srcdir"/0001-polkit-Avoid-race-condition-in-scraping-proc.patch + patch -Np1 -i ../0001-fix-lingering-references-to-var-lib-backlight-random.patch } build() { cd "$pkgname-$pkgver" - CFLAGS+=' -g' - ./configure \ --libexecdir=/usr/lib \ --localstatedir=/var \ @@ -102,7 +93,7 @@ package_systemd() { rmdir "$pkgdir/etc/systemd/system/getty.target.wants" # get rid of RPM macros - rm -r "$pkgdir/usr/lib/rpm/macros.d" + rm -r "$pkgdir/usr/lib/rpm" # add back tmpfiles.d/legacy.conf install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d" @@ -117,6 +108,10 @@ package_systemd() { install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev" install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev" + # ensure proper permissions for /var/log/journal + chown root:systemd-journal "$pkgdir/var/log/journal" + chmod 2755 "$pkgdir/var/log/journal" + ### split out manpages for sysvcompat rm -rf "$srcdir/_sysvcompat" install -dm755 "$srcdir"/_sysvcompat/usr/share/man/man8/ diff --git a/core/systemd/systemd.install b/core/systemd/systemd.install index 3b36f0c5d..f22536360 100644 --- a/core/systemd/systemd.install +++ b/core/systemd/systemd.install @@ -38,6 +38,19 @@ mask_net_naming() { fi } +_208_changes() { + chown root:systemd-journal var/log/journal + chmod 2755 var/log/journal + + if [ -e var/lib/backlight ] && [ ! -e var/lib/systemd/backlight ]; then + mv -T var/lib/backlight var/lib/systemd/backlight + fi + + if [ -e var/lib/random-seed ] && [ ! -e var/lib/systemd/random-seed ]; then + mv -T var/lib/random-seed var/lib/systemd/random-seed + fi +} + post_install() { post_common @@ -98,6 +111,10 @@ post_upgrade() { printf ' this hook, you must remove it from /etc/mkinitcpio.conf. A "systemd"\n' printf ' hook has been added which provides this functionality, and more.\n' fi + + if [ "$(vercmp 208-1 "$2")" -eq 1 ]; then + _208_changes + fi } # vim:set ts=2 sw=2 et: |