1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-09-13 12:34:31 -07:00 committed by Ralph Boehme
parent 2adc0e0fdc
commit 3bf8181f15

View 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. */