mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
s3: libsmb: Change size of finfo->attr to uint32_t.
That's what modern servers return. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
a5f5cbc25e
commit
8db68d7417
@ -496,7 +496,7 @@ static NTSTATUS parse_finfo_id_both_directory_info(uint8_t *dir_data,
|
||||
finfo->mtime_ts = interpret_long_date((const char *)dir_data + 24);
|
||||
finfo->ctime_ts = interpret_long_date((const char *)dir_data + 32);
|
||||
finfo->size = IVAL2_TO_SMB_BIG_UINT(dir_data + 40, 0);
|
||||
finfo->attr = (uint16_t)IVAL(dir_data + 56, 0);
|
||||
finfo->attr = IVAL(dir_data + 56, 0);
|
||||
namelen = IVAL(dir_data + 60,0);
|
||||
if (namelen > (dir_data_length - 104)) {
|
||||
return NT_STATUS_INFO_LENGTH_MISMATCH;
|
||||
|
@ -100,7 +100,7 @@ struct cli_state {
|
||||
struct file_info {
|
||||
uint64_t size;
|
||||
uint64_t allocated_size;
|
||||
uint16_t attr;
|
||||
uint32_t attr;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
uint64_t ino;
|
||||
|
@ -1199,8 +1199,7 @@ static NTSTATUS parse_finfo_id_both_directory_info(const uint8_t *dir_data,
|
||||
finfo->ctime_ts = interpret_long_date((const char *)dir_data + 32);
|
||||
finfo->size = IVAL2_TO_SMB_BIG_UINT(dir_data + 40, 0);
|
||||
finfo->allocated_size = IVAL2_TO_SMB_BIG_UINT(dir_data + 48, 0);
|
||||
/* NB. We need to enlarge finfo->attr to be 32-bits. */
|
||||
finfo->attr = (uint16_t)IVAL(dir_data + 56, 0);
|
||||
finfo->attr = IVAL(dir_data + 56, 0);
|
||||
finfo->ino = IVAL2_TO_SMB_BIG_UINT(dir_data + 96, 0);
|
||||
namelen = IVAL(dir_data + 60,0);
|
||||
if (namelen > (dir_data_length - 104)) {
|
||||
@ -1419,8 +1418,8 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (dir_check_ftype((uint32_t)finfo->attr,
|
||||
(uint32_t)attribute)) {
|
||||
if (dir_check_ftype(
|
||||
finfo->attr, (uint32_t)attribute)) {
|
||||
/*
|
||||
* Only process if attributes match.
|
||||
* On SMB1 server does this, so on
|
||||
|
@ -257,8 +257,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
|
||||
finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0);
|
||||
p += 8;
|
||||
p += 8; /* alloc size */
|
||||
/* NB. We need to enlarge finfo->attr to be 32-bits. */
|
||||
finfo->attr = (uint16_t)IVAL(p,0);
|
||||
finfo->attr = IVAL(p,0);
|
||||
p += 4;
|
||||
namelen = IVAL(p,0);
|
||||
p += 4;
|
||||
|
Loading…
Reference in New Issue
Block a user