s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().
authorJeremy Allison <jra@samba.org>
Sat, 19 Mar 2016 04:19:38 +0000 (21:19 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Mar 2016 21:57:16 +0000 (22:57 +0100)
Get it from parent/deriving smb_filename if present.
Use 0 (as usually this a Windows-style lookup) if
not.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
41 files changed:
source3/include/proto.h
source3/lib/filename_util.c
source3/modules/non_posix_acls.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_fruit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_nfs4acl_xattr.c
source3/modules/vfs_recycle.c
source3/modules/vfs_shadow_copy.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_vxfs.c
source3/modules/vfs_xattr_tdb.c
source3/printing/nt_printing.c
source3/printing/printspoolss.c
source3/rpc_server/fss/srv_fss_agent.c
source3/smbd/close.c
source3/smbd/dir.c
source3/smbd/dosmode.c
source3/smbd/durable.c
source3/smbd/file_access.c
source3/smbd/filename.c
source3/smbd/files.c
source3/smbd/msdfs.c
source3/smbd/open.c
source3/smbd/pipes.c
source3/smbd/posix_acls.c
source3/smbd/pysmbd.c
source3/smbd/reply.c
source3/smbd/service.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c

index dc8fee9196300f51b047f12aeb7cbed79872a235..8cdbadfbb0d677bf1025db839487b6d5e5e17171 100644 (file)
@@ -1139,7 +1139,8 @@ NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_f
 struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
                                         const char *base_name,
                                         const char *stream_name,
-                                        const SMB_STRUCT_STAT *psbuf);
+                                        const SMB_STRUCT_STAT *psbuf,
+                                        uint32_t flags);
 struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
                                                const char *fname,
                                                bool posix_path);
index c2beae170af4ad9f169fd4240b3fb660cb583e9c..78bfc7040d8ad8b237045acc9d52c7bae71a4b12 100644 (file)
@@ -53,13 +53,15 @@ NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx,
 struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
                                         const char *base_name,
                                         const char *stream_name,
