[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Sep 7 18:25:03 UTC 2018


The branch, master has been updated
       via  70169d4 wafsamba: Fix 'make -j<jobs>'
       via  b487979 ctdb-tests: Fix CTDB -O3 --picky-developer build on CentOS 7
       via  95682e2 dbwrap: Remove a pointless "return;"
       via  a5f9b33 vfs_fruit: fix an uninitialized variable error
       via  6be25d5 smbd: Simplify logic in remove_stale_share_mode_entries
       via  6a76a31 smbd: Simplify share_mode_stale_pid
       via  45a2e3e smbd: Simplify lease_match() a bit
       via  9108572 smbd: Simplify logic in fsp_lease_update
       via  6a78201 smbd: Simplify logic in smb2_lease_break_send
       via  c228134 smbd: Factor out file_has_read_oplocks()
       via  b88290c s3:lib: Rename server_contexts to global_contexts
       via  a7c19bc s3:lib/server_contexts: Rename variables
       via  cc76aae s3: Rename server_messaging_context() to global_messaging_context()
       via  ae7db3e s3: Rename server_event_context() to global_event_context()
       via  94852e3 examples: Fix the smb2mount build
       via  20ed139 s3:smbget: Use cmdline_messaging_context
       via  de040ea s3:smbcontrol: Use cmdline_messaging_context
       via  7eeff96 s3:dbwrap_tool: Use cmdline_messaging_context
       via  095123d s3:eventlogadm: Use cmdline_messaging_context
       via  9ed6174 s3: ntlm_auth: Use cmdline_messaging_context
       via  cab8f27 s3:sharesec: Use cmdline_messaging_context
       via  ea7a4ff s3:testparm: Use cmdline_messaging_context
       via  4661537 s3:pdbedit: Use cmdline_messaging_context
       via  f56496b s3:messaging: remove unused messaging_init_client()
       via  f2b659e s3:net: Use cmdline_messaging_context
       via  dd3ae2f rpcclient: Use cmdline_messaging_context
       via  d7fa381 s3:smbstatus: Use cmdline_messaging_context
       via  29fd2c2 s3:smbpasswd: Use cmdline_messaging_context
       via  3ecb9ed test:doc: Skip 'clustering=yes'
       via  2c63ce9 s3:popt_common: use cmdline_messaging_context() in popt_common_credentials_callback()
       via  10e1a6e selftest: pass configfile to pdbedit
       via  3aca3f2 s3:loadparm: reinit_globals in lp_load_with_registry_shares()
       via  8c3b62e s3:lib: Introduce cmdline context wrapper
       via  b7464fd s3:lib: Move popt_common_credentials to separate file
       via  dff1028 s3/lib:popt_common: Move setup_logging to common callback
       via  d920a72 s3:lib/server_contexts: make server_event_ctx and server_msg_ctx static
      from  4847daf wafsamba/samba_waf18: redefine flex function

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


- Log -----------------------------------------------------------------
commit 70169d4789fe8b2ee4efe5e88eeaa80e1a641b32
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Sep 6 12:40:10 2018 +0200

    wafsamba: Fix 'make -j<jobs>'
    
    Currently only 'make -j' enables parallel builds and e.g. 'make -j4'
    results in no parallel compile jobs at all.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13606
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Sep  7 20:24:46 CEST 2018 on sn-devel-144

commit b487979f89cd4dffabfb68b60955ff65de94b02f
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 6 16:06:40 2018 +1000

    ctdb-tests: Fix CTDB -O3 --picky-developer build on CentOS 7
    
    gcc 4.8.5 complains:
    
    [319/381] Compiling ctdb/tests/src/system_socket_test.c
    ../tests/src/system_socket_test.c: In function ‘test_tcp’:
    ../tests/src/system_socket_test.c:196:20: error: ‘rst_out’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      assert((rst != 0) == (rst_out != 0));
                        ^
    cc1: all warnings being treated as errors
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 95682e2fdd55b390170ec4ccd6ad679738e97c20
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Aug 31 06:09:48 2018 +0200

    dbwrap: Remove a pointless "return;"
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a5f9b33cb47d7cb91a201e058b18bc5d45c397ef
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 5 11:31:10 2018 +0200

    vfs_fruit: fix an uninitialized variable error
    
    clang does not recognize "smb_panic" as an "exit()" equivalent
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6be25d5683d5fbfddab4f22c4dbe6299969d1978
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 30 13:21:26 2018 +0200

    smbd: Simplify logic in remove_stale_share_mode_entries
    
    To me, an early "continue" is easier to follow than a "else".
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6a76a317793d6ae8fa1ce05f4faacbd0978fd5cb
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 30 13:03:17 2018 +0200

    smbd: Simplify share_mode_stale_pid
    
    This loop does not need to count valid share modes. A single valid one
    is sufficient for keeping the delete token around
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 45a2e3eb536f07cec1447b2de566c5840cd71074
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 27 14:16:20 2018 +0200

    smbd: Simplify lease_match() a bit
    
    This has been implicitly initialized to 0 with the explicit struct
    initializer above.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9108572039e42fbc0ec540d8a89764d81597dd5d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 26 15:46:18 2018 +0200

    smbd: Simplify logic in fsp_lease_update
    
    One if-condition is better than two
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6a7820141908084aaa002d3f4b8a984fcb67d2d9
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 26 14:52:55 2018 +0200

    smbd: Simplify logic in smb2_lease_break_send
    
    If/else if chains are hard to follow to me. Simplify the code by using
    early returns.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c2281341cb8a3bbe9f94a4b92cd83eb557214e97
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 26 12:35:30 2018 +0200

    smbd: Factor out file_has_read_oplocks()
    
    Why? This makes it clearer to me that we're not interested in the actual
    number of read oplocks. We only want to know if there are any read
    oplocks at all.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b88290cd3e1cd82bacfae75f078f551ef017bb1d
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 13:08:42 2018 -0700

    s3:lib: Rename server_contexts to global_contexts
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a7c19bca8cf480d35948ae061d4dfcf959ce5b59
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 11:18:08 2018 -0700

    s3:lib/server_contexts: Rename variables
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit cc76aaeb6234698bca5d6520bb14a9306c9131cd
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 11:09:16 2018 -0700

    s3: Rename server_messaging_context() to global_messaging_context()
    
    This reflects that the messaging context is also used outside of the
    server processes.
    
    The command used for the rename:
    find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_messaging_context/global_messaging_context/'
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit ae7db3e543d412864fafb0d0303c2219ce344526
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 11:06:16 2018 -0700

    s3: Rename server_event_context() to global_event_context()
    
    This reflects that the event context is also used outside of the server
    processes.
    
    The command used for the rename:
    find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_event_context/global_event_context/'
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 94852e3544bf2cace3ddba8b9c89d986d77fdab5
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Sep 7 07:27:46 2018 +0200

    examples: Fix the smb2mount build
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 20ed13923ed3c55e1b293e5440028d29384e9d3a
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 16:11:02 2018 -0700

    s3:smbget: Use cmdline_messaging_context
    
    Initialize the messaging context through cmdline_messaging_context to
    allow access to config in clustered Samba.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit de040eafbd7d729316d757c14c44df163a4b36ad
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 12:35:11 2018 -0700

    s3:smbcontrol: Use cmdline_messaging_context
    
    Initialize the messaging context through cmdline_messaging_context to
    allow access to config in clustered Samba.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 7eeff96b826711b5a8d44ab24603dafcc0343d84
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 12:34:34 2018 -0700

    s3:dbwrap_tool: Use cmdline_messaging_context
    
    Initialize the messaging context through cmdline_messaging_context to
    allow access to config in clustered Samba.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 095123df945270bc51635a19125a7abdfcd4ab80
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:21:51 2018 -0700

    s3:eventlogadm: Use cmdline_messaging_context
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9ed617474f588ceb42c8929ee8a51071a408c219
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:18:20 2018 -0700

    s3: ntlm_auth: Use cmdline_messaging_context
    
    Call cmdline_messaging_context to initialize the messaging context
    before accessing clustered Samba config.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit cab8f27bbc927e48c52bac6350325e8ec38092b2
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:15:02 2018 -0700

    s3:sharesec: Use cmdline_messaging_context
    
    Call cmdline_messasging_context to initialize messaging context before
    accessing clustered Samba config.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit ea7a4ff7ae5ef2b22fb7ef5640d6b946c064cfc3
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:11:11 2018 -0700

    s3:testparm: Use cmdline_messaging_context
    
    Call cmdline_messaging_context to initialize a messaging config before
    accessing clustered Samba config.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4661537c201acebee991d219d151cb481f56265c
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:08:21 2018 -0700

    s3:pdbedit: Use cmdline_messaging_context
    
    Initialize the messaging context through cmdline_messaging_context to
    allow access to config in clustered Samba.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit f56496b11469f0e9af9ba81cefb796ca1febabb1
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 10 16:29:46 2018 +0200

    s3:messaging: remove unused messaging_init_client()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>

commit f2b659e4f518ccb06f221dd028f99883ca1a1847
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 16:01:00 2018 -0700

    s3:net: Use cmdline_messaging_context
    
    Use cmdline_messaging_context with its error checking instead of open
    coding the same steps.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit dd3ae2ffdc66be4707471bfccf27ef446b5599cb
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 15:54:11 2018 -0700

    rpcclient: Use cmdline_messaging_context
    
    Use cmdline_messaging_context with its error checking instead of open
    coding the same steps.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d7fa3815a83a50fd9e3d78cac0d5ef3eb79235e5
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 15:46:27 2018 -0700

    s3:smbstatus: Use cmdline_messaging_context
    
    Use cmdline_messaging_context to initialize a messaging context instead
    of open coding the same steps.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 29fd2c2e5ad3c2d44f3629c6b7b4139772fe350c
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 15:38:33 2018 -0700

    s3:smbpasswd: Use cmdline_messaging_context
    
    smbpasswd does not use POPT_CREDENTIALS. Call cmdline_messaging_context
    to initialize a messaging_context with proper error checking before
    calling lp_load_global.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 3ecb9ed7b079fc1bf74c311cf5f1684086b36883
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Aug 21 14:58:01 2018 -0700

    test:doc: Skip 'clustering=yes'
    
    As testparm will error out when running clustering=yes as non-root, skip
    this step to avoid a test failure.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 2c63ce94ef3a55ab0aa1aae4f6fee88e29ac2efe
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 10 15:26:40 2018 +0200

    s3:popt_common: use cmdline_messaging_context() in popt_common_credentials_callback()
    
    This adds a call to cmdline_messaging_context() to the popt
    popt_common_credentials_callback() hook and ensures that any client tool
    that uses POPT_COMMON_CREDENTIALS gets an implicit messaging context,
    ensuring it doesn't crash in the subsequent lp_load_client() with
    include=registry in a cluster.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>

commit 10e1a6ebb3d95b8a1584a9b90c2584536aa9c96d
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 10 10:38:10 2018 +0200

    selftest: pass configfile to pdbedit
    
    This is needed otherwise pdbedit fails to initialize messaging in
    autobuild.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>

commit 3aca3f24d4bdacc11278388934b0b411d518d7b0
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 10 08:11:31 2018 +0200

    s3:loadparm: reinit_globals in lp_load_with_registry_shares()
    
    This was set to false in 0e0d77519c27038b30fec92d542198e97be767d9 based
    on the assumption that callers would have no need to call
    lp_load_initial_only() with a later call to lp_load_something().
    
    This is not quite correct, since for accessing registry config on a
    cluster with include=registry, we need messaging up and running which
    *itself* requires loadparm to be initialized to get the statedir,
    lockdir asf. directories.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>

commit 8c3b62e6231e62feafacf2a7ee4c9d41cd27a4a1
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 20 14:44:28 2018 -0700

    s3:lib: Introduce cmdline context wrapper
    
    Command line tools need acccess to the same messaging context provided
    by server_messaging_context, as common code for db_open uses that
    context. We want to have additional checking for command line tools
    without having that code part of the servers. Introduce a wrapper
    library to use for command line tools with the additional checks, that
    then acquires the server_messaging_context.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b7464fd89bc22b71c82bbaa424bcbfcf947db651
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 13 15:39:08 2018 -0700

    s3:lib: Move popt_common_credentials to separate file
    
    This is only used by command line utilities and has additional
    dependencies. Move to a separate file to contain the dependencies to the
    command line tools.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit dff1028e8ba4c70e726283c12531853681034014
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Aug 13 15:07:20 2018 -0700

    s3/lib:popt_common: Move setup_logging to common callback
    
    The flag is set in the common callback, so be consistent
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d920a725ee19215190bbccaefd5b426bedc98860
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Jul 9 17:11:57 2018 +0200

    s3:lib/server_contexts: make server_event_ctx and server_msg_ctx static
    
    server_event_ctx and server_msg_ctx static shouldn't be accessible from
    outside this compilation unit.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>

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

Summary of changes:
 buildtools/wafsamba/samba_utils.py                 |   9 +-
 ctdb/tests/src/system_socket_test.c                |   2 +-
 examples/fuse/smb2mount.c                          |   2 +-
 examples/fuse/wscript_build                        |   2 +-
 lib/dbwrap/dbwrap.c                                |   1 -
 python/samba/tests/docs.py                         |  13 +-
 source3/auth/auth_samba4.c                         |   2 +-
 source3/client/client.c                            |   2 +-
 source3/include/messages.h                         |   3 -
 source3/include/popt_common.h                      |  10 -
 .../background.h => include/popt_common_cmdline.h} |  46 ++--
 source3/include/proto.h                            |   8 +-
 source3/lib/cmdline_contexts.c                     |  70 ++++++
 .../unix_match.h => source3/lib/cmdline_contexts.h |  12 +-
 source3/lib/dbwrap/dbwrap_open.c                   |   2 +-
 .../lib/{server_contexts.c => global_contexts.c}   |  36 +--
 source3/lib/messages.c                             |   9 -
 source3/lib/popt_common.c                          | 216 +-----------------
 source3/lib/popt_common_cmdline.c                  | 249 +++++++++++++++++++++
 source3/locking/locking.c                          |  24 +-
 source3/locking/share_mode_lock.c                  |   2 +-
 source3/modules/vfs_aio_fork.c                     |   4 +-
 source3/modules/vfs_fruit.c                        |   2 +-
 source3/modules/vfs_preopen.c                      |   2 +-
 source3/nmbd/nmbd.c                                |   4 +-
 source3/param/loadparm.c                           |   2 +-
 source3/passdb/pdb_interface.c                     |   2 +-
 source3/printing/nt_printing.c                     |   6 +-
 source3/printing/printing.c                        |  28 +--
 source3/printing/queue_process.c                   |   4 +-
 source3/printing/spoolssd.c                        |   2 +-
 source3/rpc_server/fss/srv_fss_agent.c             |   4 +-
 source3/rpc_server/lsasd.c                         |   2 +-
 source3/rpc_server/mdssd.c                         |   2 +-
 source3/rpc_server/mdssvc/mdssvc.c                 |   6 +-
 source3/rpc_server/samr/srv_samr_nt.c              |   2 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c        |  18 +-
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c          |   4 +-
 source3/rpcclient/cmd_spoolss.c                    |   2 +-
 source3/rpcclient/rpcclient.c                      |  30 +--
 source3/rpcclient/wscript_build                    |   2 +-
 source3/smbd/msdfs.c                               |   8 +-
 source3/smbd/open.c                                |   2 -
 source3/smbd/oplock.c                              |  38 ++--
 source3/smbd/posix_acls.c                          |   2 +-
 source3/smbd/server.c                              |   4 +-
 source3/smbd/server_exit.c                         |   6 +-
 source3/smbd/smb2_break.c                          |  14 +-
 source3/smbd/smbXsrv_session.c                     |   2 +-
 source3/torture/test_dbwrap_ctdb.c                 |   2 +-
 source3/torture/test_dbwrap_do_locked.c            |   8 +-
 source3/torture/test_g_lock.c                      |   4 +-
 source3/torture/vfstest.c                          |   2 +-
 source3/utils/dbwrap_tool.c                        |   3 +
 source3/utils/eventlogadm.c                        |   4 +
 source3/utils/net.c                                |  31 +--
 source3/utils/ntlm_auth.c                          |   3 +
 source3/utils/pdbedit.c                            |   3 +
 source3/utils/regedit.c                            |   2 +-
 source3/utils/sharesec.c                           |   2 +
 source3/utils/smbcacls.c                           |   2 +-
 source3/utils/smbcontrol.c                         |  19 +-
 source3/utils/smbcquotas.c                         |   2 +-
 source3/utils/smbget.c                             |   5 +-
 source3/utils/smbpasswd.c                          |  17 +-
 source3/utils/smbtree.c                            |   2 +-
 source3/utils/status.c                             |  25 +--
 source3/utils/testparm.c                           |   3 +
 source3/utils/wscript_build                        |  34 ++-
 source3/winbindd/idmap_ldap.c                      |   2 +-
 source3/winbindd/idmap_rfc2307.c                   |   2 +-
 source3/winbindd/winbindd.c                        |  74 +++---
 source3/winbindd/winbindd_cm.c                     |  36 +--
 source3/winbindd/winbindd_cred_cache.c             |  14 +-
 source3/winbindd/winbindd_domain_info.c            |   2 +-
 source3/winbindd/winbindd_dual.c                   |  54 ++---
 source3/winbindd/winbindd_dual_srv.c               |   6 +-
 source3/winbindd/winbindd_gpupdate.c               |   4 +-
 source3/winbindd/winbindd_irpc.c                   |  18 +-
 source3/winbindd/winbindd_pam_auth.c               |   2 +-
 source3/winbindd/winbindd_pam_auth_crap.c          |   2 +-
 source3/winbindd/winbindd_pam_chauthtok.c          |   2 +-
 .../winbindd/winbindd_pam_chng_pswd_auth_crap.c    |   2 +-
 source3/winbindd/winbindd_pam_logoff.c             |   2 +-
 source3/winbindd/winbindd_util.c                   |   2 +-
 source3/wscript_build                              |  17 +-
 testprogs/blackbox/test_pdbtest.sh                 |   8 +-
 87 files changed, 712 insertions(+), 634 deletions(-)
 copy source3/{lib/background.h => include/popt_common_cmdline.h} (50%)
 create mode 100644 source3/lib/cmdline_contexts.c
 copy lib/util/unix_match.h => source3/lib/cmdline_contexts.h (72%)
 rename source3/lib/{server_contexts.c => global_contexts.c} (61%)
 create mode 100644 source3/lib/popt_common_cmdline.c


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 30e9943..fd61b84 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -448,6 +448,7 @@ def CHECK_MAKEFLAGS(bld):
     if makeflags is None:
         return
     jobs_set = False
