diff options
-rw-r--r-- | source3/libsmb/smb_signing.c | 17 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 11 |
2 files changed, 13 insertions, 15 deletions
diff --git a/source3/libsmb/smb_signing.c b/source3/libsmb/smb_signing.c index 8e3a4ff8d8..23611f3e3b 100644 --- a/source3/libsmb/smb_signing.c +++ b/source3/libsmb/smb_signing.c @@ -491,21 +491,14 @@ static struct smb_sign_info srv_sign_info = { }; /*********************************************************** - Turn on signing after sending an oplock break. + Turn signing off or on for oplock break code. ************************************************************/ -void srv_enable_signing(void) +BOOL srv_oplock_set_signing(BOOL onoff) { - srv_sign_info.doing_signing = True; -} - -/*********************************************************** - Turn off signing before sending an oplock break. -************************************************************/ - -void srv_disable_signing(void) -{ - srv_sign_info.doing_signing = False; + BOOL ret = srv_sign_info.doing_signing; + srv_sign_info.doing_signing = onoff; + return ret; } /*********************************************************** diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index bd52b0066d..ab7c6e8344 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -660,6 +660,7 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id, time_t start_time; BOOL shutdown_server = False; BOOL oplock_timeout = False; + BOOL sign_state; connection_struct *saved_user_conn; connection_struct *saved_fsp_conn; int saved_vuid; @@ -742,12 +743,16 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id, /* Remember if we just sent a break to level II on this file. */ fsp->sent_oplock_break = using_levelII? LEVEL_II_BREAK_SENT:EXCLUSIVE_BREAK_SENT; - srv_disable_signing(); + /* Save the server smb signing state. */ + sign_state = srv_oplock_set_signing(False); + if (!send_smb(smbd_server_fd(), outbuf)) { - srv_enable_signing(); + srv_oplock_set_signing(sign_state); exit_server("oplock_break: send_smb failed."); } - srv_enable_signing(); + + /* Restore the sign state to what it was. */ + srv_oplock_set_signing(sign_state); /* We need this in case a readraw crosses on the wire. */ global_oplock_break = True; |