diff options
author | Jeremy Allison <jra@samba.org> | 2001-03-29 02:58:47 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-03-29 02:58:47 +0000 |
commit | 34508053bfeba53ec91f5dbf18874c5078e146c9 (patch) | |
tree | 8ead034d7ca9d716a3c5201e7617cd9ff9591d77 /source3/libsmb/clifile.c | |
parent | 1b95784324cd518d166cc790d9b1cf8a7905aed6 (diff) | |
download | samba-34508053bfeba53ec91f5dbf18874c5078e146c9.tar.gz samba-34508053bfeba53ec91f5dbf18874c5078e146c9.tar.xz samba-34508053bfeba53ec91f5dbf18874c5078e146c9.zip |
Added cli_nt_delete_on_close() call to allow flag to be set for torture tests.
Jeremy.
(This used to be commit 6f7d9e29e4d3a17254ff0ae20c0da63eacded7fe)
Diffstat (limited to 'source3/libsmb/clifile.c')
-rw-r--r-- | source3/libsmb/clifile.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index bae07d34e65..e90bd7c41fa 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -164,6 +164,47 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname) } return True; + Set or clear the delete on close flag. +****************************************************************************/ + +int cli_nt_delete_on_close(struct cli_state *cli, int fnum, BOOL flag) +{ + int data_len = 1; + int param_len = 6; + uint16 setup = TRANSACT2_SETFILEINFO; + pstring param; + unsigned char data; + char *rparam=NULL, *rdata=NULL; + + memset(param, 0, param_len); + SSVAL(param,0,fnum); + SSVAL(param,2,SMB_SET_FILE_DISPOSITION_INFO); + + data = flag ? 1 : 0; + + if (!cli_send_trans(cli, SMBtrans2, + NULL, 0, /* name, length */ + -1, 0, /* fid, flags */ + &setup, 1, 0, /* setup, length, max */ + param, param_len, 2, /* param, length, max */ + &data, data_len, cli->max_xmit /* data, length, max */ + )) { + return False; + } + + if (!cli_receive_trans(cli, SMBtrans2, + &rparam, ¶m_len, + &rdata, &data_len)) { + return False; + } + + if (rdata) free(rdata); + if (rparam) free(rparam); + + return True; +} + +/**************************************************************************** } /**************************************************************************** |