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

Karolin Seeger kseeger at samba.org
Thu Apr 20 14:22:03 UTC 2017


The branch, v4-6-test has been updated
       via  12c24f3 s3:smbd: Fix incorrect use of sys_getgroups()
       via  ee420c1 s3:lib: Fix incorrect logic in sys_broken_getgroups()
       via  72d1724 lib: debug: Avoid negative array access.
       via  71abf1a vfs_acl_xattr: avoid needlessly supplying a large buffer to getxattr()
       via  ec39296 vfs_acl_xattr: factor out fetching of an extended attribute
       via  fb375e3 vfs_xattr_tdb: handle case of zero size.
       via  70a2e2e selftest: test fetching a large ACL from vfs_acl_xattr
       via  7a806d7 ctdb-docs: Fix documentation of -n option to ctdb tool
       via  c9a5199 rpcclient: allow -U'OTHERDOMAIN\user' again
       via  8719babb winbindd: trigger possible passdb_dsdb initialisation
       via  d0d8663 winbindd: error handling in rpc_lookup_sids()
       via  a323631 s3/rpc_client: lookupsids error handling of NT_STATUS_NONE_MAPPED
       via  9afba47 s3/rpc_client: use NT_STATUS_LOOKUP_ERR
       via  6526a27 s3/include: add NT_STATUS_LOOKUP_ERR
       via  b6ea6f7 selftest: fix for wbinfo -s tests for wellknown SIDs
       via  5083579 winbindd: explicit check for well-known SIDs in wb_lookupsids_bulk()
       via  1a6802e selftest: wbinfo --sids-to-unix-ids tests for wellknown SIDs
       via  1d66d33 selftest: wbinfo -s tests for wellknown SIDs
       via  fd6ec35 winbindd: use passdb backend for well-known SIDs
       via  50583a6 selftest: tests idmap mapping with idmap_rid
       via  d0643c5 selftest: new environment "ad_member_idmap_rid"
       via  ff5865a winbindd: remove unused single_domains array
       via  b86a793 winbindd: use correct domain name for failed lookupsids
       via  4c5f50c autobuild: Stop waf uninstall from removing test_tmpdir
       via  dce116d script/autobuild.py: ignore missing test_tmpdir
       via  da065cd script/autobuild.py: try to make TMPDIR handling more verbose
       via  286a9fd script/autobuild.py: add a do_print() wrapper function that flushes after each message
       via  5d964e1 script/autobuild.py: export PYTHONUNBUFFERED=1
       via  a727300 script/autobuild.py: cleanup the task subdirs when they're done.
       via  3cd5d41 s4/torture: vfs_fruit: test for bug 12565
       via  fe3fe4f vfs_fruit: resource fork open request with flags=O_CREAT|O_RDONLY
       via  981e667 wafsamba: move -L/some/path from LINKFLAGS_PYEMBED to LIBPATH_PYEMBED
       via  122e46f selftest: Test for bug 12558
       via  ef48aa4 smbd: Fix smb1 findfirst with DFS
       via  6f05903 winbindd: Fix password policy for pam authentication
       via  f37537b ctdb-tools: Avoid deferencing argv[0] if argc == 0
       via  208dc58 selftest: Define template homedir for 'ad_member' env
       via  2cad042 s3:tests: Add a subsitution test for %D %u %g
       via  bc93a47 s3:winbind: Use the correct talloc context for user information
      from  925aa47 VERSION: Bump version up to 4.6.3.

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


- Log -----------------------------------------------------------------
commit 12c24f3e338599529f880ff4de176e07a8019aee
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 17 14:30:54 2017 -0700

    s3:smbd: Fix incorrect use of sys_getgroups()
    
    Second arg must be NULL when first arg is 0 (it is in all other places).
    
    Bug report and patch from Hanno Böck <hanno at hboeck.de>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12747
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Tue Apr 18 15:43:02 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 76b351e907f67cc7d4af4e7d800c7a3aa1269ee8)
    
    Autobuild-User(v4-6-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-6-test): Thu Apr 20 16:21:13 CEST 2017 on sn-devel-144

commit ee420c1bc61a1b4fd25b7c2d93e59ede10261926
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 17 14:30:04 2017 -0700

    s3:lib: Fix incorrect logic in sys_broken_getgroups()
    
    If setlen == 0 then the second argument must be ignored.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12747
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 60af864f751706c48b8af448700bf06e33e45946)

commit 72d172434df7655620d1bee41b39ba316229cf1f
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 17 14:09:24 2017 -0700

    lib: debug: Avoid negative array access.
    
    Report and patch from Hanno Böck <hanno at hboeck.de>.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12746
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 600f8787e3b605c9f3e8f724c726e63157ee9efc)

commit 71abf1a78f55b9dc5586d43eb0af389116ee36ee
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Apr 13 12:44:58 2017 +0300

    vfs_acl_xattr: avoid needlessly supplying a large buffer to getxattr()
    
    When obtaining the security descriptor via getxattr(), first try
    optimistically to supply a buffer of 4K, and if that turns out
    to be too small, determine the correct buffer size.
    
    The previous behavior of falling back to a 64K buffer encountered
    problem with Linux prior to version 3.6, due to pyisical memory
    fragmentation. With those kernels, as long as the buffer is 8K or
    smaller, getting the xattr is much less prone to failure due to
    memory fragmentation.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12737
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Apr 18 04:41:16 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 05d83ccf7a6fecf963fcb980acd50cebfc0c3ea9)

