vfs: Convert stream_dir to synthetic_smb_fname
authorVolker Lendecke <vl@samba.org>
Fri, 12 Apr 2013 09:26:27 +0000 (11:26 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 17 Apr 2013 21:49:59 +0000 (14:49 -0700)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_streams_depot.c

index 620a58075383cba8aade1362ac3fa550415cc0d4..b74e774f08cbd45282e45b3b89ae3db4e7f7fe99 100644 (file)
@@ -124,7 +124,6 @@ static char *stream_dir(vfs_handle_struct *handle,
        uint8 id_buf[16];
        bool check_valid;
        const char *rootdir;
-       NTSTATUS status;
 
        check_valid = lp_parm_bool(SNUM(handle->conn),
                      "streams_depot", "check_valid", true);
@@ -142,14 +141,12 @@ static char *stream_dir(vfs_handle_struct *handle,
 
        /* Stat the base file if it hasn't already been done. */
        if (base_sbuf == NULL) {
-               struct smb_filename *smb_fname_base = NULL;
+               struct smb_filename *smb_fname_base;
 
-               status = create_synthetic_smb_fname(talloc_tos(),
-                                                   smb_fname->base_name,
-                                                   NULL, NULL,
-                                                   &smb_fname_base);
-               if (!NT_STATUS_IS_OK(status)) {
-                       errno = map_errno_from_nt_status(status);
+               smb_fname_base = synthetic_smb_fname(
+                       talloc_tos(), smb_fname->base_name, NULL, NULL);
+               if (smb_fname_base == NULL) {
+                       errno = ENOMEM;
                        goto fail;
                }
                if (SMB_VFS_NEXT_STAT(handle, smb_fname_base) == -1) {
@@ -188,10 +185,9 @@ static char *stream_dir(vfs_handle_struct *handle,
                return NULL;
        }
 
-       status = create_synthetic_smb_fname(talloc_tos(), result, NULL, NULL,
-                                           &smb_fname_hash);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
+       smb_fname_hash = synthetic_smb_fname(talloc_tos(), result, NULL, NULL);
+       if (smb_fname_hash == NULL) {
+               errno = ENOMEM;
                goto fail;
        }
 
@@ -239,13 +235,11 @@ static char *stream_dir(vfs_handle_struct *handle,
                                goto fail;
                        }
 
-                       status = create_synthetic_smb_fname(talloc_tos(),
-                                                           newname,
-                                                           NULL, NULL,
-                                                           &smb_fname_new);
+                       smb_fname_new = synthetic_smb_fname(
+                               talloc_tos(), newname, NULL, NULL);
                        TALLOC_FREE(newname);
-                       if (!NT_STATUS_IS_OK(status)) {
-                               errno = map_errno_from_nt_status(status);
+                       if (smb_fname_new == NULL) {
+                               errno = ENOMEM;
                                goto fail;
                        }