]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint3...
authorJeremy Allison <jra@samba.org>
Mon, 1 Jun 2020 18:36:03 +0000 (11:36 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Jun 2020 07:52:26 +0000 (07:52 +0000)
Cast to a uint16_t for now after pulling the information
as finfo->mode is currently only 16 bits.

We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 5e3e6c4c0c70e171607f4b5351bd8ec146730f08)

source3/libsmb/clilist.c

index f9444bc401c89ff6093600b046c8ec900cf6c7e8..a78678f45321d64b7fab25dc319915f71f7bdd5e 100644 (file)
@@ -257,7 +257,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
                        finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0);
                        p += 8;
                        p += 8; /* alloc size */
-                       finfo->mode = CVAL(p,0);
+                       /* NB. We need to enlarge finfo->mode to be 32-bits. */
+                       finfo->mode = (uint16_t)IVAL(p,0);
                        p += 4;
                        namelen = IVAL(p,0);
                        p += 4;