summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2019-07-16 15:20:25 -0700
committerKarolin Seeger <kseeger@samba.org>2019-08-26 10:23:28 +0000
commit02a5fbd007aa29834765c5d5a21fdb8ca493f552 (patch)
tree982a304d51dd3a751699a0ab59b7bfd4d02e492a
parent8c8f09c32f80667286b3790feb5adf3dcf926581 (diff)
downloadsamba-02a5fbd007aa29834765c5d5a21fdb8ca493f552.tar.gz
nfs4_acls: Move smbacl4_MergeIgnoreReject function
This static function will be called earlier in later patches. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14032 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 3499d97463110f042415d917160bc2743805a544)
-rw-r--r--source3/modules/nfs4_acls.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 2317e0bc8b1..cb407c6e032 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -654,6 +654,36 @@ static SMB_ACE4PROP_T *smbacl4_find_equal_special(
return NULL;
}
+static int smbacl4_MergeIgnoreReject(enum smbacl4_acedup_enum acedup,
+ struct SMB4ACL_T *theacl,
+ SMB_ACE4PROP_T *ace,
+ bool *paddNewACE)
+{
+ int result = 0;
+ SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special(theacl, ace);
+ if (ace4found)
+ {
+ switch(acedup)
+ {
+ case e_merge: /* "merge" flags */
+ *paddNewACE = false;
+ ace4found->aceFlags |= ace->aceFlags;
+ ace4found->aceMask |= ace->aceMask;
+ break;
+ case e_ignore: /* leave out this record */
+ *paddNewACE = false;
+ break;
+ case e_reject: /* do an error */
+ DBG_INFO("ACL rejected by duplicate nt ace.\n");
+ errno = EINVAL; /* SHOULD be set on any _real_ error */
+ result = -1;
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
static bool smbacl4_fill_ace4(
bool is_directory,
@@ -765,37 +795,6 @@ static bool smbacl4_fill_ace4(
return true; /* OK */
}
-static int smbacl4_MergeIgnoreReject(enum smbacl4_acedup_enum acedup,
- struct SMB4ACL_T *theacl,
- SMB_ACE4PROP_T *ace,
- bool *paddNewACE)
-{
- int result = 0;
- SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special(theacl, ace);
- if (ace4found)
- {
- switch(acedup)
- {
- case e_merge: /* "merge" flags */
- *paddNewACE = false;
- ace4found->aceFlags |= ace->aceFlags;
- ace4found->aceMask |= ace->aceMask;
- break;
- case e_ignore: /* leave out this record */
- *paddNewACE = false;
- break;
- case e_reject: /* do an error */
- DBG_INFO("ACL rejected by duplicate nt ace.\n");
- errno = EINVAL; /* SHOULD be set on any _real_ error */
- result = -1;
- break;
- default:
- break;
- }
- }
- return result;
-}
-
static int smbacl4_substitute_special(
struct SMB4ACL_T *acl,
uid_t ownerUID,