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

Stefan Metzmacher metze at samba.org
Tue Aug 16 19:38:01 UTC 2022


The branch, v4-17-test has been updated
       via  8b6cea8105c WHATSNEW: SMB Server performance improvements
       via  c027512a612 s3:vfs.h: add comment about VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
       via  ff46ee6ad51 s3: smbd: Add IS_VETO_PATH checks to openat_pathref_fsp_case_insensitive().
       via  9e32b03e1ee s3: smbd: Add IS_VETO_PATH check to openat_pathref_dirfsp_nosymlink().
       via  80c090c87b2 s3: tests: Add samba3.blackbox.test_veto_files.
       via  912ee2c92d4 selftest/Samba3: let nt4_dc* use vfs_default:VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS=no
       via  783e6e7520c vfs_default: Use openat2(RESOLVE_NO_SYMLINKS) if available
       via  3ec21a8dd98 vfs_default: prepare O_PATH usage with openat2()
       via  40476e83899 s3:smbd: let openat_pathref_dirfsp_nosymlink() try VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS first
       via  5d703111ff2 s3:smbd: let openat_pathref_dirfsp_nosymlink() handle ELOOP similar to ENOTDIR
       via  4ec4806b35a s3:smbd: let openat_pathref_dirfsp_nosymlink() do a verification loop against . and .. first
       via  25071a1f4ee vfs: define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
       via  b71871a193d lib/replace: let DISABLE_OPATH also undef __NR_openat2
       via  4b1f56aa04a lib/replace: add fallback defines for __NR_openat2
       via  dd18624395d lib/replace: use syscall(__NR_openat2) if available
       via  b9a1441238f lib/replace: always include <sys/syscall.h> in replace.c if available
       via  5326bbac232 lib/replace: add a replacement for openat2() that returns ENOSYS
       via  cc9caffa60e vfs_btrfs: fix include order, includes.h or replace.h should be first
       via  c8c2cbca60b vfs_io_uring: hide a possible definition of struct open_how in liburing/compat.h
       via  efb488977f5 wafsamba: allow cflags for CHECK_TYPE[_IN]()
       via  c2a69553872 s3:tests: add a lot more tests to test_symlink_traversal_smb2.sh
       via  7b4e11f1554 s3:utils: Fix NULL check
       via  b8a5f41b790 s3:util: Initialize json_object structures so we can call json_free()
       via  fc3f035e368 s3: smbd: Remove unix_convert() and associated functions.
       via  0ffe593bdab s3: smbd: Remove the old dfs_path_lookup() code.
       via  37ce01d6ed2 s3: smbd: Switch get_referred_path() over to use the new dfs_path_lookup().
       via  bd5c6755581 s3: smbd: Add new version of dfs_path_lookup() that uses filename_convert_dirfsp().
       via  161324f5758 s3: smbd: Remove dfs_redirect().
       via  38740ceea80 s3: smbd: Remove call to dfs_redirect() from filename_convert_dirfsp_nosymlink().
       via  66bc141ddfb s3: smbd: Remove call to dfs_redirect() from filename_convert_smb1_search_path().
       via  d0a9046c80e s3: smbd: In filename_convert_dirfsp_nosymlink(), cope with an MS-DFS link as the terminal component.
       via  879b42bd6f4 s3: smbd: In filename_convert_dirfsp_nosymlink(), allow a NT_STATUS_PATH_NOT_COVERED error to be returned.
       via  5f68afbd016 s3: smbd: Allow openat_pathref_dirfsp_nosymlink() to return NT_STATUS_PATH_NOT_COVERED for a DFS link on a DFS share.
       via  7e9fb8e9fbe s3: smbd: In get create_junction(), make sure check_path_syntax() is called on returned reqpath.
       via  9a9b953a9d7 s3: smbd: In get referred_path(), make sure check_path_syntax() is called on returned reqpath.
       via  d1ba2845a2a s3: smbd: Add dfs_filename_convert(). Simple wrapper around parse_dfs_path().
       via  c0f9b5f41e4 s3: smbd: Use helper function msdfs_servicename_matches_connection() in dfs_redirect().
       via  74dc7cb556a s3: smbd: Use helper function msdfs_servicename_matches_connection() in parse_dfs_path().
       via  0dd880abd96 s3: smbd: Add helper function msdfs_servicename_matches_connection().
       via  8ce26e1e4be s3: smbd: Remove definition of struct dfs_path.
       via  274c8a06b48 s3: smbd: Remove use of 'struct dfs_path'. Not needed for a (hostname, servicename, path) tuple.
       via  3a944329c31 s3: smbd: Add TALLOC_CTX * parameter to parse_dfs_path().
       via  8031584e1eb s3: smbd: Ensure smb2_file_rename_information() uses the SMB2 pathname parsers, not the SMB1 parsers.
       via  8d09dc16912 s3: smbd: Make sure we have identical check_path_syntax logic in smbd_smb2_create_durable_lease_check(), as for smb2_create.
       via  c940c9eae94 s3: smbd: In smbd_smb2_create_send() call the helper function check_path_syntax_smb2().
       via  deb009404a5 s3: smbd: Add helper function check_path_syntax_smb2().
       via  33d00d7e881 s3: smbd: Add new function check_path_syntax_smb2_msdfs() for SMB2 MSDFS paths.
       via  496b9b45c38 s3: smbd: Fix cosmetic bug logging pathnames from Linux kernel clients using SMB1 DFS calls.
       via  adcf069e71e s4:torture/smb2: add smb2.bench.echo
       via  76672394ba5 s4:torture/smb2: teach smb2.bench.path-contention-shared about --option="torture:qdepth=4"
       via  ca8fab6e92f s4:param: add --option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4" support...
       via  691d0fad1c3 s3:g_lock: use TDB_VOLATILE to avoid fcntl locks
       via  c12a8d50837 smbd: avoid calling SMB_VFS_FGET_NT_ACL() if do_not_check_mask already covers all
       via  851d7768c30 s3:include: remove unused update_stat_ex_file_id() prototype
       via  f82ef749180 smbstatus: Fix the 32-bit build on FreeBSD
       via  7b338dc6f57 smbd: Use dirfsp where we have it
       via  d6c44a93f08 s3:tests: let smbstatus json tests fail if jq is not installed
      from  fd61f48e0c1 manpages: add smbstatus option --json with sample output

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