+    jobs = None
     # we need to use shlex.split to cope with the escaping of spaces
     # in makeflags
     for opt in shlex.split(makeflags):
@@ -470,17 +471,21 @@ def CHECK_MAKEFLAGS(bld):
             setattr(Options.options, opt[0:loc], opt[loc+1:])
         elif opt[0] != '-':
             for v in opt:
-                if v == 'j':
+                if re.search(r'j[0-9]*$', v):
                     jobs_set = True
+                    jobs = opt.strip('j')
                 elif v == 'k':
                     Options.options.keep = True
-        elif opt == '-j':
+        elif re.search(r'-j[0-9]*$', opt):
             jobs_set = True
+            jobs = opt.strip('-j')
         elif opt == '-k':
             Options.options.keep = True
     if not jobs_set:
         # default to one job
         Options.options.jobs = 1
+    elif jobs_set and jobs:
+        Options.options.jobs = int(jobs)
 
 Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
 
diff --git a/ctdb/tests/src/system_socket_test.c b/ctdb/tests/src/system_socket_test.c
index f7d0c7c..b395957 100644
--- a/ctdb/tests/src/system_socket_test.c
+++ b/ctdb/tests/src/system_socket_test.c
@@ -109,7 +109,7 @@ static void test_tcp(const char *src_str,
 	ssize_t num_written;
 	char src_str_out[64], dst_str_out[64];
 	uint32_t seq_out, ack_out;
-	int rst_out;
+	int rst_out = 0;
 	uint16_t window;
 	int ret;
 
diff --git a/examples/fuse/smb2mount.c b/examples/fuse/smb2mount.c
index 816b0b5..ec4be80 100644
--- a/examples/fuse/smb2mount.c
+++ b/examples/fuse/smb2mount.c
@@ -20,7 +20,7 @@
 
 #include "source3/include/includes.h"
 #include "popt.h"
-#include "popt_common.h"
+#include "popt_common_cmdline.h"
 #include "client.h"
 #include "libsmb/proto.h"
 #include "clifuse.h"
diff --git a/examples/fuse/wscript_build b/examples/fuse/wscript_build
index 9ec5fc0..31341e4 100644
--- a/examples/fuse/wscript_build
+++ b/examples/fuse/wscript_build
@@ -3,5 +3,5 @@
 if bld.env.HAVE_FUSE:
     bld.SAMBA_BINARY('smb2mount',
                      source='smb2mount.c clifuse.c',
-                     deps='smbconf popt_samba3 libsmb fuse',
+                     deps='smbconf popt_samba3_cmdline libsmb fuse',
                      install=False)
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index a214a4e..79c83b1 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -505,7 +505,6 @@ static void dbwrap_parse_record_done(struct tevent_req *subreq)
 	}
 
 	tevent_req_done(req);
