s3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT().
authorJeremy Allison <jra@samba.org>
Fri, 13 Sep 2019 19:29:41 +0000 (12:29 -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 c441f4eb5bcca689e0938cb7fa51af18a7d255a5..713ecb6a9b7fe23a69f2ee459bd07be17bf6a369 100644 (file)
@@ -853,6 +853,7 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
        long offset = 0;
        SMB_STRUCT_STAT st;
        struct smb_Dir *dir_hnd;
+       int retval;
 
        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
 
@@ -907,8 +908,14 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
                        if(SMB_VFS_RMDIR(conn, smb_dname_full) != 0) {
                                goto err_break;
                        }
-               } else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) {
-                       goto err_break;
+               } else {
+                       retval = SMB_VFS_UNLINKAT(conn,
+                                       conn->cwd_fsp,
+                                       smb_dname_full,
+                                       0);
+                       if (retval != 0) {
+                               goto err_break;
+                       }
                }
 
                /* Successful iteration. */