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

Karolin Seeger kseeger at samba.org
Tue Jul 25 00:21:04 UTC 2017


The branch, v4-7-test has been updated
       via  54088c0 s3: drop build_env
       via  1335e7a s3: smbd: Fix a read after free if a chained SMB1 call goes async.
       via  8d7bf8c s3: libsmb: Fix use-after-free when accessing pointer *p.
       via  60949fc smbd: Fix a connection run-down race condition
       via  0b24182 s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
       via  7933732 Build py3 versions of other rpc modules
       via  18d0708 py3: Make sure to specify METH_VARARGS together with METH_KEYWORDS
       via  2a16228 s3: smbclient: Add a test for the setmode command.
       via  d426120 s3: libsmb: Reverse sense of 'clear all attributes', ignore attribute change in SMB2 to match SMB1.
       via  b51aa15 ctdb-common: Set close-on-exec when creating PID file
       via  0f40c21 vfs_fruit: don't use MS NFS ACEs with Windows clients
       via  961266e dbwrap_ctdb: Fix calculation of persistent flag
       via  7439394 dbwrap: Ask CTDB for local tdb open flags
       via  a577510 ctdbd_conn: pass persistent bool instead of tdb_flags
       via  d12832f ctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb
       via  fcb08f7 dbwrap: CTDB ignores tdb_flags passed to db attach controls
       via  5afede8 dbwrap: enable mutexes by default for volatile TDBs
       via  28f8439 ctdb: enable mutexes for volatile TDBs by default
       via  683b107 s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK
       via  e44257a s3/vfs: remove SMB_VFS_STRICT_UNLOCK
       via  8559b2e s3:client: The smbspool krb5 wrapper needs negotiate for authentication
       via  f6b1a53 vfs_fruit: add fruit:model = <modelname> parametric option
       via  3cb73b1 idmap_ad: Retry query_user exactly once if we get TLDAP_SERVER_DOWN
      from  892c3aa tevent: version 0.9.33

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


- Log -----------------------------------------------------------------
commit 54088c005fe8dedcfb6dab01c774aa03d88251ce
Author: Bernhard M. Wiedemann <bwiedemann at suse.de>
Date:   Mon Jul 10 18:29:41 2017 +0200

    s3: drop build_env
    
    As a follow up to eedebe2ef1b ("docs-xml: Sort input file list"), this
    change enables reproducible builds, without the added complexity of
    https://lists.samba.org/archive/samba-technical/2017-June/121302.html
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12906
    
    Signed-off-by: Bernhard M. Wiedemann <bwiedemann at suse.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): David Disseldorp <ddiss at samba.org>
    Autobuild-Date(master): Fri Jul 14 18:48:08 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 85b10a636e0eeeca0948c6b1d59d2df7b4507d45)
    
    Autobuild-User(v4-7-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-7-test): Tue Jul 25 02:20:38 CEST 2017 on sn-devel-144

commit 1335e7a944d4e6a4c83481163d3700a550fb10c2
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Jul 13 12:06:58 2017 -0700

    s3: smbd: Fix a read after free if a chained SMB1 call goes async.
    
    Reported to the Samba Team by Yihan Lian <lianyihan at 360.cn>, a security
    researcher of Qihoo 360 GearTeam. Thanks a lot!
    
    smb1_parse_chain() incorrectly used talloc_tos() for the memory
    context of the chained smb1 requests. This gets freed between
    requests so if a chained request goes async, the saved request
    array also is freed, which causes a crash on resume.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12836
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 5fe76a5474823ed7602938a07c9c43226a7882a3)

commit 8d7bf8c5281d7cbfc34d3eb4747df20dfc74c276
Author: Thomas Jarosch <thomas.jarosch at intra2net.com>
Date:   Sat Jul 22 09:36:18 2017 -0700

    s3: libsmb: Fix use-after-free when accessing pointer *p.
    
    talloc_asprintf_append() might call realloc()
    and therefore move the memory address of "path".
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12927
    
    Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
    Reviewed-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): Sat Jul 22 22:45:05 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 890137cffedcaf88a9ff808c01335ee14fcfd8da)

commit 60949fc32362f96f413f8580adcce061f13a241a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jul 19 14:51:33 2017 +0200

    smbd: Fix a connection run-down race condition
    
    When we do a server exit with active aio jobs, we need to keep the
    aio state active for the helper thread. Right now I don't see another
    chance than to leak memory in this case. And, I don't really oversee
    how cancelling requests works in this case, but this does fix crashes
    seen at a customer site.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12925
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0181fcc4aaa730e3a88ff5d397145332f4013950)

