smack: never follow symlinks when relabelling

previously mac_smack_apply(path, NULL) would operate on the symlink
itself while mac_smack_apply(path, "foo") would follow the symlink.
Let's clean this up an always operate on the symlink, which appears to
be the safer option.
This commit is contained in:
Lennart Poettering
2014-10-23 21:36:56 +02:00
parent d53e386db6
commit d1ce2089b4
+1 -1
View File
@@ -50,7 +50,7 @@ int mac_smack_apply(const char *path, const char *label) {
return 0;
if (label)
r = setxattr(path, "security.SMACK64", label, strlen(label), 0);
r = lsetxattr(path, "security.SMACK64", label, strlen(label), 0);
else
r = lremovexattr(path, "security.SMACK64");
if (r < 0)