From: Volker Lendecke Date: Mon, 2 Jan 2023 15:21:50 +0000 (+0100) Subject: smbd: Use get_dirent_ea_size() also for BOTH_DIRECTORY_INFO X-Git-Tag: talloc-2.4.0~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9636b40b05b90e5317bb1ef29985ffb91bccf482;p=thirdparty%2Fsamba.git smbd: Use get_dirent_ea_size() also for BOTH_DIRECTORY_INFO 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 Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Jan 4 09:48:37 UTC 2023 on sn-devel-184 --- diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index c6a184b2ffb..b12b37e0b4f 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -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 &&