diff options
author | Jeremy Allison <jra@samba.org> | 2020-06-01 11:36:03 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2020-06-26 07:52:26 +0000 |
commit | bb210d6d29bcd08a36334e9b159c0a5fd3d82bf5 (patch) | |
tree | 42609a3a21493f4b5dae9bddf3010203d1d45dd9 | |
parent | 10e8d8b4b13a7d1bbd07072a8ebd178ca12b9641 (diff) | |
download | samba-bb210d6d29bcd08a36334e9b159c0a5fd3d82bf5.tar.gz |
s3: libsmb: Info level SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8.
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)
-rw-r--r-- | source3/libsmb/clilist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index f9444bc401c..a78678f4532 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -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; |