commit ec3929696cf3e35236cc7aaae1cb01068c26a4ad
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Apr 9 00:40:44 2017 +0300

    vfs_acl_xattr: factor out fetching of an extended attribute
    
    Pure refactoring - add a function that fetches an extended attribute
    based on either the file descriptor or the file name.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12737
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7b775abd9278ae34110ec87d94a736be7f64884a)

commit fb375e38b98961af1cdad928f4d7b135b4ed4e9d
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Apr 13 12:50:47 2017 +0300

    vfs_xattr_tdb: handle case of zero size.
    
    With getxattr(), passing a zero buffer size is a
    way of obtaining actual xattr size.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12737
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4dfa2d6a0972847e3b21ddf05077e50ed72c4ea8)

commit 70a2e2ed94f4bdb5a430b8d35a12c9557d6dac88
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Apr 9 00:20:40 2017 +0300

    selftest: test fetching a large ACL from vfs_acl_xattr
    
    Add a test that fetches an ACL whose size is larger than 4K.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12737
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 5017dfeef24b8d568e0146c085f3f979d688acf2)

commit 7a806d7d1360aa7919c01a09d43b1ab83f3fcf9d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Apr 6 12:20:21 2017 +1000

    ctdb-docs: Fix documentation of -n option to ctdb tool
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12733
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    (cherry picked from commit 7f714a436250dfeaa1970f78090ef066482711f0)

commit c9a519992de26ae412da6d23d583a6d6e6e3abff
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Apr 3 00:19:40 2017 +0200

    rpcclient: allow -U'OTHERDOMAIN\user' again
    
    I guess the primary reason for forcing lp_workgroup()
    was the usage of -U% together with schannel,
    see source3/script/tests/test_rpcclient_samlogon.sh
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12731
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Apr  5 14:09:23 CEST 2017 on sn-devel-144
    
    (cherry picked from commit f1e3c8ebb31fcd9ef9e1809a42a648442dffc1ee)

commit 8719babb7e49b30e764ce9fa687c432e043451dd
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Mar 29 11:13:46 2017 +0200

    winbindd: trigger possible passdb_dsdb initialisation
    
    If the passdb backend is passdb_dsdb the domain SID comes from dsdb, not
    from secrets.tdb. As we use the domain SID in various places, we must
    ensure the domain SID is migrated from dsdb to secrets.tdb before
    get_global_sam_sid() is called the first time.
    
    The migration is done as part of the passdb_dsdb initialisation, calling
    pdb_get_domain_info() triggers it.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12729
    
    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): Sat Apr  1 21:18:59 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 8b32fc4006ae338ddee7c0e5991958ec3463da0d)

commit d0d8663eb2a00c83391d2433d445129ec7e9eb88
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Mar 26 08:22:13 2017 +0200

    winbindd: error handling in rpc_lookup_sids()
    
    NT_STATUS_NONE_MAPPED and NT_STATUS_SOME_NOT_MAPPED should not be
    treated as fatal error. We should continue processing the results and
    not bail out.
    
    In case we got NT_STATUS_NONE_MAPPED we must have to ensure all
    lsa_TranslatedName are of type SID_NAME_UNKNOWN.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12728
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8dfbba59d768b10f6b088cfc49e5dbe6de4834e1)

commit a3236314e1dae3e5429ffa8b812ad0a360305af9
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Apr 1 16:51:07 2017 +0200

    s3/rpc_client: lookupsids error handling of NT_STATUS_NONE_MAPPED
    
    NT_STATUS_NONE_MAPPED is not a fatal error, it just means we must return
    all lsa_TranslatedName's as type SID_NAME_UNKNOWN.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12728
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 416c74e8c89dc2fb2083beaaa9ac8a6e975ec873)

commit 9afba472af8bc31de8c921008ea82482b4cfb187
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Apr 1 16:56:39 2017 +0200

    s3/rpc_client: use NT_STATUS_LOOKUP_ERR
    
    No change in behaviour.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12728
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0e7e4ebad31caa1ccb392f2fe20c67929149b8c9)

commit 6526a279ae9eb9cc2a665b82a74804382ee56879
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Apr 1 16:44:45 2017 +0200

    s3/include: add NT_STATUS_LOOKUP_ERR
    
    Useful helper macro to check the return value of LSA and SAMR
    translations.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12728
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit fc37c7327dc7e4ad4405e324fc88d4bbf9b6ef9e)

commit b6ea6f764c044f248b19fce3b2ccfb71bc02075e
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Mar 31 16:06:18 2017 +0200

    selftest: fix for wbinfo -s tests for wellknown SIDs
    
    Rework while loop to not use a pipe as that uses a subshell for the loop
    which means assigning to the variable failed is not visible in the
    main script.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit d8fd56a8244a3010469c27eaa3b73a2c5fbbc41f)

commit 5083579048b8c5b810868550be2230a1f9519c05
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Apr 2 13:42:45 2017 +0200

    winbindd: explicit check for well-known SIDs in wb_lookupsids_bulk()
    
    Those are implicitly already catched by the
    
      if (sid->num_auths != 5)
    
    check, but I'd like to make the desired behaviour more obvious.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 167bb5ead8c7193d173fdba8a453279d422fa7ea)