commit 0b241826f56b256691c415c3c628a7f94bfc43a4
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Jul 14 16:38:36 2017 +0200

    s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12910
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7f4e7cfd1b0bd917395c631a1a8195fffd13bbad)

commit 7933732c07221743792d1ec7803e710d673e93c9
Author: Alexander Bokovoy <ab at samba.org>
Date:   Thu Jul 13 14:49:12 2017 +0300

    Build py3 versions of other rpc modules
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12905
    
    Signed-off-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Alexander Bokovoy <ab at samba.org>
    Autobuild-Date(master): Fri Jul 14 11:36:53 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 0ed918ef5276c459d46c9e77c9e9d84bc41d4b14)

commit 18d07082b6110fccc90d219cc9bd276008ab9488
Author: Alexander Bokovoy <ab at samba.org>
Date:   Thu Jul 13 15:37:47 2017 +0300

    py3: Make sure to specify METH_VARARGS together with METH_KEYWORDS
    
    A Python 3 bug https://bugs.python.org/issue15657 explains that one should
    always use METH_VARARGS|METH_KEYWORDS when defining a function rather
    than a lonely METH_KEYWORDS. We had only one definition like this in
    Samba and it was the one that affects FreeIPA when running in Python 3
    mode.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12905
    
    Signed-off-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 303a52d8d48e4f5754448a876fedc98d7829e2bb)

commit 2a16228d4bbbe3bad08c9541d5f4cdcd0ebb56be
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jul 18 11:15:28 2017 -0700

    s3: smbclient: Add a test for the setmode command.
    
    Tested over SMB1 and SMB2.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899
    
    Back ported from 5facd045efe88783ba078c14793d05439bcc5a4b in master.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit d426120796cd76c758e5adc858352c59872fa514
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jul 17 10:37:15 2017 -0700

    s3: libsmb: Reverse sense of 'clear all attributes', ignore attribute change in SMB2 to match SMB1.
    
    SMB1 uses attr == 0 to clear all attributes
    on a file (end up with FILE_ATTRIBUTE_NORMAL),
    and attr == FILE_ATTRIBUTE_NORMAL to mean ignore
    request attribute change.
    
    SMB2 uses exactly the reverse. Unfortunately as the
    cli_setatr() ABI is exposed inside libsmbclient,
    we must make the SMB2 cli_smb2_setatr() call
    export the same ABI as the SMB1 cli_setatr()
    which calls it. This means reversing the sense
    of the requested attr argument if it's zero
    or FILE_ATTRIBUTE_NORMAL.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
    (cherry picked from commit f1cc79a46d56bda99c392d491d88479cd6427a32)

commit b51aa15406e5da172be870facdfbdbd1402973a6
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 12 13:41:17 2017 +1000

    ctdb-common: Set close-on-exec when creating PID file
    
    Otherwise, for example, the file descriptor for the main PID file will
    leak all the way down to event scripts.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12898
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 3e85cbfd7541d8f30ce1f3244ebcc44332b394fe)

commit 0f40c214585a765955c5340db53e28802604dfcd
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Jul 12 09:33:59 2017 +0200

    vfs_fruit: don't use MS NFS ACEs with Windows clients
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12897
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Thu Jul 13 22:21:08 CEST 2017 on sn-devel-144
    
    (cherry picked from commit df0db9d8f893f9245c6289200303b94a6e2d48d0)

commit 961266e551ecb7342d23bdaa79ed520aa0eedf5f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 19 12:04:35 2017 +1000

    dbwrap_ctdb: Fix calculation of persistent flag
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit f7daa453045c787ddab6e04c1fdaa386c231371f)

commit 74393944095b361859265d26d1dc07b2cc808241
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 11 21:35:17 2017 +0200

    dbwrap: Ask CTDB for local tdb open flags
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Wed Jul 12 13:25:11 CEST 2017 on sn-devel-144
    
    (cherry picked from commit de9d21957706bd5d811db01b7b5d88a0bb17034b)

commit a577510d348ba9be9653a75363eeb2e400d1a425
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 11 20:41:43 2017 +0200

    ctdbd_conn: pass persistent bool instead of tdb_flags
    
    ctdbd_db_attach() only needs to know the ctdb database model, not the
    rest of the flags.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit b2b7e3b9710fa22716f931177265dcd8de74532b)

