summaryrefslogtreecommitdiff
path: root/src/basic/smack-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/smack-util.c')
-rw-r--r--src/basic/smack-util.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
index 6d5c20511..a5fd687b8 100644
--- a/src/basic/smack-util.c
+++ b/src/basic/smack-util.c
@@ -29,9 +29,6 @@
#include "fileio.h"
#include "smack-util.h"
-#define SMACK_FLOOR_LABEL "_"
-#define SMACK_STAR_LABEL "*"
-
#ifdef HAVE_SMACK
bool mac_smack_use(void) {
static int cached_use = -1;
@@ -42,6 +39,8 @@ bool mac_smack_use(void) {
return cached_use;
}
+/// UNNEEDED by elogind
+#if 0
static const char* const smack_attr_table[_SMACK_ATTR_MAX] = {
[SMACK_ATTR_ACCESS] = "security.SMACK64",
[SMACK_ATTR_EXEC] = "security.SMACK64EXEC",
@@ -129,6 +128,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
return r;
}
+#endif // 0
int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
struct stat st;
@@ -185,12 +185,34 @@ int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
return r;
}
+/// UNNEEDED by elogind
+#if 0
+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;
+}
+#endif // 0
#else
bool mac_smack_use(void) {
return false;
}
+/// UNNEEDED by elogind
+#if 0
int mac_smack_read(const char *path, SmackAttr attr, char **label) {
return -EOPNOTSUPP;
}
@@ -210,8 +232,16 @@ int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label) {
int mac_smack_apply_pid(pid_t pid, const char *label) {
return 0;
}
+#endif // 0
int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
return 0;
}
+
+/// UNNEEDED by elogind
+#if 0
+int mac_smack_copy(const char *dest, const char *src) {
+ return 0;
+}
+#endif // 0
#endif