[SCM] Samba Shared Repository - branch v4-10-test updated

Karolin Seeger kseeger at samba.org
Thu Feb 21 15:27:02 UTC 2019


The branch, v4-10-test has been updated
       via  a3a9630a464 waf: Check for libnscd
       via  d8911eaa54d WHATSNEW: Add note that python2 support will be dropped on v4.11
       via  be6f8d41ca7 waf: Do not install internal header
       via  9bf434a941b lib:util: Move discard_const(_p) to own header for libndr.h
       via  66bf14d8322 pidl: Use NDR_ZERO_STRUCT(P) macros
       via  f6a44c807a9 librpc:ndr: Add NDR_ZERO_STRUCT(P) macros
       via  2ba1d9dd8d2 librpc:ndr: Implement ndr_zero_memory()
       via  6d2af886f40 tldap: avoid more use after free errors
       via  9a530ee4f91 tldap: avoid a use after free crash
       via  1ed75df5711 s3:vfs: Correctly check if OFD locks should be enabled or not
       via  fcd5865f3ff s3:vfs: Initialize pid to 0 in test_netatalk_lock()
       via  fbc8ea71c5c s4: torture: vfs_fruit. Change test_fruit_locking_conflict() to match the vfs_fruit working server code.
       via  72bcae77752 s3: VFS: vfs_fruit. Fix the NetAtalk deny mode compatibility code.
       via  eba5d055376 smbd: uid: Don't crash if 'force group' is added to an existing share connection.
       via  f68aab42318 s3: tests: Add regression test for smbd crash on share force group change with existing connection.
       via  d6dbd33fdcd printing: check lp_load_printers() prior to pcap cache update
       via  3d0450ef3c5 printing: drop pcap_cache_loaded() guard around load_printers()
       via  7621c622f83 s3-smbd: use fruit:model string for mDNS registration
      from  e21e24d8345 ldb: Release ldb 1.5.3

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-10-test


- Log -----------------------------------------------------------------
commit a3a9630a464979159cac2ea6783982584d3a450e
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Feb 12 12:28:32 2019 -0700

    waf: Check for libnscd
    
    The check was in the old autoconf, but not in waf. As the code is still
    in source3/lib/util_nscd.c, add the check for libnscd to allow building
    and using the code.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13787
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Wed Feb 13 17:58:33 CET 2019 on sn-devel-144
    
    (cherry picked from commit 3a793497796395ffa3efda5807bdb1ca8e09e35b)
    
    Autobuild-User(v4-10-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-10-test): Thu Feb 21 16:26:51 CET 2019 on sn-devel-144

commit d8911eaa54d5c82046311e856cbc8e7269477aa4
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Wed Feb 13 11:28:29 2019 +1300

    WHATSNEW: Add note that python2 support will be dropped on v4.11
    
    Add a warning to Samba users that v4.10 will be the last Samba release
    with python2 support.
    
    I've reworked the existing text describing the different python2 build
    options for 4.10. Hopefully this makes it slightly clearer.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13785
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>

commit be6f8d41ca7452840545356c7320355be815b5cd
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 13 10:44:45 2019 +0100

    waf: Do not install internal header
    
    We should not install header files without an public API:
    
    - memory.h
    - safe_strings.h
    - talloc_stack.h
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 6d232f3f7c64f9b01439326e0e9b6d9df9a0bcbb)

commit 9bf434a941be2f3b13b5cc59b5ad6f77f0c0fb8d
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 6 16:05:48 2019 +0100

    lib:util: Move discard_const(_p) to own header for libndr.h
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 96df6878ed521b7e744d703abb32a585500d3b94)

commit 66bf14d832286f5f5b9b4b68cd9b5b96975dbbed
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 13 10:41:19 2019 +0100

    pidl: Use NDR_ZERO_STRUCT(P) macros
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 532ce0d20a8016c1270ea689de627da8aa4abfdd)

commit f6a44c807a9cf9061ab82930c7b0799c785ff6b2
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 13 10:38:02 2019 +0100

    librpc:ndr: Add NDR_ZERO_STRUCT(P) macros
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 666802a3db3115ca09f3ffed58c8e4a8cabd65de)

commit 2ba1d9dd8d2ab2b11e13a1e1355cbc391226e084
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Feb 13 10:35:13 2019 +0100

    librpc:ndr: Implement ndr_zero_memory()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 2a7086f1ac4ad91fb7cd958e9386abb996794ed1)

commit 6d2af886f405ab7dbd2bf9022cadf8e12e0a26b5
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 5 14:08:56 2019 +0100

    tldap: avoid more use after free errors
    
    See the previous commit for an explanation. :)
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13776
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Wed Feb  6 10:19:12 CET 2019 on sn-devel-144
    
    (cherry picked from commit bf91ee0a9727cc392583fe84ad069204be758515)