commit d12832f11a120b35a472f9268af2081c5699b44b
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Jul 11 20:36:35 2017 +0200

    ctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb
    
    No change in behaviour.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 0077296cee1cd54a5adb12fc706cbf99203a8213)

commit fcb08f7d828b9683668fe26784c563144bc82ee1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 11 00:38:59 2017 +1000

    dbwrap: CTDB ignores tdb_flags passed to db attach controls
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 6ae063a109ca88bf815fd1bf5e8865053bea41b9)

commit 5afede8d715b3b42329ac53c4887e3cd50de0922
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Jul 9 16:23:20 2017 +0200

    dbwrap: enable mutexes by default for volatile TDBs
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit a70be43246ab74f0a2bbe245ab31f24460b70547)

commit 28f84392dc63a5a8b715cef22ab7e58831f06fcc
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Jul 9 16:20:11 2017 +0200

    ctdb: enable mutexes for volatile TDBs by default
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 2bce9cb72f3ac7efc2f4f48b0cffa1876364ae8c)

commit 683b10782a82fecf5a0db4ebe46fc94dc6199204
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Jul 9 14:34:10 2017 +0200

    s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK
    
    As per MS-SMB2 and MS-FSA and our SMB_VFS_STRICT_LOCK implementation,
    we're merely testing for locks, not setting any.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jul 11 03:37:44 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 67466271c26ca10c6bce6a51f9dd97a22258f8a4)

commit e44257aa15c25dc2b5b02c739d5fb61a325856f2
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Jul 9 14:21:21 2017 +0200

    s3/vfs: remove SMB_VFS_STRICT_UNLOCK
    
    It's just a noop, so let's remove it. SMB_VFS_STRICT_LOCK doesn't set
    logs, it just checks for the presence of incompatible locks.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12887
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c9172c5a4505eb18cb4645e2436eabcc93ec67e1)

commit 8559b2e54663cc2f3a2f63c67d78e62af0f4c087
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jul 7 14:08:49 2017 +0200

    s3:client: The smbspool krb5 wrapper needs negotiate for authentication
    
    If you create a new printer it doesn't have AuthInfoRequired set and so
    cups calls the backend with:
    
      AUTH_INFO_REQUIRED=none
    
    In this case we need to return:
    
      ATTR: auth-info-required=negotiate
    
    and return an error that we require authentication.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12886
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    (cherry picked from commit 4cced4da4ca97f0c6db227e6b2c7e03c2e5c1f28)

commit f6b1a5329b3c4e14aafc8f7f85afbdc0e1f96eb3
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jun 28 18:10:28 2017 +0200

    vfs_fruit: add fruit:model = <modelname> parametric option
    
    fruit:model = iMac
    fruit:model = MacBook
    fruit:model = MacPro
    fruit:model = Xserve
    
    will all display a different icon inside Finder.
    
    Formerly, we used "Samba" which resulted in a "?" icon in Finder, with
    the new default "MacSamba" we appear with a computer box icon at least.
    
    Guenther
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12840
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Wed Jul 12 03:17:57 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 259e1706e3206b215e136ea9d5beef4c9e3fcdee)

commit 3cb73b183efad4ca8a4caca514a6b304a25c0a39
Author: Dustin L. Howett via samba-technical <samba-technical at lists.samba.org>
Date:   Fri Jun 30 16:10:01 2017 -0700

    idmap_ad: Retry query_user exactly once if we get TLDAP_SERVER_DOWN
    
    All other ldap-querying methods in idmap_ad make a single retry attempt if they get
    TLDAP_SERVER_DOWN. This patch brings idmap_ad_query_user in line with that design.
    
    This fixes the symptom described in 12720 at the cost of an additional reconnect per
    failed lookup.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12720
    
    Signed-off-by: Dustin L. Howett <dustin at howett.net>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    (cherry picked from commit fe7020b0d1b6fe1ca9add4815e20c2e2262cb6c9)

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

