From 6baa7db00812437bbc87e73faa1a11b6cf631958 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 23 Oct 2014 17:34:30 +0200 Subject: mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention --- src/shared/smack-util.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/shared/smack-util.c') diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c index 33e1cd849e..0bedd75081 100644 --- a/src/shared/smack-util.c +++ b/src/shared/smack-util.c @@ -27,14 +27,14 @@ #include "path-util.h" #include "smack-util.h" -bool use_smack(void) { +bool mac_smack_use(void) { #ifdef HAVE_SMACK - static int use_smack_cached = -1; + static int cached_use = -1; - if (use_smack_cached < 0) - use_smack_cached = access("/sys/fs/smackfs/", F_OK) >= 0; + if (cached_use < 0) + cached_use = access("/sys/fs/smackfs/", F_OK) >= 0; - return use_smack_cached; + return cached_use; #else return false; #endif @@ -43,7 +43,7 @@ bool use_smack(void) { int mac_smack_set_path(const char *path, const char *label) { #ifdef HAVE_SMACK - if (!use_smack()) + if (!mac_smack_use()) return 0; if (label) @@ -57,7 +57,7 @@ int mac_smack_set_path(const char *path, const char *label) { int mac_smack_set_fd(int fd, const char *label) { #ifdef HAVE_SMACK - if (!use_smack()) + if (!mac_smack_use()) return 0; return fsetxattr(fd, "security.SMACK64", label, strlen(label), 0); @@ -68,7 +68,7 @@ int mac_smack_set_fd(int fd, const char *label) { int mac_smack_set_ip_out_fd(int fd, const char *label) { #ifdef HAVE_SMACK - if (!use_smack()) + if (!mac_smack_use()) return 0; return fsetxattr(fd, "security.SMACK64IPOUT", label, strlen(label), 0); @@ -79,7 +79,7 @@ int mac_smack_set_ip_out_fd(int fd, const char *label) { int mac_smack_set_ip_in_fd(int fd, const char *label) { #ifdef HAVE_SMACK - if (!use_smack()) + if (!mac_smack_use()) return 0; return fsetxattr(fd, "security.SMACK64IPIN", label, strlen(label), 0); -- cgit v1.2.3-54-g00ecf