commit 9a530ee4f917a6a0d37359587ad99ef8d1befd2f
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 5 13:56:53 2019 +0100

    tldap: avoid a use after free crash
    
    I saw the following crash in tldap in the winbindd idmap child on a
    member server after messing with the LDAP server on the DC:
    
    0  0x00007f77ea9a307a in __GI___waitpid (pid=9815, stat_loc=stat_loc at entry=0x7ffe77569eb0, options=options at entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
    1  0x00007f77ea91bfbb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
    2  0x00007f77edd8c24b in smb_panic_s3 (why=0x7f77f08e6e88 "Bad talloc magic value - access after free") at ../source3/lib/util.c:828
    3  0x00007f77f15afe85 in smb_panic (why=0x7f77f08e6e88 "Bad talloc magic value - access after free") at ../lib/util/fault.c:170
    4  0x00007f77f08e2678 in talloc_abort (reason=0x7f77f08e6e88 "Bad talloc magic value - access after free") at ../lib/talloc/talloc.c:472
    5  0x00007f77f08e268b in talloc_abort_access_after_free () at ../lib/talloc/talloc.c:477
    6  0x00007f77f08e2710 in talloc_chunk_from_ptr (ptr=0x55da7605a020) at ../lib/talloc/talloc.c:494
    7  0x00007f77f08e4a19 in _talloc_free (ptr=0x55da7605a020, location=0x7f77e181474d "../source3/lib/tldap.c:1918") at ../lib/talloc/talloc.c:1716
    8  0x00007f77e180b65c in tldap_search_all_done (subreq=0x55da7605a020) at ../source3/lib/tldap.c:1918
    9  0x00007f77f0af0fd0 in _tevent_req_notify_callback (req=0x55da7605a020, location=0x7f77e1813e50 "../source3/lib/tldap.c:47") at ../lib/tevent/tevent_req.c:125
    10 0x00007f77f0af10a5 in tevent_req_finish (req=0x55da7605a020, state=TEVENT_REQ_USER_ERROR, location=0x7f77e1813e50 "../source3/lib/tldap.c:47") at ../lib/tevent/tevent_req.c:162
    11 0x00007f77f0af1113 in _tevent_req_error (req=0x55da7605a020, error=9780923860630110289, location=0x7f77e1813e50 "../source3/lib/tldap.c:47") at ../lib/tevent/tevent_req.c:180
    12 0x00007f77e180781a in tevent_req_ldap_error (req=0x55da7605a020, rc=...) at ../source3/lib/tldap.c:47
    13 0x00007f77e180b2c4 in tldap_search_done (subreq=0x55da76058280) at ../source3/lib/tldap.c:1813
    14 0x00007f77f0af0fd0 in _tevent_req_notify_callback (req=0x55da76058280, location=0x7f77e1813e50 "../source3/lib/tldap.c:47") at ../lib/tevent/tevent_req.c:125
    15 0x00007f77f0af10a5 in tevent_req_finish (req=0x55da76058280, state=TEVENT_REQ_USER_ERROR, location=0x7f77e1813e50 "../source3/lib/tldap.c:47") at ../lib/tevent/tevent_req.c:162
    16 0x00007f77f0af11cd in tevent_req_trigger (ev=0x55da760526c0, im=0x55da76058360, private_data=0x55da76058280) at ../lib/tevent/tevent_req.c:219
    17 0x00007f77f0af0378 in tevent_common_loop_immediate (ev=0x55da760526c0) at ../lib/tevent/tevent_immediate.c:135
    18 0x00007f77f0af8b8f in epoll_event_loop_once (ev=0x55da760526c0, location=0x7f77f0af92b0 "../lib/tevent/tevent_req.c:269") at ../lib/tevent/tevent_epoll.c:911
    19 0x00007f77f0af5925 in std_event_loop_once (ev=0x55da760526c0, location=0x7f77f0af92b0 "../lib/tevent/tevent_req.c:269") at ../lib/tevent/tevent_standard.c:114
    20 0x00007f77f0aef201 in _tevent_loop_once (ev=0x55da760526c0, location=0x7f77f0af92b0 "../lib/tevent/tevent_req.c:269") at ../lib/tevent/tevent.c:725
    21 0x00007f77f0af1361 in tevent_req_poll (req=0x55da7605eed0, ev=0x55da760526c0) at ../lib/tevent/tevent_req.c:269
    22 0x00007f77e180fec9 in tldap_gensec_bind (ctx=0x55da76051ec0, creds=0x55da76052250, target_service=0x7f77e18164b3 "ldap", target_hostname=0x55da7605d182 "dc1.sdom1.site", target_principal=0x0, lp_ctx=0x55da76052180, gensec_features=6) at ../source3/lib/tldap_gensec_bind.c:358
    23 0x00007f77e1810d21 in idmap_ad_get_tldap_ctx (mem_ctx=0x55da76050510, domname=0x55da76051d50 "sdom1", pld=0x55da76050518) at ../source3/winbindd/idmap_ad.c:326
    24 0x00007f77e1811056 in idmap_ad_context_create (mem_ctx=0x55da76059c00, dom=0x55da76059c00, domname=0x55da76051d50 "sdom1", pctx=0x7ffe7756a5f8) at ../source3/winbindd/idmap_ad.c:374
    25 0x00007f77e18119c0 in idmap_ad_get_context (dom=0x55da76059c00, pctx=0x7ffe7756a640) at ../source3/winbindd/idmap_ad.c:554
    26 0x00007f77e181275b in idmap_ad_sids_to_unixids (dom=0x55da76059c00, ids=0x55da760518a0) at ../source3/winbindd/idmap_ad.c:784
    27 0x00007f77e1813217 in idmap_ad_sids_to_unixids_retry (dom=0x55da76059c00, ids=0x55da760518a0) at ../source3/winbindd/idmap_ad.c:947
    28 0x000055da7459ce05 in _wbint_Sids2UnixIDs (p=0x7ffe7756a870, r=0x55da76050860) at ../source3/winbindd/winbindd_dual_srv.c:202
    29 0x000055da7460aa5e in api_wbint_Sids2UnixIDs (p=0x7ffe7756a870) at default/librpc/gen_ndr/srv_winbind.c:391
    30 0x000055da7459c7f4 in winbindd_dual_ndrcmd (domain=0x0, state=0x7ffe7756abb8) at ../source3/winbindd/winbindd_dual_ndr.c:369
    31 0x000055da7459828c in child_process_request (child=0x55da74874bc0 <static_idmap_child>, state=0x7ffe7756abb8) at ../source3/winbindd/winbindd_dual.c:666
    32 0x000055da7459ae58 in child_handler (ev=0x55da7602c2b0, fde=0x55da7603f8a0, flags=1, private_data=0x7ffe7756abb0) at ../source3/winbindd/winbindd_dual.c:1567
    33 0x00007f77f0af85f1 in epoll_event_loop (epoll_ev=0x55da76048b00, tvalp=0x7ffe7756aab0) at ../lib/tevent/tevent_epoll.c:728
    34 0x00007f77f0af8c29 in epoll_event_loop_once (ev=0x55da7602c2b0, location=0x55da74628b08 "../source3/winbindd/winbindd_dual.c:1766") at ../lib/tevent/tevent_epoll.c:930
    35 0x00007f77f0af5925 in std_event_loop_once (ev=0x55da7602c2b0, location=0x55da74628b08 "../source3/winbindd/winbindd_dual.c:1766") at ../lib/tevent/tevent_standard.c:114
    36 0x00007f77f0aef201 in _tevent_loop_once (ev=0x55da7602c2b0, location=0x55da74628b08 "../source3/winbindd/winbindd_dual.c:1766") at ../lib/tevent/tevent.c:725
    37 0x000055da7459b9e9 in fork_domain_child (child=0x55da74874bc0 <static_idmap_child>) at ../source3/winbindd/winbindd_dual.c:1766
    38 0x000055da74596e96 in wb_child_request_waited (subreq=0x0) at ../source3/winbindd/winbindd_dual.c:188
    39 0x00007f77f0af0fd0 in _tevent_req_notify_callback (req=0x55da7604f820, location=0x7f77f0af90f8 "../lib/tevent/tevent_queue.c:355") at ../lib/tevent/tevent_req.c:125
    40 0x00007f77f0af10a5 in tevent_req_finish (req=0x55da7604f820, state=TEVENT_REQ_DONE, location=0x7f77f0af90f8 "../lib/tevent/tevent_queue.c:355") at ../lib/tevent/tevent_req.c:162
    41 0x00007f77f0af10cd in _tevent_req_done (req=0x55da7604f820, location=0x7f77f0af90f8 "../lib/tevent/tevent_queue.c:355") at ../lib/tevent/tevent_req.c:168
    42 0x00007f77f0af0cc1 in tevent_queue_wait_trigger (req=0x55da7604f820, private_data=0x0) at ../lib/tevent/tevent_queue.c:355
    43 0x00007f77f0af06f2 in tevent_queue_immediate_trigger (ev=0x55da7602c2b0, im=0x55da760466a0, private_data=0x55da76046580) at ../lib/tevent/tevent_queue.c:149
    44 0x00007f77f0af0378 in tevent_common_loop_immediate (ev=0x55da7602c2b0) at ../lib/tevent/tevent_immediate.c:135
    45 0x00007f77f0af8b8f in epoll_event_loop_once (ev=0x55da7602c2b0, location=0x55da74612630 "../source3/winbindd/winbindd.c:1803") at ../lib/tevent/tevent_epoll.c:911
    46 0x00007f77f0af5925 in std_event_loop_once (ev=0x55da7602c2b0, location=0x55da74612630 "../source3/winbindd/winbindd.c:1803") at ../lib/tevent/tevent_standard.c:114
    47 0x00007f77f0aef201 in _tevent_loop_once (ev=0x55da7602c2b0, location=0x55da74612630 "../source3/winbindd/winbindd.c:1803") at ../lib/tevent/tevent.c:725
    48 0x000055da74561431 in main (argc=2, argv=0x7ffe7756c968) at ../source3/winbindd/winbindd.c:1803
    
    subreq is a child of the state of req which will already be free by the
    callback of req.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13776
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 9465292d4109f710f8fcd141a076f5c8278577bc)