Summary of changes:
 buildtools/wafsamba/samba_patterns.py     |  14 --
 ctdb/common/pidfile.c                     |   8 +
 ctdb/common/tunable.c                     |   2 +-
 ctdb/config/ctdbd.conf                    |   2 +-
 ctdb/doc/ctdb-tunables.7.xml              |   2 +-
 ctdb/doc/ctdb.1.xml                       |   2 +-
 ctdb/tests/tool/ctdb.listvars.001.sh      |   2 +-
 docs-xml/manpages/vfs_fruit.8.xml         |   9 ++
 examples/VFS/skel_opaque.c                |  16 +-
 examples/VFS/skel_transparent.c           |  18 +--
 source3/client/smbspool_krb5_wrapper.c    |  29 ++--
 source3/include/ctdbd_conn.h              |   2 +-
 source3/include/vfs.h                     |  22 ++-
 source3/include/vfs_macros.h              |  13 +-
 source3/lib/ctdbd_conn.c                  |  20 +--
 source3/lib/dbwrap/dbwrap_ctdb.c          |  43 +++++-
 source3/lib/dbwrap/dbwrap_open.c          |   2 +-
 source3/libsmb/cli_smb2_fnum.c            |  23 +++
 source3/libsmb/libsmb_dir.c               |   6 +-
 source3/locking/locking.c                 |   6 +-
 source3/locking/proto.h                   |   6 +-
 source3/modules/vfs_btrfs.c               |   9 +-
 source3/modules/vfs_catia.c               |  28 +---
 source3/modules/vfs_default.c             |  80 +++++-----
 source3/modules/vfs_fruit.c               |  12 +-
 source3/modules/vfs_full_audit.c          |  30 +---
 source3/modules/vfs_glusterfs.c           |   3 +-
 source3/modules/vfs_time_audit.c          |  30 +---
 source3/script/build_env.sh               |  41 -----
 source3/script/tests/test_smbclient_s3.sh |  51 +++++++
 source3/smbd/aio.c                        |  28 +---
 source3/smbd/process.c                    |   2 +-
 source3/smbd/reply.c                      |  91 ++++-------
 source3/smbd/server.c                     |   8 +-
 source3/smbd/smb2_ioctl_filesys.c         |   5 +-
 source3/smbd/smb2_read.c                  |   8 +-
 source3/smbd/smb2_write.c                 |   4 +-
 source3/smbd/vfs.c                        |  18 +--
 source3/winbindd/idmap_ad.c               |  19 ++-
 source3/wscript_build                     |   8 -
 source4/libnet/py_net.c                   |   2 +-
 source4/librpc/wscript_build              | 242 +++++++++++++++---------------
 source4/torture/vfs/fruit.c               |   8 +-
 43 files changed, 456 insertions(+), 518 deletions(-)
 delete mode 100755 source3/script/build_env.sh


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 1baa601..e809f26 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -51,7 +51,6 @@ def write_build_options_header(fp):
     fp.write("*/\n")
     fp.write("\n")
     fp.write("#include \"includes.h\"\n")
-    fp.write("#include \"build_env.h\"\n")
     fp.write("#include \"dynconfig/dynconfig.h\"\n")
     fp.write("#include \"lib/cluster_support.h\"\n")
 
@@ -92,19 +91,6 @@ def write_build_options_header(fp):
     fp.write("              return;\n")
     fp.write("       }\n")
     fp.write("\n")