- Log -----------------------------------------------------------------
commit 8b6cea8105c8e8f3f5279b0ee62d36fa467e316d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 16 14:17:50 2022 +0200

    WHATSNEW: SMB Server performance improvements
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(v4-17-test): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(v4-17-test): Tue Aug 16 19:37:17 UTC 2022 on sn-devel-184

commit c027512a6128f40ba9f533b624535ccfdba1260b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 16 09:35:16 2022 +0200

    s3:vfs.h: add comment about VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 5adf051228b56c05fe1205e7a865a497b58e81d9)

commit ff46ee6ad51be64264f706cf7965ad178033ddd2
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Aug 11 10:03:58 2022 -0700

    s3: smbd: Add IS_VETO_PATH checks to openat_pathref_fsp_case_insensitive().
    
    Returns NT_STATUS_OBJECT_NAME_NOT_FOUND for final component.
    
    Note we have to call the check before each call to
    openat_pathref_fsp(), as each call may be using a
    different filesystem name. The first name is the
    one passed into openat_pathref_fsp_case_insensitive()
    by the caller, the second one is a name retrieved from
    get_real_filename_cache_key(), and the third one is the name
    retrieved from get_real_filename_at(). The last two
    calls may have demangled the client given name into
    a veto'ed path on the filesystem.
    
    Remove knownfail.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15143
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Aug 16 08:26:54 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 1654eae11b9c13308b2b78f70309eb3a56960619)

commit 9e32b03e1eec07485582c6c0ea67f2f3a7ea89fd
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Aug 11 09:55:56 2022 -0700

    s3: smbd: Add IS_VETO_PATH check to openat_pathref_dirfsp_nosymlink().
    
    Returns NT_STATUS_OBJECT_PATH_NOT_FOUND for directory component.
    Note IS_VETO_PATH only looks at the last component, so we must
    do it during the directory walk on each component.
    
    Note, we also have to check after a call to get_real_filename_at()
    as it may have demangled the client sent name into a filesystem
    name that matches the "veto files" parameter.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15143
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 1c293060204d96bf94427f91eb20eb9decc29a41)

commit 80c090c87b2898af7f793e1289efd66b279a0e5c
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Aug 11 09:51:11 2022 -0700

    s3: tests: Add samba3.blackbox.test_veto_files.
    
    Shows we currently don't look at smb.conf veto files parameter
    when opening a file or directory. Checks multi-component paths.
    Also checks veto files that might be hidden behind a mangled
    name.
    
    Add knownfail.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15143
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit c6933673222ea9ae2eb74d5586c9495269f51ea0)

commit 912ee2c92d410167f8a01afd26517ca5763bb617
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 12 10:55:42 2022 +0200

    selftest/Samba3: let nt4_dc* use vfs_default:VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS=no
    
    We should always test the code path without openat2 being available,
    even if the kernel supports it.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Mon Aug 15 16:00:26 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 076c22fbd7ecbf22dbfeb1711609f07fd42f88b0)

commit 783e6e7520cee485b89122a45ea7782090088f67
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jun 17 17:41:52 2022 +0200

    vfs_default: Use openat2(RESOLVE_NO_SYMLINKS) if available
    
    This improves the following test:
    
     time smbtorture //127.0.0.1/m -Uroot%test \
            smb2.create.bench-path-contention-shared \
            --option='torture:bench_path=Apps\1\2\3\4\5\6\7\8\9\10' \
            --option="torture:timelimit=600" \
            --option="torture:nprocs=1"
    
    From:
    
       open[num/s=14186,avslat=0.000044,minlat=0.000042,maxlat=0.000079]
       close[num/s=14185,avslat=0.000027,minlat=0.000025,maxlat=0.000057]
    
    to:
    
       open[num/s=16917,avslat=0.000038,minlat=0.000035,maxlat=0.000340]
       close[num/s=16916,avslat=0.000020,minlat=0.000019,maxlat=0.000104]
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 4708ba2f013c5f5ea5aa5dcf4873c2b4a86fb8ff)

commit 3ec21a8dd9832e9af6ee648a69f4c9294f49d081
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 27 18:43:14 2022 +0000

    vfs_default: prepare O_PATH usage with openat2()
    
    When O_PATH is specified in flags, flag bits other than O_CLOEXEC,
    O_DIRECTORY, and O_NOFOLLOW are ignored.
    
    In preparation to use openat2(), which gives an error instead of
    ignoring flags, we better remove unexpected flags, callers typically
    pass O_RDONLY and O_NONBLOCK.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 8544f4490a0b5e54b807daedddb96778744b62ee)

commit 40476e8389933bb70a71faf3559006f8c2789f7c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 14 19:44:04 2022 +0200

    s3:smbd: let openat_pathref_dirfsp_nosymlink() try VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS first
    
    This will reduce the amount of syscalls and the related cost drastically
    for long path names.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit d6653067b20e61af1f05423764c8486a1a5445c8)

commit 5d703111ff242366d426b2ff78f7aaf567f744c4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 12 19:12:44 2022 +0200

    s3:smbd: let openat_pathref_dirfsp_nosymlink() handle ELOOP similar to ENOTDIR
    
    This is no likely to happen as we use O_NOFOLLOW with O_DIRECTORY,
    but it's better to be prepared...
    
    This will be more important in the upcoming openat2(RESOLVE_NO_SYMLINK)
    case, but we should be consitent...
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 35b99c87ef92df006f8b0a41bbea051f0faeadb9)

commit 4ec4806b35ac3ecb3fc96d9acf8ff476dcd0fa4c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 22:01:10 2022 +0200

    s3:smbd: let openat_pathref_dirfsp_nosymlink() do a verification loop against . and .. first
    
    I guess we should catch NT_STATUS_OBJECT_NAME_INVALID first,
    currently the check is already done in check_path_syntax*,
    but we may remove it in future.
    
    But the most important reason for this is the
    openat2(RESOLVE_NO_SYMLINK) optimization, which will
    be introduced in the following commits.
    
    Review with: git show -w
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 17484d069b92d08b0228fb509ea42ab4c3f496a8)

commit 25071a1f4ee1d4893078514c7355abb681ff2695
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jun 3 16:45:41 2022 +0200

    vfs: define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
    
    This will allow us to make use of openat2(RESOLVE_NO_SYMLINKS) soon.
    
    The caller should check if connection_struct.open_how_resolve contains
    VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS before using it, this avoids waisting
    cpu time. But even then the caller must be prepared to handle -1/ENOSYS.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit f7dc27558329eea7d2c4d75ee101c7f9d3a7afe3)

