diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0002-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0002-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0002-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch b/meta/recipes-core/systemd/systemd/0002-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch new file mode 100644 index 0000000000..c195437ba0 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0002-tmpfiles-quietly-ignore-ACLs-on-unsupported-filesyst.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> | ||
3 | |||
4 | From 31d05181e3a34c5c0ff6314d8eca1c3b4bb29423 Mon Sep 17 00:00:00 2001 | ||
5 | From: Hans-Peter Deifel <hpd@hpdeifel.de> | ||
6 | Date: Tue, 3 Mar 2015 00:35:08 +0100 | ||
7 | Subject: [PATCH 2/2] tmpfiles: quietly ignore ACLs on unsupported filesystems | ||
8 | |||
9 | A warning is printed if ACLs cannot be retrieved for any reason other | ||
10 | than -ENOSYS. For -ENOSYS, debug log is printed. | ||
11 | |||
12 | (cherry picked from commit d873e8778c92014c02a9122852758b436fa95c0e) | ||
13 | --- | ||
14 | src/tmpfiles/tmpfiles.c | 36 ++++++++++++++++++++---------------- | ||
15 | 1 file changed, 20 insertions(+), 16 deletions(-) | ||
16 | |||
17 | diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c | ||
18 | index 88ba7e4..187997e 100644 | ||
19 | --- a/src/tmpfiles/tmpfiles.c | ||
20 | +++ b/src/tmpfiles/tmpfiles.c | ||
21 | @@ -704,6 +704,9 @@ static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modif | ||
22 | int r; | ||
23 | _cleanup_(acl_free_charpp) char *t = NULL; | ||
24 | |||
25 | + /* Returns 0 for success, positive error if already warned, | ||
26 | + * negative error otherwise. */ | ||
27 | + | ||
28 | if (modify) { | ||
29 | r = acls_for_file(path, type, acl, &dup); | ||
30 | if (r < 0) | ||
31 | @@ -731,35 +734,36 @@ static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modif | ||
32 | |||
33 | r = acl_set_file(path, type, dup); | ||
34 | if (r < 0) | ||
35 | - return log_error_errno(-errno, | ||
36 | - "Setting %s ACL \"%s\" on %s failed: %m", | ||
37 | - type == ACL_TYPE_ACCESS ? "access" : "default", | ||
38 | - strna(t), path); | ||
39 | + return -log_error_errno(errno, | ||
40 | + "Setting %s ACL \"%s\" on %s failed: %m", | ||
41 | + type == ACL_TYPE_ACCESS ? "access" : "default", | ||
42 | + strna(t), path); | ||
43 | + | ||
44 | return 0; | ||
45 | } | ||
46 | #endif | ||
47 | |||
48 | static int path_set_acls(Item *item, const char *path) { | ||
49 | + int r = 0; | ||
50 | #ifdef HAVE_ACL | ||
51 | - int r; | ||
52 | - | ||
53 | assert(item); | ||
54 | assert(path); | ||
55 | |||
56 | - if (item->acl_access) { | ||
57 | + if (item->acl_access) | ||
58 | r = path_set_acl(path, ACL_TYPE_ACCESS, item->acl_access, item->force); | ||
59 | - if (r < 0) | ||
60 | - return r; | ||
61 | - } | ||
62 | |||
63 | - if (item->acl_default) { | ||
64 | + if (r == 0 && item->acl_default) | ||
65 | r = path_set_acl(path, ACL_TYPE_DEFAULT, item->acl_default, item->force); | ||
66 | - if (r < 0) | ||
67 | - return r; | ||
68 | - } | ||
69 | -#endif | ||
70 | |||
71 | - return 0; | ||
72 | + if (r > 0) | ||
73 | + return -r; /* already warned */ | ||
74 | + else if (r == -ENOTSUP) { | ||
75 | + log_debug_errno(r, "ACLs not supported by file system at %s", path); | ||
76 | + return 0; | ||
77 | + } else if (r < 0) | ||
78 | + log_error_errno(r, "ACL operation on \"%s\" failed: %m", path); | ||
79 | +#endif | ||
80 | + return r; | ||
81 | } | ||
82 | |||
83 | static int write_one_file(Item *i, const char *path) { | ||
84 | -- | ||
85 | 2.3.1 | ||
86 | |||