diff options
author | Jeremy Allison <jra@samba.org> | 2020-06-03 13:28:04 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-06-04 17:11:38 +0000 |
commit | 3849ceaa699e0be16cb3c84955eeb39ecdad682e (patch) | |
tree | 2a77273d8adb287bef10d40d10dc882230be21c1 /source3 | |
parent | ad5d5d94a3ff185e61ec1ca7d405aa2845653992 (diff) | |
download | samba-3849ceaa699e0be16cb3c84955eeb39ecdad682e.tar.gz |
s3: libsmb: Change cli_qpathinfo2() and async versions to return a 32-bit attribute.
Fix all callers.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clirap.c | 30 | ||||
-rw-r--r-- | source3/libsmb/clirap.h | 4 | ||||
-rw-r--r-- | source3/libsmb/libsmb_file.c | 3 |
3 files changed, 19 insertions, 18 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index d5baf59c115..8e4d31e0ae8 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -958,7 +958,7 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - off_t *size, uint16_t *pattr, + off_t *size, uint32_t *pattr, SMB_INO_T *ino) { struct cli_qpathinfo2_state *state = tevent_req_data( @@ -982,7 +982,8 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req, *change_time = interpret_long_date((char *)state->data+24); } if (pattr) { - *pattr = SVAL(state->data, 32); + /* SMB_QUERY_FILE_ALL_INFO returns 32-bit attributes. */ + *pattr = IVAL(state->data, 32); } if (size) { *size = IVAL2_TO_SMB_BIG_UINT(state->data,48); @@ -1006,7 +1007,7 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - off_t *size, uint16_t *pattr, + off_t *size, uint32_t *pattr, SMB_INO_T *ino) { TALLOC_CTX *frame = NULL; @@ -1015,23 +1016,15 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname, NTSTATUS status = NT_STATUS_NO_MEMORY; if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { - uint32_t attr = 0; - status = cli_smb2_qpathinfo2(cli, + return cli_smb2_qpathinfo2(cli, fname, create_time, access_time, write_time, change_time, size, - &attr, + pattr, ino); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - if (pattr != NULL) { - *pattr = attr; - } - return status; } frame = talloc_stackframe(); @@ -1601,9 +1594,16 @@ NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname, uint64_t pos; if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { - return cli_qpathinfo2(cli, fname, + status = cli_qpathinfo2(cli, fname, create_time, access_time, write_time, change_time, - size, pattr, ino); + size, &attr, ino); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + if (pattr != NULL) { + *pattr = attr; + } + return status; } if (create_time || access_time || write_time || change_time || pattr) { diff --git a/source3/libsmb/clirap.h b/source3/libsmb/clirap.h index f7c059aeaf3..e64fc2bc61f 100644 --- a/source3/libsmb/clirap.h +++ b/source3/libsmb/clirap.h @@ -91,14 +91,14 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - off_t *size, uint16_t *pattr, + off_t *size, uint32_t *pattr, SMB_INO_T *ino); NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname, struct timespec *create_time, struct timespec *access_time, struct timespec *write_time, struct timespec *change_time, - off_t *size, uint16_t *pattr, + off_t *size, uint32_t *pattr, SMB_INO_T *ino); NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname, struct timespec *create_time, diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index 5b868c21954..14474ea316f 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -509,9 +509,10 @@ SMBC_getatr(SMBCCTX * context, &write_time_ts, &change_time_ts, &size, - &sattr, + &attr, &ino); if (NT_STATUS_IS_OK(status)) { + sattr = attr; goto setup_stat; } } |