-	return;
 }
 
 NTSTATUS dbwrap_parse_record_recv(struct tevent_req *req)
diff --git a/python/samba/tests/docs.py b/python/samba/tests/docs.py
index 6ffdeab..5a59ed6 100644
--- a/python/samba/tests/docs.py
+++ b/python/samba/tests/docs.py
@@ -159,12 +159,13 @@ class SmbDotConfTests(TestCase):
 
         # registry shares appears to need sudo
         self._set_arbitrary(['bin/testparm'],
-                            exceptions=['client lanman auth',
-                                        'client plaintext auth',
-                                        'registry shares',
-                                        'smb ports',
-                                        'rpc server dynamic port range',
-                                        'name resolve order'])
+            exceptions = ['client lanman auth',
+                          'client plaintext auth',
+                          'registry shares',
+                          'smb ports',
+                          'rpc server dynamic port range',
+                          'name resolve order',
+                          'clustering'])
         self._test_empty(['bin/testparm'])
 
     def test_default_s4(self):
diff --git a/source3/auth/auth_samba4.c b/source3/auth/auth_samba4.c
index 46c8f9f..a71c756 100644
--- a/source3/auth/auth_samba4.c
+++ b/source3/auth/auth_samba4.c
@@ -59,7 +59,7 @@ static struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx)
 		}
 	}
 