commit b71871a193d38e8f3e9e4da426b11ed402f4438b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 12 10:53:06 2022 +0200

    lib/replace: let DISABLE_OPATH also undef __NR_openat2
    
    The reason for DISABLE_OPATH is to simulate a non-linux
    system, so we should not use openat2() either.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit ae1a84f7313bdf4702492451714eacc78ee7745f)

commit 4b1f56aa04a3e0a1ffbfda7f596d7a5762813a56
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 8 15:33:24 2022 +0200

    lib/replace: add fallback defines for __NR_openat2
    
    sys/syscall.h might be older than the runtime kernel.
    
    If the kernel has support for openat2() we should
    try to use if anyway.
    
    The callers have to deal with ENOSYS anyway,
    so there's no difference if we get that from syscall(__NR_openat2)
    or directly from rep_openat2().
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit f7618dd31a9f8f6c0dbfdedd1a664eed25e2e449)

commit dd18624395dc8a7cd2cfc9527961ae2f1375b744
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 8 15:25:39 2022 +0200

    lib/replace: use syscall(__NR_openat2) if available
    
    There's no glibc wrapper for openat2() yet, so we need
    to use syscall(__NR_openat2) ourself.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit b89001e9226ecb0f4e5c906f7195f0e53cd7d608)

commit b9a1441238f17c3873938bc78de215cd607c36f7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 8 15:24:28 2022 +0200

    lib/replace: always include <sys/syscall.h> in replace.c if available
    
    It will be used for openat2() soon.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 37ba6df174d73b82e951de401cba7f839ad61ab5)

commit 5326bbac232def53753e6bb83dc84b4ad7bb42a2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 8 15:23:29 2022 +0200

    lib/replace: add a replacement for openat2() that returns ENOSYS
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit ce804b78164a3166a16ca3071028536761fd18d7)

commit cc9caffa60eac044f00653b1ef194184563b8952
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Aug 8 15:29:28 2022 +0200

    vfs_btrfs: fix include order, includes.h or replace.h should be first
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 2369d0833361faf4a125431e735fce7efb6024d6)

commit c8c2cbca60bb64a38e38908fedd6e058baeb30e2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 9 10:29:24 2022 +0000

    vfs_io_uring: hide a possible definition of struct open_how in liburing/compat.h
    
    liburing.h will include liburing/compat.h, which either includes
    linux/openat2.h or defines struct open_how itself.
    
    This will help with the following changes, which will provide
    openat2() via libreplace's system/filesys.h, either including
    linux/openat2.h or defining open_how ourself.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit cea9451f780d13e528f1722a67eccbbc78b2daf9)

commit efb488977f563217e88ca1b3b11a78a07859e8c0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Aug 11 00:41:28 2022 +0200

    wafsamba: allow cflags for CHECK_TYPE[_IN]()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 2b51bad747551605ba3b70ac3b692107a0cd7aad)

commit c2a69553872d7f733faf06a7a757ffc53d773506
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 12 19:07:39 2022 +0200

    s3:tests: add a lot more tests to test_symlink_traversal_smb2.sh
    
    We now also test more path components checking the difference between
    OBJECT_NAME_NOT_FOUND and OBJECT_PATH_NOT_FOUND.
    
    We also test with symlinks within the path instead of only checking
    symlinks as final path components (at least for the dirfsp part).
    
    This ensures the following commits won't introduce regressions
    when adding the openat2(RESOLVE_NO_SYMLINK) optimization.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 085f14857531dab179af66a69962486c7dd2592c)

commit 7b4e11f155445d78cdf0090dc7030991934aa36f
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 10 08:51:06 2022 +0200

    s3:utils: Fix NULL check
    
    CID 1507864
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15140
    
    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): Fri Aug 12 21:50:23 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit a38fad29803f9e2891b2264ac3258394152e8deb)

commit b8a5f41b79046368f0a95a09cd10a1c70dfea086
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 10 08:41:24 2022 +0200

    s3:util: Initialize json_object structures so we can call json_free()
    
    CID 1507863
    CID 1507865
    CID 1507866
    CID 1507867
    CID 1507868
    CID 1507869
    CID 1507870
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15140
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 4a702cddaebf7e616706e0c728685567e141b493)

commit fc3f035e368907e750ac1fe33ad6eaf912d9de3a
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 21:59:14 2022 -0700

    s3: smbd: Remove unix_convert() and associated functions.
    
    All code now uses filename_convert_dirfsp() for race-free
    filename conversion.
    
    Best viewed with:
    $ git show --patience
    
                   ----------------
                  /                \
                 /       REST       \
                /         IN         \
               /         PEACE        \
              /                        \
              |                        |
              |      unix_convert      |
              |                        |
              |                        |
              |       9th August       |
              |          2022          |
              |                        |
              |                        |
             *|     *  *  *            | *
    _________)/\\_//(\/(/\)/\//\/\///\/|_)_______
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Aug 12 19:18:25 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 78e4aac76df977cea6cdbcfdf082fd3acdffbd95)

commit 0ffe593bdabf8ab15e8419b8f2ea1c62d768fd86
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 12:13:10 2022 -0700

    s3: smbd: Remove the old dfs_path_lookup() code.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit cc638c25e0332d366016880d174d9349940cba3f)

commit 37ce01d6ed2b90d728a16131d7b982159d580052
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 12:11:07 2022 -0700

    s3: smbd: Switch get_referred_path() over to use the new dfs_path_lookup().
    
    New function doesn't need a TWRP argument and returns NT_STATUS_OK
    on successful redirect, not NT_STATUS_PATH_NOT_COVERED.
    
    Comment out the old dfs_path_lookup().
    
    There are now no more users of unix_convert().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 88e8bfec59412fdc0e83251fef60b45d2cc3a884)

commit bd5c67555816623e1946b4539168af6591609d42
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 12:07:30 2022 -0700

    s3: smbd: Add new version of dfs_path_lookup() that uses filename_convert_dirfsp().
    
    Commented out as not yet used but it's easier to see the
    new logic this way.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 22d4f62537199d9454be312a546e251f04022497)

commit 161324f57583f8993a15205ec697b7aa38496d71
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 10 11:34:24 2022 -0700

    s3: smbd: Remove dfs_redirect().
    
    A moment of silence please.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 6b1224b22012b54b1ae20b682daf61c877362a7b)

