summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-08-13 16:04:21 +0000
committerAndrew Tridgell <tridge@samba.org>2003-08-13 16:04:21 +0000
commit75c0125fb71b0562e7bdd85c391764796b5f12f6 (patch)
treeb589d2e6bbc2c517a3f79790d0ed309ef79f7507 /source4/libcli/raw
parenta3b86fe170beb70ffab8585a276ca1648fffd454 (diff)
downloadsamba-75c0125fb71b0562e7bdd85c391764796b5f12f6.tar.gz
samba-75c0125fb71b0562e7bdd85c391764796b5f12f6.tar.bz2
samba-75c0125fb71b0562e7bdd85c391764796b5f12f6.zip
- added SMBntrename test suite
- allow username of form DOMAIN\username or DOMAIN/username - added ntrename to gentest (This used to be commit 2b464472c17b791eb5b117f89d5aaea2bf60f6ad)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/rawfile.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 279dfcf0c1..57b6ded66f 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -32,16 +32,27 @@
Rename a file - async interface
****************************************************************************/
struct cli_request *smb_raw_rename_send(struct cli_tree *tree,
- struct smb_rename *parms)
+ union smb_rename *parms)
{
struct cli_request *req;
- SETUP_REQUEST(SMBmv, 1, 0);
-
- SSVAL(req->out.vwv, VWV(0), parms->in.attrib);
-
- cli_req_append_ascii4(req, parms->in.pattern1, STR_TERMINATE);
- cli_req_append_ascii4(req, parms->in.pattern2, STR_TERMINATE);
+ switch (parms->generic.level) {
+ case RAW_RENAME_RENAME:
+ SETUP_REQUEST(SMBmv, 1, 0);
+ SSVAL(req->out.vwv, VWV(0), parms->rename.in.attrib);
+ cli_req_append_ascii4(req, parms->rename.in.pattern1, STR_TERMINATE);
+ cli_req_append_ascii4(req, parms->rename.in.pattern2, STR_TERMINATE);
+ break;
+
+ case RAW_RENAME_NTRENAME:
+ SETUP_REQUEST(SMBntrename, 4, 0);
+ SSVAL(req->out.vwv, VWV(0), parms->ntrename.in.attrib);
+ SSVAL(req->out.vwv, VWV(1), parms->ntrename.in.flags);
+ SIVAL(req->out.vwv, VWV(2), parms->ntrename.in.root_fid);
+ cli_req_append_ascii4(req, parms->ntrename.in.old_name, STR_TERMINATE);
+ cli_req_append_ascii4(req, parms->ntrename.in.new_name, STR_TERMINATE);
+ break;
+ }
if (!cli_request_send(req)) {
cli_request_destroy(req);
@@ -55,7 +66,7 @@ struct cli_request *smb_raw_rename_send(struct cli_tree *tree,
Rename a file - sync interface
****************************************************************************/
NTSTATUS smb_raw_rename(struct cli_tree *tree,
- struct smb_rename *parms)
+ union smb_rename *parms)
{
struct cli_request *req = smb_raw_rename_send(tree, parms);
return cli_request_simple_recv(req);