]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in 2 places.
authorJeremy Allison <jra@samba.org>
Fri, 13 Sep 2019 19:34:31 +0000 (12:34 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:48 +0000 (17:20 +0000)
Use conn->cwd_fsp as current fsp. Rework to modern standards.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/close.c

index 713ecb6a9b7fe23a69f2ee459bd07be17bf6a369..567315b712ee1b704003fb8ffafd1bb0cf72c546 100644 (file)
@@ -959,7 +959,10 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
                if (!(S_ISDIR(smb_dname->st.st_ex_mode))) {
                        return NT_STATUS_NOT_A_DIRECTORY;
                }
-               ret = SMB_VFS_UNLINK(conn, smb_dname);
+               ret = SMB_VFS_UNLINKAT(conn,
+                               conn->cwd_fsp,
+                               smb_dname,
+                               0);
        } else {
                ret = SMB_VFS_RMDIR(conn, smb_dname);
        }
@@ -1069,8 +1072,14 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
                                        smb_dname_full) != 0) {
                                        goto err_break;
                                }
-                       } else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) {
-                               goto err_break;
+                       } else {
+                               int retval = SMB_VFS_UNLINKAT(conn,
+                                               conn->cwd_fsp,
+                                               smb_dname_full,
+                                               0);
+                               if(retval != 0) {
+                                       goto err_break;
+                               }
                        }
 
                        /* Successful iteration. */