commit 38740ceea809eae60706e08faf9da0e98b0b65f1
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 10 11:32:30 2022 -0700

    s3: smbd: Remove call to dfs_redirect() from filename_convert_dirfsp_nosymlink().
    
    Use dfs_filename_convert() instead. There are now no more callers of dfs_redirect().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit d20b60c3200b5e1881cdf4b59da154d1af7e3994)

commit 66bc141ddfb467854591e1b2beb812900ce66cef
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 10 11:29:33 2022 -0700

    s3: smbd: Remove call to dfs_redirect() from filename_convert_smb1_search_path().
    
    Use dfs_filename_convert() instead. Code is now much simpler.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit fcf19d91c09edc6dfbf5bd7cbeedcd641030eb31)

commit d0a9046c80eb07529bf6e9696d8e8a557bb4e434
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 13:18:56 2022 -0700

    s3: smbd: In filename_convert_dirfsp_nosymlink(), cope with an MS-DFS link as the terminal component.
    
    If the terminal component was an MSDFS link, openat_pathref_fsp_case_insensitive() will
    return NT_STATUS_OBJECT_NAME_NOT_FOUND with a VALID_STAT of a symlink.
    
    If this is the case, check if we actually found a terminal MS-DFS link
    at the end of the pathname and return NT_STATUS_PATH_NOT_COVERED.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit d80bedc3c418b6839b1bde78ba8d3db06611be2a)

commit 879b42bd6f4d1d64879735dc8e1b6438dd4c24b3
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 13:15:17 2022 -0700

    s3: smbd: In filename_convert_dirfsp_nosymlink(), allow a NT_STATUS_PATH_NOT_COVERED error to be returned.
    
    openat_pathref_dirfsp_nosymlink() can now return NT_STATUS_PATH_NOT_COVERED.
    Don't convert this automatically into NT_STATUS_OBJECT_PATH_NOT_FOUND.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 07ef9e3029b8cca1b92d900d6ed684ca0ac6afe4)

commit 5f68afbd016e4941a7d2b306938998b75d88ef42
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 11:31:39 2022 -0700

    s3: smbd: Allow openat_pathref_dirfsp_nosymlink() to return NT_STATUS_PATH_NOT_COVERED for a DFS link on a DFS share.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit b5f6809593524e7e9aca1c09ff379e02a1cde61b)

commit 7e9fb8e9fbe7bf46660e042a1fb631bccf3f95a8
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Aug 11 23:57:51 2022 -0700

    s3: smbd: In get create_junction(), make sure check_path_syntax() is called on returned reqpath.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit a92f4f7af0eaa035deebfb1c930ca0cc12d992d5)

commit 9a9b953a9d7af81f0144b73331e6b8043ae954cc
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Aug 11 23:55:58 2022 -0700

    s3: smbd: In get referred_path(), make sure check_path_syntax() is called on returned reqpath.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit da625e4ab4bc670e44fcb6ad7456aa64d0f1f9d2)

commit d1ba2845a2aa5ed2a88d1a9cb6d121eba0656764
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 11:16:17 2022 -0700

    s3: smbd: Add dfs_filename_convert(). Simple wrapper around parse_dfs_path().
    
    Not yet used.
    
    This is what we will use to replace dfs_redirect() in the filename
    conversion code. Keep as a wrapper for now as we might want to
    add some error checking around the 'hostname' and 'service'
    returns.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 245d07ab84852b829c029496618e56782d070e83)

commit c0f9b5f41e478ea2d1019adb6cb085c8ed2b490a
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:58:24 2022 -0700

    s3: smbd: Use helper function msdfs_servicename_matches_connection() in dfs_redirect().
    
    Replaces ugly complex logic.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit a3c9eb7931cb4da0dd5bc5d600125979dd1a7df5)

commit 74dc7cb556ac0815bc22ab05225e25b61c011415
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:53:18 2022 -0700

    s3: smbd: Use helper function msdfs_servicename_matches_connection() in parse_dfs_path().
    
    Replaces ugly complex logic.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit c0a1d7c7a8a7f24890e60c7a371498949dec11c2)

commit 0dd880abd96977235499665a6a8e55e708f767ed
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:49:46 2022 -0700

    s3: smbd: Add helper function msdfs_servicename_matches_connection().
    
    Not yet used so commented out.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 4f5d02f8c0efc1520b2113ce656c78483deb7826)

commit 8ce26e1e4be3d14b1b501257b7a949b012519ddf
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 8 10:27:16 2022 -0700

    s3: smbd: Remove definition of struct dfs_path.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 6c83c674bab8e57ecaf6271eb3a403171bbbacca)

commit 274c8a06b48ec2492d48c13ab759d7932c38898c
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 10 11:17:49 2022 -0700

    s3: smbd: Remove use of 'struct dfs_path'. Not needed for a (hostname, servicename, path) tuple.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit f92711f000a3cb658dfb8fffe92ae6bba78b4f91)

commit 3a944329c31ac665940c3122547d01c60d6010a2
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Aug 10 11:06:47 2022 -0700

    s3: smbd: Add TALLOC_CTX * parameter to parse_dfs_path().
    
    Not yet used. Preparing to remove 'struct dfs_path'.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 2df8a8ab87a1372f2b67880be4454a0285b3104b)

commit 8031584e1eb776bafe3f29efbebadfa9bd2666fb
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:43:45 2022 -0700

    s3: smbd: Ensure smb2_file_rename_information() uses the SMB2 pathname parsers, not the SMB1 parsers.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 0a4a27ce48bc7090aa821eea5e56f8d44c686716)

commit 8d09dc1691250e88d3bf11ea2a51b40d0dce8373
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:41:39 2022 -0700

    s3: smbd: Make sure we have identical check_path_syntax logic in smbd_smb2_create_durable_lease_check(), as for smb2_create.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit a2a097fc3d6a89fb970c1ea3ea75fde93ddb545e)

commit c940c9eae9487840b077742a793d3631b2b8f027
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:39:41 2022 -0700

    s3: smbd: In smbd_smb2_create_send() call the helper function check_path_syntax_smb2().
    
    Previously for DFS names we were skipping this.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 4fafc3418931de06ea2d91baca1eef8d904cc4e6)

