aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-11-01 17:45:29 +0000
committerMark Johnston <markj@FreeBSD.org>2018-11-01 17:45:29 +0000
commit49618eacb23c3f9a343d8ab4092ebbbaa53e6678 (patch)
tree70c33244863b2f0196904081d7d474801b0ec28f /bin
parenta9725b6332be3242ea6601090f7f274354436fe6 (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/getfacl/getfacl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c
index 45d6b451c67e..3f104bc40adb 100644
--- a/bin/getfacl/getfacl.c
+++ b/bin/getfacl/getfacl.c
@@ -88,7 +88,7 @@ getgname(gid_t gid)
* contained in struct stat
*/
static acl_t
-acl_from_stat(struct stat sb)
+acl_from_stat(const struct stat *sb)
{
acl_t acl;
acl_entry_t entry;
@@ -111,13 +111,13 @@ acl_from_stat(struct stat sb)
return NULL;
/* calculate user mode */
- if (sb.st_mode & S_IRUSR)
+ if (sb->st_mode & S_IRUSR)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
- if (sb.st_mode & S_IWUSR)
+ if (sb->st_mode & S_IWUSR)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
- if (sb.st_mode & S_IXUSR)
+ if (sb->st_mode & S_IXUSR)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -135,13 +135,13 @@ acl_from_stat(struct stat sb)
return NULL;
/* calculate group mode */
- if (sb.st_mode & S_IRGRP)
+ if (sb->st_mode & S_IRGRP)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
- if (sb.st_mode & S_IWGRP)
+ if (sb->st_mode & S_IWGRP)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
- if (sb.st_mode & S_IXGRP)
+ if (sb->st_mode & S_IXGRP)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -159,13 +159,13 @@ acl_from_stat(struct stat sb)
return NULL;
/* calculate other mode */
- if (sb.st_mode & S_IROTH)
+ if (sb->st_mode & S_IROTH)
if (acl_add_perm(perms, ACL_READ) == -1)
return NULL;
- if (sb.st_mode & S_IWOTH)
+ if (sb->st_mode & S_IWOTH)
if (acl_add_perm(perms, ACL_WRITE) == -1)
return NULL;
- if (sb.st_mode & S_IXOTH)
+ if (sb->st_mode & S_IXOTH)
if (acl_add_perm(perms, ACL_EXECUTE) == -1)
return NULL;
if (acl_set_permset(entry, perms) == -1)
@@ -229,7 +229,7 @@ print_acl(char *path, acl_type_t type, int hflag, int iflag, int nflag,
errno = 0;
if (type == ACL_TYPE_DEFAULT)
return(0);
- acl = acl_from_stat(sb);
+ acl = acl_from_stat(&sb);
if (!acl) {
warn("%s: acl_from_stat() failed", path);
return(-1);