-    fp.write("#ifdef _BUILD_ENV_H\n")
-    fp.write("       /* Output information about the build environment */\n")
-    fp.write("       output(screen,\"Build environment:\\n\");\n")
-    fp.write("       output(screen,\"   Built by:    %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
-    fp.write("       output(screen,\"   Built on:    %s\\n\",BUILD_ENV_DATE);\n")
-    fp.write("\n")
-    fp.write("       output(screen,\"   Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
-    fp.write("       output(screen,\"   Build host:  %s\\n\",BUILD_ENV_UNAME);\n")
-    fp.write("       output(screen,\"   SRCDIR:      %s\\n\",BUILD_ENV_SRCDIR);\n")
-    fp.write("       output(screen,\"   BUILDDIR:    %s\\n\",BUILD_ENV_BUILDDIR);\n")
-    fp.write("\n")
-    fp.write("\n")
-    fp.write("#endif\n")
     fp.write("\n")
     fp.write("       /* Output various paths to files and directories */\n")
     fp.write("       output(screen,\"\\nPaths:\\n\");\n")
diff --git a/ctdb/common/pidfile.c b/ctdb/common/pidfile.c
index b3f29e3..51c0c25 100644
--- a/ctdb/common/pidfile.c
+++ b/ctdb/common/pidfile.c
@@ -22,6 +22,8 @@
 
 #include <talloc.h>
 
+#include "lib/util/blocking.h"
+
 #include "common/pidfile.h"
 
 struct pidfile_context {
@@ -61,6 +63,12 @@ int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile,
 		goto fail;
 	}
 
+	if (! set_close_on_exec(fd)) {
+		close(fd);
+		ret = EIO;
+		goto fail;
+	}
+
 	pid_ctx->fd = fd;
 
 	lck = (struct flock) {
diff --git a/ctdb/common/tunable.c b/ctdb/common/tunable.c
index ed7a52d..14f6828 100644
--- a/ctdb/common/tunable.c
+++ b/ctdb/common/tunable.c
@@ -145,7 +145,7 @@ static struct {
 		offsetof(struct ctdb_tunable_list, no_ip_host_on_all_disabled) },
 	{ "Samba3AvoidDeadlocks", 0, true,
 		offsetof(struct ctdb_tunable_list, samba3_hack) },
-	{ "TDBMutexEnabled", 0, false,
+	{ "TDBMutexEnabled", 1, false,
 		offsetof(struct ctdb_tunable_list, mutex_enabled) },
 	{ "LockProcessesPerDB", 200, false,
 		offsetof(struct ctdb_tunable_list, lock_processes_per_db) },
diff --git a/ctdb/config/ctdbd.conf b/ctdb/config/ctdbd.conf
index e75c65c..2d525c5 100644
--- a/ctdb/config/ctdbd.conf
+++ b/ctdb/config/ctdbd.conf
@@ -29,4 +29,4 @@
 # CTDB_DEBUGLEVEL=ERR
 
 # Set some CTDB tunable variables during CTDB startup?
-# CTDB_SET_TDBMutexEnabled=1
+# CTDB_SET_TDBMutexEnabled=0
diff --git a/ctdb/doc/ctdb-tunables.7.xml b/ctdb/doc/ctdb-tunables.7.xml
index d0bb450..7b059b7 100644
--- a/ctdb/doc/ctdb-tunables.7.xml
+++ b/ctdb/doc/ctdb-tunables.7.xml
@@ -658,7 +658,7 @@
 
     <refsect2>
       <title>TDBMutexEnabled</title>
-      <para>Default: 0</para>
+      <para>Default: 1</para>
       <para>
 	This parameter enables TDB_MUTEX_LOCKING feature on volatile
 	databases if the robust mutexes are supported. This optimizes the
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 1af1f50..3aceb73 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -843,7 +843,7 @@ DBRecordSizeWarn        = 10000000
 DBSizeWarn              = 100000000
 PullDBPreallocation     = 10485760
 NoIPHostOnAllDisabled   = 0
-TDBMutexEnabled         = 0
+TDBMutexEnabled         = 1
 LockProcessesPerDB      = 200
 RecBufferSizeLimit      = 1000000
 QueueBufferSize         = 1024
diff --git a/ctdb/tests/tool/ctdb.listvars.001.sh b/ctdb/tests/tool/ctdb.listvars.001.sh
index f6010a4..fc8f42c 100755
--- a/ctdb/tests/tool/ctdb.listvars.001.sh
+++ b/ctdb/tests/tool/ctdb.listvars.001.sh
@@ -59,7 +59,7 @@ DBRecordSizeWarn           = 10000000
 DBSizeWarn                 = 100000000
 PullDBPreallocation        = 10485760
 NoIPHostOnAllDisabled      = 0
-TDBMutexEnabled            = 0
+TDBMutexEnabled            = 1
 LockProcessesPerDB         = 200
 RecBufferSizeLimit         = 1000000
 QueueBufferSize            = 1024
diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index 0bddd4a..1637a77 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -160,6 +160,15 @@
 	    </listitem>
 	  </varlistentry>
 
+	  <varlistentry>
+	    <term>fruit:model = MacSamba</term>
+	    <listitem>
+	      <para>This option defines the model string inside the AAPL
+	      extension and will determine the appearance of the icon representing the
+	      Samba server in the Finder window.</para>
+	      <para>The default is <emphasis>MacSamba</emphasis>.</para>
+	    </listitem>
+	  </varlistentry>
 	</variablelist>
 </refsect1>
 
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index fed9d2f..614dcff 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -687,21 +687,14 @@ static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
 	return false;
 }
 
-static bool skel_strict_lock(struct vfs_handle_struct *handle,
-			     struct files_struct *fsp,
-			     struct lock_struct *plock)
+static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
+				   struct files_struct *fsp,
+				   struct lock_struct *plock)
 {
 	errno = ENOSYS;
 	return false;
 }
 
-static void skel_strict_unlock(struct vfs_handle_struct *handle,
-			       struct files_struct *fsp,
-			       struct lock_struct *plock)
-{
-	;
-}
-
 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
 				    const char *mapped_name,
 				    enum vfs_translate_direction direction,
@@ -1022,8 +1015,7 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.brl_lock_windows_fn = skel_brl_lock_windows,
 	.brl_unlock_windows_fn = skel_brl_unlock_windows,
 	.brl_cancel_windows_fn = skel_brl_cancel_windows,
-	.strict_lock_fn = skel_strict_lock,
-	.strict_unlock_fn = skel_strict_unlock,
+	.strict_lock_check_fn = skel_strict_lock_check,
 	.translate_name_fn = skel_translate_name,
 	.fsctl_fn = skel_fsctl,
 	.readdir_attr_fn = skel_readdir_attr,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index d9123e0..2f59a3d 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -856,18 +856,11 @@ static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
 	return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock);
 }
 
