1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

nfs4acls: Use an anon struct for SMB4ACE_T

-typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
+struct SMB4ACE_T;

Same as for ACL_T

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2015-08-11 12:35:20 +02:00
parent f15ad38d14
commit 157711cb47
6 changed files with 21 additions and 21 deletions

View File

@ -190,7 +190,7 @@ static SMB_ACL4_INT_T *get_validated_aclint(struct SMB4ACL_T *theacl)
return aclint;
}
static SMB_ACE4_INT_T *get_validated_aceint(SMB4ACE_T *ace)
static SMB_ACE4_INT_T *get_validated_aceint(struct SMB4ACE_T *ace)
{
SMB_ACE4_INT_T *aceint = (SMB_ACE4_INT_T *)ace;
if (ace==NULL)
@ -224,7 +224,7 @@ struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx)
return (struct SMB4ACL_T *)theacl;
}
SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop)
struct SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop)
{
SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
SMB_ACE4_INT_T *ace;
@ -251,10 +251,10 @@ SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop)
}
aclint->naces++;
return (SMB4ACE_T *)ace;
return (struct SMB4ACE_T *)ace;
}
SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace)
SMB_ACE4PROP_T *smb_get_ace4(struct SMB4ACE_T *ace)
{
SMB_ACE4_INT_T *aceint = get_validated_aceint(ace);
if (aceint==NULL)
@ -263,22 +263,22 @@ SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace)
return &aceint->prop;
}
SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace)
struct SMB4ACE_T *smb_next_ace4(struct SMB4ACE_T *ace)
{
SMB_ACE4_INT_T *aceint = get_validated_aceint(ace);
if (aceint==NULL)
return NULL;
return (SMB4ACE_T *)aceint->next;
return (struct SMB4ACE_T *)aceint->next;
}
SMB4ACE_T *smb_first_ace4(struct SMB4ACL_T *theacl)
struct SMB4ACE_T *smb_first_ace4(struct SMB4ACL_T *theacl)
{
SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
if (aclint==NULL)
return NULL;
return (SMB4ACE_T *)aclint->first;
return (struct SMB4ACE_T *)aclint->first;
}
uint32_t smb_get_naces(struct SMB4ACL_T *theacl)

View File

@ -112,21 +112,21 @@ typedef struct _SMB_ACE4PROP_T {
* use create_smb4acl instead
*/
struct SMB4ACL_T;
typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
struct SMB4ACE_T;
struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx);
/* prop's contents are copied */
/* it doesn't change the order, appends */
SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop);
struct SMB4ACE_T *smb_add_ace4(struct SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop);
SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace);
SMB_ACE4PROP_T *smb_get_ace4(struct SMB4ACE_T *ace);
/* Returns NULL if none - or error */
SMB4ACE_T *smb_first_ace4(struct SMB4ACL_T *theacl);
struct SMB4ACE_T *smb_first_ace4(struct SMB4ACL_T *theacl);
/* Returns NULL in the end - or error */
SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace);
struct SMB4ACE_T *smb_next_ace4(struct SMB4ACE_T *ace);
uint32_t smb_get_naces(struct SMB4ACL_T *theacl);

View File

@ -349,7 +349,7 @@ static bool aixjfs2_process_smbacl(vfs_handle_struct *handle,
files_struct *fsp,
struct SMB4ACL_T *smbacl)
{
SMB4ACE_T *smbace;
struct SMB4ACE_T *smbace;
TALLOC_CTX *mem_ctx;
nfs4_acl_int_t *jfs2acl;
int32_t entryLen;

View File

@ -632,7 +632,7 @@ static struct gpfs_acl *vfs_gpfs_smbacl2gpfsacl(TALLOC_CTX *mem_ctx,
{
struct gpfs_acl *gacl;
gpfs_aclLen_t gacl_len;
SMB4ACE_T *smbace;
struct SMB4ACE_T *smbace;
gacl_len = offsetof(gpfs_acl_t, ace_v4) + sizeof(unsigned int)
+ smb_get_naces(smbacl) * sizeof(gpfs_ace_v4_t);
@ -1300,7 +1300,7 @@ static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
bool haveAllowEntry[SMB_ACE4_WHO_EVERYONE + 1] = {False, False, False, False};
int i;
files_struct fake_fsp = { 0 }; /* TODO: rationalize parametrization */
SMB4ACE_T *smbace;
struct SMB4ACE_T *smbace;
TALLOC_CTX *frame = talloc_stackframe();
DEBUG(10, ("gpfsacl_emu_chmod invoked for %s mode %o\n", path, mode));

View File

@ -182,7 +182,7 @@ static bool nfs4acl_smb4acl2nfs4acl(TALLOC_CTX *mem_ctx,
bool denymissingspecial)
{
struct nfs4acl *nfs4acl;
SMB4ACE_T *smbace;
struct SMB4ACE_T *smbace;
bool have_special_id = false;
int i;
@ -343,7 +343,7 @@ static NTSTATUS nfs4_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
static struct SMB4ACL_T *nfs4acls_defaultacl(TALLOC_CTX *mem_ctx)
{
struct SMB4ACL_T *pacl = NULL;
SMB4ACE_T *pace;
struct SMB4ACE_T *pace;
SMB_ACE4PROP_T ace = {
.flags = SMB_ACE4_ID_SPECIAL,
.who = {
@ -408,7 +408,7 @@ static struct SMB4ACL_T *nfs4acls_inheritacl(vfs_handle_struct *handle,
char *parent_dir = NULL;
struct SMB4ACL_T *pparentacl = NULL;
struct SMB4ACL_T *pchildacl = NULL;
SMB4ACE_T *pace;
struct SMB4ACE_T *pace;
SMB_ACE4PROP_T ace;
bool isdir;
struct smb_filename *smb_fname = NULL;
@ -469,7 +469,7 @@ static struct SMB4ACL_T *nfs4acls_inheritacl(vfs_handle_struct *handle,
for (pace = smb_first_ace4(pparentacl); pace != NULL;
pace = smb_next_ace4(pace)) {
SMB4ACE_T *pchildace;
struct SMB4ACE_T *pchildace;
ace = *smb_get_ace4(pace);
if ((isdir && !(ace.aceFlags & SMB_ACE4_DIRECTORY_INHERIT_ACE)) ||
(!isdir && !(ace.aceFlags & SMB_ACE4_FILE_INHERIT_ACE))) {

View File

@ -110,7 +110,7 @@ static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp,
{
int naces = smb_get_naces(smbacl), i;
ace_t *acebuf;
SMB4ACE_T *smbace;
struct SMB4ACE_T *smbace;
TALLOC_CTX *mem_ctx;
bool have_special_id = false;