diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-23 17:29:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:44 -0500 |
commit | e57fd2c5f00de2b11a2b44374830e89a90bc0022 (patch) | |
tree | ce50b5d4e2bfe760fb5d5ff2750ceb2605002ea1 /source/libsmb/clirap.c | |
parent | 00738dca3b07083c91545910486a1f30f2b17281 (diff) | |
download | samba-e57fd2c5f00de2b11a2b44374830e89a90bc0022.tar.gz samba-e57fd2c5f00de2b11a2b44374830e89a90bc0022.tar.xz samba-e57fd2c5f00de2b11a2b44374830e89a90bc0022.zip |
r5518: Add initial msdfs support to smbclient. Currently I can only
cd up and down the tree and get directory listings.
Still have to figure out how to get a directory listing on a
2k dfs root. Also have to work out some issues with relative paths
that cross dfs mount points.
We're protected from the new code paths when connecting to
a non-dfs root share ( the flag from the tcon&X is stored
in the struct cli_state* )
Diffstat (limited to 'source/libsmb/clirap.c')
-rw-r--r-- | source/libsmb/clirap.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/source/libsmb/clirap.c b/source/libsmb/clirap.c index 8cc5d8bf901..6ede1b2b53a 100644 --- a/source/libsmb/clirap.c +++ b/source/libsmb/clirap.c @@ -1,7 +1,8 @@ /* Unix SMB/CIFS implementation. client RAP calls - Copyright (C) Andrew Tridgell 1994-1998 + Copyright (C) Andrew Tridgell 1994-1998 + Copyright (C) Gerald (Jerry) Carter 2004 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -641,9 +642,65 @@ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, return True; } + +/**************************************************************************** +send a qpathinfo BASIC_INFO call +****************************************************************************/ +BOOL cli_qpathinfo_basic( struct cli_state *cli, const char *name, + SMB_STRUCT_STAT *sbuf, uint32 *attributes ) +{ + unsigned int param_len = 0; + unsigned int data_len = 0; + uint16 setup = TRANSACT2_QPATHINFO; + char param[sizeof(pstring)+6]; + char *rparam=NULL, *rdata=NULL; + char *p; + + p = param; + memset(p, 0, 6); + SSVAL(p, 0, SMB_QUERY_FILE_BASIC_INFO); + p += 6; + p += clistr_push(cli, p, name, sizeof(pstring)-6, STR_TERMINATE); + param_len = PTR_DIFF(p, param); + + 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, 0, cli->max_xmit /* data, length, max */ + )) { + return False; + } + + if (!cli_receive_trans(cli, SMBtrans2, + &rparam, ¶m_len, + &rdata, &data_len)) { + return False; + } + + if (data_len < 36) { + SAFE_FREE(rdata); + SAFE_FREE(rparam); + return False; + } + + sbuf->st_atime = interpret_long_date( rdata+8 ); + sbuf->st_mtime = interpret_long_date( rdata+16 ); + sbuf->st_ctime = interpret_long_date( rdata+24 ); + + *attributes = IVAL( rdata, 32 ); + + SAFE_FREE(rparam); + SAFE_FREE(rdata); + + return True; +} + /**************************************************************************** send a qfileinfo call ****************************************************************************/ + BOOL cli_qfileinfo_test(struct cli_state *cli, int fnum, int level, char **poutdata, uint32 *poutlen) { unsigned int data_len = 0; |