r1260: Added new parameter in the protocol section. "defer sharing violations",
authorJeremy Allison <jra@samba.org>
Sat, 26 Jun 2004 00:47:58 +0000 (00:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:03 +0000 (10:52 -0500)
by default set to "yes" (to correctly emulate Windows). I've added this to
ensure if we find a critical problem with this new code when 3.0.5 ships
it can be turned off to test for bugs.
Jeremy.
(This used to be commit bee0619cc476335e19a5f76179832802587563d1)

source3/param/loadparm.c
source3/smbd/open.c

index 12bbebcaa809cf69b4aa9a14d18c259178b0f8e5..107e500a51bff35ff66c02c7ddcdd64ae9d9c257 100644 (file)
@@ -417,6 +417,7 @@ typedef struct
        BOOL bMap_acl_inherit;
        BOOL bAfs_Share;
        BOOL bEASupport;
+       BOOL bDeferSharingViolations;
        param_opt_struct *param_opt;
 
        char dummy[3];          /* for alignment */
@@ -540,6 +541,7 @@ static service sDefault = {
        False,                  /* bMap_acl_inherit */
        False,                  /* bAfs_Share */
        False,                  /* bEASupport */
+       True,                   /* bDeferSharingViolations */
        
        NULL,                   /* Parametric options */
 
@@ -892,6 +894,7 @@ static struct parm_struct parm_table[] = {
        {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED}, 
 
        {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility,  NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, 
+       { "defer sharing violations", P_BOOL, P_LOCAL, &sDefault.bDeferSharingViolations, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
        {"ea support", P_BOOL, P_LOCAL, &sDefault.bEASupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, 
        {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, 
        {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED}, 
@@ -1890,6 +1893,7 @@ FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver)
 FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode)
 FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport)
 FN_LOCAL_BOOL(lp_ea_support, bEASupport)
+FN_LOCAL_BOOL(lp_defer_sharing_violations, bDeferSharingViolations)
 FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile)
 FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls)
 FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit)
index 330080353ccad6082c6e8cca2e7d0d36d808ce03..119eb04e09945a158079c6942626f584d9314408 100644 (file)
@@ -786,6 +786,10 @@ static void delete_defered_open_entry_record(connection_struct *conn, SMB_DEV_T
        deferred_open_entry *de_array = NULL;
        int num_de_entries, i;
 
+       if (!lp_defer_sharing_violations(SNUM(conn))) {
+               return;
+       }
+
        num_de_entries = get_deferred_opens(conn, dev, inode, &de_array);
        for (i = 0; i < num_de_entries; i++) {
                deferred_open_entry *entry = &de_array[i];
@@ -814,6 +818,10 @@ void defer_open_sharing_error(connection_struct *conn, struct timeval *ptv,
        int num_de_entries, i;
        struct dev_inode_bundle dib;
 
+       if (!lp_defer_sharing_violations(SNUM(conn))) {
+               return;
+       }
+
        dib.dev = dev;
        dib.inode = inode;