summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-01-24 11:11:43 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-26 06:27:00 +0000
commite7ffa406dcaefd168b1641fee2f19ca3df850d53 (patch)
tree605ac6337bb21ef2d286627879eda3b082ceff00 /meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
parent603dffc49a2c0084ce73340fdf1d7c624d1a954e (diff)
downloadpoky-e7ffa406dcaefd168b1641fee2f19ca3df850d53.tar.gz
systemd: Forward port musl patches
Redo the header include patch and add fixes for new code. (From OE-Core rev: 7e35a575ef09a85e625a81e0b4d80b020e3e3a92) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch19
1 files changed, 7 insertions, 12 deletions
diff --git a/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
index 12a92b8739..0026a7b72a 100644
--- a/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
+++ b/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
@@ -31,16 +31,12 @@ Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
31 src/shared/base-filesystem.c | 6 +++--- 31 src/shared/base-filesystem.c | 6 +++---
32 2 files changed, 24 insertions(+), 5 deletions(-) 32 2 files changed, 24 insertions(+), 5 deletions(-)
33 33
34diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
35index 7f15b558ca..4263298cad 100644
36--- a/src/basic/fs-util.h 34--- a/src/basic/fs-util.h
37+++ b/src/basic/fs-util.h 35+++ b/src/basic/fs-util.h
38@@ -47,8 +47,27 @@ int futimens_opath(int fd, const struct timespec ts[2]); 36@@ -46,8 +46,27 @@ int futimens_opath(int fd, const struct
39 int fd_warn_permissions(const char *path, int fd); 37 int fd_warn_permissions(const char *path, int fd);
40 int stat_warn_permissions(const char *path, const struct stat *st); 38 int stat_warn_permissions(const char *path, const struct stat *st);
41 39
42-#define laccess(path, mode) \
43- (faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW) < 0 ? -errno : 0)
44+/* 40+/*
45+ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to 41+ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
46+ do and it's not portable (not supported by musl). See: 42+ do and it's not portable (not supported by musl). See:
@@ -60,16 +56,15 @@ index 7f15b558ca..4263298cad 100644
60+ or why it needs to return success for broken symlinks. Maybe just historical 56+ or why it needs to return success for broken symlinks. Maybe just historical
61+ and not actually necessary or desired behaviour? 57+ and not actually necessary or desired behaviour?
62+*/ 58+*/
63+ 59 #define laccess(path, mode) \
64+#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), 0) 60- RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
61+ RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), 0))
65 62
66 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode); 63 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
67 int touch(const char *path); 64 int touch(const char *path);
68diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
69index 016eb7b82a..b1967f9f2f 100644
70--- a/src/shared/base-filesystem.c 65--- a/src/shared/base-filesystem.c
71+++ b/src/shared/base-filesystem.c 66+++ b/src/shared/base-filesystem.c
72@@ -53,7 +53,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 67@@ -117,7 +117,7 @@ int base_filesystem_create(const char *r
73 return log_error_errno(errno, "Failed to open root file system: %m"); 68 return log_error_errno(errno, "Failed to open root file system: %m");
74 69
75 for (size_t i = 0; i < ELEMENTSOF(table); i++) { 70 for (size_t i = 0; i < ELEMENTSOF(table); i++) {
@@ -78,7 +73,7 @@ index 016eb7b82a..b1967f9f2f 100644
78 continue; 73 continue;
79 74
80 if (table[i].target) { 75 if (table[i].target) {
81@@ -61,7 +61,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 76@@ -125,7 +125,7 @@ int base_filesystem_create(const char *r
82 77
83 /* check if one of the targets exists */ 78 /* check if one of the targets exists */
84 NULSTR_FOREACH(s, table[i].target) { 79 NULSTR_FOREACH(s, table[i].target) {
@@ -87,7 +82,7 @@ index 016eb7b82a..b1967f9f2f 100644
87 continue; 82 continue;
88 83
89 /* check if a specific file exists at the target path */ 84 /* check if a specific file exists at the target path */
90@@ -72,7 +72,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 85@@ -136,7 +136,7 @@ int base_filesystem_create(const char *r
91 if (!p) 86 if (!p)
92 return log_oom(); 87 return log_oom();
93 88