commit 1ed75df5711c67565bfe70e4e82de9df208a4a7c
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 30 18:45:34 2019 +0100

    s3:vfs: Correctly check if OFD locks should be enabled or not
    
    Also the smb.conf options should only be checked once and a reload of
    the config should not switch to a different locking mode.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13770
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Feb  9 03:43:50 CET 2019 on sn-devel-144
    
    (cherry picked from commit 7ff94b18e2e39567ef7a208084cc5c914c39d3bd)

commit fcd5865f3ff7e966b376a2073d8477b1ef37fc25
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 30 18:09:52 2019 +0100

    s3:vfs: Initialize pid to 0 in test_netatalk_lock()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13770
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2ff2594b2bd878928cec30bc72a95a6d38bee154)

commit fbc8ea71c5c32bc87e07d0550f8bb8d08227fc5b
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Feb 6 18:01:52 2019 -0800

    s4: torture: vfs_fruit. Change test_fruit_locking_conflict() to match the vfs_fruit working server code.
    
    Originally added for BUG: https://bugzilla.samba.org/show_bug.cgi?id=13584
    to demonstrate a lock order violation, this test
    exposed problems in the mapping of SMB1/2 share modes
    and open modes to NetATalk modes once we moved to OFD locks.
    
    Change the test slightly (and add comments)
    so it demonstrates working NetATalk share modes
    on an open file.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13770
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Feb  8 23:26:46 CET 2019 on sn-devel-144
    
    (cherry picked from commit 28990e4ba23695ecf264117efad90cc4e573302e)

