s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * instead...
authorJeremy Allison <jra@samba.org>
Wed, 24 May 2017 17:47:46 +0000 (10:47 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 31 May 2017 20:50:22 +0000 (22:50 +0200)
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
35 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/smb_acls.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/sysacls.c
source3/modules/posixacl_xattr.c
source3/modules/posixacl_xattr.h
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c
source3/modules/vfs_aixacl.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_default.c
source3/modules/vfs_fake_acls.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_hpuxacl.h
source3/modules/vfs_media_harmony.c
source3/modules/vfs_nfs4acl_xattr.c
source3/modules/vfs_posixacl.c
source3/modules/vfs_posixacl.h
source3/modules/vfs_solarisacl.c
source3/modules/vfs_solarisacl.h
source3/modules/vfs_time_audit.c
source3/modules/vfs_tru64acl.c
source3/modules/vfs_tru64acl.h
source3/modules/vfs_unityed_media.c
source3/modules/vfs_vxfs.c
source3/modules/vfs_zfsacl.c
source3/smbd/posix_acls.c
source3/smbd/pysmbd.c
source3/smbd/vfs.c

index 8ecd0bef473a819128a7d5c219eefb9198a5048f..e7158203c50a335b04bb51f092c3088cf912a6e7 100644 (file)
@@ -774,8 +774,10 @@ static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
-                                SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int skel_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
        errno = ENOSYS;
        return -1;
index 82d3c37408c544724a9a4c6fcab694fedcadec7e..05d672348450ebe4708acb2aca328a343c6431f7 100644 (file)
@@ -912,10 +912,13 @@ static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
                                                blob_description, blob);
 }
 
-static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
-                                SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int skel_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
-       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
+       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
+                       acltype, theacl);
 }
 
 static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
index f5603f3f38bb10c32489db2216e521555adc8747..73b67af020e75b094917b523ad9783f4b431afa4 100644 (file)
@@ -59,7 +59,9 @@ SMB_ACL_T sys_acl_get_file(struct vfs_handle_struct *handle,
 SMB_ACL_T sys_acl_get_fd(struct vfs_handle_struct *handle, struct files_struct *fsp,
                         TALLOC_CTX *mem_ctx);
 int sys_acl_set_file(struct vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d);
 int sys_acl_set_fd(struct vfs_handle_struct *handle, struct files_struct *fsp,
                   SMB_ACL_T acl_d);
 int sys_acl_delete_def_file(struct vfs_handle_struct *handle,
index e32952a582a20cd371b0cdd90a1463eb7c0ecf42..f3a0b323923d3076faca9979cbee01ec1d4561b1 100644 (file)
                to const struct smb_filename * */
 /* Version 37 - Change sys_acl_blob_get_file from const char *
                to const struct smb_filename * */
+/* Version 37 - Change sys_acl_set_file from const char *
+               to const struct smb_filename * */
 
 #define SMB_VFS_INTERFACE_VERSION 37
 
@@ -876,7 +878,10 @@ struct vfs_fn_pointers {
        int (*sys_acl_blob_get_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp,
                                      TALLOC_CTX *mem_ctx, char **blob_description,
                                      DATA_BLOB *blob);
-       int (*sys_acl_set_file_fn)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
+       int (*sys_acl_set_file_fn)(struct vfs_handle_struct *handle,
+                                       const struct smb_filename *smb_fname,
+                                       SMB_ACL_TYPE_T acltype,
+                                       SMB_ACL_T theacl);
        int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl);
        int (*sys_acl_delete_def_file_fn)(struct vfs_handle_struct *handle,
                                        const struct smb_filename *smb_fname);
@@ -1335,8 +1340,9 @@ int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle,
                                     char **blob_description,
                                     DATA_BLOB *blob);
 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle,
-                                 const char *name, SMB_ACL_TYPE_T acltype,
-                                 SMB_ACL_T theacl);
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl);
 int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct *handle,
                                struct files_struct *fsp, SMB_ACL_T theacl);
 int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle,
index 0ca601a89ab0f1b6e89841fe8ffa1e854ad1a93d..ac04093b10891e29599af0ddc9619c4d023045c4 100644 (file)
 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob) \
        smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob))
 
-#define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) \
-       smb_vfs_call_sys_acl_set_file((conn)->vfs_handles, (name), (acltype), (theacl))
-#define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl) \
-       smb_vfs_call_sys_acl_set_file((handle)->next, (name), (acltype), (theacl))
+#define SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname, acltype, theacl) \
+       smb_vfs_call_sys_acl_set_file((conn)->vfs_handles, (smb_fname), (acltype), (theacl))
+#define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype, theacl) \
+       smb_vfs_call_sys_acl_set_file((handle)->next, (smb_fname), (acltype), (theacl))
 
 #define SMB_VFS_SYS_ACL_SET_FD(fsp, theacl) \
        smb_vfs_call_sys_acl_set_fd((fsp)->conn->vfs_handles, (fsp), (theacl))
