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 status = NT_STATUS_OK;
uint64_t pos;
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
- status = cli_qpathinfo2(cli, fname,
+ /*
+ * NB. cli_qpathinfo2() checks pattr is valid before
+ * storing a value into it, so we don't need to use
+ * an intermediate attr variable as below but can
+ * pass pattr directly.
+ */
+ return cli_qpathinfo2(cli, fname,
create_time, access_time, write_time, change_time,
- size, &attr, ino);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- if (pattr != NULL) {
- *pattr = attr;
- }
- return status;
+ size, pattr, ino);
}
if (create_time || access_time || write_time || change_time || pattr) {
+ /*
+ * cli_qpathinfo_basic() always indirects the passed
+ * in pointers so we use intermediate variables to
+ * collect all of them before assigning any requested
+ * below.
+ */
status = cli_qpathinfo_basic(cli, fname, &st, &attr);
if (!NT_STATUS_IS_OK(status)) {
return status;
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 tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
char *fixedpath = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
- uint16_t sattr = 0;
uint32_t attr = 0;
off_t size = 0;
struct timespec create_time_ts = {0};
&attr,
&ino);
if (NT_STATUS_IS_OK(status)) {
- sattr = attr;
goto setup_stat;
}
}
&write_time_ts,
&change_time_ts,
&size,
- &sattr,
+ &attr,
&ino);
if (NT_STATUS_IS_OK(status)) {
goto setup_stat;
convert_time_t_to_timespec(write_time);
access_time_ts = change_time_ts = write_time_ts = w_time_ts;
- sattr = attr;
goto setup_stat;
}
setup_stat(sb,
path,
size,
- sattr,
+ attr,
ino,
srv->dev,
access_time_ts,