commit 1a6802ed4ce8a247963f2b220dabd0cb4afa124e
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Mar 31 16:24:05 2017 +0200

    selftest: wbinfo --sids-to-unix-ids tests for wellknown SIDs
    
    This test passes even without the fix, as in sids2xids we use the
    lookupnames just to determine the mapping domain, using the default
    idmap domain as fallback if that fails.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8bd5f774fdc1f4ea012885262eb0f40640504de8)

commit 1d66d3369d597ab83ed79874f5733b2f67bfd925
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Mar 31 16:06:18 2017 +0200

    selftest: wbinfo -s tests for wellknown SIDs
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2150de3a73527850547263e853faf4f3fedca6e6)

commit fd6ec35b52101b384049f6786d5e746a2d0219b8
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Mar 30 23:41:59 2017 +0200

    winbindd: use passdb backend for well-known SIDs
    
    On a DC well-known SIDs like S-1-1-0 (everyone) *must* be handled by the
    local domain, otherwise something simple like this fails with
    WBC_ERR_DOMAIN_NOT_FOUND:
    
    $ make testenv SELFTEST_TESTENV=nt4_dc SCREEN=1
    
    localnt4dc2$ ./bin/wbinfo --sid-to-name S-1-1-0
    failed to call wbcLookupSid: WBC_ERR_DOMAIN_NOT_FOUND
    Could not lookup sid S-1-1-0
    
    On a member server asking our DC works and is what we're currently
    doing, but changing it to ask passdb avoids the overhead.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12727
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6b7a14b4b9c3411bd2e05383917e8fdedae51c90)

commit 50583a66a06fcd6a510e034bc206f1c6c39f4d7a
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Apr 5 13:27:51 2017 +0200

    selftest: tests idmap mapping with idmap_rid
    
    This adds two blackbox tests that run wbinfo --sids-to-unix-ids:
    
    o a non-existing SID from the primary domain should return a mapping
    
    o a SID with a bogus (and therefor unknown) domain must not return a mapping
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11961
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Fri Apr  7 00:05:02 CEST 2017 on sn-devel-144
    
    (cherry picked from commit b680ceebf85b2403758a0f9e931f1211e9b80e8d)

commit d0643c5e537798486f2707b20dd8aee27b74161c
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Apr 5 13:27:14 2017 +0200

    selftest: new environment "ad_member_idmap_rid"
    
    This uses idmap_rid for the primary domain.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11961
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit ef10b43469f5b31a696259a70b3e116a350bfd3d)

commit ff5865a927d29c9e6b7d98c16adc23b8e9dbfc80
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Apr 4 14:23:03 2017 +0200

    winbindd: remove unused single_domains array
    
    This was added as part of 9be918116e356c358ef77cc2933e471090088293, but
    is not needed anymore as the previous commit changed the logic.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11961
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 9671811da8ad3f91ba7bb0fa868f806bc5afe863)

commit b86a793c196b7e26ae0b3187824416132016d14f
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Apr 4 14:21:25 2017 +0200

    winbindd: use correct domain name for failed lookupsids
    
    What we want here is, for failed lookupsids, pass the domain name of the
    SID we were trying to lookup to the idmap backend.
    
    But as a domain member, using
    
      state->single_domains[state->single_sids_done]
    
    for this purpose will always be use our primary domain name (for S-1-5-21
    SIDs that are not in our local SAM).
    
    So for now use find_domain_from_sid_noinit() to find the domain from the
    domain list. This can be removed when we switch idmap backend
    determination to be based on domain SIDs, not names.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11961
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit a684df160e692710e011c4eb6795a66772025c23)

commit 4c5f50c0048712cfb81d4892f25036d83d63ecde
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Mar 20 14:49:34 2017 +1100

    autobuild: Stop waf uninstall from removing test_tmpdir
    
    Most of the autobuild tasks run "make distcheck", which does a
    recursive "waf configure make install uninstall".  "waf uninstall"
    (via BuildContext.install() in Build.py) removes empty directories all
    the way up the directory tree.  This means that it removes
    test_tmpdir, if it is empty, and any empty directories above it.
    
    While this is arguably a waf bug, the simplest solution is to make
    test_tmpdir non-empty so it don't get removed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12703
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Mar 21 10:37:08 CET 2017 on sn-devel-144
    
    (cherry picked from commit 05b5af4ae5fbc9b59c857468512858f73e5dea1b)

commit dce116dc814daa3ea93d95776993cf28a5ce478e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 21 17:05:08 2017 +0100

    script/autobuild.py: ignore missing test_tmpdir
    
    It is still unknown what removes it...
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit cad23629ac48253e508fd9bead2bb79bfa7ee3b8)

commit da065cd9420de431ff826f5b7b98ed812cfa2090
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 11 14:13:00 2017 +0100

    script/autobuild.py: try to make TMPDIR handling more verbose
    
    This hopefully gives some hints regarding flakey tests where
    the tmpdir is not available.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 278c921263550c1473df8944260bbb4e62a0e0e6)

commit 286a9fdd036a22d47c56f7723dfba148e198d936
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 11 15:02:17 2017 +0100

    script/autobuild.py: add a do_print() wrapper function that flushes after each message
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 96277a9f82379c7fedf36ca13644eb3493dcd1e2)