index 8016773110a62067eed62ec32fe7cc2c29fab23a..0bf3c37edfa517dd08680dccbf79a492ec4c67b8 100644 (file)
@@ -375,9 +375,11 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, TALLOC_CT
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
-       return posixacl_sys_acl_set_file(handle, name, type, acl_d);
+       return posixacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -409,9 +411,11 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
-       return aixacl_sys_acl_set_file(handle, name, type, acl_d);
+       return aixacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -444,9 +448,11 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
-       return tru64acl_sys_acl_set_file(handle, name, type, acl_d);
+       return tru64acl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -480,9 +486,11 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
-       return solarisacl_sys_acl_set_file(handle, name, type, acl_d);
+       return solarisacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -514,9 +522,11 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
-       return hpuxacl_sys_acl_set_file(handle, name, type, acl_d);
+       return hpuxacl_sys_acl_set_file(handle, smb_fname, type, acl_d);
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -558,7 +568,9 @@ SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T acl_d)
 {
 #ifdef ENOTSUP
        errno = ENOTSUP;
index ded16a0bfba968e6e66b9808a26472721b0973d6..416295fc6a88647de3e5e17c60d1155c6b68b3a0 100644 (file)
@@ -444,7 +444,7 @@ SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle,
 }
 
 int posixacl_xattr_acl_set_file(vfs_handle_struct *handle,
-                               const char *path_p,
+                               const struct smb_filename *smb_fname,
                                SMB_ACL_TYPE_T type,
                                SMB_ACL_T theacl)
 {
@@ -474,7 +474,8 @@ int posixacl_xattr_acl_set_file(vfs_handle_struct *handle,
                return -1;
        }
 
-       return SMB_VFS_SETXATTR(handle->conn, path_p, name, buf, size, 0);
+       return SMB_VFS_SETXATTR(handle->conn, smb_fname->base_name,
+                       name, buf, size, 0);
 }
 
 int posixacl_xattr_acl_set_fd(vfs_handle_struct *handle,
index 8751692f5715a3ccadbc7df2320ffd2bae18ec51..70962dd3115864734cba434a565c62cd2cddb805 100644 (file)
@@ -31,7 +31,7 @@ SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle,
                                    TALLOC_CTX *mem_ctx);
 
 int posixacl_xattr_acl_set_file(vfs_handle_struct *handle,
-                               const char *name,
+                               const struct smb_filename *smb_fname,
                                SMB_ACL_TYPE_T type,
                                SMB_ACL_T theacl);
 