-	msg_ctx = server_messaging_context();
+	msg_ctx = global_messaging_context();
 	if (msg_ctx == NULL) {
 		return NULL;
 	}
diff --git a/source3/client/client.c b/source3/client/client.c
index fc6d9a3..e8faed5 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -23,7 +23,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "popt_common.h"
+#include "popt_common_cmdline.h"
 #include "rpc_client/cli_pipe.h"
 #include "client/client_proto.h"
 #include "client/clitar_proto.h"
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 29c394a..f7b4066 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -46,9 +46,6 @@ struct messaging_rec;
 
 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
 					 struct tevent_context *ev);
-NTSTATUS messaging_init_client(TALLOC_CTX *mem_ctx,
-			       struct tevent_context *ev,
-			       struct messaging_context **pmsg_ctx);
 
 struct server_id messaging_server_id(const struct messaging_context *msg_ctx);
 struct tevent_context *messaging_tevent_context(
diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h
index a8c7784..e001a53 100644
--- a/source3/include/popt_common.h
+++ b/source3/include/popt_common.h
@@ -21,7 +21,6 @@
 #define _POPT_COMMON_H
 
 #include <popt.h>
-#include "auth_info.h"
 
 /* Common popt structures */
 extern struct poptOption popt_common_samba[];
@@ -41,19 +40,10 @@ extern const struct poptOption popt_common_dynconfig[];
 #define POPT_COMMON_CONNECTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_connection, 0, "Connection options:", NULL },
 #define POPT_COMMON_VERSION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version, 0, "Common samba options:", NULL },
 #define POPT_COMMON_CONFIGFILE { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile, 0, "Common samba config:", NULL },
-#define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
 #define POPT_COMMON_DYNCONFIG { NULL, 0, POPT_ARG_INCLUDE_TABLE, \
     discard_const_p(poptOption, popt_common_dynconfig), 0, \
     "Build-time configuration overrides:", NULL },
 #define POPT_COMMON_DEBUGLEVEL { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debuglevel, 0, "Common samba debugging:", NULL },
 #define POPT_COMMON_OPTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_option, 0, "Common samba commandline config:", NULL },
 
