summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-09-07 15:49:47 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-09-12 05:26:16 +0200
commitac804f0d7f5a93ff2710e213d9213ad9960a15d6 (patch)
tree938a8c734adc57e168459001135e3cfdf1302af5 /source3/lib
parentbd2f1604d73f05f3b2f151a81f09824c7bb99ab5 (diff)
downloadsamba-ac804f0d7f5a93ff2710e213d9213ad9960a15d6.tar.gz
samba-ac804f0d7f5a93ff2710e213d9213ad9960a15d6.tar.bz2
samba-ac804f0d7f5a93ff2710e213d9213ad9960a15d6.zip
smbd-posix_acls: Use a IDL union to store the ACL entry
This is a clearer, long-term-stable structure we can hash without risking it changing. Andrew Bartlett
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/sysacls.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index 31966c6077..1b6eb9a35c 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -107,11 +107,11 @@ int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d)
{
if (entry_d->a_type == SMB_ACL_USER) {
- return &entry_d->uid;
+ return &entry_d->info.user.uid;
}
if (entry_d->a_type == SMB_ACL_GROUP) {
- return &entry_d->gid;
+ return &entry_d->info.group.gid;
}
errno = EINVAL;
@@ -189,15 +189,15 @@ char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p)
break;
case SMB_ACL_USER:
- id = uidtoname(ap->uid);
+ id = uidtoname(ap->info.user.uid);
case SMB_ACL_USER_OBJ:
tag = "user";
break;
case SMB_ACL_GROUP:
- if ((gr = getgrgid(ap->gid)) == NULL) {
+ if ((gr = getgrgid(ap->info.group.gid)) == NULL) {
slprintf(idbuf, sizeof(idbuf)-1, "%ld",
- (long)ap->gid);
+ (long)ap->info.group.gid);
id = idbuf;
} else {
id = gr->gr_name;
@@ -294,8 +294,6 @@ int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p)
entry_d = &acl_d->acl[acl_d->count++];
entry_d->a_type = SMB_ACL_TAG_INVALID;
- entry_d->uid = -1;
- entry_d->gid = -1;
entry_d->a_perm = 0;
*entry_p = entry_d;
@@ -324,11 +322,11 @@ int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type)
int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p)
{
if (entry_d->a_type == SMB_ACL_USER) {
- entry_d->uid = *((uid_t *)qual_p);
+ entry_d->info.user.uid = *((uid_t *)qual_p);
return 0;
}
if (entry_d->a_type == SMB_ACL_GROUP) {
- entry_d->gid = *((gid_t *)qual_p);
+ entry_d->info.group.gid = *((gid_t *)qual_p);
return 0;
}