summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/reply.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index a881e135c0..3371d9b544 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -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);