From 1a50b36d978416e7c08423296db351e434bdea50 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 28 Nov 2001 04:47:46 +0000 Subject: Re-added "Share modes" meaning don't allow deny mode conflict. Due to user demand (don't talk to me about removing parameters.... :-). Jeremy. (This used to be commit b69127391b322d81cc648f73a601ed61e79c8a44) --- source3/smbd/open.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 67be12626b..487a8a71a8 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -352,13 +352,21 @@ 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); int old_open_mode = GET_OPEN_MODE(share->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; -- cgit