summaryrefslogtreecommitdiff
path: root/src/shared/chown-recursive.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-18 09:43:25 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-19 09:19:27 +0200
commitddb6eeafe2d3445eeab2c450cf9d270d68b3a4b7 (patch)
tree4ff19b6603b181e4e6f8c1181fbbc7256937479d /src/shared/chown-recursive.c
parent48a01cd93483d93de6f58431bb316dcedc55f3d3 (diff)
downloadsystemd-ddb6eeafe2d3445eeab2c450cf9d270d68b3a4b7.tar.gz
tree-wide: port things over to FORMAT_PROC_FD_PATH()
Diffstat (limited to 'src/shared/chown-recursive.c')
-rw-r--r--src/shared/chown-recursive.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/shared/chown-recursive.c b/src/shared/chown-recursive.c
index 4563729b7c..50848715e3 100644
--- a/src/shared/chown-recursive.c
+++ b/src/shared/chown-recursive.c
@@ -21,7 +21,6 @@ static int chown_one(
gid_t gid,
mode_t mask) {
- char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
const char *n;
int r;
@@ -30,11 +29,10 @@ static int chown_one(
/* We change ACLs through the /proc/self/fd/%i path, so that we have a stable reference that works
* with O_PATH. */
- xsprintf(procfs_path, "/proc/self/fd/%i", fd);
/* Drop any ACL if there is one */
FOREACH_STRING(n, "system.posix_acl_access", "system.posix_acl_default")
- if (removexattr(procfs_path, n) < 0)
+ if (removexattr(FORMAT_PROC_FD_PATH(fd), n) < 0)
if (!IN_SET(errno, ENODATA, EOPNOTSUPP, ENOSYS, ENOTTY))
return -errno;