SHA256
1
0
forked from pool/systemd

Accepting request 178446 from home:elvigia:branches:Base:System

- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
 fixes :
 * systemd-journald[347]: Failed to set ACL on 
 /var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal, 
 ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
  systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
  alien childs are reported as alive when they are really dead.

- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
 fixes :
 * systemd-journald[347]: Failed to set ACL on 
 /var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal, 
 ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
  systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
  alien childs are reported as alive when they are really dead.

OBS-URL: https://build.opensuse.org/request/show/178446
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=390
This commit is contained in:
Robert Milasan 2013-06-11 09:22:26 +00:00 committed by Git OBS Bridge
parent 28dd57258d
commit ef894ec214
7 changed files with 199 additions and 0 deletions

View File

@ -0,0 +1,87 @@
From 7f20c71497ec7c78c6d2572a0d7075f78b14548a Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Tue, 28 May 2013 20:45:34 +0200
Subject: [PATCH 4/8] journald: DO recalculate the ACL mask, but only if it
doesn't exist
Since 11ec7ce, journald isn't setting the ACLs properly anymore if
the files had no ACLs to begin with: acl_set_fd fails with EINVAL.
An ACL with ACL_USER or ACL_GROUP entries but no ACL_MASK entry is
invalid, so make sure a mask exists before trying to set the ACL.
---
src/journal/journald-server.c | 6 ++++--
src/shared/acl-util.c | 28 ++++++++++++++++++++++++++++
src/shared/acl-util.h | 1 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index cc52b8a..01f23ce 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -227,9 +227,11 @@ void server_fix_perms(Server *s, JournalFile *f, uid_t uid) {
}
}
- /* We do not recalculate the mask here, so that the fchmod() mask above stays intact. */
+ /* We do not recalculate the mask unconditionally here,
+ * so that the fchmod() mask above stays intact. */
if (acl_get_permset(entry, &permset) < 0 ||
- acl_add_perm(permset, ACL_READ) < 0) {
+ acl_add_perm(permset, ACL_READ) < 0 ||
+ calc_acl_mask_if_needed(&acl) < 0) {
log_warning("Failed to patch ACL on %s, ignoring: %m", f->path);
goto finish;
}
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index 48bb12f..fb04e49 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -69,6 +69,34 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
return 0;
}
+int calc_acl_mask_if_needed(acl_t *acl_p) {
+ acl_entry_t i;
+ int found;
+
+ assert(acl_p);
+
+ for (found = acl_get_entry(*acl_p, ACL_FIRST_ENTRY, &i);
+ found > 0;
+ found = acl_get_entry(*acl_p, ACL_NEXT_ENTRY, &i)) {
+
+ acl_tag_t tag;
+
+ if (acl_get_tag_type(i, &tag) < 0)
+ return -errno;
+
+ if (tag == ACL_MASK)
+ return 0;
+ }
+
+ if (found < 0)
+ return -errno;
+
+ if (acl_calc_mask(acl_p) < 0)
+ return -errno;
+
+ return 0;
+}
+
int search_acl_groups(char*** dst, const char* path, bool* belong) {
acl_t acl;
diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h
index 23090d9..36ef490 100644
--- a/src/shared/acl-util.h
+++ b/src/shared/acl-util.h
@@ -24,4 +24,5 @@
#include <stdbool.h>
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
+int calc_acl_mask_if_needed(acl_t *acl_p);
int search_acl_groups(char*** dst, const char* path, bool* belong);
--
1.8.1.4

View File

@ -0,0 +1,36 @@
From 3b1680e04cb0ff0e4cf180dbacd067f1f99316a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 3 Jun 2013 13:55:13 -0400
Subject: [PATCH 6/8] systemctl,core: allow nuking of symlinks to removed units
Before, one the unit file was deleted, install_context_for_removal()
would refuse to look for symlinks. But we can remove dangling symlinks
anyway.
In principle, package installation/deinstallation scripts should do
that before the unit is uninstalled, but they don't always do. Also,
a user might have added additional symlinks manually.
https://bugs.freedesktop.org/show_bug.cgi?id=62395
---
src/shared/install.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shared/install.c b/src/shared/install.c
index edf4d2a..a695e12 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1413,7 +1413,9 @@ static int install_context_mark_for_removal(
assert_se(hashmap_move_one(c->have_installed, c->will_install, i->name) == 0);
q = unit_file_search(c, i, paths, root_dir, false);
- if (q < 0) {
+ if (q == -ENOENT) {
+ /* do nothing */
+ } else if (q < 0) {
if (r >= 0)
r = q;
--
1.8.1.4

View File

@ -0,0 +1,32 @@
From 3608595751f62bbc6d37eb78b746ab6fecfa2d45 Mon Sep 17 00:00:00 2001
From: Ross Lagerwall <rosslagerwall@gmail.com>
Date: Sun, 9 Jun 2013 17:28:44 +0100
Subject: [PATCH 8/8] service: don't report alien child as alive when it's not
When a sigchld is received from an alien child, main_pid is set to
0 then service_enter_running calls main_pid_good to check if the
child is running. This incorrectly returned true because
kill(main_pid, 0) would return >= 0.
This fixes an error where a service would die and the cgroup would
become empty but the service would still report as active (running).
---
src/core/service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/service.c b/src/core/service.c
index e110a41..973bd03 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1865,7 +1865,7 @@ static int main_pid_good(Service *s) {
/* If it's an alien child let's check if it is still
* alive ... */
- if (s->main_pid_alien)
+ if (s->main_pid_alien && s->main_pid > 0)
return kill(s->main_pid, 0) >= 0 || errno != ESRCH;
/* .. otherwise assume we'll get a SIGCHLD for it,
--
1.8.1.4

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Jun 11 02:29:49 UTC 2013 - crrodriguez@opensuse.org
- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
fixes :
* systemd-journald[347]: Failed to set ACL on
/var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal,
ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
alien childs are reported as alive when they are really dead.
-------------------------------------------------------------------
Wed May 29 10:44:11 CEST 2013 - fcrozat@suse.com

View File

@ -170,6 +170,12 @@ Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch
Patch42: systemctl-does-not-expand-u-so-revert-back-to-I.patch
# PATCH-FIX-UPSTREAM Start-ctrl-alt-del.target-irreversibly.patch fcrozat@suse.com -- ctrl-alt-del should be irreversible for reliability.
Patch43: Start-ctrl-alt-del.target-irreversibly.patch
# PATCH-FIX-UPSTREAM 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch crrodriguez@opensuse.org fix systemd-journald[347]: Failed to set ACL on ...user-1000.journal..Invalid argument
Patch44: 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
# PATCH-FIX-UPSTREAM 0006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch crrodriguez@opensuse.org ensure systemctl disable removes dangling symlinks
Patch45: 0006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
# PATCH-FIX-UPSTREAM 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch crrodriguez@opensuse.org do not report alien child as alive when it is dead.
Patch46: 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch
@ -406,6 +412,9 @@ cp %{SOURCE7} m4/
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%build
autoreconf -fiv

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Jun 11 02:29:49 UTC 2013 - crrodriguez@opensuse.org
- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
fixes :
* systemd-journald[347]: Failed to set ACL on
/var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal,
ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
alien childs are reported as alive when they are really dead.
-------------------------------------------------------------------
Wed May 29 10:44:11 CEST 2013 - fcrozat@suse.com

View File

@ -165,6 +165,12 @@ Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch
Patch42: systemctl-does-not-expand-u-so-revert-back-to-I.patch
# PATCH-FIX-UPSTREAM Start-ctrl-alt-del.target-irreversibly.patch fcrozat@suse.com -- ctrl-alt-del should be irreversible for reliability.
Patch43: Start-ctrl-alt-del.target-irreversibly.patch
# PATCH-FIX-UPSTREAM 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch crrodriguez@opensuse.org fix systemd-journald[347]: Failed to set ACL on ...user-1000.journal..Invalid argument
Patch44: 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
# PATCH-FIX-UPSTREAM 0006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch crrodriguez@opensuse.org ensure systemctl disable removes dangling symlinks
Patch45: 0006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
# PATCH-FIX-UPSTREAM 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch crrodriguez@opensuse.org do not report alien child as alive when it is dead.
Patch46: 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch
@ -401,6 +407,9 @@ cp %{SOURCE7} m4/
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%build
autoreconf -fiv