commit deb009404a5e6ec6499b3df5aec94ff34675d063
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Aug 9 10:36:00 2022 -0700

    s3: smbd: Add helper function check_path_syntax_smb2().
    
    Not yet used, but uses check_path_syntax_smb2_msdfs()
    so remove the #ifdef's around that.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 7bd7fa0a0b46ad6826097a1987595e2ab6f83384)

commit 33d00d7e8819b70861294bbc90726e0306443adb
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 5 12:16:44 2022 -0700

    s3: smbd: Add new function check_path_syntax_smb2_msdfs() for SMB2 MSDFS paths.
    
     #ifdef'ed out as static and not yet used.
    
    We can't just call check_path_syntax() on these as
    they are of the form hostname\share[\extrapath]
    (where [\extrapath] is optional).
    
    hostname here can be an IPv6 ':' separated address,
    which check_path_syntax() fails on due to the streamname
    processing.
    
    NB. This also has to cope with out existing (broken)
    libsmbclient libraries that sometimes set the DFS
    flag and then send a local pathname. Cope by just
    calling the normal check_path_syntax() on the
    whole pathname in that case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit bcba5502282eb6dcc346d7c63aa3218cda2f9bb0)

commit 496b9b45c385d5b89a1d335f157d73824db47004
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Aug 5 19:27:33 2022 -0700

    s3: smbd: Fix cosmetic bug logging pathnames from Linux kernel clients using SMB1 DFS calls.
    
    The Linux kernel SMB1 client has a bug - it sends
    DFS pathnames as:
    
    \\server\share\path
    
    instead of:
    
    \server\share\path
    
    Causing us to mis-parse server,share,remaining_path here
    and jump into 'goto local_path' at 'share\path' instead
    of 'path'.
    
    This doesn't cause an error as the limits on share names
    are similar to those on pathnames.
    
    parse_dfs_path() which we call before filename parsing
    copes with this by calling trim_char on the leading '\'
    characters before processing.
    
    Do the same here so logging of pathnames looks better.
    
    How did I find this ? Lots and lots of manual
    testing with the Linux kernel client to make
    sure all the recent changes haven't broken Linux
    SMB1/2/3 DFS :-).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 2818fd6910201fd4a18b921933a0b7392a0a8995)

commit adcf069e71e6eb632d1c6e8c97a813b85c0b5825
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 13:14:52 2022 +0000

    s4:torture/smb2: add smb2.bench.echo
    
    This test calls SMB2_Echo in a loop per connection.
    
    For 4 connections with 2 parallel loops use this:
    
    time smbtorture //127.0.0.1/m -Uroot%test smb2.bench.echo \
    	--option="torture:timelimit=600" \
    	--option="torture:nprocs=1" \
    	--option="torture:qdepth=2"
    
    Sometimes the bottleneck is the smbtorture process.
    In order to bring the smbd process to 100% cpu, you can use
    '--option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4"'
    and run multiple instances of the test at the same time,
    which both talk to the same smbd process.
    
    This is a very useful test to show how many requests are possible
    at the raw SMB2 layer.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Aug 11 19:23:37 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 23988f19e7cc2823d6c0c0f40af0195d0a3b81bf)

commit 76672394ba55a881429c57e3e049cb3f648b4be9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 11:43:20 2022 +0000

    s4:torture/smb2: teach smb2.bench.path-contention-shared about --option="torture:qdepth=4"
    
    This can now test more than one open/close loop per connection.
    
    time smbtorture //127.0.0.1/m -Uroot%test \
    	smb2.create.bench-path-contention-shared \
    	--option='torture:bench_path=' \
    	--option="torture:timelimit=60" \
    	--option="torture:nprocs=1" \
    	--option="torture:qdepth=4"
    
    The default is still 1, but it's very useful for tests.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 8ee783c4803d28cccc39144afa7b78c4b9e0cc2e)

commit ca8fab6e92f08113e04edfc202924c24a973b5c1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 13:15:45 2022 +0000

    s4:param: add --option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4" support...
    
    We already handle this in the source3/libsmb code, but it's good to
    have this also for torture tests.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 72caffbe1115c57ad38270eaeb951f6b97bf62b3)

commit 691d0fad1c351f415bcd2fc45b66b615d29a7f29
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 13:16:14 2022 +0000

    s3:g_lock: use TDB_VOLATILE to avoid fcntl locks
    
    This improves 'time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 50000000'
    from ~1.400.000 to ~3.400.000 operations per second any a testsystem.
    
    As we also use TDB_VOLATILE for locking.tdb, this is a much more
    realistic test now.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit cd01f5134696f7789fbc2933629ac2606feb0b5e)

commit c12a8d50837d5073d89753a400b5ffbcdf3321e7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 9 14:07:12 2022 +0000

    smbd: avoid calling SMB_VFS_FGET_NT_ACL() if do_not_check_mask already covers all
    
    This is inspired by 0d4cb5a641e1fea2d369bdc66470a580321366c2,
    which avoids SMB_VFS_FGET_NT_ACL() for the root user again.
    
    Opens with just FILE_READ_ATTRIBUTES are very common, so it's worth
    optimizing for it.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit a0a97d27f7a60dbd86317b51bec0ece2476e8c8d)

commit 851d7768c30f60c981e8d6472874c056daf3846c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 10 16:45:26 2022 +0200

    s3:include: remove unused update_stat_ex_file_id() prototype
    
    It was removed by commit 643da37fd139413651a6198fb0f6e550f7de6584
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 8c7e8c5f80f1488456f9dd6225020d29f74458d2)

commit f82ef749180e08620d3b77c11baea079d848b133
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 12:42:05 2022 +0200

    smbstatus: Fix the 32-bit build on FreeBSD
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Aug  9 20:04:26 UTC 2022 on sn-devel-184
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit 4d015b4b6db20235d6d821204d03b0e1fce1c681)

commit 7b338dc6f57a04e70c58993795e94d143cd08c43
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Aug 8 14:05:46 2022 +0200

    smbd: Use dirfsp where we have it
    
    One reference to conn->cwd_fsp less, makes "mkdir" look less ugly in
    strace.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
    (cherry picked from commit b1b513eebb0999cdfabab597927305be7d978605)

commit d6c44a93f081fc8ada359323049ad5730df4846e
Author: Jule Anger <janger at samba.org>
Date:   Tue Aug 16 12:25:13 2022 +0200

    s3:tests: let smbstatus json tests fail if jq is not installed
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 4b91702a6ea2c6474e635d5ae5f7acd9aebbbab7)

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

