smbd: Convert open_dir_with_privilege to synthetic_smb_fname
authorVolker Lendecke <vl@samba.org>
Mon, 15 Apr 2013 09:02:19 +0000 (11:02 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 17 Apr 2013 21:50:01 +0000 (14:50 -0700)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c

index f1a08bb34a6752a688183a23b1a6ced8b46ff610..346ff8683fa174d3dfbce63367755822b47c7110 100644 (file)
@@ -428,7 +428,7 @@ static struct smb_Dir *open_dir_with_privilege(connection_struct *conn,
 {
        NTSTATUS status;
        struct smb_Dir *dir_hnd = NULL;
-       struct smb_filename *smb_fname_cwd = NULL;
+       struct smb_filename *smb_fname_cwd;
        char *saved_dir = vfs_GetWd(talloc_tos(), conn);
        struct privilege_paths *priv_paths = req->priv_paths;
        int ret;
@@ -442,11 +442,10 @@ static struct smb_Dir *open_dir_with_privilege(connection_struct *conn,
        }
 
        /* Now check the stat value is the same. */
-       status = create_synthetic_smb_fname(talloc_tos(), ".",
-                                       NULL, NULL,
-                                       &smb_fname_cwd);
+       smb_fname_cwd = synthetic_smb_fname(talloc_tos(), ".", NULL, NULL);
 
-       if (!NT_STATUS_IS_OK(status)) {
+       if (smb_fname_cwd == NULL) {
+               status = NT_STATUS_NO_MEMORY;
                goto out;
        }
        ret = SMB_VFS_STAT(conn, smb_fname_cwd);