summaryrefslogtreecommitdiff
path: root/src/shared/smack-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 17:34:30 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-10-25 14:03:47 -0400
commitd9c4f21a139e999f25a68ec9742350efe6d1ad06 (patch)
treeed4e460bf9a44989158651403fcbde13f768bdd0 /src/shared/smack-util.c
parent538bf2441fa44b423c8bdf9d9c70b021c3f3334f (diff)
mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared/smack-util.c')
-rw-r--r--src/shared/smack-util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c
index 1b9c7ec93d..0fb2c9db94 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);