From b568ba0518fc7dcf30e0525df55478b42995492b Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Feb 27 2012 07:51:16 +0000 Subject: A few fixes from upstream PrivateTmp permissions (#790522) timedated without ntp installed (#790260) logind: allow PowerOff and Reboot via polkit loading empty files in read_one_line_file() (fdo#45362) fix cgit URLs in manpages --- diff --git a/0149-logind-Allow-PowerOff-Reboot-in-default-context.patch b/0149-logind-Allow-PowerOff-Reboot-in-default-context.patch new file mode 100644 index 0000000..2b1acde --- /dev/null +++ b/0149-logind-Allow-PowerOff-Reboot-in-default-context.patch @@ -0,0 +1,33 @@ +From e67810006b7adf120bbb2f6c0c84697ec4b783e5 Mon Sep 17 00:00:00 2001 +From: Benjamin Franzke +Date: Fri, 10 Feb 2012 00:56:44 +0100 +Subject: [PATCH] logind: Allow PowerOff/Reboot in default context + +(cherry picked from commit 80df5f4c3b697d666324fc37e63661f44a5f76cf) + +Conflicts: + + src/org.freedesktop.login1.conf +--- + src/org.freedesktop.login1.conf | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/src/org.freedesktop.login1.conf b/src/org.freedesktop.login1.conf +index c423ef5..96b4ae3 100644 +--- a/src/org.freedesktop.login1.conf ++++ b/src/org.freedesktop.login1.conf +@@ -69,6 +69,14 @@ + send_member="ActivateSession"/> + + ++ ++ ++ ++ + diff --git a/0150-util-fix-handling-of-empty-files-in-read_one_line_fi.patch b/0150-util-fix-handling-of-empty-files-in-read_one_line_fi.patch new file mode 100644 index 0000000..35f5a57 --- /dev/null +++ b/0150-util-fix-handling-of-empty-files-in-read_one_line_fi.patch @@ -0,0 +1,43 @@ +From 822decbb65b09fbbddde87c75996238ce642e475 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Sat, 11 Feb 2012 00:27:12 +0100 +Subject: [PATCH] util: fix handling of empty files in read_one_line_file() + +https://bugs.freedesktop.org/show_bug.cgi?id=45362 +(cherry picked from commit 4099a281bb1e7bbb941c55de559dbfb9abf5897b) +--- + src/util.c | 17 ++++++++++++----- + 1 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/src/util.c b/src/util.c +index d942d31..6065463 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -704,15 +704,22 @@ int read_one_line_file(const char *fn, char **line) { + assert(fn); + assert(line); + +- if (!(f = fopen(fn, "re"))) ++ f = fopen(fn, "re"); ++ if (!f) + return -errno; + +- if (!(fgets(t, sizeof(t), f))) { +- r = feof(f) ? -EIO : -errno; +- goto finish; ++ if (!fgets(t, sizeof(t), f)) { ++ ++ if (ferror(f)) { ++ r = -errno; ++ goto finish; ++ } ++ ++ t[0] = 0; + } + +- if (!(c = strdup(t))) { ++ c = strdup(t); ++ if (!c) { + r = -ENOMEM; + goto finish; + } diff --git a/0151-Fix-broken-Git-repository-URLs.patch b/0151-Fix-broken-Git-repository-URLs.patch new file mode 100644 index 0000000..b9b0a47 --- /dev/null +++ b/0151-Fix-broken-Git-repository-URLs.patch @@ -0,0 +1,158 @@ +From bfa350c7e425a6d77fdaadffc8a2cc7c24452a5c Mon Sep 17 00:00:00 2001 +From: Michael Biebl +Date: Mon, 13 Feb 2012 17:46:46 +0100 +Subject: [PATCH] Fix broken Git repository URLs (cherry picked from commit + a26c9cc60477acacf3a147009894bd837353ed6c) + +--- + man/sd-daemon.xml | 4 ++-- + man/sd-readahead.xml | 4 ++-- + man/sd_booted.xml | 4 ++-- + man/sd_is_fifo.xml | 4 ++-- + man/sd_listen_fds.xml | 4 ++-- + man/sd_notify.xml | 4 ++-- + man/sd_readahead.xml | 4 ++-- + src/sd-daemon.h | 4 ++-- + src/sd-readahead.h | 4 ++-- + 9 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/man/sd-daemon.xml b/man/sd-daemon.xml +index 3f3a723..4ea88e4 100644 +--- a/man/sd-daemon.xml ++++ b/man/sd-daemon.xml +@@ -130,8 +130,8 @@ + In addition, for details about the algorithms + check the liberally licensed reference implementation + sources: +- +- resp. ++ ++ resp. + + These APIs are implemented in the reference + implementation's sd-daemon.c and +diff --git a/man/sd-readahead.xml b/man/sd-readahead.xml +index 7c21656..7fb8634 100644 +--- a/man/sd-readahead.xml ++++ b/man/sd-readahead.xml +@@ -86,8 +86,8 @@ + In addition, for details about the algorithms + check the liberally licensed reference implementation + sources: +- +- resp. ++ ++ resp. + + These APIs are implemented in the reference + implementation's drop-in +diff --git a/man/sd_booted.xml b/man/sd_booted.xml +index c876874..141625d 100644 +--- a/man/sd_booted.xml ++++ b/man/sd_booted.xml +@@ -93,9 +93,9 @@ + + For details about the algorithm check the + liberally licensed reference implementation sources: +- ++ + resp. ++ url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h"/> + + sd_booted() is implemented + in the reference implementation's +diff --git a/man/sd_is_fifo.xml b/man/sd_is_fifo.xml +index 6055893..4db5120 100644 +--- a/man/sd_is_fifo.xml ++++ b/man/sd_is_fifo.xml +@@ -180,9 +180,9 @@ + + For details about the algorithms check the + liberally licensed reference implementation sources: +- ++ + resp. ++ url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h"/> + + sd_is_fifo() and the + related functions are implemented in the reference +diff --git a/man/sd_listen_fds.xml b/man/sd_listen_fds.xml +index 09d0503..c3c70a0 100644 +--- a/man/sd_listen_fds.xml ++++ b/man/sd_listen_fds.xml +@@ -140,9 +140,9 @@ + + For details about the algorithm check the + liberally licensed reference implementation sources: +- ++ + resp. ++ url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h"/> + + sd_listen_fds() is + implemented in the reference implementation's +diff --git a/man/sd_notify.xml b/man/sd_notify.xml +index 0209146..d3508b8 100644 +--- a/man/sd_notify.xml ++++ b/man/sd_notify.xml +@@ -208,9 +208,9 @@ + + For details about the algorithms check the + liberally licensed reference implementation sources: +- ++ + resp. ++ url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h"/> + + sd_notify() and + sd_notifyf() are implemented in +diff --git a/man/sd_readahead.xml b/man/sd_readahead.xml +index 4b8c957..2e7e09c 100644 +--- a/man/sd_readahead.xml ++++ b/man/sd_readahead.xml +@@ -129,9 +129,9 @@ + + For details about the algorithm check the + liberally licensed reference implementation sources: +- ++ + resp. ++ url="http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-readahead.h"/> + + sd_readahead() is + implemented in the reference implementation's drop-in +diff --git a/src/sd-daemon.h b/src/sd-daemon.h +index eb2a606..4c9ca4f 100644 +--- a/src/sd-daemon.h ++++ b/src/sd-daemon.h +@@ -58,8 +58,8 @@ extern "C" { + + You may find an up-to-date version of these source files online: + +- http://cgit.freedesktop.org/systemd/plain/src/systemd/sd-daemon.h +- http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c ++ http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h ++ http://cgit.freedesktop.org/systemd/systemd/plain/src/sd-daemon.c + + This should compile on non-Linux systems, too, but with the + exception of the sd_is_xxx() calls all functions will become NOPs. +diff --git a/src/sd-readahead.h b/src/sd-readahead.h +index afe6768..1f8c5a0 100644 +--- a/src/sd-readahead.h ++++ b/src/sd-readahead.h +@@ -47,8 +47,8 @@ extern "C" { + + You may find an up-to-date version of these source files online: + +- http://cgit.freedesktop.org/systemd/plain/src/systemd/sd-readahead.h +- http://cgit.freedesktop.org/systemd/plain/src/readahead/sd-readahead.c ++ http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-readahead.h ++ http://cgit.freedesktop.org/systemd/systemd/plain/src/readahead/sd-readahead.c + + This should compile on non-Linux systems, too, but all functions + will become NOPs. diff --git a/0152-timedate-don-t-fail-if-NTP-is-not-installed.patch b/0152-timedate-don-t-fail-if-NTP-is-not-installed.patch new file mode 100644 index 0000000..a87c405 --- /dev/null +++ b/0152-timedate-don-t-fail-if-NTP-is-not-installed.patch @@ -0,0 +1,30 @@ +From b74caa4d603051877844204aa7db3bd62e084c70 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 15 Feb 2012 00:05:31 +0100 +Subject: [PATCH] timedate: don't fail if NTP is not installed + +https://bugzilla.redhat.com/show_bug.cgi?id=790260 +(cherry picked from commit 2aa4c31529c2a370b560bc533fc677da27618044) +--- + src/timedated.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/src/timedated.c b/src/timedated.c +index 16f54b5..9ecfa94 100644 +--- a/src/timedated.c ++++ b/src/timedated.c +@@ -328,6 +328,14 @@ static int read_ntp(DBusConnection *bus) { + + reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error); + if (!reply) { ++ ++ if (streq(error.name, "org.freedesktop.DBus.Error.FileNotFound")) { ++ /* NTP is not installed. */ ++ use_ntp = false; ++ r = 0; ++ goto finish; ++ } ++ + log_error("Failed to issue method call: %s", bus_error_message(&error)); + r = -EIO; + goto finish; diff --git a/0153-namespace-temporaily-reset-umask-when-creating-priva.patch b/0153-namespace-temporaily-reset-umask-when-creating-priva.patch new file mode 100644 index 0000000..9ee23ff --- /dev/null +++ b/0153-namespace-temporaily-reset-umask-when-creating-priva.patch @@ -0,0 +1,35 @@ +From 934f04a9d6af0c2e9926aecb8e5e4717f788e71c Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 15 Feb 2012 04:56:59 +0100 +Subject: [PATCH] namespace: temporaily reset umask when creating private /tmp + (cherry picked from commit + 21d279cf543c82705a5b3362818805603d2ab9f2) + +--- + src/namespace.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/src/namespace.c b/src/namespace.c +index a06cac1..09bc829 100644 +--- a/src/namespace.c ++++ b/src/namespace.c +@@ -253,11 +253,19 @@ int setup_namespace( + } + + if (need_private) { ++ mode_t u; ++ + memcpy(private_dir, tmp_dir, sizeof(tmp_dir)-1); ++ ++ u = umask(0000); + if (mkdir(private_dir, 0777 + S_ISVTX) < 0) { ++ umask(u); ++ + r = -errno; + goto fail; + } ++ ++ umask(u); + remove_private = true; + } + diff --git a/systemd.spec b/systemd.spec index 0e3df58..7dde987 100644 --- a/systemd.spec +++ b/systemd.spec @@ -2,7 +2,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Version: 37 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2+ Group: System Environment/Base Summary: A System and Service Manager @@ -199,6 +199,12 @@ Patch0145: 0145-man-document-x-systemd-device-timeout.patch Patch0146: 0146-systemctl-check-for-no-more-work-after-chkconfig.patch Patch0147: 0147-install-fix-incorrect-Access-denied-message-with-a-n.patch Patch0148: 0148-man-Clarify-man-page-with-respect-to-automatic-fstab.patch +Patch0149: 0149-logind-Allow-PowerOff-Reboot-in-default-context.patch +Patch0150: 0150-util-fix-handling-of-empty-files-in-read_one_line_fi.patch +# from v43: +Patch0151: 0151-Fix-broken-Git-repository-URLs.patch +Patch0152: 0152-timedate-don-t-fail-if-NTP-is-not-installed.patch +Patch0153: 0153-namespace-temporaily-reset-umask-when-creating-priva.patch # For sysvinit tools Obsoletes: SysVinit < 2.86-24, sysvinit < 2.86-24 @@ -520,6 +526,14 @@ fi %{_bindir}/systemd-sysv-convert %changelog +* Mon Feb 27 2012 Michal Schmidt - 37-14 +- A few fixes from upstream: + - PrivateTmp permissions (#790522) + - timedated without ntp installed (#790260) + - logind: allow PowerOff and Reboot via polkit + - loading empty files in read_one_line_file() (fdo#45362) + - fix cgit URLs in manpages + * Thu Feb 09 2012 Michal Schmidt - 37-13 - Minor fixes and some manpage updates from upstream.