commit 72bcae77752b3918a5eb3f56e0aef0c76135a556
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Feb 6 17:49:16 2019 -0800

    s3: VFS: vfs_fruit. Fix the NetAtalk deny mode compatibility code.
    
    This exhibited itself as a problem with OFD locks reported
    as:
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13770
    
    However, due to underlying bugs in the vfs_fruit
    code the file locks were not being properly applied.
    
    There are two problems in fruit_check_access().
    
    Problem #1:
    
    Inside fruit_check_access() we have:
    
    flags = fcntl(fsp->fh->fd, F_GETFL);
    ..
    if (flags & (O_RDONLY|O_RDWR)) {
    
    We shouldn't be calling fcntl(fsp->fh->fd, ..) directly.
    fsp->fh->fd may be a made up number from an underlying
    VFS module that has no meaning to a system call.
    
    Secondly, in all POSIX systems - O_RDONLY is defined as
    *zero*. O_RDWR = 2.
    
    Which means flags & (O_RDONLY|O_RDWR) becomes (flags & 2),
    not what we actually thought.
    
    Problem #2:
    
    deny_mode is *not* a bitmask, it's a set of discrete values.
    
    Inside fruit_check_access() we have:
    
    if (deny_mode & DENY_READ) and also (deny_mode & DENY_WRITE)
    
    However, deny modes are defined as:
    
    /* deny modes */
    define DENY_DOS 0
    define DENY_ALL 1
    define DENY_WRITE 2
    define DENY_READ 3
    define DENY_NONE 4
    define DENY_FCB 7
    
    so if deny_mode = DENY_WRITE, or if deny_mode = DENY_READ
    then it's going to trigger both the if (deny_mode & DENY_READ)
    *and* the (deny_mode & DENY_WRITE) conditions.
    
    These problems allowed the original test test_netatalk_lock code to
    pass (which was added for BUG: https://bugzilla.samba.org/show_bug.cgi?id=13584
    to demonstrate the lock order violation).
    
    This patch refactors the fruit_check_access()
    code to be much simpler (IMHO) to understand.
    
    Firstly, pass in the SMB1/2 share mode, not old
    DOS deny modes.
    
    Secondly, read all the possible NetAtalk locks
    into local variables:
    
    netatalk_already_open_for_reading
    netatalk_already_open_with_deny_read
    netatalk_already_open_for_writing
    netatalk_already_open_with_deny_write
    
    Then do the share mode/access mode checks
    with the requested values against any stored
    netatalk modes/access modes.
    
    Finally add in NetATalk compatible locks
    that represent our share modes/access modes
    into the file, with an early return if we don't
    have FILE_READ_DATA (in which case we can't
    write locks anyway).
    
    The patch is easier to understand by looking
    at the completed patched fruit_check_access()
    function, rather than trying to look at the
    diff.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Böhme <slow at samba.org>
    (cherry picked from commit 3204dc66f6801a7c8c87c48f601e0ebdee9e3d40)

commit eba5d055376b6f53f784dadbe71a8bfbdcee8b4a
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 18 14:24:30 2019 -0800

    smbd: uid: Don't crash if 'force group' is added to an existing share connection.
    
    smbd could crash if "force group" is added to a
    share definition whilst an existing connection
    to that share exists. In that case, don't change
    the existing credentials for force group, only
    do so for new connections.
    
    Remove knownfail from regression test.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Fri Jan 25 16:31:27 CET 2019 on sn-devel-144
    
    (cherry picked from commit e37f9956c1f2416408bad048a4618f6366086b6a)

commit f68aab42318381fe42b90bff8962e6d77470cbd3
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jan 24 10:15:56 2019 -0800

    s3: tests: Add regression test for smbd crash on share force group change with existing connection.
    
    Mark as known fail for now.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 7b21b4c1f538650f23ec77fb3c02fe1e224d89aa)

commit d6dbd33fdcd6a4763a95d448405c54a2170c2616
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Jan 29 01:55:04 2019 +0100

    printing: check lp_load_printers() prior to pcap cache update
    
    Avoid explicit and housekeeping timer triggered printcap cache updates
    if lp_load_printers() is disabled.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13766
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(master): Noel Power <npower at samba.org>
    Autobuild-Date(master): Fri Feb  1 19:25:03 CET 2019 on sn-devel-144
    
    (cherry picked from commit 6a77237c50dd258521f356af0b5dc9942dd5592e)