commit 5d964e16299fb3aa596fcc0108348fe802126d5d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 11 14:48:45 2017 +0100

    script/autobuild.py: export PYTHONUNBUFFERED=1
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 5a8d7a5446c23985a7dd3a9cb4856481b94931db)

commit a7273002e95dfc86d561156889fba4557540c3ad
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 11 14:42:08 2017 +0100

    script/autobuild.py: cleanup the task subdirs when they're done.
    
    This hopefully reduces the used space on the memdisk.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit f9e188747753225e77f254fe41aad95ff11fec53)

commit 3cd5d4133348a6802a984967d621f04b718d655a
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 7 15:13:15 2017 +0100

    s4/torture: vfs_fruit: test for bug 12565
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12565
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 893fc5abbe0a1b63ebd81f442a8d544572ed76a9)

commit fe3fe4fa906f4a1a61d85af9b0793ce075de983f
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 7 07:44:40 2017 +0100

    vfs_fruit: resource fork open request with flags=O_CREAT|O_RDONLY
    
    When receiving an SMB create request with read-only access mode and
    open_if disposition, we end of calling the open() function with
    flags=O_CREAT|O_RDONLY for the ._ AppleDouble file.
    
    If the file doesn't exist, ie there's currently no rsrc stream, we create
    it but then we fail to write the AppleDouble header into the file due to
    the O_RDONLY open mode, leaving a 0 byte size ._ file.
    
    Running this create requests against macOS SMB server yields an
    interesting result: it returns NT_STATUS_OBJECT_NAME_NOT_FOUND even
    though create dispotion is open_if. Another instance where the macOS SMB
    server just exposes FSA behaviour (ie HFS+) and we have to adapt to be
    compatible.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12565
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit a36de8b81aa88c31450e68ec54d6b659b1693878)

commit 981e667e48fe30c179f815da25608157c3518813
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Mar 28 15:28:21 2017 +0200

    wafsamba: move -L/some/path from LINKFLAGS_PYEMBED to LIBPATH_PYEMBED
    
    LINKFLAGS should not have path components.
    
    This fixes the build on systems like FreeBSD where python
    is located in /usr/local/lib.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12724
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Apr  4 16:10:18 CEST 2017 on sn-devel-144
    
    (similar to commit d1b88c6a6edeab4f85fc110eaa8d15e76c7e1f7b)

commit 122e46f9fb27727d328b83a7ac1d035408ae293d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 7 16:33:57 2017 +0200

    selftest: Test for bug 12558
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12558
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3667876ebebb7181d89834e6038e2d7218c98797)

commit ef48aa48679baf4038457c57d9828a80c8d76c41
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 6 22:12:36 2017 +0200

    smbd: Fix smb1 findfirst with DFS
    
    9377f3bce should have changed the callers of dfs_path_lookup. It now
    takes a uint32_t ucf_flags, not a boolean anymore.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12558
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit baa3e71f7968ec3239d80d7602839c2d7c2de74f)

commit 6f05903e25ec9bce1c459e3b98298f17d89d996b
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Mar 27 15:11:08 2017 -0700

    winbindd: Fix password policy for pam authentication
    
    Authenticating users from trusted domains would return the password
    policy of the joined domain. Fix the code so that the password policy of
    the joined domain is only returned for users from that domain.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12725
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Christof Schmitt <cs at samba.org>
    Autobuild-Date(master): Wed Mar 29 22:54:47 CEST 2017 on sn-devel-144
    
    (cherry picked from commit bc39fb07ced84af4d97853d00d07fb4293352686)

commit f37537b7dcbcf57b246f20c0485f343eaa500eba
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Mar 7 14:13:10 2017 +1100

    ctdb-tools: Avoid deferencing argv[0] if argc == 0
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12723
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Wed Mar 29 11:07:18 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 6e9879f6e2f8974730517fad22875db06f0738de)

commit 208dc586f1fa01c688b435b7c2ca581f1b088309
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Mar 17 10:04:19 2017 +0100

    selftest: Define template homedir for 'ad_member' env
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
    
    With this set, the samba3.local.nss test for ad_member will ensure that
    we correctly substitute those smb.conf options.
    
    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): Thu Mar 30 04:26:18 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 5f4979509950547e68af7f64ac263d0e0705ee03)

commit 2cad0420ea432cf82bf95da42eb1d6cb611f3d4b
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Mar 15 12:37:08 2017 +0100

    s3:tests: Add a subsitution test for %D %u %g
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2be02fdd1ed1d565e28f50d02ff5216391ac0660)

commit bc93a476e74cc9d739519c27bd018e3356255392
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 17 13:52:57 2017 +0100

    s3:winbind: Use the correct talloc context for user information
    
    This fixes the substitution for 'template homedir'.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Sat Mar 18 19:47:40 CET 2017 on sn-devel-144
    
    (cherry picked from commit ece5e67bbc027432aeb3d97205ef093a0acda8d5)

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

