The branch, master has been updated
       via  c2083fa6612 smbd: Remove an unnecessary call to SMB_VFS_STAT()
       via  ab121447a51 smbd: Make dirfsp param to synthetic_pathref() const
       via  4f4b952cda3 vfs: Mondernize a few DEBUGs
       via  a24c7d566f2 vfs: Implement streams_depot_fstatat()
       via  900736f91d6 vfs: Implement streams_xattr_fstatat()
       via  7108b3b2e1b vfs: Fix streams_depot_lstat()
       via  dd9e23152e5 smbd: Use filename_convert_dirfsp_rel() in durable 
reconnect
       via  f5178105667 streams_depot: Simplify walk_streams()
       via  09f49fb56a4 smbd: Simplify delete_all_streams()
       via  79dd3a3223d smbd: Move parent_pathref() up in 
close_remove_share_mode()
       via  88b00e6cdea smbd: Move parent_pathref() out of rmdir_internals()
       via  c908dc55768 smbd: Simplify rmdir_internals()
       via  1e490886d8e vfs_fruit: Don't expect a pathref fsp in unlinkat
       via  4cb01e556dd smbd: Modernize a DEBUG
       via  8455d7a05e6 vfs: Do an early talloc_free in an error path
       via  748459a4785 vfs: Rename variables in streams_depot_renameat()
       via  78d0dfa09b0 vfs: Use is_ntfs_stream_smb_fname() where appropriate
       via  6d1376e6425 vfs: Slightly simplify acl_common_remove_object()
       via  c2ff8ddd0eb vfs: Simplify acl_common_remove_object()
       via  1fc02d575fe dsdb: Avoid a talloc
       via  e8861727f12 smbd: Slightly simplify rename_internals_fsp()
       via  4e126905990 smbd: Slightly simplify rename_internals_fsp()
       via  ae93abf7c75 pam_winbind: Align integer types
       via  77815343966 nsswitch: Align integer types
       via  056d8173a95 nsswitch: Simplify wbcCtxDcInfo()
       via  95c930e7e58 dsdb: Align an integer type
       via  a249219c9b6 dsdb: Simplification with generate_random_str_list_buf()
       via  7b38387e27c torture4: Simplification with 
generate_random_str_list_buf()
       via  6c5817d8e13 torture4: Align a few integer types
       via  c50645944ea torture4: Use generate_random_str_list_buf()
       via  aed473225ed smb1_srv: Use generate_random_str_list_buf()
       via  5e7a623f646 lib: factor out generate_random_str_list_buf()
       via  25dccd3a6e6 libsmb: Remove a pointless if-statement
       via  346dcb9dd8f vfs: Use fsp_is_alternate_stream() in shadow_copy2
       via  0fb5480d82e smbd: Modernize a DEBUG
       via  1cf58363e28 docs: Fix a copy&paste error
       via  d15ab9f17f1 vfs: Fix a typo
       via  3055e26d46a vfs: Fix DBGs
       via  d03c7fcb0f7 torture3: Fix an error message
       via  0adbd5fd2c0 smbd: Use MIN() instead of explicit if-statement
      from  21a88df032c samba-tool user disable: add new 
--remove-supplemental-groups option

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


- Log -----------------------------------------------------------------
commit c2083fa66122e17d743fd57baed45033c8ffc472
Author: Volker Lendecke <[email protected]>
Date:   Tue Dec 31 12:36:12 2024 +0100

    smbd: Remove an unnecessary call to SMB_VFS_STAT()
    
    filename_convert_dirfsp() already takes care of looking up the last
    component if it's there.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Fri Jan 24 00:06:14 UTC 2025 on atb-devel-224