-static bool skel_strict_lock(struct vfs_handle_struct *handle,
-			     struct files_struct *fsp,
-			     struct lock_struct *plock)
+static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
+				   struct files_struct *fsp,
+				   struct lock_struct *plock)
 {
-	return SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
-}
-
-static void skel_strict_unlock(struct vfs_handle_struct *handle,
-			       struct files_struct *fsp,
-			       struct lock_struct *plock)
-{
-	SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock);
+	return SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
 }
 
 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
@@ -1195,8 +1188,7 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.brl_lock_windows_fn = skel_brl_lock_windows,
 	.brl_unlock_windows_fn = skel_brl_unlock_windows,
 	.brl_cancel_windows_fn = skel_brl_cancel_windows,
-	.strict_lock_fn = skel_strict_lock,
-	.strict_unlock_fn = skel_strict_unlock,
+	.strict_lock_check_fn = skel_strict_lock_check,
 	.translate_name_fn = skel_translate_name,
 	.fsctl_fn = skel_fsctl,
 	.readdir_attr_fn = skel_readdir_attr,
diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c
index bf97d82..a72006a 100644
--- a/source3/client/smbspool_krb5_wrapper.c
+++ b/source3/client/smbspool_krb5_wrapper.c
@@ -95,17 +95,26 @@ int main(int argc, char *argv[])
 
         /* If not set, then just call smbspool. */
 	if (env == NULL) {
-		CUPS_SMB_ERROR("AUTH_INFO_REQUIRED is not set");
-                goto smbspool;
+		CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED is not set - "
+			       "execute smbspool");
+		goto smbspool;
 	} else {
-                CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
-                cmp = strcmp(env, "negotiate");
-                /* If AUTH_INFO_REQUIRED != "negotiate" then call smbspool. */
-                if (cmp != 0) {
-                          CUPS_SMB_ERROR(
-                            "AUTH_INFO_REQUIRED is not set to negotiate");
-                          goto smbspool;
-                }
+		CUPS_SMB_DEBUG("AUTH_INFO_REQUIRED=%s", env);
+
+		cmp = strcmp(env, "username,password");
+		if (cmp == 0) {
+			CUPS_SMB_DEBUG("Authenticate using username/password - "
+				       "execute smbspool");
+			goto smbspool;
+		}
+
+		/* if AUTH_INFO_REQUIRED=none */
+		cmp = strcmp(env, "negotiate");
+		if (cmp != 0) {
+			CUPS_SMB_ERROR("Authentication unsupported");
+			fprintf(stderr, "ATTR: auth-info-required=negotiate\n");
+			return CUPS_BACKEND_AUTH_REQUIRED;
+		}
 	}
 
 	uid = getuid();
diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h
index 06fbcc3..38477d3 100644
--- a/source3/include/ctdbd_conn.h
+++ b/source3/include/ctdbd_conn.h
@@ -55,7 +55,7 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn,
 		   TALLOC_CTX *mem_ctx, uint32_t db_id);
 
 int ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
-		    uint32_t *db_id, int tdb_flags);
+		    uint32_t *db_id, bool persistent);
 
 int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key);
 
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 7b9a6f8..d71d7cc 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -241,6 +241,9 @@
 /* Version 37 - Add SMB_VFS_OFFLOAD_READ_SEND/RECV */
 /* Version 37 - Rename SMB_VFS_COPY_CHUNK_SEND/RECV to
                 SMB_VFS_OFFLOAD_READ_SEND/RECV */