index 68abc33012ce1f65a4404f0144bc282f998424f0..817add71fb9de0adba782e0dfba3f5d5010baa9b 100644 (file)
@@ -246,7 +246,7 @@ static int unlink_acl_tdb(vfs_handle_struct *handle,
        struct db_context *db = acl_db;
        int ret = -1;
 
-       smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
+       smb_fname_tmp = cp_smb_filename_nostream(talloc_tos(), smb_fname);
        if (smb_fname_tmp == NULL) {
                errno = ENOMEM;
                goto out;
@@ -383,31 +383,44 @@ static int connect_acl_tdb(struct vfs_handle_struct *handle,
 *********************************************************************/
 
 static int sys_acl_set_file_tdb(vfs_handle_struct *handle,
-                              const char *path,
-                              SMB_ACL_TYPE_T type,
-                              SMB_ACL_T theacl)
+                       const struct smb_filename *smb_fname_in,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T theacl)
 {
        struct db_context *db = acl_db;
        int ret = -1;
-       struct smb_filename smb_fname = {
-               .base_name = discard_const_p(char, path)
+       int saved_errno = 0;
+       struct smb_filename *smb_fname = NULL;
+
+       smb_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname_in);
+       if (smb_fname == NULL) {
+               return -1;
        };
 
-       ret = SMB_VFS_STAT(handle->conn, &smb_fname);
+       ret = SMB_VFS_STAT(handle->conn, smb_fname);
        if (ret == -1) {
-               return -1;
+               saved_errno = errno;
+               goto fail;
        }
 
        ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle,
-                                               path,
+                                               smb_fname,
                                                type,
                                                theacl);
        if (ret == -1) {
-               return -1;
+               saved_errno = errno;
+               goto fail;
        }
 
-       acl_tdb_delete(handle, db, &smb_fname.st);
-       return 0;
+       acl_tdb_delete(handle, db, &smb_fname->st);
+
+fail:
+       TALLOC_FREE(smb_fname);
+
+       if (saved_errno != 0) {
+               errno = saved_errno;
+       }
+       return ret;
 }
 
 /*********************************************************************
index 96bd0166655bae5d0c74f7248941532af58954b6..1dc70824bf573cb49fa332b6604c99c4539b5bc4 100644 (file)
@@ -168,12 +168,12 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
 *********************************************************************/
 
 static int sys_acl_set_file_xattr(vfs_handle_struct *handle,
-                              const char *name,
-                              SMB_ACL_TYPE_T type,
-                              SMB_ACL_T theacl)
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T type,
+                               SMB_ACL_T theacl)
 {
        int ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle,
-                                               name,
+                                               smb_fname,
                                                type,
                                                theacl);
        if (ret == -1) {
@@ -181,7 +181,8 @@ static int sys_acl_set_file_xattr(vfs_handle_struct *handle,
        }
 
        become_root();
-       SMB_VFS_REMOVEXATTR(handle->conn, name, XATTR_NTACL_NAME);
+       SMB_VFS_REMOVEXATTR(handle->conn, smb_fname->base_name,
+                       XATTR_NTACL_NAME);
        unbecome_root();
 
        return ret;
index 024c9aa2691081d878990ef0278d04102e0c6838..f6c42cb40b55bfece9a56fda34dbfc6a1674f402 100644 (file)
@@ -134,9 +134,9 @@ SMB_ACL_T aixacl_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 int aixacl_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
-                             SMB_ACL_TYPE_T type,
-                             SMB_ACL_T theacl)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T theacl)
 {
        struct acl *file_acl = NULL;
        unsigned int rc;
@@ -145,7 +145,7 @@ int aixacl_sys_acl_set_file(vfs_handle_struct *handle,
        if (!file_acl)
                return -1;
 
-       rc = chacl((char *)name,file_acl,file_acl->acl_len);
+       rc = chacl((char *)smb_fname->base_name,file_acl,file_acl->acl_len);
        DEBUG(10,("errno is %d\n",errno));
        DEBUG(10,("return code is %d\n",rc));
        SAFE_FREE(file_acl);
index 8613b59ccc6166903d85416c6a43bbd9e5ee0e6b..2e4b61e369dde6ff0a239d694289e0218305beae 100644 (file)
@@ -468,9 +468,9 @@ NTSTATUS aixjfs2_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint3
 }
 
 int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
-                             SMB_ACL_TYPE_T type,
-                             SMB_ACL_T theacl)
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T type,
+                               SMB_ACL_T theacl)
 {
        struct acl      *acl_aixc;
        acl_type_t      acl_type_info;
@@ -478,7 +478,8 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
 
        DEBUG(10, ("aixjfs2_sys_acl_set_file invoked for %s", name));
 
-       rc = aixjfs2_query_acl_support((char *)name, ACL_AIXC, &acl_type_info);
+       rc = aixjfs2_query_acl_support((char *)smb_fname->base_name,
+                       ACL_AIXC, &acl_type_info);
        if (rc) {
                DEBUG(8, ("jfs2_set_nt_acl: AIXC support not found\n"));
                return -1;
@@ -498,7 +499,7 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
        );
        if (rc) {
                DEBUG(2, ("aclx_put failed with %s for %s\n",
-                       strerror(errno), name));
+                       strerror(errno), smb_fname->base_name));
                return -1;
        }
 
index 8aba4314fcb32b20ef0e3c479666a6b57a7510b6..8d621ccec5e800ae9b9db29c87910f9bec5cee0a 100644 (file)
@@ -581,15 +581,41 @@ static SMB_ACL_T cap_sys_acl_get_file(vfs_handle_struct *handle,
        return ret;
 }
 