-struct user_auth_info *popt_get_cmdline_auth_info(void);
-void popt_free_cmdline_auth_info(void);
-
-void popt_common_credentials_set_ignore_missing_conf(void);
-void popt_common_credentials_set_delay_post(void);
-void popt_common_credentials_post(void);
-void popt_burn_cmdline_password(int argc, char *argv[]);
-
 #endif /* _POPT_COMMON_H */
diff --git a/source3/lib/background.h b/source3/include/popt_common_cmdline.h
similarity index 50%
copy from source3/lib/background.h
copy to source3/include/popt_common_cmdline.h
index ccfd62b..21130cf 100644
--- a/source3/lib/background.h
+++ b/source3/include/popt_common_cmdline.h
@@ -1,7 +1,8 @@
 /*
    Unix SMB/CIFS implementation.
-   Regular background jobs as forked helpers
-   Copyright (C) Volker Lendecke 2012
+   Common popt arguments
+   Copyright (C) Jelmer Vernooij	2003
+   Copyright (C) Christof Schmitt	2018
 
    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
@@ -17,23 +18,30 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef _LIB_BACKGROUND_H_
-#define _LIB_BACKGROUND_H_
 
-/*
- * From a parent process regularly fork a process and execute fn(). fn()
- * returns the number of seconds to wait before it is run next time. Returning
- * -1 means stop the job.
- */
-
-struct tevent_req *background_job_send(TALLOC_CTX *mem_ctx,
-				       struct tevent_context *ev,
-				       struct messaging_context *msg,
-				       uint32_t *trigger_msgs,
-				       size_t num_trigger_msgs,
-				       time_t initial_wait_sec,
-				       int (*fn)(void *private_data),
-				       void *private_data);
-NTSTATUS background_job_recv(struct tevent_req *req);
+#ifndef _POPT_COMMON_CREDENTIALS_H
+#define _POPT_COMMON_CREDENTIALS_H
+
+#include "popt_common.h"
+
+extern struct poptOption popt_common_credentials[];
+#define POPT_COMMON_CREDENTIALS \
+	{ \
+		NULL,						\
+		0,						\
+		POPT_ARG_INCLUDE_TABLE,			\
+		popt_common_credentials,			\
+		0,						\
+		"Authentication options:",			\
+		NULL						\
+	},
+
+struct user_auth_info *popt_get_cmdline_auth_info(void);
+void popt_free_cmdline_auth_info(void);
+
+void popt_common_credentials_set_ignore_missing_conf(void);
+void popt_common_credentials_set_delay_post(void);
+void popt_common_credentials_post(void);
+void popt_burn_cmdline_password(int argc, char *argv[]);
 
 #endif
