diff options
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/close.c | 4 | ||||
-rw-r--r-- | source3/smbd/open.c | 4 | ||||
-rw-r--r-- | source3/smbd/process.c | 22 |
3 files changed, 28 insertions, 2 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 305377dfc6..6de2774644 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -115,6 +115,10 @@ static void notify_deferred_opens(files_struct *fsp) int num_de_entries, i; pid_t mypid = sys_getpid(); + if (!lp_defer_sharing_violations()) { + return; + } + num_de_entries = get_deferred_opens(fsp->conn, fsp->dev, fsp->inode, &de_array); for (i = 0; i < num_de_entries; i++) { deferred_open_entry *entry = &de_array[i]; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 119eb04e09..d38d94e5aa 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -786,7 +786,7 @@ 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))) { + if (!lp_defer_sharing_violations()) { return; } @@ -818,7 +818,7 @@ 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))) { + if (!lp_defer_sharing_violations()) { return; } diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 72a604811b..60ce1499e8 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -151,6 +151,10 @@ void remove_sharing_violation_open_smb_message(uint16 mid) { struct pending_message_list *pml; + if (!lp_defer_sharing_violations()) { + return; + } + for (pml = smb_sharing_violation_queue; pml; pml = pml->next) { if (mid == SVAL(pml->buf.data,smb_mid)) { DEBUG(10,("remove_sharing_violation_open_smb_message: deleting mid %u len %u\n", @@ -172,6 +176,10 @@ void schedule_sharing_violation_open_smb_message(uint16 mid) struct pending_message_list *pml; int i = 0; + if (!lp_defer_sharing_violations()) { + return; + } + for (pml = smb_sharing_violation_queue; pml; pml = pml->next) { uint16 msg_mid = SVAL(pml->buf.data,smb_mid); DEBUG(10,("schedule_sharing_violation_open_smb_message: [%d] msg_mid = %u\n", i++, @@ -197,6 +205,11 @@ void schedule_sharing_violation_open_smb_message(uint16 mid) BOOL open_was_deferred(uint16 mid) { struct pending_message_list *pml; + + if (!lp_defer_sharing_violations()) { + return False; + } + for (pml = smb_sharing_violation_queue; pml; pml = pml->next) { if (SVAL(pml->buf.data,smb_mid) == mid) { return True; @@ -212,6 +225,11 @@ BOOL open_was_deferred(uint16 mid) struct pending_message_list *get_open_deferred_message(uint16 mid) { struct pending_message_list *pml; + + if (!lp_defer_sharing_violations()) { + return NULL; + } + for (pml = smb_sharing_violation_queue; pml; pml = pml->next) { if (SVAL(pml->buf.data,smb_mid) == mid) { return pml; @@ -231,6 +249,10 @@ BOOL push_sharing_violation_open_smb_message(struct timeval *ptv, char *private, struct timeval tv; SMB_BIG_INT tdif; + if (!lp_defer_sharing_violations()) { + return True; + } + tv = *ptv; tdif = tv.tv_sec; tdif *= 1000000; |