commit 3d0450ef3c54d31d4a1aafaebf415e7f9d727c7b
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Jan 29 01:50:15 2019 +0100

    printing: drop pcap_cache_loaded() guard around load_printers()
    
    Add the pcap_cache_loaded() check to load_printers() and return early
    if it returns false. This simplifies callers in preparation for checking
    lp_load_printers() in the printcap cache update code-path.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13766
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Noel Power <npower at samba.org>
    (cherry picked from commit 0ae7c3144a30910adb1e54cf46d54d42a1036839)

commit 7621c622f83f90c213bfbf2b17b8b3a78510ecf2
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 15 14:26:17 2019 +0100

    s3-smbd: use fruit:model string for mDNS registration
    
    With this change we now allow to modify the icon to represent Samba in
    Finder. Possible values are at least:
    
    fruit:model = iMac
    fruit:model = MacBook
    fruit:model = MacPro
    fruit:model = Xserve
    fruit:model = RackMac
    
    Prior to this change we only displayed the correct icon when a mac
    client negotiated the apple create context over SMB.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13746
    
    Based on proposed patch from Rouven WEILER <Rouven_Weiler at gmx.net>
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Tue Jan 15 21:27:20 CET 2019 on sn-devel-144
    
    (cherry picked from commit 538ce72f1b2fa78450e3b711e58bd0e238faf466)

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

Summary of changes:
 WHATSNEW.txt                                    |  45 ++++--
 lib/util/discard.h                              |  51 ++++++
 lib/util/memory.h                               |  27 ----
 lib/util/samba_util.h                           |   1 +
 lib/util/wscript_build                          |  18 ++-
 librpc/ABI/{ndr-0.1.2.sigs => ndr-0.2.0.sigs}   |   1 +
 librpc/ndr/libndr.h                             |  10 +-
 librpc/ndr/util.c                               |   5 +
 librpc/wscript_build                            |   2 +-
 pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm         |   2 +-
 pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm         |   2 +-
 pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm        |   6 +-
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm        |   6 +-
 selftest/selftesthelpers.py                     |   1 +
 selftest/target/Samba3.pm                       |   5 +
 source3/include/proto.h                         |   2 +-
 source3/lib/tldap.c                             |   1 -
 source3/lib/tldap_util.c                        |   2 -
 source3/lib/util.c                              |   7 +-
 source3/libsmb/samlogon_cache.c                 |   1 +
 source3/modules/vfs_default.c                   |  14 +-
 source3/modules/vfs_fruit.c                     | 204 +++++++++++-------------
 source3/printing/load.c                         |   4 +-
 source3/printing/pcap.c                         |   5 +
 source3/printing/queue_process.c                |   6 +-
 source3/printing/spoolssd.c                     |   8 +-
 source3/script/tests/test_force_group_change.sh |  73 +++++++++
 source3/selftest/tests.py                       |   4 +
 source3/smbd/avahi_register.c                   |  27 ++++
 source3/smbd/files.c                            |   9 ++
 source3/smbd/uid.c                              |  35 +++-
 source3/wscript                                 |   3 +
 source3/wscript_build                           |   1 +
 source4/torture/vfs/fruit.c                     |  26 ++-
 34 files changed, 417 insertions(+), 197 deletions(-)
 create mode 100644 lib/util/discard.h
 copy librpc/ABI/{ndr-0.1.2.sigs => ndr-0.2.0.sigs} (99%)
 create mode 100755 source3/script/tests/test_force_group_change.sh


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 8bbb1fd705f..efbcb171ce5 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -87,23 +87,38 @@ exceeded Samba drops new connections immediately.
 python3 support
 ---------------
 
-The version of python which is now the default for samba is python3.
-'configure' & 'make' will execute using python3. It is possible to still
-specify an additional python version with '--extra-python'
-e.g. '--extra-python=/usr/bin/python2'. It should be noted that support for
-this option will be deprecated in a future release.
-
-What if I need to build with python2? To build with python2 you *must* set
-the 'PYTHON' environment variable to override the python3 default for both
-'configure' and 'make' steps.
-
-   'PYTHON=python2 ./configure.developer'
-&
+This is the first release of Samba which has full support for Python 3.
+Samba 4.10 still has support for Python 2, however, Python 3 will be used by
+default, i.e. 'configure' & 'make' will execute using python3.
+
+To build Samba with python2 you *must* set the 'PYTHON' environment variable
+for both the 'configure' and 'make' steps, i.e.
+   'PYTHON=python2 ./configure'
    'PYTHON=python2 make'
+This will override the python3 default.
+
+Alternatively, it is possible to produce Samba Python bindings for both
+Python 2 and Python 3. To do so, specify '--extra-python=/usr/bin/python2'
+as part of the 'configure' command. Note that python3 will still be used as
+the default in this case.
+
+Note that Samba 4.10 supports Python 3.4 onwards.
+
+Future Python support
+---------------------
+
+Samba 4.10 will be the last release that comes with full support for
+Python 2. Unfortunately, the Samba Team doesn't have the resources to support
+both Python 2 and Python 3 long-term.
+
+Samba 4.11 will not have any runtime support for Python 2. This means if
+you use Python 2 bindings it is time to migrate to Python 3 now.
+
+If you are building Samba using the '--disable-python' option (i.e. you're
+excluding all the run-time Python support), then this will continue to work
+on a system that supports either python2 or python3.
 
-Note: Support for python2 (with the exception of a build configured with
-      'PYTHON=python2 ./configure --disable-python' and built with
-      'PYTHON=python2 make') will be deprecated in the next release.
+Also note that Samba 4.11 will most likely only support Python 3.6 onwards.
 
 JSON logging
 ------------
