nfs4_acls: Move smbacl4_MergeIgnoreReject function
authorChristof Schmitt <cs@samba.org>
Tue, 16 Jul 2019 22:20:25 +0000 (15:20 -0700)
committerChristof Schmitt <cs@samba.org>
Tue, 23 Jul 2019 18:27:26 +0000 (18:27 +0000)
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>
source3/modules/nfs4_acls.c

index 2317e0bc8b1ac5e96a6340d004fe31fb2e337a63..59a89587665248246c243ebef8edb4c66e586173 100644 (file)
@@ -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,42 +795,9 @@ 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,
-       gid_t ownerGID
-)
+static void smbacl4_substitute_special(struct SMB4ACL_T *acl,
+                                      uid_t ownerUID,
+                                      gid_t ownerGID)
 {
        struct SMB4ACE_T *aceint;