1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

libcli/security: add a function that checks for MS NFS ACEs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2014-10-14 13:54:05 +02:00 committed by Jeremy Allison
parent 549ee51674
commit 2ab6b43da6
2 changed files with 24 additions and 0 deletions

View File

@ -595,3 +595,25 @@ struct security_ace *security_ace_create(TALLOC_CTX *mem_ctx,
return ace;
}
/*******************************************************************
Check for MS NFS ACEs in a sd
*******************************************************************/
bool security_descriptor_with_ms_nfs(const struct security_descriptor *psd)
{
int i;
if (psd->dacl == NULL) {
return false;
}
for (i = 0; i < psd->dacl->num_aces; i++) {
if (dom_sid_compare_domain(
&global_sid_Unix_NFS,
&psd->dacl->aces[i].trustee) == 0) {
return true;
}
}
return false;
}

View File

@ -81,4 +81,6 @@ struct security_descriptor *create_security_descriptor(TALLOC_CTX *mem_ctx,
struct dom_sid *default_group, /* valid only for DS, NULL for the other RSs */
uint32_t (*generic_map)(uint32_t access_mask));
bool security_descriptor_with_ms_nfs(const struct security_descriptor *psd);
#endif /* __SECURITY_DESCRIPTOR_H__ */