summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-05 22:49:54 +0000
committerJeremy Allison <jra@samba.org>2002-11-05 22:49:54 +0000
commit29546f160cde7f83110b5ca22aba7bd19d24a80d (patch)
tree9f0f47d3c6ca970d9675c7a9c374fa3561893406
parent6a4da84a0d7ac8dbf1fe250535e58cd24bb6d3bd (diff)
downloadsamba-29546f160cde7f83110b5ca22aba7bd19d24a80d.tar.gz
samba-29546f160cde7f83110b5ca22aba7bd19d24a80d.tar.bz2
samba-29546f160cde7f83110b5ca22aba7bd19d24a80d.zip
Ensure can_delete returns correct error code.
Jeremy. (This used to be commit 44db20f9f63d72c2e6e1f4ffedf72d75563369fb)
-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);