1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

s3: VFS: fake_acls: Fix Coverity CID 1435850 Uninitialized pointer read.

map_acl_perms_to_permset() can return an error, check it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Jeremy Allison 2018-11-09 14:13:47 -08:00 committed by Andreas Schneider
parent c1dd6382e3
commit 9b79d5f2a2

View File

@ -568,7 +568,10 @@ static int fake_acl_process_chmod(SMB_ACL_T *pp_the_acl,
} }
switch (tagtype) { switch (tagtype) {
case SMB_ACL_USER_OBJ: case SMB_ACL_USER_OBJ:
map_acl_perms_to_permset(umode, &permset); ret = map_acl_perms_to_permset(umode, &permset);
if (ret == -1) {
return -1;
}
break; break;
case SMB_ACL_USER: case SMB_ACL_USER:
puid = (uid_t *)sys_acl_get_qualifier(entry); puid = (uid_t *)sys_acl_get_qualifier(entry);
@ -578,18 +581,27 @@ static int fake_acl_process_chmod(SMB_ACL_T *pp_the_acl,
if (owner != *puid) { if (owner != *puid) {
break; break;
} }
map_acl_perms_to_permset(umode, &permset); ret = map_acl_perms_to_permset(umode, &permset);
if (ret == -1) {
return -1;
}
break; break;
case SMB_ACL_GROUP_OBJ: case SMB_ACL_GROUP_OBJ:
case SMB_ACL_GROUP: case SMB_ACL_GROUP:
/* Ignore all group entries. */ /* Ignore all group entries. */
break; break;
case SMB_ACL_MASK: case SMB_ACL_MASK:
map_acl_perms_to_permset(mmode, &permset); ret = map_acl_perms_to_permset(mmode, &permset);
if (ret == -1) {
return -1;
}
got_mask = true; got_mask = true;
break; break;
case SMB_ACL_OTHER: case SMB_ACL_OTHER:
map_acl_perms_to_permset(omode, &permset); ret = map_acl_perms_to_permset(omode, &permset);
if (ret == -1) {
return -1;
}
break; break;
default: default:
errno = EINVAL; errno = EINVAL;
@ -614,7 +626,10 @@ static int fake_acl_process_chmod(SMB_ACL_T *pp_the_acl,
if (ret == -1) { if (ret == -1) {
return -1; return -1;
} }
map_acl_perms_to_permset(mmode, &mask_permset); ret = map_acl_perms_to_permset(mmode, &mask_permset);
if (ret == -1) {
return -1;
}
ret = sys_acl_set_permset(mask_entry, mask_permset); ret = sys_acl_set_permset(mask_entry, mask_permset);
if (ret == -1) { if (ret == -1) {
return -1; return -1;