chiark / gitweb /
smack: bugfix the smack label of symlink when '--with-smack-run-label' is set
[elogind.git] / src / core / mount-setup.c
index ed95cbbc27abc66f837f4c64ab804428643ea6bc..4713187e6c3c1b787000b4c42489f4f97b0ee149 100644 (file)
@@ -322,6 +322,11 @@ int mount_cgroup_controllers(char ***join_controllers) {
                                 r = symlink(options, t);
                                 if (r < 0 && errno != EEXIST)
                                         return log_error_errno(errno, "Failed to create symlink %s: %m", t);
+#ifdef SMACK_RUN_LABEL
+                                r = mac_smack_copy(t, options);
+                                if (r < 0 && r != -EOPNOTSUPP)
+                                        return log_error_errno(r, "Failed to copy smack label from %s to %s: %m", options, t);
+#endif
                         }
                 }
         }