summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-05 22:49:07 +0000
committerJeremy Allison <jra@samba.org>2002-11-05 22:49:07 +0000
commit66b62281e285ae53c63e43ff074f57053b3e91ae (patch)
tree8333b472635e31d34a6ace58ae7c74fe61eb6c97
parentb391591c21e2ffe0585cb11af9869bb86ccc9c73 (diff)
downloadsamba-66b62281e285ae53c63e43ff074f57053b3e91ae.tar.gz
samba-66b62281e285ae53c63e43ff074f57053b3e91ae.tar.bz2
samba-66b62281e285ae53c63e43ff074f57053b3e91ae.zip
Ensure can_delete returns the correct error code.
Jeremy. (This used to be commit 52af4ed9ecd8ef5f31ce00c94bc55d6013a7f65a)
-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);