Summary of changes:
 buildtools/wafsamba/samba_python.py               |   6 ++
 ctdb/doc/ctdb.1.xml                               |   4 +-
 ctdb/tools/ctdb_event.c                           |  13 ++-
 lib/util/debug.c                                  |   2 +-
 nsswitch/tests/test_idmap_rid.sh                  |  66 +++++++++++++
 nsswitch/tests/test_wbinfo.sh                     |  42 +++++++--
 script/autobuild.py                               |  61 +++++++-----
 selftest/knownfail                                |   6 --
 selftest/target/Samba.pm                          |   1 +
 selftest/target/Samba3.pm                         | 108 +++++++++++++++++++++-
 selftest/target/Samba4.pm                         |   6 ++
 source3/include/lsa.h                             |   4 +
 source3/lib/system.c                              |  12 ++-
 source3/modules/vfs_acl_xattr.c                   |  84 ++++++++++++-----
 source3/modules/vfs_fruit.c                       |  14 +++
 source3/modules/vfs_xattr_tdb.c                   |  12 +++
 source3/rpc_client/cli_lsarpc.c                   |   8 +-
 source3/rpcclient/rpcclient.c                     |  21 ++---
 source3/script/tests/test_large_acl.sh            |  59 ++++++++++++
 source3/script/tests/test_smbclient_s3.sh         |  11 +++
 source3/script/tests/test_substitutions.sh        |   9 +-
 source3/script/tests/test_wbinfo_sids2xids_int.py |   2 +-
 source3/selftest/tests.py                         |   5 +-
 source3/smbd/msdfs.c                              |   4 +-
 source3/smbd/sec_ctx.c                            |   3 +-
 source3/winbindd/wb_lookupsids.c                  |  21 ++---
 source3/winbindd/wb_queryuser.c                   |   2 +-
 source3/winbindd/winbindd_pam.c                   |   7 +-
 source3/winbindd/winbindd_rpc.c                   |   9 +-
 source3/winbindd/winbindd_util.c                  |  27 ++++--
 source4/torture/vfs/fruit.c                       |  73 ++++++++++++++-
 31 files changed, 576 insertions(+), 126 deletions(-)
 create mode 100755 nsswitch/tests/test_idmap_rid.sh
 create mode 100755 source3/script/tests/test_large_acl.sh


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index 057a017..3a04881 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -76,6 +76,12 @@ def _check_python_headers(conf, mandatory):
     else:
         conf.env['PYTHON_SO_ABI_FLAG'] = ''
 
