diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-10-21 11:21:13 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-10-21 11:21:13 +0000 |
commit | b59317a71159f5f438f25bec1722c7c432d5d79a (patch) | |
tree | f212e0f3384aacabc66426280dcd2ce27ee566bc | |
parent | 7fdf6e4ca5d97d44a079f1b0f7649640347ff857 (diff) | |
download | FreeBSD-src-b59317a71159f5f438f25bec1722c7c432d5d79a.zip FreeBSD-src-b59317a71159f5f438f25bec1722c7c432d5d79a.tar.gz |
Modify libugidfw(3) to use MBI_* permission flags from mac_bsdextended.h
instead of using the V* permission flags from vnode.h. Remove include
of vnode.h.
Requested by: phk
-rw-r--r-- | lib/libugidfw/ugidfw.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c index 6f79b20..ac79b64 100644 --- a/lib/libugidfw/ugidfw.c +++ b/lib/libugidfw/ugidfw.c @@ -34,7 +34,6 @@ #include <sys/errno.h> #include <sys/time.h> #include <sys/sysctl.h> -#include <sys/vnode.h> #include <security/mac_bsdextended/mac_bsdextended.h> @@ -178,10 +177,10 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) left -= len; cur += len; - anymode = (rule->mbr_mode & VALLPERM); - unknownmode = (rule->mbr_mode & ~VALLPERM); + anymode = (rule->mbr_mode & MBI_ALLPERM); + unknownmode = (rule->mbr_mode & ~MBI_ALLPERM); - if (rule->mbr_mode & VADMIN) { + if (rule->mbr_mode & MBI_ADMIN) { len = snprintf(cur, left, "a"); if (len < 0 || len > left) goto truncated; @@ -189,7 +188,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) left -= len; cur += len; } - if (rule->mbr_mode & VREAD) { + if (rule->mbr_mode & MBI_READ) { len = snprintf(cur, left, "r"); if (len < 0 || len > left) goto truncated; @@ -197,7 +196,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) left -= len; cur += len; } - if (rule->mbr_mode & VSTAT) { + if (rule->mbr_mode & MBI_STAT) { len = snprintf(cur, left, "s"); if (len < 0 || len > left) goto truncated; @@ -205,7 +204,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) left -= len; cur += len; } - if (rule->mbr_mode & VWRITE) { + if (rule->mbr_mode & MBI_WRITE) { len = snprintf(cur, left, "w"); if (len < 0 || len > left) goto truncated; @@ -213,7 +212,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) left -= len; cur += len; } - if (rule->mbr_mode & VEXEC) { + if (rule->mbr_mode & MBI_EXEC) { len = snprintf(cur, left, "x"); if (len < 0 || len > left) goto truncated; @@ -425,19 +424,19 @@ bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen, for (i = 0; i < strlen(argv[0]); i++) { switch (argv[0][i]) { case 'a': - *mode |= VADMIN; + *mode |= MBI_ADMIN; break; case 'r': - *mode |= VREAD; + *mode |= MBI_READ; break; case 's': - *mode |= VSTAT; + *mode |= MBI_STAT; break; case 'w': - *mode |= VWRITE; + *mode |= MBI_WRITE; break; case 'x': - *mode |= VEXEC; + *mode |= MBI_EXEC; break; case 'n': /* ignore */ |