summaryrefslogtreecommitdiffstats
path: root/source/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-28 04:47:46 +0000
committerJeremy Allison <jra@samba.org>2001-11-28 04:47:46 +0000
commitb69127391b322d81cc648f73a601ed61e79c8a44 (patch)
tree65a582e5cd0c482d3ab42759d8559d4165855713 /source/smbd/open.c
parent8698f7ef3ee9b83370e895607297245b6df74934 (diff)
downloadsamba-b69127391b322d81cc648f73a601ed61e79c8a44.tar.gz
samba-b69127391b322d81cc648f73a601ed61e79c8a44.tar.xz
samba-b69127391b322d81cc648f73a601ed61e79c8a44.zip
Re-added "Share modes" meaning don't allow deny mode conflict. Due to
user demand (don't talk to me about removing parameters.... :-). Jeremy.
Diffstat (limited to 'source/smbd/open.c')
-rw-r--r--source/smbd/open.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 67be12626bb..487a8a71a82 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -352,7 +352,7 @@ static int access_table(int new_deny,int old_deny,int old_mode,
check if we can open a file with a share mode
****************************************************************************/
-static int check_share_mode( share_mode_entry *share, int share_mode,
+static BOOL check_share_mode(connection_struct *conn, share_mode_entry *share, int share_mode,
const char *fname, BOOL fcbopen, int *flags)
{
int deny_mode = GET_DENY_MODE(share_mode);
@@ -360,6 +360,14 @@ static int check_share_mode( share_mode_entry *share, int share_mode,
int old_deny_mode = GET_DENY_MODE(share->share_mode);
/*
+ * share modes = false means don't bother to check for
+ * DENY mode conflict. This is a *really* bad idea :-). JRA.
+ */
+
+ if(!lp_share_modes(SNUM(conn)))
+ return True;
+
+ /*
* Don't allow any opens once the delete on close flag has been
* set.
*/
@@ -514,7 +522,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou
/* someone else has a share lock on it, check to see
if we can too */
- if(check_share_mode(share_entry, share_mode, fname, fcbopen, p_flags) == False) {
+ if(check_share_mode(conn, share_entry, share_mode, fname, fcbopen, p_flags) == False) {
SAFE_FREE(old_shares);
errno = EACCES;
return -1;