diff --git a/lib/util/discard.h b/lib/util/discard.h
new file mode 100644
index 00000000000..d2b74ac989c
--- /dev/null
+++ b/lib/util/discard.h
@@ -0,0 +1,51 @@
+/*
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1992-1999
+   Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2008
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _SAMBA_DISCARD_H_
+#define _SAMBA_DISCARD_H_
+
+/**
+  this is a warning hack. The idea is to use this everywhere that we
+  get the "discarding const" warning from gcc. That doesn't actually
+  fix the problem of course, but it means that when we do get to
+  cleaning them up we can do it by searching the code for
+  discard_const.
+
+  It also means that other error types aren't as swamped by the noise
+  of hundreds of const warnings, so we are more likely to notice when
+  we get new errors.
+
+  Please only add more uses of this macro when you find it
+  _really_ hard to fix const warnings. Our aim is to eventually use
+  this function in only a very few places.
+
+  Also, please call this via the discard_const_p() macro interface, as that
+  makes the return type safe.
+*/
+#ifndef discard_const
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+#endif
+
+/** Type-safe version of discard_const */
+#ifndef discard_const_p
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#endif
+
+#endif /* _SAMBA_DISCARD_H_ */
diff --git a/lib/util/memory.h b/lib/util/memory.h
index 3278f6b3c21..0e151cc5f66 100644
--- a/lib/util/memory.h
+++ b/lib/util/memory.h
@@ -94,31 +94,4 @@
 #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
 #endif
 
-/**
-  this is a warning hack. The idea is to use this everywhere that we
-  get the "discarding const" warning from gcc. That doesn't actually
-  fix the problem of course, but it means that when we do get to
-  cleaning them up we can do it by searching the code for
-  discard_const.
-
-  It also means that other error types aren't as swamped by the noise
-  of hundreds of const warnings, so we are more likely to notice when
-  we get new errors.
-
-  Please only add more uses of this macro when you find it
-  _really_ hard to fix const warnings. Our aim is to eventually use
-  this function in only a very few places.
-
-  Also, please call this via the discard_const_p() macro interface, as that
-  makes the return type safe.
-*/
-#ifndef discard_const
-#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
-#endif
-
-/** Type-safe version of discard_const */
-#ifndef discard_const_p
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#endif
-
 #endif /* _SAMBA_MEMORY_H_ */
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 7b96a595d43..11c95b5bfe3 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -54,6 +54,7 @@ extern const char *panic_action;
 #endif
 
 #include "lib/util/memory.h"
