From 29546f160cde7f83110b5ca22aba7bd19d24a80d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 5 Nov 2002 22:49:54 +0000 Subject: Ensure can_delete returns correct error code. Jeremy. (This used to be commit 44db20f9f63d72c2e6e1f4ffedf72d75563369fb) --- source3/smbd/reply.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3') 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); -- cgit