summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAlexander Werth <alexander.werth@de.ibm.com>2013-04-15 16:08:46 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-05-09 06:18:21 +0200
commitbe0e2692461831dada5f5a497189a81e409e88f0 (patch)
tree65a745ba67e975dd3238c082f063419967207df3 /source3
parent9018aa82c7c8cf02950bb03e9075d1243f65c6e0 (diff)
downloadsamba-be0e2692461831dada5f5a497189a81e409e88f0.tar.gz
samba-be0e2692461831dada5f5a497189a81e409e88f0.tar.bz2
samba-be0e2692461831dada5f5a497189a81e409e88f0.zip
s3: Move up declaration of params struct and related function.
We need the parameters earlier in the code so we move up the declaration of the params struct. Since reading the parameters is closely related the definition of the function smbacl4_get_vfs_params has also been moved up. Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/nfs4_acls.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index fa6b2fe2a0..9d0651b417 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -54,6 +54,55 @@ typedef struct _SMB_ACL4_INT_T
SMB_ACE4_INT_T *last;
} SMB_ACL4_INT_T;
+enum smbacl4_mode_enum {e_simple=0, e_special=1};
+enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
+
+typedef struct _smbacl4_vfs_params {
+ enum smbacl4_mode_enum mode;
+ bool do_chown;
+ enum smbacl4_acedup_enum acedup;
+} smbacl4_vfs_params;
+
+/*
+ * Gather special parameters for NFS4 ACL handling
+ */
+static int smbacl4_get_vfs_params(
+ const char *type_name,
+ files_struct *fsp,
+ smbacl4_vfs_params *params
+)
+{
+ static const struct enum_list enum_smbacl4_modes[] = {
+ { e_simple, "simple" },
+ { e_special, "special" },
+ { -1 , NULL }
+ };
+ static const struct enum_list enum_smbacl4_acedups[] = {
+ { e_dontcare, "dontcare" },
+ { e_reject, "reject" },
+ { e_ignore, "ignore" },
+ { e_merge, "merge" },
+ { -1 , NULL }
+ };
+
+ memset(params, 0, sizeof(smbacl4_vfs_params));
+ params->mode = (enum smbacl4_mode_enum)lp_parm_enum(
+ SNUM(fsp->conn), type_name,
+ "mode", enum_smbacl4_modes, e_simple);
+ params->do_chown = lp_parm_bool(SNUM(fsp->conn), type_name,
+ "chown", true);
+ params->acedup = (enum smbacl4_acedup_enum)lp_parm_enum(
+ SNUM(fsp->conn), type_name,
+ "acedup", enum_smbacl4_acedups, e_dontcare);
+
+ DEBUG(10, ("mode:%s, do_chown:%s, acedup: %s\n",
+ enum_smbacl4_modes[params->mode].name,
+ params->do_chown ? "true" : "false",
+ enum_smbacl4_acedups[params->acedup].name));
+
+ return 0;
+}
+
/************************************************
Split the ACE flag mapping between nfs4 and Windows
into two separate functions rather than trying to do
@@ -462,55 +511,6 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
theacl);
}
-enum smbacl4_mode_enum {e_simple=0, e_special=1};
-enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
-
-typedef struct _smbacl4_vfs_params {
- enum smbacl4_mode_enum mode;
- bool do_chown;
- enum smbacl4_acedup_enum acedup;
-} smbacl4_vfs_params;
-
-/*
- * Gather special parameters for NFS4 ACL handling
- */
-static int smbacl4_get_vfs_params(
- const char *type_name,
- files_struct *fsp,
- smbacl4_vfs_params *params
-)
-{
- static const struct enum_list enum_smbacl4_modes[] = {
- { e_simple, "simple" },
- { e_special, "special" },
- { -1 , NULL }
- };
- static const struct enum_list enum_smbacl4_acedups[] = {
- { e_dontcare, "dontcare" },
- { e_reject, "reject" },
- { e_ignore, "ignore" },
- { e_merge, "merge" },
- { -1 , NULL }
- };
-
- memset(params, 0, sizeof(smbacl4_vfs_params));
- params->mode = (enum smbacl4_mode_enum)lp_parm_enum(
- SNUM(fsp->conn), type_name,
- "mode", enum_smbacl4_modes, e_simple);
- params->do_chown = lp_parm_bool(SNUM(fsp->conn), type_name,
- "chown", True);
- params->acedup = (enum smbacl4_acedup_enum)lp_parm_enum(
- SNUM(fsp->conn), type_name,
- "acedup", enum_smbacl4_acedups, e_dontcare);
-
- DEBUG(10, ("mode:%s, do_chown:%s, acedup: %s\n",
- enum_smbacl4_modes[params->mode].name,
- params->do_chown ? "true" : "false",
- enum_smbacl4_acedups[params->acedup].name));
-
- return 0;
-}
-
static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *theacl)
{
SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);