1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: libsmb: Change cli_getattrE() 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>
This commit is contained in:
Jeremy Allison 2020-06-03 13:00:56 -07:00
parent b34107f98c
commit e2726bed8d
5 changed files with 10 additions and 22 deletions

View File

@ -1186,8 +1186,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
status = cli_qfileinfo_basic(targetcli, fnum, &attr, &size, NULL, NULL,
NULL, NULL, NULL);
if (!NT_STATUS_IS_OK(status)) {
uint16_t sattr = 0;
status = cli_getattrE(targetcli, fnum, &sattr, &size, NULL, NULL,
status = cli_getattrE(targetcli, fnum, &attr, &size, NULL, NULL,
NULL);
if(!NT_STATUS_IS_OK(status)) {
d_printf("getattrib: %s\n", nt_errstr(status));
@ -1196,7 +1195,6 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
}
return 1;
}
attr = sattr;
}
DEBUG(1,("getting file %s of size %.0f as %s ",

View File

@ -4050,7 +4050,7 @@ static void cli_getattrE_done(struct tevent_req *subreq);
struct cli_getattrE_state {
uint16_t vwv[1];
int zone_offset;
uint16_t attr;
uint32_t attr;
off_t size;
time_t change_time;
time_t access_time;
@ -4110,7 +4110,7 @@ static void cli_getattrE_done(struct tevent_req *subreq)
}
NTSTATUS cli_getattrE_recv(struct tevent_req *req,
uint16_t *pattr,
uint32_t *pattr,
off_t *size,
time_t *change_time,
time_t *access_time,
@ -4143,7 +4143,7 @@ NTSTATUS cli_getattrE_recv(struct tevent_req *req,
NTSTATUS cli_getattrE(struct cli_state *cli,
uint16_t fnum,
uint16_t *pattr,
uint32_t *pattr,
off_t *size,
time_t *change_time,
time_t *access_time,
@ -4155,21 +4155,13 @@ NTSTATUS cli_getattrE(struct cli_state *cli,
NTSTATUS status = NT_STATUS_OK;
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
uint32_t attr = 0;
status = cli_smb2_getattrE(cli,
return cli_smb2_getattrE(cli,
fnum,
&attr,
pattr,
size,
change_time,
access_time,
write_time);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
if (pattr != NULL) {
*pattr = attr;
}
return status;
}
frame = talloc_stackframe();

View File

@ -299,9 +299,8 @@ SMBC_fstat_ctx(SMBCCTX *context,
&change_time_ts,
&ino))) {
time_t change_time, access_time, write_time;
uint16_t sattr = 0;
if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd, &sattr, &size,
if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd, &attr, &size,
&change_time, &access_time, &write_time))) {
errno = EINVAL;
TALLOC_FREE(frame);
@ -310,7 +309,6 @@ SMBC_fstat_ctx(SMBCCTX *context,
change_time_ts = convert_time_t_to_timespec(change_time);
access_time_ts = convert_time_t_to_timespec(access_time);
write_time_ts = convert_time_t_to_timespec(write_time);
attr = sattr;
}
setup_stat(st,

View File

@ -518,14 +518,14 @@ struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
struct cli_state *cli,
uint16_t fnum);
NTSTATUS cli_getattrE_recv(struct tevent_req *req,
uint16_t *pattr,
uint32_t *pattr,
off_t *size,
time_t *change_time,
time_t *access_time,
time_t *write_time);
NTSTATUS cli_getattrE(struct cli_state *cli,
uint16_t fnum,
uint16_t *pattr,
uint32_t *pattr,
off_t *size,
time_t *change_time,
time_t *access_time,

View File

@ -165,7 +165,7 @@ NTSTATUS net_copy_fileattr(struct net_context *c,
uint16_t fnum_src = 0;
uint16_t fnum_dst = 0;
struct security_descriptor *sd = NULL;
uint16_t attr;
uint32_t attr;
time_t f_atime, f_ctime, f_mtime;
if (!copy_timestamps && !copy_acls && !copy_attrs)