Ensure can_delete returns correct error code.
authorJeremy Allison <jra@samba.org>
Tue, 5 Nov 2002 22:49:54 +0000 (22:49 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 5 Nov 2002 22:49:54 +0000 (22:49 +0000)
Jeremy.

source/smbd/reply.c

index a881e135c08c1cecb4ae19f73a66e982984bed72..3371d9b54411b2e6ecb866820e888583beaa37bc 100644 (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);