From: Jeremy Allison Date: Fri, 13 Sep 2019 19:34:31 +0000 (-0700) Subject: s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in 2 places. X-Git-Tag: talloc-2.3.1~609 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bf8181f159c142a45287e996167d11980508dd6;p=thirdparty%2Fsamba.git s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in 2 places. Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 713ecb6a9b7..567315b712e 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -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. */