diff --git a/source3/include/proto.h b/source3/include/proto.h
index fea4ba5..685d481 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -888,10 +888,10 @@ uint32_t get_int_param( const char* param );
 char* get_string_param( const char* param );
 
 /* The following definitions come from lib/server_contexts.c  */
-struct tevent_context *server_event_context(void);
-void server_event_context_free(void);
-struct messaging_context *server_messaging_context(void);
-void server_messaging_context_free(void);
+struct tevent_context *global_event_context(void);
+void global_event_context_free(void);
+struct messaging_context *global_messaging_context(void);
+void global_messaging_context_free(void);
 
 /* The following definitions come from lib/sessionid_tdb.c  */
 struct sessionid;
diff --git a/source3/lib/cmdline_contexts.c b/source3/lib/cmdline_contexts.c
new file mode 100644
index 0000000..2bee7f3
--- /dev/null
+++ b/source3/lib/cmdline_contexts.c
@@ -0,0 +1,70 @@
+/*
+   Unix SMB/CIFS implementation.
+   cmdline context wrapper.
+
+   Copyright (C) Christof Schmitt <cs at samba.org> 2018
+
+   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/>.
+*/
+
+#include "cmdline_contexts.h"
+#include "includes.h"
+#include "messages.h"
+
+struct messaging_context *cmdline_messaging_context(const char *config_file)
+{
+	struct messaging_context *msg_ctx = NULL;
+
+	/*
+	 * Ensure that a config is loaded, in case the underlying
+	 * messaging_init needs to create directories or sockets.
+	 */
+	if (!lp_loaded()) {
+		if (!lp_load_initial_only(config_file)) {
+			return NULL;
+		}
+	}
+
+	/*
+	 * Clustered Samba can only work as root due to required
+	 * access to the registry and ctdb, which in turn requires
+	 * messaging access as root.
+	 */
+	if (lp_clustering() && geteuid() != 0) {
+		fprintf(stderr, "Cluster mode requires running as root.\n");
+		exit(1);
+	}
+
+	msg_ctx = global_messaging_context();
+	if (msg_ctx == NULL) {
+		if (geteuid() == 0) {
+			fprintf(stderr,
+				"Unable to initialize messaging context!\n");
+			exit(1);
+		} else {
+			/*
+			 * Non-cluster, non-root: Log error, but leave
+			 * it up to the caller how to proceed.
+			 */
+			DBG_NOTICE("Unable to initialize messaging context.\n");
+		}
+	}
+
+	return msg_ctx;
+}
+
+void cmdline_messaging_context_free(void)
+{
+	global_messaging_context_free();
+}
diff --git a/lib/util/unix_match.h b/source3/lib/cmdline_contexts.h
similarity index 72%
copy from lib/util/unix_match.h
copy to source3/lib/cmdline_contexts.h
index a7b6935..21f81f0 100644
--- a/lib/util/unix_match.h
+++ b/source3/lib/cmdline_contexts.h
@@ -1,7 +1,8 @@
 /*
    Unix SMB/CIFS implementation.
-   Utility functions for Samba
-   Copyright (C) Jeremy Allison 2001
+   cmdline context wrapper.
+
+   Copyright (C) Christof Schmitt <cs at samba.org> 2018
 
    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
@@ -17,9 +18,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef _UNIX_MASK_H_
-#define _UNIX_MASK_H_
+#ifndef _LIB_CMDLINE_CONTEXTS_H
+#define _LIB_CMDLINE_CONTEXTS_H
 
-bool unix_wild_match(const char *pattern, const char *string);
+struct messaging_context *cmdline_messaging_context(const char *config_file);
+void cmdline_messaging_context_free(void);
 
 #endif
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index e144d98..33bf969 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -146,7 +146,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 				errno = EIO;
 				return NULL;
 			}
-			msg_ctx = server_messaging_context();
+			msg_ctx = global_messaging_context();
 
 			result = db_open_ctdb(mem_ctx, msg_ctx, base,
 					      hash_size,
diff --git a/source3/lib/server_contexts.c b/source3/lib/global_contexts.c
similarity index 61%
rename from source3/lib/server_contexts.c
rename to source3/lib/global_contexts.c
index 50072e6..03ab8e4 100644
--- a/source3/lib/server_contexts.c
+++ b/source3/lib/global_contexts.c
@@ -1,6 +1,6 @@
 /*
    Unix SMB/CIFS implementation.
-   Common server globals
+   Global contexts
 
    Copyright (C) Simo Sorce <idra at samba.org> 2010
 
@@ -21,46 +21,46 @@
 #include "includes.h"
 #include "messages.h"
 
-struct tevent_context *server_event_ctx = NULL;
+static struct tevent_context *global_event_ctx = NULL;
 
-struct tevent_context *server_event_context(void)
+struct tevent_context *global_event_context(void)
 {
-	if (!server_event_ctx) {
+	if (!global_event_ctx) {
 		/*
 		 * Note we MUST use the NULL context here, not the
 		 * autofree context, to avoid side effects in forked
 		 * children exiting.
 		 */
