summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-02-21 04:25:17 +0000
committerAndrew Tridgell <tridge@samba.org>2002-02-21 04:25:17 +0000
commit0cbcf49f6cfb91a7251baa5339795436308578ea (patch)
tree6fb64a7cbe47f3b0b66b9f6cbe5c12eb9afcecb9
parent84b18178a99b4eeb081f09ce4bd09428ad57b5a2 (diff)
downloadsamba-0cbcf49f6cfb91a7251baa5339795436308578ea.tar.gz
samba-0cbcf49f6cfb91a7251baa5339795436308578ea.tar.bz2
samba-0cbcf49f6cfb91a7251baa5339795436308578ea.zip
added cli_qfilename(), used in trans2 torture test
(This used to be commit d37905f20397911e4f74e672ebdee28f1ddf3c2c)
-rw-r--r--source3/libsmb/clirap.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 1cbadb4344..a2b6c8bb8b 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -515,6 +515,49 @@ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
/****************************************************************************
+send a qfileinfo QUERY_FILE_NAME_INFO call
+****************************************************************************/
+BOOL cli_qfilename(struct cli_state *cli, int fnum,
+ pstring name)
+{
+ int data_len = 0;
+ int param_len = 0;
+ uint16 setup = TRANSACT2_QFILEINFO;
+ pstring param;
+ char *rparam=NULL, *rdata=NULL;
+
+ param_len = 4;
+ memset(param, 0, param_len);
+ SSVAL(param, 0, fnum);
+ SSVAL(param, 2, SMB_QUERY_FILE_NAME_INFO);
+
+ if (!cli_send_trans(cli, SMBtrans2,
+ NULL, /* name */
+ -1, 0, /* fid, flags */
+ &setup, 1, 0, /* setup, length, max */
+ param, param_len, 2, /* param, length, max */
+ NULL, data_len, cli->max_xmit /* data, length, max */
+ )) {
+ return False;
+ }
+
+ if (!cli_receive_trans(cli, SMBtrans2,
+ &rparam, &param_len,
+ &rdata, &data_len)) {
+ return False;
+ }
+
+ if (!rdata || data_len < 4) {
+ return False;
+ }
+
+ clistr_pull(cli, name, rdata+4, sizeof(pstring), IVAL(rdata, 0), STR_UNICODE);
+
+ return True;
+}
+
+
+/****************************************************************************
send a qfileinfo call
****************************************************************************/
BOOL cli_qfileinfo(struct cli_state *cli, int fnum,