+#include "lib/util/discard.h"
 
 #include "fault.h"
 
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 8fc402062fb..e3a004fa3c6 100644
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -126,7 +126,23 @@ else:
                     tevent_debug.c memcache.c unix_match.c tfork.c''',
                   deps='samba-util-core DYNCONFIG close-low-fd tiniparser genrand util_str_hex',
                   public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid',
-                  public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h string_wrappers.h idtree.h idtree_random.h blocking.h signal.h substitute.h fault.h genrand.h tfork.h',
+                  public_headers='''
+                                 attr.h
+                                 byteorder.h
+                                 data_blob.h
+                                 debug.h
+                                 discard.h
+                                 time.h
+                                 string_wrappers.h
+                                 idtree.h
+                                 idtree_random.h
+                                 blocking.h
+                                 signal.h
+                                 substitute.h
+                                 fault.h
+                                 genrand.h
+                                 tfork.h
+                                 ''',
                   header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
                   local_include=False,
                   vnum='0.0.1',
diff --git a/librpc/ABI/ndr-0.1.2.sigs b/librpc/ABI/ndr-0.2.0.sigs
similarity index 99%
copy from librpc/ABI/ndr-0.1.2.sigs
copy to librpc/ABI/ndr-0.2.0.sigs
index bf9fdfc922c..6346f2fb491 100644
--- a/librpc/ABI/ndr-0.1.2.sigs
+++ b/librpc/ABI/ndr-0.2.0.sigs
@@ -261,3 +261,4 @@ ndr_token_retrieve_cmp_fn: enum ndr_err_code (struct ndr_token_list *, const voi
 ndr_token_store: enum ndr_err_code (TALLOC_CTX *, struct ndr_token_list *, const void *, uint32_t)
 ndr_transfer_syntax_ndr: uuid = {time_low = 2324192516, time_mid = 7403, time_hi_and_version = 4553, clock_seq = "\237\350", node = "\b\000+\020H`"}, if_version = 2
 ndr_transfer_syntax_ndr64: uuid = {time_low = 1903232307, time_mid = 48826, time_hi_and_version = 18743, clock_seq = "\203\031", node = "\265\333\357\234\314\066"}, if_version = 1
+ndr_zero_memory: void (void *, size_t)
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index c31496fe1dc..8a15fccfe09 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -26,7 +26,7 @@
 #define __LIBNDR_H__
 
 #include <talloc.h>
-#include "../lib/util/memory.h" /* for discard_const */
+#include "../lib/util/discard.h" /* for discard_const */
 #include "../lib/util/byteorder.h"
 #include "../lib/util/data_blob.h"
 #include "../lib/util/time.h"
@@ -411,6 +411,13 @@ enum ndr_compression_alg {
        if (unlikely(!(s))) return ndr_push_error(ndr, NDR_ERR_ALLOC, "push alloc %s failed: %s\n", # s, __location__); \
 } while (0)
 
+#define NDR_ZERO_STRUCT(x) ndr_zero_memory(&(x), sizeof(x))
+#define NDR_ZERO_STRUCTP(x) do { \
+	if ((x) != NULL) { \
+		ndr_zero_memory((x), sizeof(*(x))); \
+	} \
+} while(0)
+
 /* these are used when generic fn pointers are needed for ndr push/pull fns */
 typedef enum ndr_err_code (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, const void *);
 typedef enum ndr_err_code (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *);
@@ -493,6 +500,7 @@ void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct do
 size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags);
 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
 void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
+void ndr_zero_memory(void *ptr, size_t len);
 bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2);
 char *ndr_syntax_id_to_string(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *id);
 bool ndr_syntax_id_from_string(const char *s, struct ndr_syntax_id *id);
diff --git a/librpc/ndr/util.c b/librpc/ndr/util.c
index b2df28dde09..0eb7eba9e5e 100644
--- a/librpc/ndr/util.c
+++ b/librpc/ndr/util.c
@@ -29,3 +29,8 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name
 	char addr[INET6_ADDRSTRLEN];
 	ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
 }
+
+_PUBLIC_ void ndr_zero_memory(void *ptr, size_t len)
+{
+	memset_s(ptr, len, 0, len);
+}
diff --git a/librpc/wscript_build b/librpc/wscript_build
index 9669dfce2bf..8e113c422b2 100644
--- a/librpc/wscript_build
+++ b/librpc/wscript_build
@@ -725,7 +725,7 @@ bld.SAMBA_LIBRARY('ndr',
     public_deps='samba-errors talloc samba-util util_str_hex',
     public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h',
     header_path= [('*gen_ndr*', 'gen_ndr')],
-    vnum='0.1.2',
+    vnum='0.2.0',
     abi_directory='ABI',
     abi_match='ndr_* GUID_*',
     )
diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
index c87d17a5a78..fa7303b8543 100644
--- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
+++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
@@ -103,7 +103,7 @@ sub CallWithStruct($$$$$$)
 		if (grep(/out/, @{$_->{DIRECTION}})) { $hasout = 1; }
 	}
 
-	pidl "ZERO_STRUCT(r->out);" if ($hasout);
+	pidl "NDR_ZERO_STRUCT(r->out);" if ($hasout);
 
 	foreach (@{$fn->{ELEMENTS}}) {
 		my @dir = @{$_->{DIRECTION}};
diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm
index 35e6e3f0d19..de050e8f8c6 100644
--- a/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/COM/Proxy.pm
@@ -101,7 +101,7 @@ static $tn dcom_proxy_$interface->{NAME}_$name(struct $interface->{NAME} *d, TAL
 		return status;
 	}
 
-	ZERO_STRUCT(r.in.ORPCthis);
+	NDR_ZERO_STRUCT(r.in.ORPCthis);
 	r.in.ORPCthis.version.MajorVersion = COM_MAJOR_VERSION;
 	r.in.ORPCthis.version.MinorVersion = COM_MINOR_VERSION;
 ";
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
index 040cd5a4bd3..734e86dd183 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
@@ -496,7 +496,7 @@ sub ParseFunction_Send($$$$)
 
 	if (defined($fn->{RETURN_TYPE})) {
 		$self->pidl("/* Result */");
-		$self->pidl("ZERO_STRUCT(state->orig.out.result);");
+		$self->pidl("NDR_ZERO_STRUCT(state->orig.out.result);");
 		$self->pidl("");
 	}
 
@@ -585,7 +585,7 @@ sub ParseFunction_Done($$$$)
 	}
 
 	$self->pidl("/* Reset temporary structure */");
-	$self->pidl("ZERO_STRUCT(state->tmp);");
+	$self->pidl("NDR_ZERO_STRUCT(state->tmp);");
 	$self->pidl("");
 
 	$self->pidl("tevent_req_done(req);");
@@ -698,7 +698,7 @@ sub ParseFunction_Sync($$$$)
 
 	if (defined($fn->{RETURN_TYPE})) {
 		$self->pidl("/* Result */");
-		$self->pidl("ZERO_STRUCT(r.out.result);");
+		$self->pidl("NDR_ZERO_STRUCT(r.out.result);");
 		$self->pidl("");
 	}
 
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index eae58a9a432..432e52f89c4 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -1134,7 +1134,7 @@ sub ParseElementPullLevel
 	if (has_property($e, "skip") or has_property($e, "skip_noinit")) {
 		$self->pidl("/* [skip] '$var_name' */");
 		if (not has_property($e, "skip_noinit")) {
-			$self->pidl("ZERO_STRUCT($var_name);");
+			$self->pidl("NDR_ZERO_STRUCT($var_name);");
 		}
 		return;
 	}
@@ -2551,7 +2551,7 @@ sub ParseFunctionPull($$)
 	# out to be too tricky (tridge)
 	foreach my $e (@{$fn->{ELEMENTS}}) {
 		next unless grep(/out/, @{$e->{DIRECTION}});
-		$self->pidl("ZERO_STRUCT(r->out);");
+		$self->pidl("NDR_ZERO_STRUCT(r->out);");
 		$self->pidl("");
 		last;
 	}
@@ -2600,7 +2600,7 @@ sub ParseFunctionPull($$)
 			if (grep(/in/, @{$e->{DIRECTION}})) {
 				$self->pidl("*r->out.$e->{NAME} = *r->in.$e->{NAME};");
 			} else {
-				$self->pidl("ZERO_STRUCTP(r->out.$e->{NAME});");
+				$self->pidl("NDR_ZERO_STRUCTP(r->out.$e->{NAME});");
 			}
 		}
 	}
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index ebdae12866a..acce6d24cce 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -207,3 +207,4 @@ smbcquotas = binpath('smbcquotas')
 smbget = binpath('smbget')
 rpcclient = binpath('rpcclient')
 smbcacls = binpath('smbcacls')
+smbcontrol = binpath('smbcontrol')
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 49bdd2ac885..f11bb9312df 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -984,6 +984,11 @@ sub setup_fileserver
 	comment = inherit only unix owner
 	inherit owner = unix only
 	acl_xattr:ignore system acls = yes
+# BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690
+[force_group_test]
+	path = $share_dir
+	comment = force group test
+#	force group = everyone
 [homes]
 	comment = Home directories
 	browseable = No
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 715bc56e286..9d6192967ba 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -360,7 +360,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist);
 void free_namearray(name_compare_entry *name_array);
 bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type);
 bool fcntl_getlock(int fd, int op, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid);
-int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks);
+int map_process_lock_to_ofd_lock(int op);
 bool is_myname(const char *s);
 void ra_lanman_string( const char *native_lanman );
 const char *get_remote_arch_str(void);
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index bfb24ee8661..d6c6e8859a6 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -1920,7 +1920,6 @@ static void tldap_search_all_done(struct tevent_req *subreq)
 	rc = tldap_search_recv(subreq, state, &msg);
 	/* No TALLOC_FREE(subreq), this is multi-step */
 	if (tevent_req_ldap_error(req, rc)) {
-		TALLOC_FREE(subreq);
 		return;
 	}
 
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index 508c6c02f80..54a9eb30bbe 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -457,7 +457,6 @@ static void tldap_fetch_rootdse_done(struct tevent_req *subreq)
 
 	rc = tldap_search_recv(subreq, state, &msg);
 	if (tevent_req_ldap_error(req, rc)) {
-		TALLOC_FREE(subreq);
 		return;
 	}
 
@@ -739,7 +738,6 @@ static void tldap_search_paged_done(struct tevent_req *subreq)
 
 	rc = tldap_search_recv(subreq, state, &state->result);
 	if (tevent_req_ldap_error(req, rc)) {
-		TALLOC_FREE(subreq);
 		return;
 	}
 
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 5dbd67349fa..7530ea67973 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1079,7 +1079,7 @@ bool fcntl_getlock(int fd, int op, off_t *poffset, off_t *pcount, int *ptype, pi
 }
 
 #if defined(HAVE_OFD_LOCKS)
-int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks)
+int map_process_lock_to_ofd_lock(int op)
 {
 	switch (op) {
 	case F_GETLK:
@@ -1095,16 +1095,13 @@ int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks)
 		op = F_OFD_SETLKW;
 		break;
 	default:
-		*use_ofd_locks = false;
 		return -1;
 	}
-	*use_ofd_locks = true;
 	return op;
 }
 #else /* HAVE_OFD_LOCKS */
-int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks)
+int map_process_lock_to_ofd_lock(int op)
 {
-	*use_ofd_locks = false;
 	return op;
 }
 #endif /* HAVE_OFD_LOCKS */
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index 494eb10a6a8..a9ddaab1a41 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -27,6 +27,7 @@
 #include "system/time.h"
 #include "lib/util/debug.h"
 #include "lib/util/talloc_stack.h"
+#include "lib/util/memory.h" /* for SAFE_FREE() */
 #include "source3/lib/util_path.h"
 #include "librpc/gen_ndr/ndr_krb5pac.h"
 #include "../libcli/security/security.h"
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index a27d33a6bea..cb5537e096e 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2553,11 +2553,8 @@ static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, o
 
 	START_PROFILE(syscall_fcntl_lock);
 
-	if (fsp->use_ofd_locks || !lp_parm_bool(SNUM(fsp->conn),
-						"smbd",
-						"force process locks",
-						false)) {
-		op = map_process_lock_to_ofd_lock(op, &fsp->use_ofd_locks);
+	if (fsp->use_ofd_locks) {
+		op = map_process_lock_to_ofd_lock(op);
 	}
 
 	result =  fcntl_lock(fsp->fh->fd, op, offset, count, type);
@@ -2581,11 +2578,8 @@ static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t
 
 	START_PROFILE(syscall_fcntl_getlock);
 
-	if (fsp->use_ofd_locks || !lp_parm_bool(SNUM(fsp->conn),
-						"smbd",
-						"force process locks",
-						false)) {
-		op = map_process_lock_to_ofd_lock(op, &fsp->use_ofd_locks);
+	if (fsp->use_ofd_locks) {
+		op = map_process_lock_to_ofd_lock(op);
 	}
 
 	result = fcntl_getlock(fsp->fh->fd, op, poffset, pcount, ptype, ppid);
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 9f3fe24e5fc..f54038f53d4 100644


-- 
Samba Shared Repository



More information about the samba-cvs mailing list