+/* Version 37 - Remove SMB_VFS_STRICT_UNLOCK */
+/* Version 37 - Rename SMB_VFS_STRICT_LOCK to
+                SMB_VFS_STRICT_LOCK_CHECK */
 
 #define SMB_VFS_INTERFACE_VERSION 37
 
@@ -848,13 +851,9 @@ struct vfs_fn_pointers {
 				      struct byte_range_lock *br_lck,
 				      struct lock_struct *plock);
 
-	bool (*strict_lock_fn)(struct vfs_handle_struct *handle,
-			       struct files_struct *fsp,
-			       struct lock_struct *plock);
-
-	void (*strict_unlock_fn)(struct vfs_handle_struct *handle,
-				 struct files_struct *fsp,
-				 struct lock_struct *plock);
+	bool (*strict_lock_check_fn)(struct vfs_handle_struct *handle,
+				     struct files_struct *fsp,
+				     struct lock_struct *plock);
 
 	NTSTATUS (*translate_name_fn)(struct vfs_handle_struct *handle,
 				      const char *name,
@@ -1315,12 +1314,9 @@ bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
 bool smb_vfs_call_brl_cancel_windows(struct vfs_handle_struct *handle,
 				     struct byte_range_lock *br_lck,
 				     struct lock_struct *plock);
-bool smb_vfs_call_strict_lock(struct vfs_handle_struct *handle,
-			      struct files_struct *fsp,
-			      struct lock_struct *plock);
-void smb_vfs_call_strict_unlock(struct vfs_handle_struct *handle,
-				struct files_struct *fsp,
-				struct lock_struct *plock);
+bool smb_vfs_call_strict_lock_check(struct vfs_handle_struct *handle,
+				    struct files_struct *fsp,
+				    struct lock_struct *plock);
 NTSTATUS smb_vfs_call_translate_name(struct vfs_handle_struct *handle,
 				     const char *name,
 				     enum vfs_translate_direction direction,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 69fa85b..3cce192 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -376,15 +376,10 @@
 #define SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock) \
 	smb_vfs_call_brl_cancel_windows((handle)->next, (br_lck), (plock))
 
-#define SMB_VFS_STRICT_LOCK(conn, fsp, plock) \
-	smb_vfs_call_strict_lock((conn)->vfs_handles, (fsp), (plock))
-#define SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock) \
-	smb_vfs_call_strict_lock((handle)->next, (fsp), (plock))
-
-#define SMB_VFS_STRICT_UNLOCK(conn, fsp, plock) \
-	smb_vfs_call_strict_unlock((conn)->vfs_handles, (fsp), (plock))
-#define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \
-	smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock))
+#define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
+	smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
+#define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
+	smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
 
 #define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
 	smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 3adb57d..b81feca 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -819,12 +819,11 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn,
  * attach to a ctdb database
  */
 int ctdbd_db_attach(struct ctdbd_connection *conn,
-		    const char *name, uint32_t *db_id, int tdb_flags)
+		    const char *name, uint32_t *db_id, bool persistent)
 {
 	int ret;
 	TDB_DATA data;
 	int32_t cstatus;
-	bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST) == 0;
 
 	data = string_term_tdb_data(name);
 
@@ -832,7 +831,7 @@ int ctdbd_db_attach(struct ctdbd_connection *conn,
 				  persistent
 				  ? CTDB_CONTROL_DB_ATTACH_PERSISTENT
 				  : CTDB_CONTROL_DB_ATTACH,
-				  tdb_flags, 0, data, NULL, &data, &cstatus);
+				  0, 0, data, NULL, &data, &cstatus);
 	if (ret != 0) {
 		DEBUG(0, (__location__ " ctdb_control for db_attach "
 			  "failed: %s\n", strerror(ret)));
@@ -847,21 +846,6 @@ int ctdbd_db_attach(struct ctdbd_connection *conn,
 	*db_id = *(uint32_t *)data.dptr;
 	talloc_free(data.dptr);
 
-	if (!(tdb_flags & TDB_SEQNUM)) {
-		return 0;
-	}
-
-	data.dptr = (uint8_t *)db_id;
-	data.dsize = sizeof(*db_id);
-
-	ret = ctdbd_control_local(conn, CTDB_CONTROL_ENABLE_SEQNUM, 0, 0, data,
-				  NULL, NULL, &cstatus);
-	if ((ret != 0) || cstatus != 0) {
-		DEBUG(0, (__location__ " ctdb_control for enable seqnum "
-			  "failed: %s\n", strerror(ret)));
-		return (ret == 0) ? EIO : ret;
-	}
-
 	return 0;
 }
 
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 8e303e6..a5ac2b2 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1779,6 +1779,8 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 	struct db_ctdb_ctx *db_ctdb;
 	char *db_path;
 	struct loadparm_context *lp_ctx;
+	TDB_DATA data;
+	bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST) == 0;
 	int32_t cstatus;
 	int ret;
 
