summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2018-08-06 11:31:04 +0200
committerLennart Poettering <lennart@poettering.net>2018-08-06 20:25:56 +0200
commit0ec113366dde85326efeb6d9625cb4499449ace5 (patch)
tree88fc1f8e97ea6bed6fe1537ef9514e8f973c802a /src
parent7735d9397b4ede86aebbada9ab01b241527fe525 (diff)
downloadsystemd-0ec113366dde85326efeb6d9625cb4499449ace5.tar.gz
systemd-0ec113366dde85326efeb6d9625cb4499449ace5.tar.bz2
systemd-0ec113366dde85326efeb6d9625cb4499449ace5.zip
smack-util: use 'path' paremeter as is if it's already absolute in mac_smack_fix_at()
Diffstat (limited to 'src')
-rw-r--r--src/basic/smack-util.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
index 5d7be1f1d5..e7ea78f349 100644
--- a/src/basic/smack-util.c
+++ b/src/basic/smack-util.c
@@ -197,11 +197,14 @@ int mac_smack_fix_at(int dirfd, const char *path, LabelFixFlags flags) {
return -errno;
}
- r = fd_get_path(fd, &p);
- if (r < 0)
- return r;
+ if (!path_is_absolute(path)) {
+ r = fd_get_path(fd, &p);
+ if (r < 0)
+ return r;
+ path = p;
+ }
- return smack_fix_fd(fd, p, flags);
+ return smack_fix_fd(fd, path, flags);
}
int mac_smack_fix(const char *path, LabelFixFlags flags) {