]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use get_dirent_ea_size() also for BOTH_DIRECTORY_INFO
authorVolker Lendecke <vl@samba.org>
Mon, 2 Jan 2023 15:21:50 +0000 (16:21 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 4 Jan 2023 09:48:37 +0000 (09:48 +0000)
This is a bit more involved as readdir_attr_data needs to be looked
at. The meaning of this if-statements should be the same though,
readdir_attr_data can only be non-NULL if we don't have a reparse
point around. See the beginning of smbd_marshall_dir_entry().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jan  4 09:48:37 UTC 2023 on sn-devel-184

source3/smbd/smb2_trans2.c

index c6a184b2ffb08b929f2bc5693d39d1d6f69dc717..b12b37e0b4f5626cea4ffe72cbe80fa7040a139d 100644 (file)
@@ -1650,20 +1650,18 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
                SOFF_T(p,0,allocation_size); p += 8;
                SIVAL(p,0,mode); p += 4;
                q = p; p += 4; /* q is placeholder for name length */
-               if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
-                       SIVAL(p, 0, IO_REPARSE_TAG_DFS);
-               } else if (readdir_attr_data &&
-                          readdir_attr_data->type == RDATTR_AAPL) {
+               if (readdir_attr_data &&
+                   readdir_attr_data->type == RDATTR_AAPL) {
                        /*
                         * OS X specific SMB2 extension negotiated via
                         * AAPL create context: return max_access in
                         * ea_size field.
                         */
-                       SIVAL(p, 0, readdir_attr_data->attr_data.aapl.max_access);
+                       ea_size = readdir_attr_data->attr_data.aapl.max_access;
                } else {
-                       unsigned int ea_size = estimate_ea_size(smb_fname->fsp);
-                       SIVAL(p,0,ea_size); /* Extended attributes */
+                       ea_size = get_dirent_ea_size(mode, smb_fname->fsp);
                }
+               SIVAL(p,0,ea_size); /* Extended attributes */
                p += 4;
 
                if (readdir_attr_data &&