@@ -1810,7 +1812,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 	db_ctdb->db = result;
 	db_ctdb->conn = conn;
 
-	ret = ctdbd_db_attach(db_ctdb->conn, name, &db_ctdb->db_id, tdb_flags);
+	ret = ctdbd_db_attach(db_ctdb->conn, name, &db_ctdb->db_id, persistent);
 	if (ret != 0) {
 		DEBUG(0, ("ctdbd_db_attach failed for %s: %s\n", name,
 			  strerror(ret)));
@@ -1818,14 +1820,45 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
+	if (tdb_flags & TDB_SEQNUM) {
+		data.dptr = (uint8_t *)&db_ctdb->db_id;
+		data.dsize = sizeof(db_ctdb->db_id);
+
+		ret = ctdbd_control_local(conn, CTDB_CONTROL_ENABLE_SEQNUM,
+					  0, 0, data,
+					  NULL, NULL, &cstatus);
+		if ((ret != 0) || cstatus != 0) {
+			DBG_ERR("ctdb_control for enable seqnum "
+				"failed: %s\n", strerror(ret));
+			TALLOC_FREE(result);
+			return NULL;
+		}
+	}
+
 	db_path = ctdbd_dbpath(db_ctdb->conn, db_ctdb, db_ctdb->db_id);
 
-	result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
+	result->persistent = persistent;
 	result->lock_order = lock_order;
 
-	/* only pass through specific flags */
-	tdb_flags &= TDB_SEQNUM|TDB_VOLATILE|
-		TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST;
+	data.dptr = (uint8_t *)&db_ctdb->db_id;
+	data.dsize = sizeof(db_ctdb->db_id);
+
+	ret = ctdbd_control_local(conn, CTDB_CONTROL_DB_OPEN_FLAGS,
+				  0, 0, data, NULL, &data, &cstatus);
+	if (ret != 0) {
+		DBG_ERR(" ctdb control for db_open_flags "
+			 "failed: %s\n", strerror(ret));
+		TALLOC_FREE(result);
+		return NULL;
+	}
+
+	if (cstatus != 0 || data.dsize != sizeof(int)) {
+		DBG_ERR("ctdb_control for db_open_flags failed\n");
+		TALLOC_FREE(result);
+		return NULL;
+	}
+
+	tdb_flags = *(int *)data.dptr;
 
 	if (!result->persistent) {
 		ret = ctdb_async_ctx_init(NULL, messaging_tevent_context(msg_ctx));
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 55e0adb..801ebcb 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -98,7 +98,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 
 	if (tdb_flags & TDB_CLEAR_IF_FIRST) {
 		const char *base;
-		bool try_mutex = false;
+		bool try_mutex = true;
 		bool require_mutex = false;
 
 		base = strrchr_m(name, '/');
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 954f3fe..6967555 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1698,6 +1698,29 @@ NTSTATUS cli_smb2_setatr(struct cli_state *cli,
 	inbuf.length = sizeof(inbuf_store);
 	data_blob_clear(&inbuf);
 
+	/*
+	 * SMB1 uses attr == 0 to clear all attributes
+	 * on a file (end up with FILE_ATTRIBUTE_NORMAL),
+	 * and attr == FILE_ATTRIBUTE_NORMAL to mean ignore
+	 * request attribute change.
+	 *
+	 * SMB2 uses exactly the reverse. Unfortunately as the
+	 * cli_setatr() ABI is exposed inside libsmbclient,
+	 * we must make the SMB2 cli_smb2_setatr() call
+	 * export the same ABI as the SMB1 cli_setatr()
+	 * which calls it. This means reversing the sense
+	 * of the requested attr argument if it's zero
+	 * or FILE_ATTRIBUTE_NORMAL.
+	 *
+	 * See BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899
+	 */
+


-- 
Samba Shared Repository



More information about the samba-cvs mailing list