summaryrefslogtreecommitdiff
path: root/source
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
commita1923d465be4c63a40d55abb800cc9b16a4b87d0 (patch)
tree5d6f2be35a0d3793d1c6213c0551d7b2ab81b141 /source
parent274a2cff30f7325d1bc1647075a6c4f887e42e4f (diff)
downloadsamba-a1923d465be4c63a40d55abb800cc9b16a4b87d0.tar.gz
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.
Diffstat (limited to 'source')
-rw-r--r--source/smbd/open.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index aac4b02fba3..670161f2d0a 100644
--- a/source/smbd/open.c
+++ b/source/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;
}