summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-29 20:17:02 +0000
committerJeremy Allison <jra@samba.org>1998-10-29 20:17:02 +0000
commitce2a92d86434c1b04d9b09b710ad362407d9bdc6 (patch)
treea46ef18583d337d21feec5209a6fcddcbb09bb24 /source3
parent610251a6312f39e9f2882b6a2427db29d6e2d70e (diff)
downloadsamba-ce2a92d86434c1b04d9b09b710ad362407d9bdc6.tar.gz
samba-ce2a92d86434c1b04d9b09b710ad362407d9bdc6.tar.bz2
samba-ce2a92d86434c1b04d9b09b710ad362407d9bdc6.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c16
1 files changed, 9 insertions, 7 deletions
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
@@ -660,13 +660,6 @@ static int check_share_mode( share_mode_entry *share, int deny_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;
}