commit ab121447a51dd0c3892f472ebb8366cc633e0959
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 14:29:27 2025 +0100

    smbd: Make dirfsp param to synthetic_pathref() const
    
    openat_pathref_fsp() only needs const
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 4f4b952cda376e36d9b1c249d619474565201133
Author: Volker Lendecke <[email protected]>
Date:   Wed Jan 22 09:08:38 2025 +0100

    vfs: Mondernize a few DEBUGs
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit a24c7d566f25595f00ad823c44085098709e537c
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 12:28:55 2025 +0100

    vfs: Implement streams_depot_fstatat()
    
    So far we don't call FSTATAT on streams, but this might change soon.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 900736f91d6706102df0d4b9c111573ef170fabf
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 14:31:55 2025 +0100

    vfs: Implement streams_xattr_fstatat()
    
    So far we don't call FSTATAT on streams, but this might change soon.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 7108b3b2e1b5d6858e839cf3bae2dc1129fba520
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 09:37:32 2025 +0100

    vfs: Fix streams_depot_lstat()
    
    When passing NULL as base_sbuf to stream_smb_fname(), it uses
    SMB_VFS_NEXT_STAT() to find the right stream directory. This will
    potentially dereference the last symlink. Make sure that in
    streams_depot_lstat() this is not done.
    
    Also, the current version did not return the stat struct at all.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit dd9e23152e5610142b88711c0d22ebd02102953d
Author: Volker Lendecke <[email protected]>
Date:   Wed Jan 1 15:51:11 2025 +0100

    smbd: Use filename_convert_dirfsp_rel() in durable reconnect
    
    Avoid a reference to conn->cwd_fsp and thus simplify the code used in
    fd_openat().
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit f51781056678df7a80a51377189b87a9a5eac53f
Author: Volker Lendecke <[email protected]>
Date:   Sat Jan 18 15:11:42 2025 +0100

    streams_depot: Simplify walk_streams()
    
    Remove unused pdirname parameter
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 09f49fb56a4d89283f4cf12e4bacd043b14917b2
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 18:14:43 2025 +0100

    smbd: Simplify delete_all_streams()
    
    In our callers we have the dirfsp around, use that and avoid
    references to conn->cwd_fsp and deep path-based operations
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 79dd3a3223d5ac1f921ff4f5cbfe6ecc767f8fbf
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 22:03:59 2025 +0100

    smbd: Move parent_pathref() up in close_remove_share_mode()
    
    Make it available for delete_all_streams()
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 88b00e6cdeaccbab79c27f5fe1a2ca9a3e682257
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 18:01:47 2025 +0100

    smbd: Move parent_pathref() out of rmdir_internals()
    
    Make the dirfsp() available in close_directory()
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit c908dc55768057a2a5d0f80e82f83a10c2d66547
Author: Volker Lendecke <[email protected]>
Date:   Fri Jan 3 10:47:13 2025 +0100

    smbd: Simplify rmdir_internals()
    
    recursive_rmdir_fsp() works fine on the original fsp passed in, we
    don't need to fetch the dirfsp from the dir_hnd we created to call
    can_delete_directory_hnd()
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 1e490886d8ec99d6d15918f80fbf56f462214342
Author: Volker Lendecke <[email protected]>
Date:   Fri Jan 3 12:33:43 2025 +0100

    vfs_fruit: Don't expect a pathref fsp in unlinkat
    
    The unix syscall unlinkat does not expect a file descriptor for the
    to-be-removed object. SMB_VFS_UNLINKAT should also not expect
    that. Put the special case into vfs_fruit.
    
    This is required to simplify delete_all_streams next, which should not
    have to do an openat_pathref_fsp() on all streams just for the
    vfs_fruit case.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 4cb01e556ddbcf5eb4c8aa333f711d1b7d276025
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 20 15:54:53 2025 +0100

    smbd: Modernize a DEBUG
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 8455d7a05e601b044c4a352654dbd1dfc10cb058
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 20 15:52:06 2025 +0100

    vfs: Do an early talloc_free in an error path
    
    Not a long-term memleak, talloc_tos() takes care of this later, but
    this looks cleaner to me.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 748459a4785b66f233579e2d1d24b4351becdea0
