]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug #7651 - mknod and mkfifo fails with "No such file or directory"
authorJeremy Allison <jra@samba.org>
Thu, 26 Aug 2010 23:49:21 +0000 (16:49 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 6 Sep 2010 18:44:39 +0000 (20:44 +0200)
Ensure we check the correct stat struct once we've created the
special fix. Thanks to izh1979@gmail.com for pointing out the
bug.

Jeremy.

source3/smbd/trans2.c

index fb4d46b76bf39c58eedaa433e4d7991de2d839d4..84139daa0e199c578fd49e40040e7d63dbff2c90 100644 (file)
@@ -6594,6 +6594,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
        files_struct *all_fsps = NULL;
        bool modify_mtime = true;
        struct file_id id;
+       struct smb_filename *smb_fname_tmp = NULL;
        SMB_STRUCT_STAT sbuf;
 
        ZERO_STRUCT(ft);
@@ -6646,7 +6647,6 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
        sbuf = smb_fname->st;
 
        if (!VALID_STAT(sbuf)) {
-               struct smb_filename *smb_fname_tmp = NULL;
                /*
                 * The only valid use of this is to create character and block
                 * devices, and named pipes. This is deprecated (IMHO) and 
@@ -6675,7 +6675,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
                }
 
                sbuf = smb_fname_tmp->st;
-               TALLOC_FREE(smb_fname_tmp);
+               smb_fname = smb_fname_tmp;
 
                /* Ensure we don't try and change anything else. */
                raw_unixmode = SMB_MODE_NO_CHANGE;