-static int cap_sys_acl_set_file(vfs_handle_struct *handle, const char *path, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int cap_sys_acl_set_file(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T acltype,
+                       SMB_ACL_T theacl)
 {
-       char *cappath = capencode(talloc_tos(), path);
+       struct smb_filename *cap_smb_fname = NULL;
+       char *cappath = capencode(talloc_tos(), smb_fname->base_name);
+       int ret;
+       int saved_errno = 0;
 
        if (!cappath) {
                errno = ENOMEM;
                return -1;
        }
-       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, cappath, acltype, theacl);
+       cap_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       cappath,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
+       if (cap_smb_fname == NULL) {
+               TALLOC_FREE(cappath);
+               errno = ENOMEM;
+               return -1;
+       }
+       ret =  SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, cap_smb_fname,
+                               acltype, theacl);
+       if (ret == -1) {
+               saved_errno = errno;
+       }
+       TALLOC_FREE(cappath);
+       TALLOC_FREE(cap_smb_fname);
+       if (saved_errno != 0) {
+               errno = saved_errno;
+       }
+       return ret;
 }
 
 static int cap_sys_acl_delete_def_file(vfs_handle_struct *handle,
index 18dbc80cd8790c3193551af94d31d2660b5888e3..24fc26d122f0a29d418f6dd2e11bffc42a637ec8 100644 (file)
@@ -1291,24 +1291,46 @@ catia_sys_acl_get_file(vfs_handle_struct *handle,
 
 static int
 catia_sys_acl_set_file(vfs_handle_struct *handle,
-                      const char *path,
-                      SMB_ACL_TYPE_T type,
-                      SMB_ACL_T theacl)
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T type,
+                       SMB_ACL_T theacl)
 {
+       struct smb_filename *mapped_smb_fname = NULL;
+       int saved_errno = 0;
        char *mapped_name = NULL;
        NTSTATUS status;
        int ret;
 
        status = catia_string_replace_allocate(handle->conn,
-                               path, &mapped_name, vfs_translate_to_unix);
+                               smb_fname->base_name,
+                               &mapped_name,
+                               vfs_translate_to_unix);
        if (!NT_STATUS_IS_OK(status)) {
                errno = map_errno_from_nt_status(status);
                return -1;
        }
 
-       ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, mapped_name, type, theacl);
-       TALLOC_FREE(mapped_name);
+       mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       mapped_name,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
+       if (mapped_smb_fname == NULL) {
+               TALLOC_FREE(mapped_name);
+               errno = ENOMEM;
+               return -1;
+       }
 
+       ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, mapped_smb_fname,
+                       type, theacl);
+       if (ret == -1) {
+               saved_errno = errno;
+       }
+       TALLOC_FREE(mapped_smb_fname);
+       TALLOC_FREE(mapped_name);
+       if (saved_errno != 0) {
+               errno = saved_errno;
+       }
        return ret;
 }
 
index c3de3d7572d2f05510bfc283f776d70c78c655ad..ad47f38105ff6fc903bfcf0d1a608138f9852dfd 100644 (file)
@@ -2724,9 +2724,12 @@ static SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle,
        return sys_acl_get_fd(handle, fsp, mem_ctx);
 }
 
-static int vfswrap_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int vfswrap_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
-       return sys_acl_set_file(handle, name, acltype, theacl);
+       return sys_acl_set_file(handle, smb_fname, acltype, theacl);
 }
 
 static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
index cb8d12395cc50cd21b68a7a3b4991791d8fd2c90..fc655c874eb404cc63bbcd46d1437e1c19628655 100644 (file)
@@ -316,7 +316,10 @@ static SMB_ACL_T fake_acls_sys_acl_get_fd(struct vfs_handle_struct *handle,
 }
 
 
-static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle, const char *path, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       SMB_ACL_TYPE_T acltype,
+                       SMB_ACL_T theacl)
 {
        int ret;
        const char *name = NULL;
@@ -336,7 +339,8 @@ static int fake_acls_sys_acl_set_file(vfs_handle_struct *handle, const char *pat
                name = FAKE_ACL_DEFAULT_XATTR;
                break;
        }
-       ret = SMB_VFS_NEXT_SETXATTR(handle, path, name, blob.data, blob.length, 0);
+       ret = SMB_VFS_NEXT_SETXATTR(handle, smb_fname->base_name,
+                       name, blob.data, blob.length, 0);
        TALLOC_FREE(frame);
        return ret;
 }
index 6d281d88c901fbf497885bd63ba1bcbd4494e48c..07f01c27e992f041c04deeb433dd4e40dbe3a724 100644 (file)
@@ -2214,17 +2214,17 @@ static int smb_full_audit_sys_acl_blob_get_fd(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
-
-                                 const char *name, SMB_ACL_TYPE_T acltype,
-                                 SMB_ACL_T theacl)
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype,
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype,
                                               theacl);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_FILE, (result >= 0), handle,
-              "%s", name);
+              "%s", smb_fname->base_name);
 
        return result;
 }
index 87ddf5de4138873d6d2274dfb989fe44861c7538..4dc9f76a42d488afc5fb7b95ed2c6d97c38a3190 100644 (file)
@@ -1233,7 +1233,7 @@ static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl,
 }
 
 static int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
-                                   const char *name,
+                                   const struct smb_filename *smb_fname,
                                    SMB_ACL_TYPE_T type,
                                    SMB_ACL_T theacl)
 {
@@ -1246,7 +1246,8 @@ static int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
                                return -1);
 
        if (!config->acl) {
-               return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, type, theacl);
+               return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
+                               type, theacl);
        }
 
        gpfs_acl = smb2gpfs_acl(theacl, type);
@@ -1254,7 +1255,7 @@ static int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
                return -1;
        }
 