Author: Volker Lendecke <[email protected]>
Date:   Fri Jan 17 13:24:11 2025 +0100

    vfs: Rename variables in streams_depot_renameat()
    
    These are directory fsps
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 78d0dfa09b03b6a2d178685308f983e44c17de64
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 30 20:16:41 2024 +0100

    vfs: Use is_ntfs_stream_smb_fname() where appropriate
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 6d1376e6425aa367f71ca2df98dd5317071dbe7f
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 30 20:15:53 2024 +0100

    vfs: Slightly simplify acl_common_remove_object()
    
    This makes it more obvious to me that it's just the flag that differs
    between the if-branches.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit c2ff8ddd0eb4d220070a545d358f0b3fd9769b9d
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 30 20:28:39 2024 +0100

    vfs: Simplify acl_common_remove_object()
    
    These days we have "dirfsp" available inside the unlinkat vfs
    functions. There's no need to mess with the cwd.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 1fc02d575fe12d3b20948fd2052f5b219583c942
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 10:07:46 2025 +0100

    dsdb: Avoid a talloc
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit e8861727f1231efc3deaa4df9807849b08239209
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 13:38:46 2025 +0100

    smbd: Slightly simplify rename_internals_fsp()
    
    The required permissions only depend on S_ISDIR, but before this patch
    they were assigned in two places far away from the call to
    check_parent_access_fsp(). Consolidate that into where the permissions
    are checked.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 4e126905990e0a37b9374ecb963de76724a633e7
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 13:32:29 2025 +0100

    smbd: Slightly simplify rename_internals_fsp()
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit ae93abf7c7597857ba5a2290350c95c6ff93cec5
Author: Volker Lendecke <[email protected]>
Date:   Wed Dec 18 16:49:10 2024 +0100

    pam_winbind: Align integer types
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 77815343966d880ea485f1b764cf4f55417822ba
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 23 11:14:00 2024 +0100

    nsswitch: Align integer types
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 056d8173a95602212614fb46f0d3b36e4efd8ccc
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 23 11:08:35 2024 +0100

    nsswitch: Simplify wbcCtxDcInfo()
    
    Use winbindd_free_response()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15775
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 95c930e7e585b81d1197002871dfb8dbb25795ef
Author: Volker Lendecke <[email protected]>
Date:   Sun Dec 29 11:57:00 2024 +0100

    dsdb: Align an integer type
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit a249219c9b6d7e2bb92af92da9d75b0abc0937b7
Author: Volker Lendecke <[email protected]>
Date:   Sun Dec 29 11:54:38 2024 +0100

    dsdb: Simplification with generate_random_str_list_buf()
    
    No NULL check required
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 7b38387e27ccf0183b51ba8a4ba9cd31a4ea85bb
Author: Volker Lendecke <[email protected]>
Date:   Sun Dec 29 11:49:35 2024 +0100

    torture4: Simplification with generate_random_str_list_buf()
    
    No NULL check required
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 6c5817d8e1342991ef292aa43d52075edee9fb50
Author: Volker Lendecke <[email protected]>
Date:   Sat Dec 28 12:08:21 2024 +0100

    torture4: Align a few integer types
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit c50645944eafa2a8a9a5f9c732fc6284a1f22be6
Author: Volker Lendecke <[email protected]>
Date:   Sat Dec 28 11:59:52 2024 +0100

    torture4: Use generate_random_str_list_buf()
    
    Avoid a theoretical printf("%s", NULL)
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit aed473225edc1211795d82799c4a19aa850c599a
Author: Volker Lendecke <[email protected]>
Date:   Fri Dec 27 18:53:27 2024 +0100

    smb1_srv: Use generate_random_str_list_buf()
    
    Avoid a theoretical printf("%s", NULL)
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 5e7a623f646a339104569ba3ca4702d2378b6bac
Author: Volker Lendecke <[email protected]>
Date:   Fri Dec 27 18:43:57 2024 +0100

    lib: factor out generate_random_str_list_buf()
    
    No talloc required
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 25dccd3a6e6b3fe72faa15b314e426e17a29492a
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 30 12:55:15 2024 +0100

    libsmb: Remove a pointless if-statement
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 346dcb9dd8f4590c17d743da988b7b2e4dc365a4
Author: Volker Lendecke <[email protected]>
Date:   Sat Jan 11 09:54:12 2025 +0100

    vfs: Use fsp_is_alternate_stream() in shadow_copy2
    
    To me this makes the meaning of this if-statement more obvious
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 0fb5480d82e71f2ae1c5dfad07eabb204ec9e8dc
Author: Volker Lendecke <[email protected]>
Date:   Thu Jan 2 17:32:45 2025 +0100

    smbd: Modernize a DEBUG
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 1cf58363e28dbd188306451db636f6d907ac2fa2
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 18:26:37 2025 +0100

    docs: Fix a copy&paste error
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit d15ab9f17f1f59a91e42383d3eeb3a97418a6a10
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 16:45:03 2025 +0100

    vfs: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 3055e26d46a6fa595fd4fa064c305aab9934784d
