1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-11 00:23:51 +03:00

libsmb: Remove cli_getattrE() fallback from cli_qfileinfo_basic() users

cli_qfileinfo_basic() now takes care of this centrally

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke
2020-06-04 08:43:49 +02:00
committed by Jeremy Allison
parent 1a14d8cf7e
commit 29866ad7b2
3 changed files with 11 additions and 32 deletions

View File

@@ -1186,16 +1186,12 @@ 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)) {
status = cli_getattrE(targetcli, fnum, &attr, &size, NULL, NULL,
NULL);
if(!NT_STATUS_IS_OK(status)) {
d_printf("getattrib: %s\n", nt_errstr(status));
if (newhandle) {
close(handle);
}
return 1;
}
}
DEBUG(1,("getting file %s of size %.0f as %s ",
rname, (double)size, lname));
@@ -1994,11 +1990,7 @@ static int do_put(const char *rname, const char *lname, bool reput)
if (!NT_STATUS_IS_OK(status = cli_qfileinfo_basic(
targetcli, fnum, NULL,
&start, NULL, NULL,
NULL, NULL, NULL)) &&
!NT_STATUS_IS_OK(status = cli_getattrE(
targetcli, fnum, NULL,
&start, NULL, NULL,
NULL))) {
NULL, NULL, NULL))) {
d_printf("getattrib: %s\n", nt_errstr(status));
return 1;
}

View File

@@ -715,14 +715,9 @@ SMBC_lseek_ctx(SMBCCTX *context,
file->targetcli, file->cli_fd, NULL,
&size, NULL, NULL, NULL, NULL,
NULL))) {
off_t b_size = size;
if (!NT_STATUS_IS_OK(cli_getattrE(file->targetcli, file->cli_fd,
NULL, &b_size, NULL, NULL, NULL))) {
errno = EINVAL;
TALLOC_FREE(frame);
return -1;
} else
size = b_size;
}
file->offset = size + offset;
break;

View File

@@ -298,18 +298,10 @@ SMBC_fstat_ctx(SMBCCTX *context,
&write_time_ts,
&change_time_ts,
&ino))) {
time_t change_time, access_time, write_time;
if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd, &attr, &size,
&change_time, &access_time, &write_time))) {
errno = EINVAL;
TALLOC_FREE(frame);
return -1;
}
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);
}
setup_stat(st,
path,