1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

Ensure can_delete returns the correct error code.

Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent 13995fc049
commit 52af4ed9ec

View File

@ -1278,10 +1278,13 @@ static NTSTATUS can_delete(char *fname,connection_struct *conn, int dirtype)
if (!fsp) {
NTSTATUS ret = NT_STATUS_ACCESS_DENIED;
if (unix_ERR_class == ERRDOS && unix_ERR_code == ERRbadshare)
if (!NT_STATUS_IS_OK(unix_ERR_ntstatus))
ret = unix_ERR_ntstatus;
else if (unix_ERR_class == ERRDOS && unix_ERR_code == ERRbadshare)
ret = NT_STATUS_SHARING_VIOLATION;
unix_ERR_class = 0;
unix_ERR_code = 0;
unix_ERR_ntstatus = NT_STATUS_OK;
return ret;
}
close_file(fsp,False);