Author: Volker Lendecke <[email protected]>
Date:   Mon Jan 13 15:50:02 2025 +0100

    vfs: Fix DBGs
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit d03c7fcb0f7675717f707d9aca99de9fa1a5a73a
Author: Volker Lendecke <[email protected]>
Date:   Mon Dec 19 16:35:51 2022 +0100

    torture3: Fix an error message
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 0adbd5fd2c0a0e48e4ea2a0a6b00c857b3076f6c
Author: Volker Lendecke <[email protected]>
Date:   Fri Dec 16 14:12:57 2022 +0100

    smbd: Use MIN() instead of explicit if-statement
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

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

Summary of changes:
 docs-xml/manpages/vfs_nfs4acl_xattr.8.xml      |   6 +-
 lib/util/genrand_util.c                        |  37 +++++--
 lib/util/samba_util.h                          |   3 +
 nsswitch/libwbclient/wbc_util.c                |   7 +-
 nsswitch/pam_winbind.c                         |   6 +-
 source3/libsmb/clifile.c                       |   5 +-
 source3/modules/nfs4_acls.c                    |   4 +-
 source3/modules/vfs_acl_common.c               |  93 ++++-------------
 source3/modules/vfs_default.c                  |   1 +
 source3/modules/vfs_fruit.c                    |  43 ++++++--
 source3/modules/vfs_nfs4acl_xattr.c            |   2 +-
 source3/modules/vfs_shadow_copy2.c             |   2 +-
 source3/modules/vfs_streams_depot.c            | 107 ++++++++++++++++----
 source3/modules/vfs_streams_xattr.c            | 114 +++++++++++++++++----
 source3/smbd/close.c                           | 135 ++++++++++++-------------
 source3/smbd/durable.c                         |  35 +++----
 source3/smbd/files.c                           |   2 +-
 source3/smbd/open.c                            |   4 +-
 source3/smbd/proto.h                           |   7 +-
 source3/smbd/smb1_reply.c                      |  24 +++--
 source3/smbd/smb1_trans2.c                     |   8 +-
 source3/smbd/smb2_reply.c                      |  18 +---
 source3/torture/torture.c                      |   4 +-
 source4/dsdb/samdb/ldb_modules/password_hash.c |  14 +--
 source4/dsdb/samdb/ldb_modules/samba3sam.c     |  14 +--
 source4/torture/raw/search.c                   |  21 ++--
 source4/torture/rpc/samba3rpc.c                |  18 ++--
 27 files changed, 435 insertions(+), 299 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml 
b/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
index d4ce40b66a4..83f62b20190 100644
--- a/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
+++ b/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
@@ -33,9 +33,9 @@
     <citerefentry><refentrytitle>samba</refentrytitle>
     <manvolnum>7</manvolnum></citerefentry> suite.</para>
 
-    <para>The <command>vfs_acl_xattr</command> VFS module stores NTFS Access
-    Control Lists (ACLs) in Extended Attributes (EAs/xattrs).  This enables the
-    full mapping of Windows ACLs on Samba servers.
+    <para>The <command>vfs_nfs4acl_xattr</command> VFS module provides
+    an interoperability layer between the SMB ACLs that clients expect
+    and an NFSv4 ACL implementation a file system might provide.
     </para>
 
     <para>This module is stackable.</para>
diff --git a/lib/util/genrand_util.c b/lib/util/genrand_util.c
index 43005c56666..4e05de55319 100644
--- a/lib/util/genrand_util.c
+++ b/lib/util/genrand_util.c
@@ -211,25 +211,42 @@ _PUBLIC_ bool check_password_quality(const char *pwd)
        return false;
 }
 
+_PUBLIC_ char *generate_random_str_list_buf(char *buf,
+                                           size_t buflen,
+                                           const char *list)
+{
+       const size_t list_len = strlen(list);
+       size_t i, len;
+
+       if (buflen == 0) {
+               return buf;
+       }
+       buf[buflen-1] = '\0';
+
+       if (buflen == 1) {
+               return buf;
+       }
+
+       len = buflen-1;
+       generate_secret_buffer((uint8_t *)buf, len);
+
+       for (i=0; i<len; i++) {
+               buf[i] = list[buf[i] % list_len];
+       }
+
+       return buf;
+}
+
 /**
  Use the random number generator to generate a random string.
 **/
 
 _PUBLIC_ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const 
