The branch, master has been updated
       via  82a40271719 smbd: Slightly simplify delay_for_oplock()
       via  546394a90c6 smbd: Fix a typo
       via  076402cb598 smbd: Use a direct struct assignment in reply_setatr()
       via  93131652a7a samba_autoconf: fix undefined behaviour sanitizer 
compile flags
      from  f0ea0800982 s3: net: Test of fuzzer problems with net rpc registry 
import.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 82a40271719b5e3b12d13d50312dc793add647b1
Author: Volker Lendecke <v...@samba.org>
Date:   Wed May 15 18:23:27 2019 +0200

    smbd: Slightly simplify delay_for_oplock()
    
    We don't have to look at the leases.tdb record if it's our own lease.
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Thu May 16 07:59:52 UTC 2019 on sn-devel-184

commit 546394a90c6a6872b48e1d3784aa128785d85943
Author: Volker Lendecke <v...@samba.org>
Date:   Wed May 15 18:11:55 2019 +0200

    smbd: Fix a typo
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 076402cb598ea14ba9508ba5fbcac928851ba983
Author: Volker Lendecke <v...@samba.org>
Date:   Sun Apr 14 10:50:10 2019 +0200

    smbd: Use a direct struct assignment in reply_setatr()
    
    Saves .text bytes with -O3
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 93131652a7af622c1dbae016739024150ac38000
Author: Gary Lockyer <g...@catalyst.net.nz>
Date:   Thu May 16 11:29:34 2019 +1200

    samba_autoconf: fix undefined behaviour sanitizer compile flags
    
    Added the -g option, -fsaniize=null and -fsanitize=alignment, removed
    the -fno-omit-frame-pointer option.
    
    Signed-off-by: Gary Lockyer <g...@catalyst.net.nz>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py |  5 ++++-
 source3/smbd/open.c                   | 26 +++++++++++++-------------
 source3/smbd/reply.c                  |  7 ++++---
 3 files changed, 21 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py 
b/buildtools/wafsamba/samba_autoconf.py
index be179d8b29b..8e5dfb87102 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -795,13 +795,16 @@ int main(void) {
 
     if (Options.options.address_sanitizer or
         Options.options.undefined_sanitizer):
-        conf.ADD_CFLAGS('-fno-omit-frame-pointer -O1', testflags=True)
+        conf.ADD_CFLAGS('-g -O1', testflags=True)
     if Options.options.address_sanitizer:
+        conf.ADD_CFLAGS('-fno-omit-frame-pointer', testflags=True)
         conf.ADD_CFLAGS('-fsanitize=address', testflags=True)
         conf.ADD_LDFLAGS('-fsanitize=address', testflags=True)
         conf.env['ADDRESS_SANITIZER'] = True
     if Options.options.undefined_sanitizer:
         conf.ADD_CFLAGS('-fsanitize=undefined', testflags=True)
+        conf.ADD_CFLAGS('-fsanitize=null', testflags=True)
+        conf.ADD_CFLAGS('-fsanitize=alignment', testflags=True)
         conf.ADD_LDFLAGS('-fsanitize=undefined', testflags=True)
         conf.env['UNDEFINED_SANITIZER'] = True
 
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d23e8965f63..e9112dcfcf2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1712,7 +1712,7 @@ NTSTATUS send_break_message(struct messaging_context 
*msg_ctx,
        /* Overload entry->op_type */
        /*
         * This is a cut from uint32_t to uint16_t, but so far only the lower 3
-        * bits (LEASE_WRITE/HANDLE/READ are used anyway.
+        * bits (LEASE_WRITE/HANDLE/READ) are used anyway.
         */
        SSVAL(msg,OP_BREAK_MSG_OP_TYPE_OFFSET, break_to);
 
@@ -1871,6 +1871,18 @@ static bool delay_for_oplock(files_struct *fsp,
                if (e_is_lease) {
                        NTSTATUS status;
 
+                       if (lease != NULL) {
+                               bool our_lease = smb2_lease_equal(
+                                       fsp_client_guid(fsp),
+                                       &lease->lease_key,
+                                       &e->client_guid,
+                                       &e->lease_key);
+                               if (our_lease) {
+                                       DBG_DEBUG("Ignoring our own lease\n");
+                                       continue;
+                               }
+                       }
+
                        status = leases_db_get(
                                &e->client_guid,
                                &e->lease_key,
@@ -1905,18 +1917,6 @@ static bool delay_for_oplock(files_struct *fsp,
                           (unsigned)i, (unsigned)e_lease_type,
                           (unsigned)will_overwrite));
 
-               if (e_is_lease && lease != NULL) {
-                       bool ign;
-
-                       ign = smb2_lease_equal(fsp_client_guid(fsp),
-                                              &lease->lease_key,
-                                              &e->client_guid,
-                                              &e->lease_key);
-                       if (ign) {
-                               continue;
-                       }
-               }
-
                if ((e_lease_type & ~break_to) == 0) {
                        if (lease_is_breaking) {
                                delay = true;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 199542e8ae0..56b82616ac0 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1489,8 +1489,6 @@ void reply_setatr(struct smb_request *req)
 
        START_PROFILE(SMBsetatr);
 
-       ZERO_STRUCT(ft);
-
        if (req->wct < 2) {
                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
                goto out;
@@ -1552,7 +1550,10 @@ void reply_setatr(struct smb_request *req)
                }
        }
 
-       ft.mtime = convert_time_t_to_timespec(mtime);
+       ft = (struct smb_file_time) {
+               .mtime = convert_time_t_to_timespec(mtime)
+       };
+
        status = smb_set_file_time(conn, NULL, smb_fname, &ft, true);
        if (!NT_STATUS_IS_OK(status)) {
                reply_nterror(req, status);


-- 
Samba Shared Repository

Reply via email to