-                                        const SMB_STRUCT_STAT *psbuf)
+                                        const SMB_STRUCT_STAT *psbuf,
+                                        uint32_t flags)
 {
        struct smb_filename smb_fname_loc = { 0, };
 
        /* Setup the base_name/stream_name. */
        smb_fname_loc.base_name = discard_const_p(char, base_name);
        smb_fname_loc.stream_name = discard_const_p(char, stream_name);
+       smb_fname_loc.flags = flags;
 
        /* Copy the psbuf if one was given. */
        if (psbuf)
@@ -83,7 +85,11 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
 
        if (posix_path) {
                /* No stream name looked for. */
-               return synthetic_smb_fname(ctx, fname, NULL, NULL);
+               return synthetic_smb_fname(ctx,
+                               fname,
+                               NULL,
+                               NULL,
+                               SMB_FILENAME_POSIX_PATH);
        }
 
        ok = split_stream_filename(ctx,
@@ -94,7 +100,7 @@ struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx,
                return NULL;
        }
 
-       ret = synthetic_smb_fname(ctx, base_name, stream_name, NULL);
+       ret = synthetic_smb_fname(ctx, base_name, stream_name, NULL, 0);
        TALLOC_FREE(base_name);
        TALLOC_FREE(stream_name);
        return ret;
index fca9979d649ef0cb5e2beecbd9ed958856bbaf6e..8d3be72223d91a3abc1e99fe626f9b649652a92c 100644 (file)
@@ -32,7 +32,7 @@ int non_posix_sys_acl_blob_get_file_helper(vfs_handle_struct *handle,
        struct xattr_sys_acl_hash_wrapper acl_wrapper = {};
        struct smb_filename *smb_fname;
 
-       smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL);
+       smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                errno = ENOMEM;
index 42b4b8dc013336c5ea37f06e180528b1a8a80f34..eece1986f90055a3d82b296692fb3f6d72053bc5 100644 (file)
@@ -69,7 +69,8 @@ static DIR *cap_opendir(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        capname,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(capname);
                errno = ENOMEM;
@@ -125,7 +126,8 @@ static int cap_mkdir(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
@@ -149,7 +151,8 @@ static int cap_rmdir(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
@@ -321,7 +324,8 @@ static int cap_chmod(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
@@ -354,7 +358,8 @@ static int cap_chown(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
@@ -387,7 +392,8 @@ static int cap_lchown(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
@@ -522,7 +528,8 @@ static int cap_chmod_acl(vfs_handle_struct *handle,
        cap_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        cappath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (cap_smb_fname == NULL) {
                TALLOC_FREE(cappath);
                errno = ENOMEM;
index e2b4eb5745e3fc13727c9f638950adad5b1feab0..c5d2b6a1b286d9ddbed486a51ecd20e81b216217 100644 (file)
@@ -290,7 +290,8 @@ static DIR *catia_opendir(vfs_handle_struct *handle,
        mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
                                name_mapped,
                                NULL,
-                               NULL);
+                               NULL,
+                               smb_fname->flags);
        if (mapped_smb_fname == NULL) {
                TALLOC_FREE(mapped_smb_fname);
                errno = ENOMEM;
@@ -543,7 +544,8 @@ static int catia_chown(vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(name);
                errno = ENOMEM;
@@ -580,7 +582,8 @@ static int catia_lchown(vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(name);
                errno = ENOMEM;
@@ -616,7 +619,8 @@ static int catia_chmod(vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(name);
                errno = ENOMEM;
@@ -650,7 +654,8 @@ static int catia_rmdir(vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(name);
                errno = ENOMEM;
@@ -684,7 +689,8 @@ static int catia_mkdir(vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(name);
                errno = ENOMEM;
@@ -819,7 +825,8 @@ catia_streaminfo(struct vfs_handle_struct *handle,
        catia_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        mapped_name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (catia_smb_fname == NULL) {
                TALLOC_FREE(mapped_name);
                return NT_STATUS_NO_MEMORY;
@@ -898,7 +905,8 @@ catia_get_nt_acl(struct vfs_handle_struct *handle,
        mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        mapped_name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (mapped_smb_fname == NULL) {
                TALLOC_FREE(mapped_name);
                return NT_STATUS_NO_MEMORY;
@@ -935,7 +943,8 @@ catia_chmod_acl(vfs_handle_struct *handle,
        mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        mapped_name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (mapped_smb_fname == NULL) {
                TALLOC_FREE(mapped_name);
                errno = ENOMEM;
index 23df640b415e26ea055223ef4547074493e865f4..65a14dfa9bcebb3340032694380f4530e163f497 100644 (file)
@@ -133,7 +133,7 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
         * use when setting a timestamp. */
 
        smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
-                                             NULL, NULL);
+                                             NULL, NULL, 0);
        if (smb_fname_cpath == NULL) {
                return caps;
        }
index 491e1ac1ea80bdb06c82c07d257ce080dbd0a86b..55ff7db37df31e9c91271bd29c8bce9d5a061fba 100644 (file)
@@ -364,7 +364,7 @@ static int fake_acls_sys_acl_delete_def_file(vfs_handle_struct *handle, const ch
        TALLOC_CTX *frame = talloc_stackframe();
        struct smb_filename *smb_fname;
 
-       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                errno = ENOMEM;
index 0c742861d76ab91f3b449179972e1b3a579b6f9c..761741a35709f0c4fad4714ead1c446cdfe1508c 100644 (file)
@@ -2132,7 +2132,10 @@ static int fruit_open_meta(vfs_handle_struct *handle,
 
        /* Create an smb_filename with stream_name == NULL. */
        smb_fname_base = synthetic_smb_fname(talloc_tos(),
-                                            smb_fname->base_name, NULL, NULL);
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
 
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
@@ -2281,7 +2284,10 @@ static int fruit_open_rsrc(vfs_handle_struct *handle,
 
        /* Create an smb_filename with stream_name == NULL. */
        smb_fname_base = synthetic_smb_fname(talloc_tos(),
-                                            adpath, NULL, NULL);
+                                       adpath,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
                rc = -1;
@@ -2527,7 +2533,8 @@ static int fruit_chmod(vfs_handle_struct *handle,
        smb_fname_adp = synthetic_smb_fname(talloc_tos(),
                                        adp,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_adp == NULL) {
                TALLOC_FREE(adp);
                errno = ENOMEM;
@@ -2583,7 +2590,8 @@ static int fruit_chown(vfs_handle_struct *handle,
        adp_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        adp,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (adp_smb_fname == NULL) {
                errno = ENOMEM;
                rc = -1;
@@ -3802,7 +3810,8 @@ static void fruit_copy_chunk_done(struct tevent_req *subreq)
                        req,
                        state->src_fsp->fsp_name->base_name,
                        streams[i].name,
-                       NULL);
+                       NULL,
+                       state->src_fsp->fsp_name->flags);
                if (tevent_req_nomem(src_fname_tmp, req)) {
                        return;
                }
@@ -3816,7 +3825,8 @@ static void fruit_copy_chunk_done(struct tevent_req *subreq)
                        req,
                        state->dst_fsp->fsp_name->base_name,
                        streams[i].name,
-                       NULL);
+                       NULL,
+                       state->dst_fsp->fsp_name->flags);
                if (tevent_req_nomem(dst_fname_tmp, req)) {
                        TALLOC_FREE(src_fname_tmp);
                        return;
index 09e37fa7f5374f5327857b89a55509d63a6d074c..04d89f48997bacceb4a7ef5f3434c24ef93f0b2c 100644 (file)
@@ -1380,7 +1380,7 @@ static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
 
        /* don't add complementary DENY ACEs here */
        fake_fsp.fsp_name = synthetic_smb_fname(
-               frame, path, NULL, NULL);
+               frame, path, NULL, NULL, 0);
        if (fake_fsp.fsp_name == NULL) {
                errno = ENOMEM;
                TALLOC_FREE(frame);
index 55a68946517a12fa10f50e4f8a514b9ef71c01bc..df27c89f948349e328e1f112baf7e6d2a8452dbc 100644 (file)
@@ -221,7 +221,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);
+       smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
        if (smb_fname == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
index 2ae6c4a96a1454e124193c89e9704ccc4daef7e5..8f80221677192a38ad3ab92d98ec426ad3ce049f 100644 (file)
@@ -783,7 +783,8 @@ static DIR *mh_opendir(vfs_handle_struct *handle,
                                synthetic_smb_fname(talloc_tos(),
                                        dirInfo->clientPath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_fname_clientpath == NULL) {
                        goto err;
                }
@@ -2045,7 +2046,8 @@ static NTSTATUS mh_get_nt_acl(vfs_handle_struct *handle,
        client_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        clientPath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (client_smb_fname == NULL) {
                TALLOC_FREE(clientPath);
                return NT_STATUS_NO_MEMORY;
index af84b8bb71ada6fb20856784aff295a4fa62204f..9ab7238e0ac2770d6355724f664087ff4bf1421c 100644 (file)
@@ -417,7 +417,7 @@ static struct SMB4ACL_T *nfs4acls_inheritacl(vfs_handle_struct *handle,
        TALLOC_CTX *frame = talloc_stackframe();
 
        DEBUG(10, ("nfs4acls_inheritacl invoked for %s\n", path));
-       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                errno = ENOMEM;
index 4981f558a824d86d3c4df6ffa643b72014506308..ca3fc2ee5f41333ee6de0b85cc41f6063fda47f2 100644 (file)
@@ -299,7 +299,8 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
                        smb_fname = synthetic_smb_fname(talloc_tos(),
                                                new_dir,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               0);
                        if (smb_fname == NULL) {
                                goto done;
                        }
@@ -587,8 +588,11 @@ static int recycle_unlink(vfs_handle_struct *handle,
        }
 
        /* Create smb_fname with final base name and orig stream name. */
-       smb_fname_final = synthetic_smb_fname(talloc_tos(), final_name,
-                                             smb_fname->stream_name, NULL);
+       smb_fname_final = synthetic_smb_fname(talloc_tos(),
+                                       final_name,
+                                       smb_fname->stream_name,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_final == NULL) {
                rc = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
                goto done;
index 77dc1636c91f8dd8835c34ddb7ec803a261e78b2..9b43e85af636f7b621c2cac82417c83bf9317a92 100644 (file)
@@ -230,7 +230,8 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
        struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
                                                fsp->conn->connectpath,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               0);
        if (smb_fname == NULL) {
                errno = ENOMEM;
                return -1;
index c63d67603d3495ad46cd65eab91f487611cde16b..43bc89d3126eced78adae2e5288bee211fb33b25 100644 (file)
@@ -719,7 +719,8 @@ static DIR *shadow_copy2_opendir(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                return NULL;
@@ -998,7 +999,8 @@ static int shadow_copy2_chmod(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
@@ -1042,7 +1044,8 @@ static int shadow_copy2_chown(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
@@ -1442,7 +1445,8 @@ static int shadow_copy2_get_shadow_copy_data(
        snapdir_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        snapdir,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fsp->fsp_name->flags);
        if (snapdir_smb_fname == NULL) {
                errno = ENOMEM;
                talloc_free(tmp_ctx);
@@ -1543,7 +1547,8 @@ static NTSTATUS shadow_copy2_fget_nt_acl(vfs_handle_struct *handle,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fsp->fsp_name->flags);
        if (smb_fname == NULL) {
                TALLOC_FREE(conv);
                return NT_STATUS_NO_MEMORY;
@@ -1587,7 +1592,8 @@ static NTSTATUS shadow_copy2_get_nt_acl(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                return NT_STATUS_NO_MEMORY;
@@ -1627,7 +1633,8 @@ static int shadow_copy2_mkdir(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                return -1;
@@ -1667,7 +1674,8 @@ static int shadow_copy2_rmdir(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                return -1;
@@ -1853,7 +1861,8 @@ static int shadow_copy2_chmod_acl(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
index 11a99d97b796c1dc030b18f1ffd798036a1dad9d..64a83bdfe910784ad61bd0e17da8aed33c3d0ed6 100644 (file)
@@ -1972,7 +1972,8 @@ static DIR *snapper_gmt_opendir(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
@@ -2244,7 +2245,8 @@ static int snapper_gmt_chmod(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
@@ -2289,7 +2291,8 @@ static int snapper_gmt_chown(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
@@ -2485,7 +2488,8 @@ static NTSTATUS snapper_gmt_fget_nt_acl(vfs_handle_struct *handle,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fsp->fsp_name->flags);
        TALLOC_FREE(conv);
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -2525,7 +2529,8 @@ static NTSTATUS snapper_gmt_get_nt_acl(vfs_handle_struct *handle,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fname->flags);
        TALLOC_FREE(conv);
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -2562,7 +2567,8 @@ static int snapper_gmt_mkdir(vfs_handle_struct *handle,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fname->flags);
        TALLOC_FREE(conv);
        if (smb_fname == NULL) {
                errno = ENOMEM;
@@ -2600,7 +2606,8 @@ static int snapper_gmt_rmdir(vfs_handle_struct *handle,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fname->flags);
        TALLOC_FREE(conv);
        if (smb_fname == NULL) {
                errno = ENOMEM;
@@ -2786,7 +2793,8 @@ static int snapper_gmt_chmod_acl(vfs_handle_struct *handle,
        conv_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        conv,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (conv_smb_fname == NULL) {
                TALLOC_FREE(conv);
                errno = ENOMEM;
index 5a974445e31b61c7ec66eff7b1dab43075b6f846..2b80b9dcf7b8fe214475eaa794b5eb922752b78f 100644 (file)
@@ -148,7 +148,8 @@ static char *stream_dir(vfs_handle_struct *handle,
        rootdir_fname = synthetic_smb_fname(talloc_tos(),
                                        rootdir,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (rootdir_fname == NULL) {
                errno = ENOMEM;
                goto fail;
@@ -159,7 +160,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                struct smb_filename *smb_fname_base;
 
                smb_fname_base = synthetic_smb_fname(
-                       talloc_tos(), smb_fname->base_name, NULL, NULL);
+                                       talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_fname_base == NULL) {
                        errno = ENOMEM;
                        goto fail;
@@ -200,7 +205,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                return NULL;
        }
 
-       smb_fname_hash = synthetic_smb_fname(talloc_tos(), result, NULL, NULL);
+       smb_fname_hash = synthetic_smb_fname(talloc_tos(),
+                                       result,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_hash == NULL) {
                errno = ENOMEM;
                goto fail;
@@ -251,7 +260,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                        }
 
                        smb_fname_new = synthetic_smb_fname(
-                               talloc_tos(), newname, NULL, NULL);
+                                               talloc_tos(),
+                                               newname,
+                                               NULL,
+                                               NULL,
+                                               smb_fname->flags);
                        TALLOC_FREE(newname);
                        if (smb_fname_new == NULL) {
                                errno = ENOMEM;
@@ -287,7 +300,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                goto fail;
        }
 
-       tmp_fname = synthetic_smb_fname(talloc_tos(), tmp, NULL, NULL);
+       tmp_fname = synthetic_smb_fname(talloc_tos(),
+                                       tmp,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (tmp_fname == NULL) {
                errno = ENOMEM;
                goto fail;
@@ -308,7 +325,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                goto fail;
        }
 
-       tmp_fname = synthetic_smb_fname(talloc_tos(), tmp, NULL, NULL);
+       tmp_fname = synthetic_smb_fname(talloc_tos(),
+                                       tmp,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (tmp_fname == NULL) {
                errno = ENOMEM;
                goto fail;
@@ -403,8 +424,11 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
        DEBUG(10, ("stream filename = %s\n", stream_fname));
 
        /* Create an smb_filename with stream_name == NULL. */
-       *smb_fname_out = synthetic_smb_fname(
-               talloc_tos(), stream_fname, NULL, NULL);
+       *smb_fname_out = synthetic_smb_fname(talloc_tos(),
+                                       stream_fname,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (*smb_fname_out == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -449,7 +473,8 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
        dir_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        dirname,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname_base->flags);
        if (dir_smb_fname == NULL) {
                TALLOC_FREE(dirname);
                return NT_STATUS_NO_MEMORY;
@@ -615,8 +640,11 @@ static int streams_depot_open(vfs_handle_struct *handle,
        }
 
        /* Ensure the base file still exists. */
-       smb_fname_base = synthetic_smb_fname(
-               talloc_tos(), smb_fname->base_name, NULL, NULL);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_base == NULL) {
                ret = -1;
                errno = ENOMEM;
@@ -676,8 +704,11 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
         * We potentially need to delete the per-inode streams directory
         */
 
-       smb_fname_base = synthetic_smb_fname(
-               talloc_tos(), smb_fname->base_name, NULL, NULL);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
                return -1;
@@ -704,7 +735,8 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
                                synthetic_smb_fname(talloc_tos(),
                                                dirname,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               smb_fname->flags);
                        if (smb_fname_dir == NULL) {
                                TALLOC_FREE(smb_fname_base);
                                TALLOC_FREE(dirname);
@@ -737,7 +769,8 @@ static int streams_depot_rmdir(vfs_handle_struct *handle,
        smb_fname_base = synthetic_smb_fname(talloc_tos(),
                                smb_fname->base_name,
                                NULL,
-                               NULL);
+                               NULL,
+                               smb_fname->flags);
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
                return -1;
@@ -764,7 +797,8 @@ static int streams_depot_rmdir(vfs_handle_struct *handle,
                                synthetic_smb_fname(talloc_tos(),
                                                dirname,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               smb_fname->flags);
                        if (smb_fname_dir == NULL) {
                                TALLOC_FREE(smb_fname_base);
                                TALLOC_FREE(dirname);
@@ -884,7 +918,7 @@ static bool collect_one_stream(const char *dirname,
                goto out;
        }
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), sname, NULL, NULL);
+       smb_fname = synthetic_smb_fname(talloc_tos(), sname, NULL, NULL, 0);
        if (smb_fname == NULL) {
                state->status = NT_STATUS_NO_MEMORY;
                ret = false;
@@ -930,7 +964,8 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
        smb_fname_base = synthetic_smb_fname(talloc_tos(),
                                        smb_fname->base_name,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (smb_fname_base == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index 0d547346b14ca84a5557d43f18ecfdcf889ddf3e..b3b800264fbcc27b194403aa9932c08e20c72075 100644 (file)
@@ -242,8 +242,11 @@ static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
        }
 
        /* Create an smb_filename with stream_name == NULL. */
-       smb_fname_base = synthetic_smb_fname(talloc_tos(), io->base,
-                                            NULL, NULL);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       io->base,
+                                       NULL,
+                                       NULL,
+                                       fsp->fsp_name->flags);
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
                return -1;
@@ -427,8 +430,11 @@ static int streams_xattr_open(vfs_handle_struct *handle,
        }
 
        /* Create an smb_filename with stream_name == NULL. */
-       smb_fname_base = synthetic_smb_fname(
-               talloc_tos(), smb_fname->base_name, NULL, NULL);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                               smb_fname->base_name,
+                               NULL,
+                               NULL,
+                               smb_fname->flags);
        if (smb_fname_base == NULL) {
                errno = ENOMEM;
                goto fail;
index 4bbb8fb3a23f3081053cf7fa41c032c4df8dbdc0..3b3493d013f7bc7ff7d7a2e63657b5801956ccd1 100644 (file)
@@ -571,7 +571,8 @@ static DIR *um_opendir(vfs_handle_struct *handle,
                        synthetic_smb_fname(talloc_tos(),
                                        dirInfo->clientPath,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
                if (client_smb_fname == NULL) {
                        goto err;
                }
@@ -1561,7 +1562,8 @@ static NTSTATUS um_get_nt_acl(vfs_handle_struct *handle,
        client_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        client_path,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
        if (client_smb_fname == NULL) {
                TALLOC_FREE(client_path);
                return NT_STATUS_NO_MEMORY;
index 4bfbef3530bbc0f5c114c5b616ab5fcdb47bc378..bcd7ae3a91f44f7551680ad667d68749b7a756d9 100644 (file)
@@ -421,7 +421,7 @@ static bool vxfs_compare(connection_struct *conn, char *name, SMB_ACL_T the_acl,
                goto out;
        }
 
-       smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL);
+       smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL, 0);
        if (smb_fname == NULL) {
                DEBUG(10, ("vfs_vxfs: Failed to create smb_fname\n"));
                goto out;
index a22192bcdf0c18fb0b7b491920a9034d91697286..aac824523b901718fbc1a616f96c7ff694928b81 100644 (file)
@@ -37,7 +37,7 @@ static int xattr_tdb_get_file_id(struct vfs_handle_struct *handle,
        TALLOC_CTX *frame = talloc_stackframe();
        struct smb_filename *smb_fname;
 
-       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(frame, path, NULL, NULL, 0);
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                errno = ENOMEM;
index 3d6cfb1330950480b69e54ef41410f7603ccb673..36e7324520b77b6fd31c46f0d8c131cbd2e88568 100644 (file)
@@ -1585,7 +1585,7 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
                goto err_out;
        }
 
-       smb_fname = synthetic_smb_fname(tmp_ctx, print_dlr_path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(tmp_ctx, print_dlr_path, NULL, NULL, 0);
        if (smb_fname == NULL) {
                goto err_out;
        }
index 883e81f38e678339f051c567f5180db5a559c6d9..ebf6d39505f829d06a539266d6f957dd7e6fc3f7 100644 (file)
@@ -212,7 +212,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
        }
 
        /* setup a full fsp */
-       fsp->fsp_name = synthetic_smb_fname(fsp, pf->filename, NULL, NULL);
+       fsp->fsp_name = synthetic_smb_fname(fsp, pf->filename, NULL, NULL, 0);
        if (fsp->fsp_name == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
index 68a51439c25c5628d1cc63be10810de2208e8cbe..2a1f770fd949a3b0aed410aae586422057c7a437 100644 (file)
@@ -173,7 +173,7 @@ static bool snap_path_exists(TALLOC_CTX *ctx, struct messaging_context *msg_ctx,
                goto out;
        }
 
-       smb_fname = synthetic_smb_fname(service, sc->sc_path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(service, sc->sc_path, NULL, NULL, 0);
        if (smb_fname == NULL) {
                goto out;
        }
index 3b887c86385c23d7779e823907a7ac4c669f1efe..0302c67ce845e06481e0813fc68f5a69ef960249 100644 (file)
@@ -204,7 +204,8 @@ NTSTATUS delete_all_streams(connection_struct *conn,
                smb_fname_stream = synthetic_smb_fname(talloc_tos(),
                                        smb_fname->base_name,
                                        stream_info[i].name,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
 
                if (smb_fname_stream == NULL) {
                        DEBUG(0, ("talloc_aprintf failed\n"));
@@ -833,8 +834,11 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
                        goto err_break;
                }
 
-               smb_dname_full = synthetic_smb_fname(talloc_tos(), fullname,
-                                                    NULL, NULL);
+               smb_dname_full = synthetic_smb_fname(talloc_tos(),
+                                               fullname,
+                                               NULL,
+                                               NULL,
+                                               smb_dname->flags);
                if (smb_dname_full == NULL) {
                        errno = ENOMEM;
                        goto err_break;
@@ -984,8 +988,11 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
                                goto err_break;
                        }
 
-                       smb_dname_full = synthetic_smb_fname(
-                               talloc_tos(), fullname, NULL, NULL);
+                       smb_dname_full = synthetic_smb_fname(talloc_tos(),
+                                                       fullname,
+                                                       NULL,
+                                                       NULL,
+                                                       smb_dname->flags);
                        if (smb_dname_full == NULL) {
                                errno = ENOMEM;
                                goto err_break;
index 82841ebc5e726ebaabb83784cbf351c6915f4873..3c6f00096fa829bb96d44a1d6a4373800fb10120 100644 (file)
@@ -413,8 +413,11 @@ static struct smb_Dir *open_dir_with_privilege(connection_struct *conn,
        }
 
        /* Now check the stat value is the same. */
-       smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL);
-
+       smb_fname_cwd = synthetic_smb_fname(talloc_tos(),
+                                       ".",
+                                       NULL,
+                                       NULL,
+                                       smb_dname->flags);
        if (smb_fname_cwd == NULL) {
                goto out;
        }
@@ -1545,8 +1548,11 @@ bool is_visible_file(connection_struct *conn, const char *dir_path,
                }
 
                /* Create an smb_filename with stream_name == NULL. */
-               smb_fname_base = synthetic_smb_fname(talloc_tos(), entry, NULL,
-                                                    pst);
+               smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                               entry,
+                                               NULL,
+                                               pst,
+                                               0);
                if (smb_fname_base == NULL) {
                        ret = false;
                        goto out;
index 638299dbf15721456f23a61e2587f08dc40ae020..60f2f6810a029337da87f6f8c7dc9ec1c21c9149 100644 (file)
@@ -135,8 +135,11 @@ mode_t unix_mode(connection_struct *conn, int dosmode,
                          smb_fname_str_dbg(smb_fname),
                          inherit_from_dir));
 
-               smb_fname_parent = synthetic_smb_fname(
-                       talloc_tos(), inherit_from_dir, NULL, NULL);
+               smb_fname_parent = synthetic_smb_fname(talloc_tos(),
+                                       inherit_from_dir,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_fname_parent == NULL) {
                        DEBUG(1,("unix_mode(%s) failed, [dir %s]: No memory\n",
                                 smb_fname_str_dbg(smb_fname),
@@ -1022,8 +1025,11 @@ NTSTATUS set_create_timespec_ea(connection_struct *conn,
                return NT_STATUS_OK;
        }
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), psmb_fname->base_name,
-                                       NULL, &psmb_fname->st);
+       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       psmb_fname->base_name,
+                                       NULL,
+                                       &psmb_fname->st,
+                                       psmb_fname->flags);
 
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
index d9b88a859a426aac4e77583cc6ffa453f7dcb2d1..f39a365242c963d0443109084b2a0a15b000d33e 100644 (file)
@@ -598,8 +598,11 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
        }
 
        /* Create an smb_filename with stream_name == NULL. */
-       smb_fname = synthetic_smb_fname(talloc_tos(), cookie.base_name,
-                                       NULL, NULL);
+       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       cookie.base_name,
+                                       NULL,
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index 0a6d6b154a4d4ac216e398f31dd80d0b1692867a..66c9ed3add7c5d32b65c051c770c102ef19aacf2 100644 (file)
@@ -54,7 +54,11 @@ bool can_delete_file_in_directory(connection_struct *conn,
                return False;
        }
 
-       smb_fname_parent = synthetic_smb_fname(ctx, dname, NULL, NULL);
+       smb_fname_parent = synthetic_smb_fname(ctx,
+                               dname,
+                               NULL,
+                               NULL,
+                               smb_fname->flags);
        if (smb_fname_parent == NULL) {
                ret = false;
                goto out;
@@ -155,7 +159,8 @@ bool directory_has_default_acl(connection_struct *conn, const char *fname)
        struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
                                                fname,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               0);
 
        if (smb_fname == NULL) {
                return false;
index a1920c32207bcd30027506210cacf615a225f506..72714666cf3349f1704655efedcecd1ef1b3068b 100644 (file)
@@ -1202,7 +1202,8 @@ static int get_real_filename_full_scan(connection_struct *conn,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        path,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                TALLOC_FREE(unmangled_name);
                return -1;
index 3e2b3d790543cdf65272a1c7778b0693bb5666af..a3cce138e02b3688b6abfcae29d0a1f4d99e50df 100644 (file)
@@ -118,7 +118,7 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
         * few NULL checks, so make sure it's initialized with something. to
         * be safe until an audit can be done.
         */
-       fsp->fsp_name = synthetic_smb_fname(fsp, "", NULL, NULL);
+       fsp->fsp_name = synthetic_smb_fname(fsp, "", NULL, NULL, 0);
        if (fsp->fsp_name == NULL) {
                file_free(NULL, fsp);
                return NT_STATUS_NO_MEMORY;
index fe95877fe8d7c7dd33a44be3356de7213e3aa87e..647ac3b80bebde2da0583afa6911966b0bf0c264 100644 (file)
@@ -1311,8 +1311,11 @@ bool create_msdfs_link(const struct junction_map *jucn)
                if (errno == EEXIST) {
                        struct smb_filename *smb_fname;
 
-                       smb_fname = synthetic_smb_fname(talloc_tos(), path,
-                                                       NULL, NULL);
+                       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                               path,
+                                               NULL,
+                                               NULL,
+                                               0);
                        if (smb_fname == NULL) {
                                errno = ENOMEM;
                                goto out;
@@ -1353,7 +1356,11 @@ bool remove_msdfs_link(const struct junction_map *jucn)
                return false;
        }
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), path, NULL, NULL);
+       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       path,
+                                       NULL,
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                errno = ENOMEM;
                return false;
@@ -1417,7 +1424,8 @@ static int count_dfs_links(TALLOC_CTX *ctx, int snum)
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        ".",
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                goto out;
        }
@@ -1534,7 +1542,8 @@ static int form_junctions(TALLOC_CTX *ctx,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        ".",
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                goto out;
        }
index e5503f57f36103a42f066b3caa425cee73372051..d111254b9cb8e58a843818493e16f5e4a5591c66 100644 (file)
@@ -255,7 +255,8 @@ static NTSTATUS check_parent_access(struct connection_struct *conn,
        parent_smb_fname = synthetic_smb_fname(talloc_tos(),
                                parent_dir,
                                NULL,
-                               NULL);
+                               NULL,
+                               smb_fname->flags);
        if (parent_smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -457,8 +458,11 @@ void change_file_owner_to_parent(connection_struct *conn,
        struct smb_filename *smb_fname_parent;
        int ret;
 
-       smb_fname_parent = synthetic_smb_fname(talloc_tos(), inherit_from_dir,
-                                              NULL, NULL);
+       smb_fname_parent = synthetic_smb_fname(talloc_tos(),
+                                       inherit_from_dir,
+                                       NULL,
+                                       NULL,
+                                       0);
        if (smb_fname_parent == NULL) {
                return;
        }
@@ -515,8 +519,11 @@ NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
        NTSTATUS status = NT_STATUS_OK;
        int ret;
 
-       smb_fname_parent = synthetic_smb_fname(ctx, inherit_from_dir,
-                                              NULL, NULL);
+       smb_fname_parent = synthetic_smb_fname(ctx,
+                                       inherit_from_dir,
+                                       NULL,
+                                       NULL,
+                                       0);
        if (smb_fname_parent == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -556,7 +563,7 @@ NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
                goto chdir;
        }
 
-       smb_fname_cwd = synthetic_smb_fname(ctx, ".", NULL, NULL);
+       smb_fname_cwd = synthetic_smb_fname(ctx, ".", NULL, NULL, 0);
        if (smb_fname_cwd == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto chdir;
@@ -3812,8 +3819,11 @@ void msg_file_was_renamed(struct messaging_context *msg,
                stream_name = NULL;
        }
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), base_name,
-                                       stream_name, NULL);
+       smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       base_name,
+                                       stream_name,
+                                       NULL,
+                                       0);
        if (smb_fname == NULL) {
                return;
        }
@@ -3911,7 +3921,8 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
                smb_fname_cp = synthetic_smb_fname(talloc_tos(),
                                        smb_fname->base_name,
                                        stream_info[i].name,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_fname_cp == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
@@ -4009,7 +4020,8 @@ static NTSTATUS inherit_new_acl(files_struct *fsp)
        parent_smb_fname = synthetic_smb_fname(talloc_tos(),
                                                parent_name,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               fsp->fsp_name->flags);
 
        if (parent_smb_fname == NULL) {
                TALLOC_FREE(frame);
@@ -4564,8 +4576,10 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
 
                /* Create an smb_filename with stream_name == NULL. */
                smb_fname_base = synthetic_smb_fname(talloc_tos(),
-                                                    smb_fname->base_name,
-                                                    NULL, NULL);
+                                               smb_fname->base_name,
+                                               NULL,
+                                               NULL,
+                                               smb_fname->flags);
                if (smb_fname_base == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
index 455dbf0cf4965b3197665cd7313ab57ceca0304a..2c9516d0756cf3f21d7f4e5745997f058553db3d 100644 (file)
@@ -51,7 +51,7 @@ NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
        fsp->can_lock = false;
        fsp->access_mask = FILE_READ_DATA | FILE_WRITE_DATA;
 
-       smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL);
+       smb_fname = synthetic_smb_fname(talloc_tos(), name, NULL, NULL, 0);
        if (smb_fname == NULL) {
                file_free(smb_req, fsp);
                return NT_STATUS_NO_MEMORY;
index c4eeb9c4bd921aae442b6b8225a2b720e1e582ba..8fc7cbae3faecbbcb94bfc4532d83f162da036d4 100644 (file)
@@ -4642,7 +4642,8 @@ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname,
        struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
                                                fname,
                                                NULL,
-                                               NULL);
+                                               NULL,
+                                               0);
 
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
@@ -4809,7 +4810,7 @@ int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
        };
        struct smb_filename *smb_fname;
 
-       smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL);
+       smb_fname = synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
                errno = ENOMEM;
index 4d95bcff01bd52f952ae077065ae79c84fa4a552..fca8f108b57deb1f14993d1939c50c8a7e9ba857 100644 (file)
@@ -199,9 +199,11 @@ static NTSTATUS get_nt_acl_conn(TALLOC_CTX *mem_ctx,
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
        struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
-                                               fname,
-                                               NULL,
-                                               NULL);
+                                       fname,
+                                       NULL,
+                                       NULL,
+                                       lp_posix_pathnames() ?
+                                               SMB_FILENAME_POSIX_PATH : 0);
 
        if (smb_fname == NULL) {
                TALLOC_FREE(frame);
@@ -398,7 +400,9 @@ static PyObject *py_smbd_chown(PyObject *self, PyObject *args, PyObject *kwargs)
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        fname,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       lp_posix_pathnames() ?
+                                               SMB_FILENAME_POSIX_PATH : 0);
        if (smb_fname == NULL) {
                umask(saved_umask);
                TALLOC_FREE(frame);
index c18eb38722a591d2c3ff0cd2fec818c723eb472e..cbe15a38c3524978abca5e406a459276a513e4e5 100644 (file)
@@ -1825,7 +1825,8 @@ void reply_search(struct smb_request *req)
                smb_dname = synthetic_smb_fname(talloc_tos(),
                                        directory,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_dname == NULL) {
                        reply_nterror(req, NT_STATUS_NO_MEMORY);
                        goto out;
@@ -3088,7 +3089,8 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
                smb_fname_dir = synthetic_smb_fname(talloc_tos(),
                                        fname_dir,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname->flags);
                if (smb_fname_dir == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto out;
@@ -7064,7 +7066,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
        smb_fname_src_dir = synthetic_smb_fname(talloc_tos(),
                                fname_src_dir,
                                NULL,
-                               NULL);
+                               NULL,
+                               smb_fname_src->flags);
        if (smb_fname_src_dir == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto out;
@@ -7779,7 +7782,8 @@ void reply_copy(struct smb_request *req)
                smb_fname_src_dir = synthetic_smb_fname(talloc_tos(),
                                        fname_src_dir,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       smb_fname_src->flags);
                if (smb_fname_src_dir == NULL) {
                        reply_nterror(req, NT_STATUS_NO_MEMORY);
                        goto out;
index ba8946d5d2fab82d66b7cf8642989b8734ea3416..2777a09e8e290a6a981042e1eb6c9255a58eaf59 100644 (file)
@@ -814,8 +814,11 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
                set_namearray( &conn->aio_write_behind_list,
                                lp_aio_write_behind(talloc_tos(), snum));
        }
-       smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
-                                             NULL, NULL);
+       smb_fname_cpath = synthetic_smb_fname(talloc_tos(),
+                                       conn->connectpath,
+                                       NULL,
+                                       NULL,
+                                       0);
        if (smb_fname_cpath == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto err_root_exit;
index e23b8932948cca68442135df55d855b05f97425b..a76b2df70d8434e33c6ac5bae40ec300c7e0741b 100644 (file)
@@ -5764,8 +5764,11 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
 
                        /* Create an smb_filename with stream_name == NULL. */
                        smb_fname_base = synthetic_smb_fname(
-                               talloc_tos(), smb_fname->base_name,
-                               NULL, NULL);
+                                               talloc_tos(),
+                                               smb_fname->base_name,
+                                               NULL,
+                                               NULL,
+                                               smb_fname->flags);
                        if (smb_fname_base == NULL) {
                                reply_nterror(req, NT_STATUS_NO_MEMORY);
                                return;
@@ -6163,8 +6166,11 @@ static NTSTATUS smb_set_file_dosmode(connection_struct *conn,
        }
 
        /* Always operate on the base_name, even if a stream was passed in. */
-       smb_fname_base = synthetic_smb_fname(
-               talloc_tos(), smb_fname->base_name, NULL, &smb_fname->st);
+       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+                                       smb_fname->base_name,
+                                       NULL,
+                                       &smb_fname->st,
+                                       smb_fname->flags);
        if (smb_fname_base == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -6666,9 +6672,11 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn,
                }
 
                /* Create an smb_fname to call rename_internals_fsp() with. */
-               smb_fname_dst = synthetic_smb_fname(
-                       talloc_tos(), fsp->base_fsp->fsp_name->base_name,
-                       newname, NULL);
+               smb_fname_dst = synthetic_smb_fname(talloc_tos(),
+                                       fsp->base_fsp->fsp_name->base_name,
+                                       newname,
+                                       NULL,
+                                       fsp->base_fsp->fsp_name->flags);
                if (smb_fname_dst == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto out;
@@ -6872,9 +6880,11 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                }
 
                /* Create an smb_fname to call rename_internals_fsp() with. */
-               smb_fname_dst = synthetic_smb_fname(
-                       talloc_tos(), fsp->base_fsp->fsp_name->base_name,
-                       newname, NULL);
+               smb_fname_dst = synthetic_smb_fname(talloc_tos(),
+                                       fsp->base_fsp->fsp_name->base_name,
+                                       newname,
+                                       NULL,
+                                       fsp->base_fsp->fsp_name->flags);
                if (smb_fname_dst == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto out;
@@ -6944,8 +6954,11 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
                                goto out;
                        }
                        /* Create an smb_fname to call rename_internals_fsp() */
-                       smb_fname_dst = synthetic_smb_fname(
-                               ctx, base_name, NULL, NULL);
+                       smb_fname_dst = synthetic_smb_fname(ctx,
+                                               base_name,
+                                               NULL,
+                                               NULL,
+                                               smb_fname_src->flags);
                        if (smb_fname_dst == NULL) {
                                status = NT_STATUS_NO_MEMORY;
                                goto out;
index a1154aee784d6b242534429a6b0207a59393b459..972cea42117313fd8d22ec29367a767740046840 100644 (file)
@@ -876,7 +876,7 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn)
                goto nocache;
        }
 
-       smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL);
+       smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL, 0);
        if (smb_fname_dot == NULL) {
                errno = ENOMEM;
                goto out;
@@ -904,7 +904,7 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn)
                   && (cache_value.data[cache_value.length-1] == '\0'));
 
        smb_fname_full = synthetic_smb_fname(ctx, (char *)cache_value.data,
-                                            NULL, NULL);
+                                            NULL, NULL, 0);
        if (smb_fname_full == NULL) {
                errno = ENOMEM;
                goto out;
@@ -1044,7 +1044,7 @@ NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
                resolved_name));
 
        /* Now check the stat value is the same. */
-       smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL);
+       smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL, 0);
        if (smb_fname_cwd == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto err;
@@ -1968,7 +1968,8 @@ NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid)
                local_smb_fname = synthetic_smb_fname(talloc_tos(),
                                        final_component,
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       fsp->fsp_name->flags);
                if (local_smb_fname == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto out;
index 7c49ce78db8be99e9bdc186329f80309829fc82a..12610cf8f3c2b9cb6f6b7f9397381c736542c8c9 100644 (file)
 
 static const char *null_string = "";
 
+static uint32_t ssf_flags(void)
+{
+       return lp_posix_pathnames() ? SMB_FILENAME_POSIX_PATH : 0;
+}
+
 static NTSTATUS cmd_load_module(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        int i;
@@ -139,7 +144,8 @@ static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -222,7 +228,8 @@ static NTSTATUS cmd_mkdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
 
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -424,7 +431,8 @@ static NTSTATUS cmd_pathfunc(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int arg
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
 
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -859,7 +867,8 @@ static NTSTATUS cmd_chmod(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -918,7 +927,8 @@ static NTSTATUS cmd_chmod_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -979,7 +989,8 @@ static NTSTATUS cmd_chown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -1459,7 +1470,8 @@ static NTSTATUS cmd_get_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        argv[1],
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
 
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -1796,7 +1808,8 @@ static NTSTATUS cmd_translate_name(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        smb_fname = synthetic_smb_fname(talloc_tos(),
                                        ".",
                                        NULL,
-                                       NULL);
+                                       NULL,
+                                       ssf_flags());
        if (smb_fname == NULL) {
                return NT_STATUS_NO_MEMORY;
        }