char *list)
 {
-       size_t i;
-       size_t list_len = strlen(list);
-
        char *retstr = talloc_array(mem_ctx, char, len + 1);
        if (!retstr) return NULL;
 
-       generate_secret_buffer((uint8_t *)retstr, len);
-       for (i = 0; i < len; i++) {
-               retstr[i] = list[retstr[i] % list_len];
-       }
-       retstr[i] = '\0';
-
-       return retstr;
+       return generate_random_str_list_buf(retstr, len+1, list);
 }
 
 /**
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 3994f8373c5..03dee5c6137 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -170,6 +170,9 @@ _PUBLIC_ char *generate_random_machine_password(TALLOC_CTX 
*mem_ctx, size_t min,
 /**
  Use the random number generator to generate a random string.
 **/
+_PUBLIC_ char *generate_random_str_list_buf(char *buf,
+                                           size_t buflen,
+                                           const char *list);
 _PUBLIC_ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const 
char *list);
 
 /**
diff --git a/nsswitch/libwbclient/wbc_util.c b/nsswitch/libwbclient/wbc_util.c
index 5618039a89d..d97e00db383 100644
--- a/nsswitch/libwbclient/wbc_util.c
+++ b/nsswitch/libwbclient/wbc_util.c
@@ -243,7 +243,7 @@ wbcErr wbcCtxDcInfo(struct wbcContext *ctx,
        const char **ips = NULL;
        wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
        size_t extra_len;
-       int i;
+       uint32_t i;
        char *p;
 
        /* Initialise request */