+    for lib in conf.env['LINKFLAGS_PYEMBED']:
+        if lib.startswith('-L'):
+            conf.env.append_unique('LIBPATH_PYEMBED', lib[2:]) # strip '-L'
+            conf.env['LINKFLAGS_PYEMBED'].remove(lib)
+
+    return
 
 def SAMBA_PYTHON(bld, name,
                  source='',
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index f24f8dd..99e535d 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -123,10 +123,10 @@
     <title>OPTIONS</title>
 
     <variablelist>
-      <varlistentry><term>-n <parameter>PNN-LIST</parameter></term>
+      <varlistentry><term>-n <parameter>PNN</parameter></term>
       <listitem>
 	<para>
-	  The nodes specified by PNN-LIST should be queried for the
+	  The node specified by PNN should be queried for the
 	  requested information.  Default is to query the daemon
 	  running on the local host.
 	</para>
diff --git a/ctdb/tools/ctdb_event.c b/ctdb/tools/ctdb_event.c
index 62b4b91..8e2dca7 100644
--- a/ctdb/tools/ctdb_event.c
+++ b/ctdb/tools/ctdb_event.c
@@ -223,23 +223,26 @@ static int command_status(TALLOC_CTX *mem_ctx, struct tool_context *tctx,
 	talloc_free(req);
 	if (! status) {
 		fprintf(stderr, "Failed to get event %s status, ret=%d\n",
-			argv[0], ret);
+			ctdb_event_to_string(event), ret);
 		return ret;
 	}
 
 	if (result != 0) {
 		fprintf(stderr, "Failed to get event %s status, result=%d\n",
-			argv[0], result);
+			ctdb_event_to_string(event), result);
 		return result;
 	}
 
 	if (script_list == NULL) {
 		if (state == CTDB_EVENT_LAST_RUN) {
-			printf("Event %s has never run\n", argv[0]);
+			printf("Event %s has never run\n",
+			       ctdb_event_to_string(event));
 		} else if (state == CTDB_EVENT_LAST_PASS) {
-			printf("Event %s has never passed\n", argv[0]);
+			printf("Event %s has never passed\n",
+				ctdb_event_to_string(event));
 		} else if (state == CTDB_EVENT_LAST_FAIL) {
-			printf("Event %s has never failed\n", argv[0]);
+			printf("Event %s has never failed\n",
+				ctdb_event_to_string(event));
 		}
 	} else {
 		for (i=0; i<script_list->num_scripts; i++) {
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 37582db..8f0c383 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -397,7 +397,7 @@ static void debug_backends_log(const char *msg, int msg_level)
 	 * a buffer without the newline character.
 	 */
 	len = MIN(strlen(msg), FORMAT_BUFR_SIZE - 1);
-	if (msg[len - 1] == '\n') {
+	if ((len > 0) && (msg[len - 1] == '\n')) {
 		len--;
 	}
 
diff --git a/nsswitch/tests/test_idmap_rid.sh b/nsswitch/tests/test_idmap_rid.sh
new file mode 100755
index 0000000..7fb5985
--- /dev/null
+++ b/nsswitch/tests/test_idmap_rid.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Test id mapping with various SIDs and idmap_rid
+#
+
+if [ $# -lt 1 ]; then
+	echo Usage: $0 DOMAIN RANGE_START
+	exit 1
+fi
+
+DOMAIN="$1"
+RANGE_START="$2"
+
+wbinfo="$VALGRIND $BINDIR/wbinfo"
+failed=0
+
+. `dirname $0`/../../testprogs/blackbox/subunit.sh
+
+DOMAIN_SID=$($wbinfo -n "@$DOMAIN" | cut -f 1 -d " ")
+if [ $? -ne 0 ] ; then
+    echo "Could not find domain SID" | subunit_fail_test "test_idmap_rid"
+    exit 1
+fi
+
+# Find an unused uid and SID
+RID=66666
+MAX_RID=77777
+while true ; do
+    id $RID
+    if [ $? -ne 0 ] ; then
+	SID="$DOMAIN_SID-$RID"
+	$wbinfo -s $SID
+	if [ $? -ne 0 ] ; then
+	    break
+	fi
+    fi
+    RID=$(expr $RID + 1)
+    if [ $RID -eq $MAX_RID ] ; then
+	echo "Could not find free SID" | subunit_fail_test "test_idmap_rid"
+	exit 1
+    fi
+done
+
+#
+# Test 1: Using non-existing SID to check backend returns a mapping
+#
+
+EXPECTED_ID=$(expr $RID + $RANGE_START)
+out="$($wbinfo --sids-to-unix-ids=$SID)"
+echo "wbinfo returned: \"$out\", expecting \"$SID -> uid/gid $EXPECTED_ID\""
+test "$out" = "$SID -> uid/gid $EXPECTED_ID"
+ret=$?
+testit "Unknown RID from primary domain returns a mapping" test $ret -eq 0 || failed=$(expr $failed + 1)
+
+#
+# Test 2: Using bogus SID with bad domain part to check idmap backend does not generate a mapping
+#
+
+SID=S-1-5-21-1111-2222-3333-666
+out="$($wbinfo --sids-to-unix-ids=$SID)"
+echo "wbinfo returned: \"$out\", expecting \"$SID -> unmapped\""
+test "$out" = "$SID -> unmapped"
+ret=$?
+testit "Bogus SID returns unmapped" test $ret -eq 0 || failed=$(expr $failed + 1)
+
+exit $failed
diff --git a/nsswitch/tests/test_wbinfo.sh b/nsswitch/tests/test_wbinfo.sh
index cfe582d..49296b6 100755
--- a/nsswitch/tests/test_wbinfo.sh
+++ b/nsswitch/tests/test_wbinfo.sh
@@ -88,6 +88,31 @@ else
 	echo "success: wbinfo -s check for sane mapping"
 fi
 
+while read SID ; do
+    read NAME
+
+    testit "wbinfo -s $SID against $TARGET" $wbinfo -s $SID || failed=`expr $failed + 1`
+
+    RESOLVED_NAME=`$wbinfo -s $SID | tr a-z A-Z`
+    echo "$SID resolved to $RESOLVED_NAME"
+
+    echo "test: wbinfo -s $SID against $TARGET"
+    if test x"$RESOLVED_NAME" != x"$NAME" ; then
+        echo "$RESOLVED_NAME does not match $NAME"
+	echo "failure: wbinfo -s $SID against $TARGET"
+	failed=`expr $failed + 1`
+    else
+        echo "success: wbinfo -s $SID against $TARGET"
+    fi
+done <<EOF
+S-1-1-0
+/EVERYONE 5
+S-1-3-1
+/CREATOR GROUP 5
+S-1-5-1
+NT AUTHORITY/DIALUP 5
+EOF
+
 testit "wbinfo -n on the returned name against $TARGET" $wbinfo -n $admin_name || failed=`expr $failed + 1`
 test_sid=`$wbinfo -n $tested_name | cut -d " " -f1`
 
@@ -205,13 +230,18 @@ subunit_start_test "$test_name"
 # The full name (GECOS) is based on name (the RDN, in this case CN)
 # and displayName in winbindd_ads, and is based only on displayName in
 # winbindd_msrpc and winbindd_rpc.  Allow both versions.
-expected_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
-expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+if test "$TARGET" = "ad_member"; then
+	expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/Domain Users/administrator:/bin/false"
+	expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/Domain Users/administrator:/bin/false"
+else
+	expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
+	expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+fi
 
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
 	subunit_pass_test "$test_name"
 else
-	echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+	echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
 	failed=`expr $failed + 1`
 fi
 
@@ -227,10 +257,10 @@ fi
 
 test_name="confirm output of wbinfo --uid-info against $TARGET"
 subunit_start_test "$test_name"
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
 	subunit_pass_test "$test_name"
 else
-	echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+	echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
 	failed=`expr $failed + 1`
 fi
 
diff --git a/script/autobuild.py b/script/autobuild.py
index 3d76130..e46869c 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -15,6 +15,8 @@ from email.mime.multipart import MIMEMultipart
 from distutils.sysconfig import get_python_lib
 import platform
 
+os.environ["PYTHONUNBUFFERED"] = "1"
+
 # This speeds up testing remarkably.
 os.environ['TDB_NO_FSYNC'] = '1'
 
@@ -243,11 +245,16 @@ tasks = {
     'fail' : [ ("fail", 'echo failing && /bin/false', "text/plain") ]
 }
 
+def do_print(msg):
+    print "%s" % msg
+    sys.stdout.flush()
+    sys.stderr.flush()
+
 def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
     if show is None:
         show = options.verbose
     if show:
-        print("Running: '%s' in '%s'" % (cmd, dir))
+        do_print("Running: '%s' in '%s'" % (cmd, dir))
     if output:
         return Popen([cmd], shell=True, stdout=PIPE, cwd=dir).communicate()[0]
     elif checkfail:
@@ -269,8 +276,8 @@ class builder(object):
         self.stdout_path = "%s/%s.stdout" % (gitroot, self.tag)
         self.stderr_path = "%s/%s.stderr" % (gitroot, self.tag)
         if options.verbose:
-            print("stdout for %s in %s" % (self.name, self.stdout_path))
-            print("stderr for %s in %s" % (self.name, self.stderr_path))
+            do_print("stdout for %s in %s" % (self.name, self.stdout_path))
+            do_print("stderr for %s in %s" % (self.name, self.stderr_path))
         run_cmd("rm -f %s %s" % (self.stdout_path, self.stderr_path))
         self.stdout = open(self.stdout_path, 'w')
         self.stderr = open(self.stderr_path, 'w')
@@ -278,6 +285,7 @@ class builder(object):
         self.sdir = "%s/%s" % (testbase, self.tag)
         self.prefix = "%s/%s" % (test_prefix, self.tag)
         run_cmd("rm -rf %s" % self.sdir)
+        run_cmd("rm -rf %s" % self.prefix)
         if cp:
             run_cmd("cp --recursive --link --archive %s %s" % (test_master, self.sdir), dir=test_master, show=True)
         else:
@@ -286,7 +294,10 @@ class builder(object):
 
     def start_next(self):
         if self.next == len(self.sequence):
-            print '%s: Completed OK' % self.name
+            if not options.nocleanup:
+                run_cmd("rm -rf %s" % self.sdir)
+                run_cmd("rm -rf %s" % self.prefix)
+            do_print('%s: Completed OK' % self.name)
             self.done = True
             return
         (self.stage, self.cmd, self.output_mime_type) = self.sequence[self.next]
@@ -297,7 +308,7 @@ class builder(object):
         self.cmd = self.cmd.replace("${TESTS}", options.restrict_tests)
 #        if self.output_mime_type == "text/x-subunit":
 #            self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
-        print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
+        do_print('%s: [%s] Running %s' % (self.name, self.stage, self.cmd))
         cwd = os.getcwd()
         os.chdir("%s/%s" % (self.sdir, self.dir))
         self.proc = Popen(self.cmd, shell=True,
@@ -395,7 +406,7 @@ class buildlist(object):
             b = self.wait_one()
             if options.retry and self.need_retry:
                 self.kill_kids()
-                print("retry needed")
+                do_print("retry needed")
                 return (0, None, None, None, "retry")
             if b is None:
                 break
@@ -443,7 +454,9 @@ class buildlist(object):
 def cleanup():
     if options.nocleanup:
         return
-    print("Cleaning up ....")
+    run_cmd("stat %s || true" % test_tmpdir, show=True)
+    run_cmd("stat %s" % testbase, show=True)
+    do_print("Cleaning up ....")
     for d in cleanup_list:
         run_cmd("rm -rf %s" % d)
 
@@ -490,7 +503,7 @@ def write_pidfile(fname):
 
 def rebase_tree(rebase_url, rebase_branch = "master"):
     rebase_remote = "rebaseon"
-    print("Rebasing on %s" % rebase_url)
+    do_print("Rebasing on %s" % rebase_url)
     run_cmd("git describe HEAD", show=True, dir=test_master)
     run_cmd("git remote add -t %s %s %s" %
             (rebase_branch, rebase_remote, rebase_url),
@@ -508,7 +521,7 @@ def rebase_tree(rebase_url, rebase_branch = "master"):
                    (rebase_remote, rebase_branch),
                    dir=test_master, output=True)
     if diff == '':
-        print("No differences between HEAD and %s/%s - exiting" %
+        do_print("No differences between HEAD and %s/%s - exiting" %
               (rebase_remote, rebase_branch))
         sys.exit(0)
     run_cmd("git describe %s/%s" %
@@ -521,7 +534,7 @@ def rebase_tree(rebase_url, rebase_branch = "master"):
 
 def push_to(push_url, push_branch = "master"):
     push_remote = "pushto"
-    print("Pushing to %s" % push_url)
+    do_print("Pushing to %s" % push_url)
     if options.mark:
         run_cmd("git config --replace-all core.editor script/commit_mark.sh", dir=test_master)
         run_cmd("git commit --amend -c HEAD", dir=test_master)
@@ -723,7 +736,7 @@ cleanup_list.append(testbase)
 
 if options.daemon:
     logfile = os.path.join(testbase, "log")
-    print "Forking into the background, writing progress to %s" % logfile
+    do_print("Forking into the background, writing progress to %s" % logfile)
     daemonize(logfile)
 
 write_pidfile(gitroot + "/autobuild.pid")
@@ -732,10 +745,15 @@ start_time = time.time()
 
 while True:
     try:
-        run_cmd("rm -rf %s" % test_master)
-        run_cmd("rm -rf %s" % test_prefix)
-        run_cmd("rm -rf %s" % test_tmpdir)
+        run_cmd("rm -rf %s" % test_tmpdir, show=True)
         os.makedirs(test_tmpdir)
+        # The waf uninstall code removes empty directories all the way
+        # up the tree.  Creating a file in test_tmpdir stops it from
+        # being removed.
+        run_cmd("touch %s" % os.path.join(test_tmpdir,
+                                          ".directory-is-not-empty"), show=True)
+        run_cmd("stat %s" % test_tmpdir, show=True)
+        run_cmd("stat %s" % testbase, show=True)
         run_cmd("git clone --recursive --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
     except Exception:
         cleanup()
@@ -766,27 +784,28 @@ while True:
 
 cleanup_list.append(gitroot + "/autobuild.pid")
 
+do_print(errstr)
+
 blist.kill_kids()
 if options.tail:
-    print("waiting for tail to flush")
+    do_print("waiting for tail to flush")
     time.sleep(1)
 
 elapsed_time = time.time() - start_time
 if status == 0:
-    print errstr
     if options.passcmd is not None:
-        print("Running passcmd: %s" % options.passcmd)
+        do_print("Running passcmd: %s" % options.passcmd)
         run_cmd(options.passcmd, dir=test_master)
     if options.pushto is not None:
         push_to(options.pushto, push_branch=options.branch)
     if options.keeplogs or options.attach_logs:
         blist.tarlogs("logs.tar.gz")
-        print("Logs in logs.tar.gz")
+        do_print("Logs in logs.tar.gz")
     if options.always_email:
         email_success(elapsed_time, log_base=options.log_base)
     blist.remove_logs()
     cleanup()
-    print(errstr)
+    do_print(errstr)
     sys.exit(0)
 
 # something failed, gather a tar of the logs
@@ -815,6 +834,6 @@ the autobuild has been abandoned. Please fix the error and resubmit.
 ''' % (options.branch, platform.node(), elapsed_minutes, failed_task, errstr)
 
 cleanup()
-print(errstr)
-print("Logs in logs.tar.gz")
+do_print(errstr)
+do_print("Logs in logs.tar.gz")
 sys.exit(status)
diff --git a/selftest/knownfail b/selftest/knownfail
index d96e238..d16d723 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -22,14 +22,12 @@
 ^samba3.raw.samba3hide.samba3hide\((nt4_dc|ad_dc)\) # This test fails against an smbd environment with NT ACLs enabled
 ^samba3.raw.samba3closeerr.samba3closeerr\(nt4_dc\) # This test fails against an smbd environment with NT ACLs enabled
 ^samba3.raw.acls nfs4acl_xattr-simple.INHERITFLAGS\(nt4_dc\) # This (and the follow nfs4acl_xattr tests fail because our NFSv4 backend isn't a complete mapping yet.
-^samba3.raw.acls nfs4acl_xattr-simple.sd\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-simple.create_file\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-simple.create_dir\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-simple.nulldacl\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-simple.generic\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-simple.inheritance\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-special.INHERITFLAGS\(nt4_dc\)
-^samba3.raw.acls nfs4acl_xattr-special.sd\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-special.create_file\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-special.create_dir\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-special.nulldacl\(nt4_dc\)
@@ -222,10 +220,6 @@
 #
 ^samba4.winbind.struct.domain_info\(s4member:local\)
 ^samba4.winbind.struct.getdcname\(s4member:local\)
-^samba.blackbox.wbinfo\(s4member:local\).wbinfo -r against s4member\(s4member:local\)
-^samba.blackbox.wbinfo\(s4member:local\).wbinfo --user-sids against s4member\(s4member:local\)
-^samba.wbinfo_simple.\(s4member:local\).--user-groups
-^samba.nss.test using winbind\(s4member:local\)
 #
 # These fail since ad_dc_ntvfs assigns the local user's uid to SAMBADOMAIN/Administrator
 # hence we have a duplicate UID in nsswitch.
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 24484c9..5590be4 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -290,6 +290,7 @@ sub get_interface($)
 
     # 11-16 used by selftest.pl for client interfaces
 
+    $interfaces{"idmapridmember"} = 20;
     $interfaces{"localdc"} = 21;
     $interfaces{"localvampiredc"} = 22;
     $interfaces{"s4member"} = 23;
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 7722a5e..d81e4a4 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -394,16 +394,34 @@ sub setup_admember($$$$)
 	$substitution_path = "$share_dir/D_SAMBADOMAIN/U_alice/G_domain users";
 	push(@dirs, $substitution_path);
 
+	# Using '/' as the winbind separator is a bad idea ...
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN";
+	push(@dirs, $substitution_path);
+
+	$substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN/domain users";
+	push(@dirs, $substitution_path);
+
 	my $member_options = "
 	security = ads
         workgroup = $dcvars->{DOMAIN}
         realm = $dcvars->{REALM}
         netbios aliases = foo bar
+	template homedir = /home/%D/%G/%U
 
-[subDUG]
+[sub_dug]
 	path = $share_dir/D_%D/U_%U/G_%G
 	writeable = yes
 
+[sub_dug2]
+	path = $share_dir/D_%D/u_%u/g_%g
+	writeable = yes
+
 ";
 
 	my $ret = $self->provision($prefix,
@@ -566,6 +584,94 @@ sub setup_admember_rfc2307($$$$)
 	return $ret;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list