nfs4acls: Add some const
[samba.git] / source3 / modules / nfs4_acls.c
index 26a98b7247196e264aed83254e8cc5549d2bf02d..f5f6302d962a23a658f9161080e10ff440e0c4ac 100644 (file)
@@ -54,19 +54,19 @@ struct SMB4ACL_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 {
+struct smbacl4_vfs_params {
        enum smbacl4_mode_enum mode;
        bool do_chown;
        enum smbacl4_acedup_enum acedup;
        bool map_full_control;
-} smbacl4_vfs_params;
+};
 
 /*
  * Gather special parameters for NFS4 ACL handling
  */
 static int smbacl4_get_vfs_params(
        struct connection_struct *conn,
-       smbacl4_vfs_params *params
+       struct smbacl4_vfs_params *params
 )
 {
        static const struct enum_list enum_smbacl4_modes[] = {
@@ -268,13 +268,13 @@ bool smbacl4_set_controlflags(struct SMB4ACL_T *acl, uint16_t controlflags)
 }
 
 static int smbacl4_GetFileOwner(struct connection_struct *conn,
-                               const char *filename,
+                               const struct smb_filename *smb_fname,
                                SMB_STRUCT_STAT *psbuf)
 {
        ZERO_STRUCTP(psbuf);
 
        /* Get the stat struct for the owner info. */
-       if (vfs_stat_smb_basename(conn, filename, psbuf) != 0)
+       if (vfs_stat_smb_basename(conn, smb_fname, psbuf) != 0)
        {
                DEBUG(8, ("vfs_stat_smb_basename failed with error %s\n",
                        strerror(errno)));
@@ -290,7 +290,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
 
        if (fsp->fh->fd == -1) {
                return smbacl4_GetFileOwner(fsp->conn,
-                                           fsp->fsp_name->base_name, psbuf);
+                                           fsp->fsp_name, psbuf);
        }
        if (SMB_VFS_FSTAT(fsp, psbuf) != 0)
        {
@@ -303,7 +303,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
 }
 
 static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
-       smbacl4_vfs_params *params,
+       const struct smbacl4_vfs_params *params,
        struct SMB4ACL_T *acl, /* in */
        struct dom_sid *psid_owner, /* in */
        struct dom_sid *psid_group, /* in */
@@ -472,7 +472,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
 }
 
 static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf,
-                                          smbacl4_vfs_params *params,
+                                          const struct smbacl4_vfs_params *params,
                                           uint32_t security_info,
                                           TALLOC_CTX *mem_ctx,
                                           struct security_descriptor **ppdesc,
@@ -539,7 +539,7 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
                              struct SMB4ACL_T *theacl)
 {
        SMB_STRUCT_STAT sbuf;
-       smbacl4_vfs_params params;
+       struct smbacl4_vfs_params params;
 
        DEBUG(10, ("smb_fget_nt_acl_nfs4 invoked for %s\n", fsp_str_dbg(fsp)));
 
@@ -557,18 +557,19 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
 }
 
 NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
-                            const char *name,
+                            const struct smb_filename *smb_fname,
                             uint32_t security_info,
                             TALLOC_CTX *mem_ctx,
                             struct security_descriptor **ppdesc,
                             struct SMB4ACL_T *theacl)
 {
        SMB_STRUCT_STAT sbuf;
-       smbacl4_vfs_params params;
+       struct smbacl4_vfs_params params;
 
-       DEBUG(10, ("smb_get_nt_acl_nfs4 invoked for %s\n", name));
+       DEBUG(10, ("smb_get_nt_acl_nfs4 invoked for %s\n",
+               smb_fname->base_name));
 
-       if (smbacl4_GetFileOwner(conn, name, &sbuf)) {
+       if (smbacl4_GetFileOwner(conn, smb_fname, &sbuf)) {
                return map_nt_error_from_unix(errno);
        }
 
@@ -647,7 +648,7 @@ static SMB_ACE4PROP_T *smbacl4_find_equal_special(
 
 static bool smbacl4_fill_ace4(
        const struct smb_filename *filename,
-       smbacl4_vfs_params *params,
+       const struct smbacl4_vfs_params *params,
        uid_t ownerUID,
        gid_t ownerGID,
        const struct security_ace *ace_nt, /* input */
@@ -852,7 +853,7 @@ static struct SMB4ACL_T *smbacl4_win2nfs4(
        TALLOC_CTX *mem_ctx,
        const files_struct *fsp,
        const struct security_acl *dacl,
-       smbacl4_vfs_params *pparams,
+       const struct smbacl4_vfs_params *pparams,
        uid_t ownerUID,
        gid_t ownerGID
 )
@@ -906,7 +907,7 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
        const struct security_descriptor *psd,
        set_nfs4acl_native_fn_t set_nfs4_native)
 {
-       smbacl4_vfs_params params;
+       struct smbacl4_vfs_params params;
        struct SMB4ACL_T *theacl = NULL;
        bool    result;
 
@@ -967,7 +968,7 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
                                  fsp_str_dbg(fsp), (unsigned int)newUID,
                                  (unsigned int)newGID));
                        if (smbacl4_GetFileOwner(fsp->conn,
-                                                fsp->fsp_name->base_name,
+                                                fsp->fsp_name,
                                                 &sbuf)){
                                TALLOC_FREE(frame);
                                return map_nt_error_from_unix(errno);