@@ -305,8 +305,7 @@ wbcErr wbcCtxDcInfo(struct wbcContext *ctx,
 
         wbc_status = WBC_ERR_SUCCESS;
 done:
-       if (response.extra_data.data)
-               free(response.extra_data.data);
+       winbindd_free_response(&response);
 
        if (WBC_ERROR_IS_OK(wbc_status)) {
                *num_dcs = response.data.num_entries;
@@ -564,7 +563,7 @@ wbcErr wbcCtxListTrusts(struct wbcContext *ctx,
        char *p = NULL;
        char *extra_data = NULL;
        struct wbcDomainInfo *d_list = NULL;
-       int i = 0;
+       uint32_t i = 0;
 
        *domains = NULL;
        *num_domains = 0;
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index e1581427856..a54d0ee4123 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -1738,7 +1738,7 @@ static int winbind_auth_request(struct pwb_context *ctx,
        struct wbcAuthUserInfo *user_info = NULL;
        struct wbcAuthErrorInfo *error = NULL;
        int ret = PAM_AUTH_ERR;
-       int i;
+       size_t i;
        const char *codes[] = {
                "NT_STATUS_PASSWORD_EXPIRED",
                "NT_STATUS_PASSWORD_MUST_CHANGE",
@@ -1985,7 +1985,7 @@ static int winbind_chauthtok_request(struct pwb_context 
*ctx,
        enum wbcPasswordChangeRejectReason reject_reason = -1;
        uint32_t flags = 0;
 
-       int i;
+       size_t i;
        const char *codes[] = {
                "NT_STATUS_BACKUP_CONTROLLER",
                "NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND",
@@ -3448,7 +3448,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
 out:
        {
                /* Deal with offline errors. */
-               int i;
+               size_t i;
                const char *codes[] = {
                        "NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND",
                        "NT_STATUS_NO_LOGON_SERVERS",
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index c7da7a1b14c..c079f84049e 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -2364,9 +2364,8 @@ struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
                 * Don't allow attributes greater than
                 * 16-bits for a 16-bit protocol value.
                 */
-               if (tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER)) {
-                       return tevent_req_post(req, ev);
-               }
+               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+               return tevent_req_post(req, ev);
        }
 
        SSVAL(state->vwv+0, 0, mayhave_attrs);
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index c80f8390170..a261c77aca5 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -99,10 +99,10 @@ int smbacl4_get_vfs_params(struct connection_struct *conn,
        }
        params->acedup = (enum smbacl4_acedup_enum)enumval;
        if (params->acedup == e_ignore) {
-               DBG_WARNING("nfs4:acedup ignore is deprecated.\n");
+               DBG_WARNING("nfs4:acedup = ignore is deprecated.\n");
        }
        if (params->acedup == e_reject) {
-               DBG_WARNING("nfs4:acedup ignore is deprecated.\n");
+               DBG_WARNING("nfs4:acedup = reject is deprecated.\n");
        }
 
        params->map_full_control = lp_acl_map_full_control(SNUM(conn));
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index f098b7f1e79..43580706831 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1000,58 +1000,26 @@ static int acl_common_remove_object(vfs_handle_struct 
*handle,
                                        bool is_directory)
 {
        connection_struct *conn = handle->conn;
+       struct stat_ex st;
        struct file_id id;
        files_struct *fsp = NULL;
        int ret = 0;
-       struct smb_filename *full_fname = NULL;
-       struct smb_filename *local_fname = NULL;
-       struct smb_filename *parent_dir_fname = NULL;
-       int saved_errno = 0;
-       struct smb_filename *saved_dir_fname = NULL;
-       NTSTATUS status;
-
-       saved_dir_fname = vfs_GetWd(talloc_tos(),conn);
-       if (saved_dir_fname == NULL) {
-               saved_errno = errno;
-               goto out;
-       }
-
-       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
-                                                 dirfsp,
-                                                 smb_fname);
-       if (full_fname == NULL) {
-               goto out;
-       }
-
-       status = SMB_VFS_PARENT_PATHNAME(conn,
-                                        talloc_tos(),
-                                        full_fname,
-                                        &parent_dir_fname,
-                                        &local_fname);
-       if (!NT_STATUS_IS_OK(status)) {
-               saved_errno = map_errno_from_nt_status(status);
-               goto out;
-       }
 
-       DBG_DEBUG("removing %s %s\n", is_directory ? "directory" : "file",
-                 smb_fname_str_dbg(full_fname));
+       SMB_ASSERT(strchr_m(smb_fname->base_name, '/') == NULL);
 
-       /* cd into the parent dir to pin it. */
-       ret = vfs_ChDir(conn, parent_dir_fname);
+       ret = SMB_VFS_FSTATAT(
+               conn, dirfsp, smb_fname, &st, AT_SYMLINK_NOFOLLOW);
        if (ret == -1) {
-               saved_errno = errno;
-               goto out;
+               return ret;
        }
 
-       /* Must use lstat here. */
-       ret = SMB_VFS_LSTAT(conn, local_fname);
-       if (ret == -1) {
-               saved_errno = errno;
-               goto out;
-       }
+       DBG_DEBUG("removing %s %s/%s\n",
+                 is_directory ? "directory" : "file",
+                 fsp_str_dbg(dirfsp),
+                 smb_fname_str_dbg(smb_fname));
 
        /* Ensure we have this file open with DELETE access. */
-       id = vfs_file_id_from_sbuf(conn, &local_fname->st);
+       id = vfs_file_id_from_sbuf(conn, &st);
        for (fsp = file_find_di_first(conn->sconn, id, true); fsp;
                     fsp = file_find_di_next(fsp, true)) {
                if (fsp->access_mask & DELETE_ACCESS &&
@@ -1065,43 +1033,20 @@ static int acl_common_remove_object(vfs_handle_struct 
*handle,
        }
 
        if (!fsp) {
-               DBG_DEBUG("%s %s not an open file\n",
+               DBG_DEBUG("%s %s/%s not an open file\n",
                          is_directory ? "directory" : "file",
-                         smb_fname_str_dbg(full_fname));
-               saved_errno = EACCES;
-               goto out;
+                         fsp_str_dbg(dirfsp),
+                         smb_fname_str_dbg(smb_fname));
+               return EACCES;
        }
 
        become_root();
-       if (is_directory) {
-               ret = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
-                               smb_fname,
-                               AT_REMOVEDIR);
-       } else {
-               ret = SMB_VFS_NEXT_UNLINKAT(handle,
-                               dirfsp,
-                               smb_fname,
-                               0);
-       }
+       ret = SMB_VFS_NEXT_UNLINKAT(handle,
+                                   dirfsp,
+                                   smb_fname,
+                                   is_directory ? AT_REMOVEDIR : 0);
        unbecome_root();
 
-       if (ret == -1) {
-               saved_errno = errno;
-       }
-
-  out:
-
-       TALLOC_FREE(parent_dir_fname);
-       TALLOC_FREE(full_fname);
-
-       if (saved_dir_fname) {
-               vfs_ChDir(conn, saved_dir_fname);
-               TALLOC_FREE(saved_dir_fname);
-       }
-       if (saved_errno) {
-               errno = saved_errno;
-       }
        return ret;
 }
 
@@ -1154,7 +1099,7 @@ int unlink_acl_common(struct vfs_handle_struct *handle,
                   see if we need to root override. */
 
                /* Don't do anything fancy for streams. */
-               if (smb_fname->stream_name) {
+               if (is_ntfs_stream_smb_fname(smb_fname)) {
                        return -1;
                }
                return acl_common_remove_object(handle,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index c726298ac6f..5d16cbb5bf3 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1406,6 +1406,7 @@ static NTSTATUS vfswrap_parent_pathname(struct 
vfs_handle_struct *handle,
                smb_fname_in->twrp,
                smb_fname_in->flags);
        if (name == NULL) {
+               TALLOC_FREE(parent);
                return NT_STATUS_NO_MEMORY;
        }
 
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 76ab0f8009d..2afa1ab18e2 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -631,7 +631,7 @@ static NTSTATUS fruit_check_access(vfs_handle_struct 
*handle,
        /* FIXME: hardcoded data fork, add resource fork */
        enum apple_fork fork_type = APPLE_FORK_DATA;
 
-       DBG_DEBUG("fruit_check_access: %s, am: %s/%s, sm: 0x%x\n",
+       DBG_DEBUG("%s, am: %s/%s, sm: 0x%x\n",
                  fsp_str_dbg(fsp),
                  access_mask & FILE_READ_DATA ? "READ" :"-",
                  access_mask & FILE_WRITE_DATA ? "WRITE" : "-",
@@ -1953,12 +1953,41 @@ static int fruit_unlink_meta_stream(vfs_handle_struct 
*handle,
 }
 
 static int fruit_unlink_meta_netatalk(vfs_handle_struct *handle,
+                                     struct files_struct *dirfsp,
                                      const struct smb_filename *smb_fname)
 {
-       SMB_ASSERT(smb_fname->fsp != NULL);
-       SMB_ASSERT(fsp_is_alternate_stream(smb_fname->fsp));
-       return SMB_VFS_FREMOVEXATTR(smb_fname->fsp->base_fsp,
-                                  AFPINFO_EA_NETATALK);
+       struct smb_filename *base_name = NULL;
+       struct files_struct *base_fsp = NULL;
+       int ret = -1;
+
+       if (smb_fname->fsp == NULL) {
+               NTSTATUS status;
+
+               base_name = cp_smb_filename_nostream(talloc_tos(), smb_fname);
+               if (base_name == NULL) {
+                       errno = ENOMEM;
+                       goto done;
+               }
+
+               status = openat_pathref_fsp(dirfsp, base_name);
+               if (!NT_STATUS_IS_OK(status)) {
+                       errno = map_errno_from_nt_status(status);
+                       goto done;
+               }
+               base_fsp = base_name->fsp;
+       } else {
+               SMB_ASSERT(fsp_is_alternate_stream(smb_fname->fsp));
+               base_fsp = smb_fname->fsp->base_fsp;
+       }
+
+       ret = SMB_VFS_FREMOVEXATTR(base_fsp, AFPINFO_EA_NETATALK);
+done:
+       {
+               int err = errno;
+               TALLOC_FREE(base_name);
+               errno = err;
+       }
+       return ret;
 }
 
 static int fruit_unlink_meta(vfs_handle_struct *handle,
@@ -1979,7 +2008,7 @@ static int fruit_unlink_meta(vfs_handle_struct *handle,
                break;
 
        case FRUIT_META_NETATALK:
-               rc = fruit_unlink_meta_netatalk(handle, smb_fname);
+               rc = fruit_unlink_meta_netatalk(handle, dirfsp, smb_fname);
                break;
 
        default:
@@ -3203,7 +3232,7 @@ static int fruit_stat_base(vfs_handle_struct *handle,
        }
        smb_fname->stream_name = tmp_stream_name;
 
-       DBG_DEBUG("fruit_stat_base [%s] dev [%ju] ino [%ju]\n",
+       DBG_DEBUG("[%s] dev [%ju] ino [%ju]\n",
                  smb_fname->base_name,
                  (uintmax_t)smb_fname->st.st_ex_dev,
                  (uintmax_t)smb_fname->st.st_ex_ino);
diff --git a/source3/modules/vfs_nfs4acl_xattr.c 
b/source3/modules/vfs_nfs4acl_xattr.c
index 1fd3519ca02..fb2d2bc407b 100644
--- a/source3/modules/vfs_nfs4acl_xattr.c
+++ b/source3/modules/vfs_nfs4acl_xattr.c
@@ -525,7 +525,7 @@ static int nfs4acl_connect(struct vfs_handle_struct *handle,
 }
 
 /*
-   As long as Samba does not support an exiplicit method for a module
+   As long as Samba does not support an explicit method for a module
    to define conflicting vfs methods, we should override all conflicting
    methods here.  That way, we know we are using the NFSv4 storage
 
diff --git a/source3/modules/vfs_shadow_copy2.c 
b/source3/modules/vfs_shadow_copy2.c
index 9b7d208bb7b..8db3e664f19 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -1521,7 +1521,7 @@ static struct smb_filename *shadow_copy2_openat_name(
 {
        struct smb_filename *result = NULL;
 
-       if (fsp->base_fsp != NULL) {
+       if (fsp_is_alternate_stream(fsp)) {
                struct smb_filename *base_fname = fsp->base_fsp->fsp_name;
 
                if (smb_fname_in->base_name[0] == '/') {
diff --git a/source3/modules/vfs_streams_depot.c 
b/source3/modules/vfs_streams_depot.c
index 408ff02e559..dd4f8f524f8 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -494,7 +494,6 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
 
 static NTSTATUS walk_streams(vfs_handle_struct *handle,
                             struct smb_filename *smb_fname_base,
-                            char **pdirname,
                             bool (*fn)(const struct smb_filename *dirname,
                                        const char *dirent,
                                        void *private_data),
@@ -581,13 +580,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
        TALLOC_FREE(rootdir);
        TALLOC_FREE(dir_smb_fname);
        TALLOC_FREE(dir_hnd);
-
-       if (pdirname != NULL) {
-               *pdirname = dirname;
-       }
-       else {
-               TALLOC_FREE(dirname);
-       }
+       TALLOC_FREE(dirname);
 
        return NT_STATUS_OK;
 }
@@ -630,6 +623,7 @@ static int streams_depot_lstat(vfs_handle_struct *handle,
                               struct smb_filename *smb_fname)
 {
        struct smb_filename *smb_fname_stream = NULL;
+       struct smb_filename *base_fname = NULL;
        NTSTATUS status;
        int ret = -1;
 
@@ -640,9 +634,20 @@ static int streams_depot_lstat(vfs_handle_struct *handle,
                return SMB_VFS_NEXT_LSTAT(handle, smb_fname);
        }
 
-       /* Stat the actual stream now. */
+       base_fname = cp_smb_filename_nostream(talloc_tos(), smb_fname);
+       if (base_fname == NULL) {
+               errno = ENOMEM;
+               goto done;
+       }
+
+       ret = SMB_VFS_NEXT_LSTAT(handle, base_fname);
+       if (ret == -1) {
+               goto done;
+       }
+
+       /* lstat the actual stream now. */
        status = stream_smb_fname(
-               handle, NULL, smb_fname, &smb_fname_stream, false);
+               handle, &base_fname->st, smb_fname, &smb_fname_stream, false);
        if (!NT_STATUS_IS_OK(status)) {
                ret = -1;
                errno = map_errno_from_nt_status(status);
@@ -651,8 +656,74 @@ static int streams_depot_lstat(vfs_handle_struct *handle,
 
        ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname_stream);
 
+       if (ret == 0) {
+               smb_fname->st = smb_fname_stream->st;
+       }
+
  done:


-- 
Samba Shared Repository

Reply via email to