summaryrefslogtreecommitdiff
path: root/src/basic/smack-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-09 14:01:26 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-09 14:01:26 +0200
commit542a69a284805aaf5b92b0e5da39339967d516e3 (patch)
tree2a16ffd21b56d92be81fede6b0068888e1c4c3db /src/basic/smack-util.c
parent9c00a6adfa6c2ded071222b2ec76295480add34e (diff)
parentf8c1a81c5188ca121573caeee290e39ef966e3e6 (diff)
Merge pull request #1212 from again4you/devel/fix_smack_label_#3
Wrong smack label of the symlink in CGROUP root directory when enabling '--with-smack-run-label' (v3)
Diffstat (limited to 'src/basic/smack-util.c')
-rw-r--r--src/basic/smack-util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
index 6d5c205117..9e221d6eab 100644
--- a/src/basic/smack-util.c
+++ b/src/basic/smack-util.c
@@ -185,6 +185,23 @@ int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
return r;
}
+int mac_smack_copy(const char *dest, const char *src) {
+ int r = 0;
+ _cleanup_free_ char *label = NULL;
+
+ assert(dest);
+ assert(src);
+
+ r = mac_smack_read(src, SMACK_ATTR_ACCESS, &label);
+ if (r < 0)
+ return r;
+
+ r = mac_smack_apply(dest, SMACK_ATTR_ACCESS, label);
+ if (r < 0)
+ return r;
+
+ return r;
+}
#else
bool mac_smack_use(void) {
@@ -214,4 +231,8 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
return 0;
}
+
+int mac_smack_copy(const char *dest, const char *src) {
+ return 0;
+}
#endif