Summary of changes:
 WHATSNEW.txt                                       |   21 +
 buildtools/wafsamba/samba_autoconf.py              |    7 +-
 lib/replace/replace.c                              |   52 +-
 lib/replace/system/filesys.h                       |   35 +
 lib/replace/wscript                                |    1 +
 selftest/target/Samba3.pm                          |    6 +
 source3/include/msdfs.h                            |    7 -
 source3/include/proto.h                            |    1 -
 source3/include/vfs.h                              |    4 +
 source3/lib/g_lock.c                               |    2 +-
 source3/modules/vfs_btrfs.c                        |    4 +-
 source3/modules/vfs_default.c                      |   71 +-
 source3/modules/vfs_io_uring.c                     |   18 +
 source3/script/tests/test_smbstatus.sh             |   22 -
 .../script/tests/test_symlink_traversal_smb2.sh    |  116 ++
 source3/script/tests/test_veto_files.sh            |  201 +++
 source3/selftest/tests.py                          |    4 +
 source3/smbd/filename.c                            | 1639 ++------------------
 source3/smbd/files.c                               |  141 +-
 source3/smbd/msdfs.c                               |  714 +++++----
 source3/smbd/open.c                                |   71 +-
 source3/smbd/proto.h                               |   25 +-
 source3/smbd/smb2_create.c                         |   21 +-
 source3/smbd/smb2_reply.c                          |   68 +
 source3/smbd/smb2_trans2.c                         |   30 +-
 source3/utils/status_json.c                        |   43 +-
 source3/wscript                                    |   13 +
 source4/param/loadparm.c                           |   11 +-
 source4/torture/smb2/create.c                      |  591 +++++--
 29 files changed, 1876 insertions(+), 2063 deletions(-)
 create mode 100755 source3/script/tests/test_veto_files.sh


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 006220f0d4c..9ef0bcc68d7 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -16,6 +16,27 @@ UPGRADING
 NEW FEATURES/CHANGES
 ====================
 
+SMB Server performance improvements
+-----------------------------------
+
+The security improvements in recent releases
+(4.13, 4.14, 4.15, 4.16), mainly as protection against symlink races,
+caused performance regressions for meta data heavy workloads.
+
+With 4.17 the situation improved a lot again:
+
+- Pathnames given by a client are devided into dirname and basename.
+  The amount of syscalls to validate dirnames is reduced to 2 syscalls
+  (openat, close) per component. On modern Linux kernels (>= 5.6) smbd
+  makes use of the openat2() syscall with RESOLVE_NO_SYMLINKS,
+  in order to just use 2 syscalls (openat2, close) for the whole dirname.
+
+- Contended path based operations used to generate a lot of unsolicited
+  wakeup events causing thundering herd problems, which lead to masive
+  latencies for some clients. These events are now avoided in order
+  to provide stable latencies and much higher throughput of open/close
+  operations.
+
 Configure without the SMB1 Server
 ---------------------------------
 
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 9db53e40724..3ca2f334190 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -146,7 +146,7 @@ def header_list(conf, headers=None, lib=None):
 
 
 @conf
-def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg=None):
+def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg=None, cflags=''):
     '''check for a single type'''
     if define is None:
         define = 'HAVE_' + t.upper().replace(' ', '_')
@@ -158,6 +158,7 @@ def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None, lib=None, msg
                      headers=headers,
                      local_include=False,
                      msg=msg,
+                     cflags=cflags,
                      lib=lib,
                      link=False)
     if not ret and alternate:
@@ -177,9 +178,9 @@ def CHECK_TYPES(conf, list, headers=None, define=None, alternate=None, lib=None)
 
 
 @conf
-def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None):
+def CHECK_TYPE_IN(conf, t, headers=None, alternate=None, define=None, cflags=''):
     '''check for a single type with a header'''
-    return CHECK_TYPE(conf, t, headers=headers, alternate=alternate, define=define)
+    return CHECK_TYPE(conf, t, headers=headers, alternate=alternate, define=define, cflags=cflags)
 
 
 @conf
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 0652cb4e6d6..cbf372e494f 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -33,6 +33,10 @@
 #include "system/locale.h"
 #include "system/wait.h"
 
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
+
 #ifdef _WIN32
 #define mkdir(d,m) _mkdir(d)
 #endif
@@ -1058,9 +1062,6 @@ const char *rep_getprogname(void)
 #endif /* HAVE_GETPROGNAME */
 
 #ifndef HAVE_COPY_FILE_RANGE