-       result = gpfswrap_putacl(discard_const_p(char, name),
+       result = gpfswrap_putacl(discard_const_p(char, smb_fname->base_name),
                                 GPFS_PUTACL_STRUCT|GPFS_ACL_SAMBA, gpfs_acl);
 
        SAFE_FREE(gpfs_acl);
index c344cb95fde619717001f4876717adcb7e360905..53e0ad6fe803c5e33841e0fe8ccc17c44a151178 100644 (file)
@@ -209,7 +209,7 @@ SMB_ACL_T hpuxacl_sys_acl_get_fd(vfs_handle_struct *handle,
 
 
 int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
-                            const char *name,
+                            const struct smb_filename *smb_fname_in,
                             SMB_ACL_TYPE_T type,
                             SMB_ACL_T theacl)
 {
@@ -222,7 +222,7 @@ int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
        DEBUG(10, ("hpuxacl_sys_acl_set_file called for file '%s'\n",
                   name));
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
+       smb_fname = cp_smb_filename(talloc_tos(), smb_fname_in);
        if (smb_fname == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
index b629c7d0b7fc9b2caaebfec25d55d7a2ff65829f..b1b9ec3eccb7989854850b1c6a30e064e92d8219 100644 (file)
@@ -41,7 +41,7 @@ SMB_ACL_T hpuxacl_sys_acl_get_fd(vfs_handle_struct *handle,
                                 files_struct *fsp);
 
 int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
-                            const char *name,
+                            const struct smb_filename *smb_fname,
                             SMB_ACL_TYPE_T type,
                             SMB_ACL_T theacl);
 
index cad3d9fcfe820ae26d017be8713521aa83fdbeb1..6915fb0e21e1cff61c03a630477dc08a19de7ca7 100644 (file)
@@ -2138,36 +2138,32 @@ out:
  * In this case, "name" is a path.
  */
 static int mh_sys_acl_set_file(vfs_handle_struct *handle,
-               const char *name,
+               const struct smb_filename *smb_fname,
                SMB_ACL_TYPE_T acltype,
                SMB_ACL_T theacl)
 {
        int status;
-       char *clientPath;
-       TALLOC_CTX *ctx;
+       struct smb_filename *clientFname = NULL;
 
        DEBUG(MH_INFO_DEBUG, ("Entering mh_sys_acl_set_file\n"));
-       if (!is_in_media_files(name))
-       {
-               status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name,
+       if (!is_in_media_files(smb_fname->base_name)) {
+               status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
                                acltype, theacl);
                goto out;
        }
 
-       clientPath = NULL;
-       ctx = talloc_tos();
-
-       if ((status = alloc_get_client_path(handle, ctx,
-                               name,
-                               &clientPath)))
-       {
+       status = alloc_get_client_smb_fname(handle,
+                               talloc_tos(),
+                               smb_fname,
+                               &clientFname);
+       if (status != 0) {
                goto err;
        }
 
-       status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, clientPath,
+       status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, clientFname,
                        acltype, theacl);
 err:
-       TALLOC_FREE(clientPath);
+       TALLOC_FREE(clientFname);
 out:
        return status;
 }
index a0c4af7ec6b418c93f4a8bc9a66a4d556b960e83..faf9f9b0597b6c856cb54bb158f12ab99bf6d699 100644 (file)
@@ -600,7 +600,7 @@ static SMB_ACL_T nfs4acl_xattr_fail__sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 static int nfs4acl_xattr_fail__sys_acl_set_file(vfs_handle_struct *handle,
-                                        const char *name,
+                                        const struct smb_filename *smb_fname,
                                         SMB_ACL_TYPE_T type,
                                         SMB_ACL_T theacl)
 {
index d99f538524c054d8ca0d055a76eabcca59bf1a38..0cad9b6ec68c1d9638db734abb8630277524c0c4 100644 (file)
@@ -81,7 +81,7 @@ SMB_ACL_T posixacl_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
+                             const struct smb_filename *smb_fname,
                              SMB_ACL_TYPE_T type,
                              SMB_ACL_T theacl)
 {
@@ -89,7 +89,9 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
        acl_type_t acl_type;
        acl_t acl;
 
-       DEBUG(10, ("Calling acl_set_file: %s, %d\n", name, type));
+       DEBUG(10, ("Calling acl_set_file: %s, %d\n",
+                       smb_fname->base_name,
+                       type));
 
        switch(type) {
        case SMB_ACL_TYPE_ACCESS:
@@ -106,7 +108,7 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
        if ((acl = smb_acl_to_posix(theacl)) == NULL) {
                return -1;
        }
-       res = acl_set_file(name, acl_type, acl);
+       res = acl_set_file(smb_fname->base_name, acl_type, acl);
        if (res != 0) {
                DEBUG(10, ("acl_set_file failed: %s\n", strerror(errno)));
        }
index 8dd138e632de8eacdc9f9781b972bb2979e717ab..9cd3160f345dbfc70fd38e9140843787302d4e3d 100644 (file)
@@ -31,7 +31,7 @@ SMB_ACL_T posixacl_sys_acl_get_fd(vfs_handle_struct *handle,
                                  TALLOC_CTX *mem_ctx);
 
 int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
+                             const struct smb_filename *smb_fname,
                              SMB_ACL_TYPE_T type,
                              SMB_ACL_T theacl);
 
index 4506274a99c8b5fe7af01d80796bc116d86dbced..74086bd9fa7e488b7800ea5ec6db7eabcc9c713b 100644 (file)
@@ -136,19 +136,23 @@ SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
-                               const char *name,
+                               const struct smb_filename *smb_fname_in,
                                SMB_ACL_TYPE_T type,
                                SMB_ACL_T theacl)
 {
        int ret = -1;
        SOLARIS_ACL_T solaris_acl = NULL;
        int count;
-       struct smb_filename smb_fname = {
-               .base_name = discard_const_p(char, name)
-       };
+       struct smb_filename *smb_fname = NULL;
+
+       smb_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname_in);
+       if (smb_fname == NULL) {
+               errno = ENOMEM;
+               goto done;
+       }
 
        DEBUG(10, ("solarisacl_sys_acl_set_file called for file '%s'\n",
-                  name));
+                  smb_fname->base_name));
 
        if ((type != SMB_ACL_TYPE_ACCESS) && (type != SMB_ACL_TYPE_DEFAULT)) {
                errno = EINVAL;
@@ -176,12 +180,12 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
         * For a Windows acl mapped call on a symlink, we want to follow
         * it.
         */
-       ret = SMB_VFS_STAT(handle->conn, &smb_fname);
+       ret = SMB_VFS_STAT(handle->conn, smb_fname);
        if (ret != 0) {
                DEBUG(10, ("Error in stat call: %s\n", strerror(errno)));
                goto done;
        }
-       if (S_ISDIR(smb_fname.st.st_ex_mode)) {
+       if (S_ISDIR(smb_fname->st.st_ex_mode)) {
                SOLARIS_ACL_T other_acl = NULL;
                int other_count;
                SMB_ACL_TYPE_T other_type;
@@ -190,7 +194,8 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
                        ? SMB_ACL_TYPE_DEFAULT
                        : SMB_ACL_TYPE_ACCESS;
                DEBUGADD(10, ("getting acl from filesystem\n"));
-               if (!solaris_acl_get_file(name, &other_acl, &other_count)) {
+               if (!solaris_acl_get_file(smb_fname->base_name,
+                                       &other_acl, &other_count)) {
                        DEBUG(10, ("error getting acl from directory\n"));
                        goto done;
                }
@@ -217,12 +222,13 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
                goto done;
        }
 
-       ret = acl(name, SETACL, count, solaris_acl);
-       
+       ret = acl(smb_fname->base_name, SETACL, count, solaris_acl);
+
  done:
        DEBUG(10, ("solarisacl_sys_acl_set_file %s.\n",
                   ((ret != 0) ? "failed" : "succeeded")));
        SAFE_FREE(solaris_acl);
+       TALLOC_FREE(smb_fname);
        return ret;
 }
 
index 0ee4fa3131c66fa1d1fdc75f6a2246694fc27b6d..02bd3711da8d41fd5168687ca27c2110840471e4 100644 (file)
@@ -30,7 +30,7 @@ SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
                                    TALLOC_CTX *mem_ctx);
 
 int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
-                               const char *name,
+                               const struct smb_filename *smb_fname,
                                SMB_ACL_TYPE_T type,
                                SMB_ACL_T theacl);
 
