chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mac: rename all calls that apply a label mac_{selinux|smack}_apply_xyz(), and all...
[elogind.git]
/
src
/
shared
/
smack-util.c
diff --git
a/src/shared/smack-util.c
b/src/shared/smack-util.c
index 33e1cd849ec38677e9a1e2e18d911fe97a8e38b7..7726d69b0fce607035ee8365d34c9c0e8fd1ca3c 100644
(file)
--- a/
src/shared/smack-util.c
+++ b/
src/shared/smack-util.c
@@
-27,23
+27,23
@@
#include "path-util.h"
#include "smack-util.h"
#include "path-util.h"
#include "smack-util.h"
-bool
use_smack
(void) {
+bool
mac_smack_use
(void) {
#ifdef HAVE_SMACK
#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
}
#else
return false;
#endif
}
-int mac_smack_
set_path
(const char *path, const char *label) {
+int mac_smack_
apply
(const char *path, const char *label) {
#ifdef HAVE_SMACK
#ifdef HAVE_SMACK
- if (!
use_smack
())
+ if (!
mac_smack_use
())
return 0;
if (label)
return 0;
if (label)
@@
-55,9
+55,9
@@
int mac_smack_set_path(const char *path, const char *label) {
#endif
}
#endif
}
-int mac_smack_
set
_fd(int fd, const char *label) {
+int mac_smack_
apply
_fd(int fd, const char *label) {
#ifdef HAVE_SMACK
#ifdef HAVE_SMACK
- if (!
use_smack
())
+ if (!
mac_smack_use
())
return 0;
return fsetxattr(fd, "security.SMACK64", label, strlen(label), 0);
return 0;
return fsetxattr(fd, "security.SMACK64", label, strlen(label), 0);
@@
-66,9
+66,9
@@
int mac_smack_set_fd(int fd, const char *label) {
#endif
}
#endif
}
-int mac_smack_
set
_ip_out_fd(int fd, const char *label) {
+int mac_smack_
apply
_ip_out_fd(int fd, const char *label) {
#ifdef HAVE_SMACK
#ifdef HAVE_SMACK
- if (!
use_smack
())
+ if (!
mac_smack_use
())
return 0;
return fsetxattr(fd, "security.SMACK64IPOUT", label, strlen(label), 0);
return 0;
return fsetxattr(fd, "security.SMACK64IPOUT", label, strlen(label), 0);
@@
-77,9
+77,9
@@
int mac_smack_set_ip_out_fd(int fd, const char *label) {
#endif
}
#endif
}
-int mac_smack_
set
_ip_in_fd(int fd, const char *label) {
+int mac_smack_
apply
_ip_in_fd(int fd, const char *label) {
#ifdef HAVE_SMACK
#ifdef HAVE_SMACK
- if (!
use_smack
())
+ if (!
mac_smack_use
())
return 0;
return fsetxattr(fd, "security.SMACK64IPIN", label, strlen(label), 0);
return 0;
return fsetxattr(fd, "security.SMACK64IPIN", label, strlen(label), 0);
@@
-88,7
+88,7
@@
int mac_smack_set_ip_in_fd(int fd, const char *label) {
#endif
}
#endif
}
-int mac_smack_
relabel_in_dev
(const char *path) {
+int mac_smack_
fix
(const char *path) {
int r = 0;
#ifdef HAVE_SMACK
int r = 0;
#ifdef HAVE_SMACK