summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-10-23 22:37:16 +0200
committerVolker Lendecke <vl@samba.org>2010-10-24 11:39:30 +0200
commitc095809c0464cd174e0993d8c32434d6f3733342 (patch)
treefa252edc75dc3c39c8668232b85fc52a5e11ba8f /source3/libsmb
parentd864b1bace0038b86cb393ca811dcce2e938bebd (diff)
downloadsamba-c095809c0464cd174e0993d8c32434d6f3733342.tar.gz
samba-c095809c0464cd174e0993d8c32434d6f3733342.tar.bz2
samba-c095809c0464cd174e0993d8c32434d6f3733342.zip
s3: Convert cli_qfileinfo_basic to cli_qfileinfo
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clirap.c47
-rw-r--r--source3/libsmb/libsmb_file.c7
-rw-r--r--source3/libsmb/libsmb_stat.c17
3 files changed, 31 insertions, 40 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 0b141d7497..17311ddb4e 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -1122,41 +1122,30 @@ NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name,
Send a qfileinfo call.
****************************************************************************/
-bool cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
- uint16 *mode, SMB_OFF_T *size,
- struct timespec *create_time,
- struct timespec *access_time,
- struct timespec *write_time,
- struct timespec *change_time,
- SMB_INO_T *ino)
+NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
+ uint16 *mode, SMB_OFF_T *size,
+ struct timespec *create_time,
+ struct timespec *access_time,
+ struct timespec *write_time,
+ struct timespec *change_time,
+ SMB_INO_T *ino)
{
- uint32_t data_len = 0;
- uint16 setup;
- uint8_t param[4];
- uint8_t *rdata=NULL;
+ uint8_t *rdata;
+ uint32_t num_rdata;
NTSTATUS status;
/* if its a win95 server then fail this - win95 totally screws it
up */
- if (cli->win95) return False;
-
- SSVAL(param, 0, fnum);
- SSVAL(param, 2, SMB_QUERY_FILE_ALL_INFO);
-
- SSVAL(&setup, 0, TRANSACT2_QFILEINFO);
-
- status = cli_trans(talloc_tos(), cli, SMBtrans2,
- NULL, -1, 0, 0, /* name, fid, function, flags */
- &setup, 1, 0, /* setup, length, max */
- param, 4, 2, /* param, length, max */
- NULL, 0, MIN(cli->max_xmit, 0xffff), /* data, length, max */
- NULL, /* recv_flags2 */
- NULL, 0, NULL, /* rsetup, length */
- NULL, 0, NULL, /* rparam, length */
- &rdata, 68, &data_len);
+ if (cli->win95) {
+ return NT_STATUS_NOT_SUPPORTED;
+ }
+ status = cli_qfileinfo(talloc_tos(), cli, fnum,
+ SMB_QUERY_FILE_ALL_INFO,
+ 68, MIN(cli->max_xmit, 0xffff),
+ &rdata, &num_rdata);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
if (create_time) {
@@ -1182,7 +1171,7 @@ bool cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
}
TALLOC_FREE(rdata);
- return True;
+ return NT_STATUS_OK;
}
/****************************************************************************
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 1a44f0e9af..6b08b61c2e 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -730,9 +730,10 @@ SMBC_lseek_ctx(SMBCCTX *context,
}
/*d_printf(">>>lseek: resolved path as %s\n", targetpath);*/
- if (!cli_qfileinfo_basic(targetcli, file->cli_fd, NULL,
- &size, NULL, NULL, NULL, NULL, NULL))
- {
+ if (!NT_STATUS_IS_OK(cli_qfileinfo_basic(
+ targetcli, file->cli_fd, NULL,
+ &size, NULL, NULL, NULL, NULL,
+ NULL))) {
SMB_OFF_T b_size = size;
if (!NT_STATUS_IS_OK(cli_getattrE(targetcli, file->cli_fd,
NULL, &b_size, NULL, NULL, NULL))) {
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index fd390017c6..0f64502409 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/libsmb/libsmb_stat.c
@@ -250,8 +250,8 @@ SMBC_fstat_ctx(SMBCCTX *context,
/*d_printf(">>>fstat: resolving %s\n", path);*/
if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ file->srv->cli, path,
+ &targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
@@ -259,12 +259,13 @@ SMBC_fstat_ctx(SMBCCTX *context,
}
/*d_printf(">>>fstat: resolved path as %s\n", targetpath);*/
- if (!cli_qfileinfo_basic(targetcli, file->cli_fd, &mode, &size,
- NULL,
- &access_time_ts,
- &write_time_ts,
- &change_time_ts,
- &ino)) {
+ if (!NT_STATUS_IS_OK(cli_qfileinfo_basic(
+ targetcli, file->cli_fd, &mode, &size,
+ NULL,
+ &access_time_ts,
+ &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, &mode, &size,