index d62df373269df6be765f80dd561e1fcfecdbd354..2a2f084cdd84e846ef1c38007da9d31625551800 100644 (file)
@@ -2258,7 +2258,7 @@ static int smb_time_audit_sys_acl_blob_get_fd(vfs_handle_struct *handle,
 }
 
 static int smb_time_audit_sys_acl_set_file(vfs_handle_struct *handle,
-                                          const char *name,
+                                          const struct smb_filename *smb_fname,
                                           SMB_ACL_TYPE_T acltype,
                                           SMB_ACL_T theacl)
 {
@@ -2267,13 +2267,14 @@ static int smb_time_audit_sys_acl_set_file(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype,
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname, acltype,
                                               theacl);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log_fname("sys_acl_set_file", timediff, name);
+               smb_time_audit_log_fname("sys_acl_set_file", timediff,
+                       smb_fname->base_name);
        }
 
        return result;
index 69e5dfcaec4a55d595478e21ded226b167314d3f..d44e56a0df9f0a18cf6b8047357f1135dd19c28b 100644 (file)
@@ -88,7 +88,7 @@ SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 int tru64acl_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
+                             const struct smb_filename *smb_fname,
                              SMB_ACL_TYPE_T type,
                              SMB_ACL_T theacl)
 {
@@ -97,7 +97,7 @@ int tru64acl_sys_acl_set_file(vfs_handle_struct *handle,
         acl_t tru64_acl;
 
         DEBUG(10, ("tru64acl_sys_acl_set_file called with name %s, type %d\n", 
-                       name, type));
+                       smb_fname->base_name, type));
 
         switch(type) {
         case SMB_ACL_TYPE_ACCESS:
@@ -120,7 +120,8 @@ int tru64acl_sys_acl_set_file(vfs_handle_struct *handle,
                 goto fail;
         }
        DEBUG(10, ("got tru64 acl...\n"));
-        res = acl_set_file((char *)name, the_acl_type, tru64_acl);
+        res = acl_set_file((char *)smb_fname->base_name,
+                               the_acl_type, tru64_acl);
         acl_free(tru64_acl);
         if (res != 0) {
                 DEBUG(10, ("acl_set_file failed: %s\n", strerror(errno)));
index 0af0930b004049ea9b4281a0b060c43a4c22599d..8dab1f0ec710ee58b91d44770fbd02bb02f4523b 100644 (file)
@@ -28,7 +28,7 @@ SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle,
                                  files_struct *fsp);
 
 int tru64acl_sys_acl_set_file(vfs_handle_struct *handle,
-                             const char *name,
+                             const struct smb_filename *smb_fname,
                              SMB_ACL_TYPE_T type,
                              SMB_ACL_T theacl);
 
index 93d9ce68755d770f4c4554881ee8c50d8f452c75..21d5416568e756147afe9862b04f241970108e2a 100644 (file)
@@ -1649,31 +1649,40 @@ err:
 }
 
 static int um_sys_acl_set_file(vfs_handle_struct *handle,
-                              const char *name,
+                              const struct smb_filename *smb_fname,
                               SMB_ACL_TYPE_T acltype,
                               SMB_ACL_T theacl)
 {
        int status;
-       char *client_path = NULL;
+       int saved_errno = 0;
+       struct smb_filename *client_fname = NULL;
 
        DEBUG(10, ("Entering um_sys_acl_set_file\n"));
 
-       if (!is_in_media_files(name)) {
-               return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name,
+       if (!is_in_media_files(smb_fname->base_name)) {
+               return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
                                                     acltype, theacl);
        }
 
-       status = alloc_get_client_path(handle, talloc_tos(),
-                                      name, &client_path);
+       status = alloc_get_client_smb_fname(handle,
+                               talloc_tos(),
+                               smb_fname,
+                               &client_fname);
        if (status != 0) {
                goto err;
        }
 
-       status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, client_path,
+       status = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, client_fname,
                                               acltype, theacl);
 
 err:
