From ce2a92d86434c1b04d9b09b710ad362407d9bdc6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 29 Oct 1998 20:17:02 +0000 Subject: Fixed bug (that I introduced when doing the "delete on close" work that caused NetBench to fail as the wrong error code was being returned from a getatr call. Change was not to set the unix_ERR_class global when you are not returning an error. This is a big of Samba internal folklore that is *important*. Jeremy. (This used to be commit a1923d465be4c63a40d55abb800cc9b16a4b87d0) --- source3/smbd/open.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index aac4b02fba..670161f2d0 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -659,13 +659,6 @@ static int check_share_mode( share_mode_entry *share, int deny_mode, int old_open_mode = GET_OPEN_MODE(share->share_mode); int old_deny_mode = GET_DENY_MODE(share->share_mode); - /* - * Setup the potential error to return. - */ - - unix_ERR_class = ERRDOS; - unix_ERR_code = ERRbadshare; - /* * Don't allow any open once the delete on close flag has been * set. @@ -675,6 +668,7 @@ static int check_share_mode( share_mode_entry *share, int deny_mode, { DEBUG(5,("check_share_mode: Failing open on file %s as delete on close flag is set.\n", fname )); + unix_ERR_class = ERRDOS; unix_ERR_code = ERRnoaccess; return False; } @@ -683,6 +677,10 @@ static int check_share_mode( share_mode_entry *share, int deny_mode, { DEBUG(0,("Invalid share mode found (%d,%d,%d) on file %s\n", deny_mode,old_deny_mode,old_open_mode,fname)); + + unix_ERR_class = ERRDOS; + unix_ERR_code = ERRbadshare; + return False; } @@ -698,6 +696,10 @@ static int check_share_mode( share_mode_entry *share, int deny_mode, DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s,fcbopen = %d, flags = %d) = %d\n", deny_mode,old_deny_mode,old_open_mode, share->pid,fname, fcbopen, *flags, access_allowed)); + + unix_ERR_class = ERRDOS; + unix_ERR_code = ERRbadshare; + return False; } -- cgit