-		server_event_ctx = samba_tevent_context_init(NULL);
+		global_event_ctx = samba_tevent_context_init(NULL);
 	}
-	if (!server_event_ctx) {
-		smb_panic("Could not init server's event context");
+	if (!global_event_ctx) {
+		smb_panic("Could not init global event context");
 	}
-	return server_event_ctx;
+	return global_event_ctx;
 }
 
-void server_event_context_free(void)
+void global_event_context_free(void)
 {
-	TALLOC_FREE(server_event_ctx);
+	TALLOC_FREE(global_event_ctx);
 }
 
-struct messaging_context *server_msg_ctx = NULL;
+static struct messaging_context *global_msg_ctx = NULL;
 
-struct messaging_context *server_messaging_context(void)
+struct messaging_context *global_messaging_context(void)
 {
-	if (server_msg_ctx == NULL) {
+	if (global_msg_ctx == NULL) {
 		/*
 		 * Note we MUST use the NULL context here, not the
 		 * autofree context, to avoid side effects in forked
 		 * children exiting.
 		 */
-		server_msg_ctx = messaging_init(NULL,
-					        server_event_context());
+		global_msg_ctx = messaging_init(NULL,
+					        global_event_context());
 	}
-	return server_msg_ctx;
+	return global_msg_ctx;
 }
 
-void server_messaging_context_free(void)
+void global_messaging_context_free(void)
 {
-	TALLOC_FREE(server_msg_ctx);
+	TALLOC_FREE(global_msg_ctx);
 }
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index cf6c1ce..aa89914 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -635,15 +635,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
 	return ctx;
 }
 
-NTSTATUS messaging_init_client(TALLOC_CTX *mem_ctx,
-			       struct tevent_context *ev,
-			       struct messaging_context **pmsg_ctx)
-{
-	return messaging_init_internal(mem_ctx,
-					ev,
-					pmsg_ctx);
-}
-
 struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
 {
 	return msg_ctx->id;
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index cc93a75..11db080 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -93,6 +93,10 @@ static void popt_common_callback(poptContext con,
 			}
 		}
 
+		if (override_logfile) {
+			setup_logging(lp_logfile(talloc_tos()), DEBUG_FILE );
+		}
+
 		/* Further 'every Samba program must do this' hooks here. */
 		return;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list