-       TALLOC_FREE(client_path);
+       if (status == -1) {
+               saved_errno = errno;
+       }
+       TALLOC_FREE(client_fname);
+       if (saved_errno != 0) {
+               errno = saved_errno;
+       }
        return status;
 }
 
index 658649406e36b82426cd2435eab4ac5550c42e78..5dc9ba2cfe37643cdc404c34022096675135bd43 100644 (file)
@@ -499,14 +499,18 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
        return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
 }
 
-static int vxfs_sys_acl_set_file(vfs_handle_struct *handle,  const char *name,
-                                SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int vxfs_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
-       if (vxfs_compare(handle->conn, (char *)name, theacl, acltype)) {
+       if (vxfs_compare(handle->conn, (char *)smb_fname->base_name,
+                       theacl, acltype)) {
                return 0;
        }
 
-       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
+       return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, smb_fname,
+                       acltype, theacl);
 }
 
 static int vxfs_set_xattr(struct vfs_handle_struct *handle,  const char *path,
index cf341da371e84b0408bc36fc57e5218f6e41965c..76cf5281af78303295b7f971e40803e9916ce0f7 100644 (file)
@@ -299,7 +299,7 @@ static SMB_ACL_T zfsacl_fail__sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 static int zfsacl_fail__sys_acl_set_file(vfs_handle_struct *handle,
-                                        const char *name,
+                                        const struct smb_filename *smb_fname,
                                         SMB_ACL_TYPE_T type,
                                         SMB_ACL_T theacl)
 {
index 07e0584003cec28125d674ff38a0f6de4751b400..2d12f1dfd9f24c7ac601402c6deb438b32d020f2 100644 (file)
@@ -2970,7 +2970,7 @@ static bool set_canon_ace_list(files_struct *fsp,
         */
 
        if(default_ace || fsp->is_directory || fsp->fh->fd == -1) {
-               if (SMB_VFS_SYS_ACL_SET_FILE(conn, fsp->fsp_name->base_name,
+               if (SMB_VFS_SYS_ACL_SET_FILE(conn, fsp->fsp_name,
                                             the_acl_type, the_acl) == -1) {
                        /*
                         * Some systems allow all the above calls and only fail with no ACL support
@@ -2990,7 +2990,7 @@ static bool set_canon_ace_list(files_struct *fsp,
 
                                become_root();
                                sret = SMB_VFS_SYS_ACL_SET_FILE(conn,
-                                   fsp->fsp_name->base_name, the_acl_type,
+                                   fsp->fsp_name, the_acl_type,
                                    the_acl);
                                unbecome_root();
                                if (sret == 0) {
@@ -4173,7 +4173,7 @@ static int copy_access_posix_acl(connection_struct *conn,
        if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
                goto done;
 
-       ret = SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname_to->base_name,
+       ret = SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname_to,
                        SMB_ACL_TYPE_ACCESS, posix_acl);
 
  done:
@@ -4466,7 +4466,7 @@ bool set_unix_posix_default_acl(connection_struct *conn,
                return False;
        }
 
-       if (SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname->base_name,
+       if (SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname,
                                SMB_ACL_TYPE_DEFAULT, def_acl) == -1) {
                DEBUG(5,("set_unix_posix_default_acl: acl_set_file failed on directory %s (%s)\n",
                        smb_fname->base_name, strerror(errno) ));
@@ -4603,7 +4603,10 @@ static bool remove_posix_acl(connection_struct *conn,
                        goto done;
                }
        } else {
-               if (SMB_VFS_SYS_ACL_SET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS, new_file_acl) == -1) {
+               if (SMB_VFS_SYS_ACL_SET_FILE(conn,
+                                       smb_fname,
+                                       SMB_ACL_TYPE_ACCESS,
+                                       new_file_acl) == -1) {
                        DEBUG(5,("remove_posix_acl: acl_set_file failed on %s (%s)\n",
                                fname, strerror(errno) ));
                        goto done;
@@ -4657,7 +4660,8 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp,
                        return False;
                }
        } else {
-               if (SMB_VFS_SYS_ACL_SET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS, file_acl) == -1) {
+               if (SMB_VFS_SYS_ACL_SET_FILE(conn, smb_fname,
+                                       SMB_ACL_TYPE_ACCESS, file_acl) == -1) {
                        DEBUG(5,("set_unix_posix_acl: acl_set_file failed on %s (%s)\n",
                                fname, strerror(errno) ));
                        TALLOC_FREE(file_acl);
index df6ab188e6b6c2dc3aaede3fc63eec6de1e145da..63fc5d68c33ff525e27d425cda983cdc4be0fb6a 100644 (file)
@@ -81,6 +81,7 @@ static int set_sys_acl_conn(const char *fname,
                                 SMB_ACL_T theacl, connection_struct *conn)
 {
        int ret;
+       struct smb_filename *smb_fname = NULL;
        mode_t saved_umask;
 
        TALLOC_CTX *frame = talloc_stackframe();
@@ -89,7 +90,16 @@ static int set_sys_acl_conn(const char *fname,
           so set our umask to 0 */
        saved_umask = umask(0);
 
-       ret = SMB_VFS_SYS_ACL_SET_FILE( conn, fname, acltype, theacl);
+       smb_fname = synthetic_smb_fname_split(frame,
+                                       fname,
+                                       lp_posix_pathnames());
+       if (smb_fname == NULL) {
+               TALLOC_FREE(frame);
+               umask(saved_umask);
+               return -1;
+       }
+
+       ret = SMB_VFS_SYS_ACL_SET_FILE( conn, smb_fname, acltype, theacl);
 
        umask(saved_umask);
 
index 8dd84a21eda87a1655ea3e771a2b21e9a41b492e..fc0a519383ba0dba72f5df602b13aa8886292827 100644 (file)
@@ -2479,11 +2479,13 @@ int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle,
 }
 
 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle,
-                                 const char *name, SMB_ACL_TYPE_T acltype,
-                                 SMB_ACL_T theacl)
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
        VFS_FIND(sys_acl_set_file);
-       return handle->fns->sys_acl_set_file_fn(handle, name, acltype, theacl);
+       return handle->fns->sys_acl_set_file_fn(handle, smb_fname,
+                               acltype, theacl);
 }
 
 int smb_vfs_call_sys_acl_set_fd(struct vfs_handle_struct *handle,