-# ifdef HAVE_SYSCALL_COPY_FILE_RANGE
-# include <sys/syscall.h>
-# endif
 ssize_t rep_copy_file_range(int fd_in,
 			    loff_t *off_in,
 			    int fd_out,
@@ -1081,3 +1082,48 @@ ssize_t rep_copy_file_range(int fd_in,
 	return -1;
 }
 #endif /* HAVE_COPY_FILE_RANGE */
+
+#ifndef HAVE_OPENAT2
+
+/* fallback known wellknown __NR_openat2 values */
+#ifndef __NR_openat2
+# if defined(LINUX) && defined(HAVE_SYS_SYSCALL_H)
+#  if defined(__i386__)
+#   define __NR_openat2 437
+#  elif defined(__x86_64__) && defined(__LP64__)
+#   define __NR_openat2 437 /* 437 0x1B5 */
+#  elif defined(__x86_64__) && defined(__ILP32__)
+#   define __NR_openat2 1073742261 /* 1073742261 0x400001B5 */
+#  elif defined(__aarch64__)
+#   define __NR_openat2 437
+#  elif defined(__arm__)
+#   define __NR_openat2 437
+#  elif defined(__sparc__)
+#   define __NR_openat2 437
+#  endif
+# endif /* defined(LINUX) && defined(HAVE_SYS_SYSCALL_H) */
+#endif /* !__NR_openat2 */
+
+#ifdef DISABLE_OPATH
+/*
+ * systems without O_PATH also don't have openat2,
+ * so make sure we at a realistic combination.
+ */
+#undef __NR_openat2
+#endif /* DISABLE_OPATH */
+
+long rep_openat2(int dirfd, const char *pathname,
+		 struct open_how *how, size_t size)
+{
+#ifdef __NR_openat2
+	return syscall(__NR_openat2,
+		       dirfd,
+		       pathname,
+		       how,
+		       size);
+#else
+	errno = ENOSYS;
+	return -1;
+#endif
+}
+#endif /* !HAVE_OPENAT2 */
diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
index bb9482c69af..8005b18780f 100644
--- a/lib/replace/system/filesys.h
+++ b/lib/replace/system/filesys.h
@@ -243,4 +243,39 @@ int rep_fsetxattr (int filedes, const char *name, const void *value, size_t size
 
 #endif /* !defined(HAVE_XATTR_XATTR) || defined(XATTR_ADDITIONAL_OPTIONS) */
 
+#ifdef HAVE_LINUX_OPENAT2_H
+#include <linux/openat2.h>
+#else /* ! HAVE_LINUX_OPENAT2_H */
+/* how->resolve flags for openat2(2). */
+#define RESOLVE_NO_XDEV		0x01 /* Block mount-point crossings
+					(includes bind-mounts). */
+#define RESOLVE_NO_MAGICLINKS	0x02 /* Block traversal through procfs-style
+					"magic-links". */
+#define RESOLVE_NO_SYMLINKS	0x04 /* Block traversal through all symlinks
+					(implies OEXT_NO_MAGICLINKS) */
+#define RESOLVE_BENEATH		0x08 /* Block "lexical" trickery like
+					"..", symlinks, and absolute
+					paths which escape the dirfd. */
+#define RESOLVE_IN_ROOT		0x10 /* Make all jumps to "/" and ".."
+					be scoped inside the dirfd
+					(similar to chroot(2)). */
+#define RESOLVE_CACHED		0x20 /* Only complete if resolution can be
+					completed through cached lookup. May
+					return -EAGAIN if that's not
+					possible. */
+struct __rep_open_how {
+	uint64_t flags;
+	uint64_t mode;
+	uint64_t resolve;
+};
+#define open_how __rep_open_how
+#endif /* ! HAVE_LINUX_OPENAT2_H */
+
+#ifndef HAVE_OPENAT2
+long rep_openat2(int dirfd, const char *pathname,
+		 struct open_how *how, size_t size);
+#define openat2(dirfd, pathname, how, size) \
+	rep_openat2(dirfd, pathname, how, size)
+#endif /* !HAVE_OPENAT2 */
+
 #endif
diff --git a/lib/replace/wscript b/lib/replace/wscript
index dd9b19219a1..2f179992c82 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -66,6 +66,7 @@ def configure(conf):
     conf.CHECK_HEADERS('errno.h')
     conf.CHECK_HEADERS('getopt.h iconv.h')
     conf.CHECK_HEADERS('memory.h nss.h sasl/sasl.h')
+    conf.CHECK_HEADERS('linux/openat2.h')
 
     conf.CHECK_FUNCS_IN('inotify_init', 'inotify', checklibc=True,
                         headers='sys/inotify.h')
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 1a4bf7439ef..b12011a71fa 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -275,6 +275,8 @@ sub setup_nt4_dc
 	server schannel = auto
 	rpc start on demand helpers = false
 
+	vfs_default:VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS = no
+
 	fss: sequence timeout = 1
 	check parent directory delete on close = yes
 ";
@@ -1914,6 +1916,10 @@ sub setup_fileserver
 	path = $veto_sharedir
 	delete veto files = yes
 
+[veto_files]
+	path = $veto_sharedir
+	veto files = /veto_name*/
+
 [delete_yes_unwrite]
 	read only = no
 	path = $delete_unwrite_sharedir
diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h
index 83265174373..892343fdd9a 100644
--- a/source3/include/msdfs.h
+++ b/source3/include/msdfs.h
@@ -56,11 +56,4 @@ struct junction_map {
 	size_t referral_count;
 	struct referral* referral_list;
 };
-
-struct dfs_path {
-	char *hostname;
-	char *servicename;
-	char *reqpath;
-};
-
 #endif /* _MSDFS_H */
diff --git a/source3/include/proto.h b/source3/include/proto.h
index aebbd7f9c47..6a6edc36dfb 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -171,7 +171,6 @@ int sys_fcntl_long(int fd, int cmd, long arg);
 int sys_fcntl_int(int fd, int cmd, int arg);
 void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts);
 void update_stat_ex_create_time(struct stat_ex *dst, struct timespec create_time);
-void update_stat_ex_file_id(struct stat_ex *dst, uint64_t file_id);
 void update_stat_ex_from_saved_stat(struct stat_ex *dst,
 				    const struct stat_ex *src);
 int sys_stat(const char *fname, SMB_STRUCT_STAT *sbuf,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 866d2a5f4a8..61360b3c21c 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -374,6 +374,7 @@
  * Version 47 - Re-add dirfsp to CREATE_FILE
  * Version 47 - Add fsp flag fstat_before_close
  * Version 47 - Change SMB_VFS_OPENAT() to match the Linux openat2 prototype, add vfs_open_how
+ * Version 47 - Add VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS for SMB_VFS_OPENAT()
  */
 
 #define SMB_VFS_INTERFACE_VERSION 47
@@ -716,6 +717,7 @@ typedef struct connection_struct {
 	bool ipc;
 	bool read_only; /* Attributes for the current user of the share. */
 	bool have_proc_fds;
+	uint64_t open_how_resolve; /* supported vfs_open_how.resolve features */
 	uint32_t share_access;
 	/* Does this filesystem honor
 	   sub second timestamps on files
@@ -905,6 +907,8 @@ struct vfs_aio_state {
 	uint64_t duration;
 };
 
+#define VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS 1
+
 struct vfs_open_how {
 	int flags;
 	mode_t mode;
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 52a1cf9fa46..d683c4ddee6 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -236,7 +236,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
 		mem_ctx,
 		db_path,
 		0,
-		TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
+		TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_VOLATILE,
 		O_RDWR|O_CREAT,
 		0600,
 		DBWRAP_LOCK_ORDER_3,
diff --git a/source3/modules/vfs_btrfs.c b/source3/modules/vfs_btrfs.c
index 1ee3f1831c6..a7ba0ece206 100644
--- a/source3/modules/vfs_btrfs.c
+++ b/source3/modules/vfs_btrfs.c
@@ -17,6 +17,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "includes.h"
+#include "system/filesys.h"
 #include <linux/ioctl.h>
 #include <linux/fs.h>
 #include <sys/ioctl.h>
@@ -24,8 +26,6 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <libgen.h>
-#include "system/filesys.h"
-#include "includes.h"
 #include "smbd/smbd.h"
 #include "smbd/globals.h"
 #include "librpc/gen_ndr/smbXsrv.h"
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 9cf70fd84ce..5d8ee98e2ca 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -49,7 +49,28 @@
 
 static int vfswrap_connect(vfs_handle_struct *handle, const char *service, const char *user)
 {
+	bool bval;
+
 	handle->conn->have_proc_fds = sys_have_proc_fds();
+
+	/*
+	 * assume the kernel will support openat2(),
+	 * it will be reset on the first ENOSYS.
+	 *
+	 * Note that libreplace will always provide openat2(),
+	 * but return -1/errno = ENOSYS...
+	 *
+	 * The option is only there to test the fallback code.
+	 */
+	bval = lp_parm_bool(SNUM(handle->conn),
+			    "vfs_default",
+			    "VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS",
+			    true);
+	if (bval) {
+		handle->conn->open_how_resolve |=
+			VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS;
+	}
+
 	return 0;    /* Return >= 0 for success */
 }
 
@@ -701,7 +722,7 @@ static int vfswrap_openat(vfs_handle_struct *handle,
 
 	START_PROFILE(syscall_openat);
 
-	if (how->resolve != 0) {
+	if (how->resolve & ~VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS) {
 		errno = ENOSYS;
 		result = -1;
 		goto out;
@@ -718,8 +739,55 @@ static int vfswrap_openat(vfs_handle_struct *handle,
 	if (fsp->fsp_flags.is_pathref) {
 		flags |= O_PATH;
 	}
+	if (flags & O_PATH) {
+		/*
+		 * From "man 2 openat":
+		 *
+		 *   When O_PATH is specified in flags, flag bits other than
+		 *   O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored.
+		 *
+		 * From "man 2 openat2":
+		 *
+		 *   Whereas  openat(2)  ignores  unknown  bits  in  its  flags
+		 *   argument, openat2() returns an error if unknown or
+		 *   conflicting flags are specified in how.flags.
+		 *
+		 * So we better clear ignored/invalid flags
+		 * and only keep the exptected once.
+		 */
+		flags &= (O_PATH|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW);
+	}
 #endif
 
+	if (how->resolve & VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS) {
+		struct open_how linux_how = {
+			.flags = flags,
+			.mode = mode,
+			.resolve = RESOLVE_NO_SYMLINKS,
+		};
+
+		result = openat2(fsp_get_pathref_fd(dirfsp),
+				 smb_fname->base_name,
+				 &linux_how,
+				 sizeof(linux_how));
+		if (result == -1) {
+			if (errno == ENOSYS) {
+				/*
+				 * The kernel doesn't support
+				 * openat2(), so indicate to
+				 * the callers that
+				 * VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS
+				 * would just be a waste of time.
+				 */
+				fsp->conn->open_how_resolve &=
+					~VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS;
+			}
+			goto out;
+		}
+
+		goto done;
+	}
+
 	if (fsp->fsp_flags.is_pathref && !have_opath) {
 		become_root();
 		became_root = true;
@@ -734,6 +802,7 @@ static int vfswrap_openat(vfs_handle_struct *handle,
 		unbecome_root();
 	}
 
+done:
 	fsp->fsp_flags.have_proc_fds = fsp->conn->have_proc_fds;
 
 out:
diff --git a/source3/modules/vfs_io_uring.c b/source3/modules/vfs_io_uring.c
index 5168df7a97b..65dd151bb02 100644
--- a/source3/modules/vfs_io_uring.c
+++ b/source3/modules/vfs_io_uring.c
@@ -20,6 +20,24 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "replace.h"
+
+/*
+ * liburing.h only needs a forward declaration
+ * of struct open_how.
+ *
+ * If struct open_how is defined in liburing/compat.h
+ * itself, hide it away in order to avoid conflicts
+ * with including linux/openat2.h or defining 'struct open_how'
+ * in libreplace.
+ */
+struct open_how;
+#ifdef HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H
+#define open_how __ignore_liburing_compat_h_open_how
+#include <liburing/compat.h>
+#undef open_how
+#endif /* HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H */
+
 #include "includes.h"
 #include "system/filesys.h"
 #include "smbd/smbd.h"
diff --git a/source3/script/tests/test_smbstatus.sh b/source3/script/tests/test_smbstatus.sh
index 0eb186e3d86..b24fe735aa5 100755
--- a/source3/script/tests/test_smbstatus.sh
+++ b/source3/script/tests/test_smbstatus.sh
@@ -292,17 +292,6 @@ EOF
 		return 1
 	fi
 
-	out=$(cat $PREFIX/$status_json | jq ".")
-	echo $out | grep -c 'jq: not found'
-	ret=$?
-	if [ $ret -eq 0 ]; then
-		subunit_start_test "test_smbstatus_json"
-		subunit_skip_test "test_smbstatus_json" <<EOF
-Test needs jq
-EOF
-		return 0
-	fi
-
 	out=$(cat $PREFIX/$status_json | jq ".")
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -424,17 +413,6 @@ EOF
 		return 1
 	fi
 
-	out=$(cat $PREFIX/$status_json | jq ".")
-	echo $out | grep -c 'jq: not found'
-	ret=$?
-	if [ $ret -eq 0 ]; then
-		subunit_start_test "test_smbstatus_json_profile"
-		subunit_skip_test "test_smbstatus_json_profile" <<EOF
-Test needs jq
-EOF
-		return 0
-	fi
-
 	out=$(cat $PREFIX/$status_json | jq ".")
 	ret=$?
 	if [ $ret -ne 0 ]; then
diff --git a/source3/script/tests/test_symlink_traversal_smb2.sh b/source3/script/tests/test_symlink_traversal_smb2.sh
index eadd7592de5..971d5344216 100755
--- a/source3/script/tests/test_symlink_traversal_smb2.sh
+++ b/source3/script/tests/test_symlink_traversal_smb2.sh
@@ -50,7 +50,11 @@ do_cleanup()
 	(
 		#subshell.
 		cd "$share_test_dir" || return
+		rm -f "symlink_to_dot"
 		rm -f "file_exists"
+		rm -f "symlink_to_file_exists"
+		rm -rf "dir_exists"
+		rm -f "symlink_to_dir_exists"
 		rm -f "symlink_noexist"


-- 
Samba Shared Repository



More information about the samba-cvs mailing list