summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-06-03 10:48:10 -0700
committerJeremy Allison <jra@samba.org>2020-06-04 17:11:37 +0000
commit8db68d7417eb33b2954ad4d43846208d19034c28 (patch)
tree412da731e2865d524fbed6a9ac92a4e0e0880911
parenta5f5cbc25ee63ba5a0204dc23b249b4479d35de5 (diff)
downloadsamba-8db68d7417eb33b2954ad4d43846208d19034c28.tar.gz
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>
-rw-r--r--examples/fuse/clifuse.c2
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/libsmb/cli_smb2_fnum.c7
-rw-r--r--source3/libsmb/clilist.c3
4 files changed, 6 insertions, 8 deletions
diff --git a/examples/fuse/clifuse.c b/examples/fuse/clifuse.c
index 1a8d3d4c094..f75a9f5a2d7 100644
--- a/examples/fuse/clifuse.c
+++ b/examples/fuse/clifuse.c
@@ -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;
diff --git a/source3/include/client.h b/source3/include/client.h
index 56d368e6582..6a3b1b02ff3 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -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;
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 994b94802d8..f1409de7bae 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -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
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index db5f4bfadd3..b2327ed97ad 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -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;