diff options
author | Günther Deschner <gd@samba.org> | 2004-08-20 20:07:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:25 -0500 |
commit | 3eb42d3b6e64c817396ee4391e0dcaacc5db0029 (patch) | |
tree | f652bb235027fa6e7ff8a0be92a85b42be10ea90 /source3/libsmb/clifile.c | |
parent | 455bc1db4113ed8248cb8d7f41a30899f5aace81 (diff) | |
download | samba-3eb42d3b6e64c817396ee4391e0dcaacc5db0029.tar.gz samba-3eb42d3b6e64c817396ee4391e0dcaacc5db0029.tar.xz samba-3eb42d3b6e64c817396ee4391e0dcaacc5db0029.zip |
r1965: add cli_setattrE (inspired by samba4-code). needed for further
migration-work. could someone possibly double-check the byte-count?
Guenther
(This used to be commit 27302905e88960d774c82eab6207ff6a918b0235)
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 398c7cc4f0a..ff0edc6bb4e 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -983,6 +983,47 @@ BOOL cli_getatr(struct cli_state *cli, const char *fname, } /**************************************************************************** + Do a SMBsetattrE call. +****************************************************************************/ + +BOOL cli_setattrE(struct cli_state *cli, int fd, + time_t c_time, time_t a_time, time_t m_time) + +{ + char *p; + + memset(cli->outbuf,'\0',smb_size); + memset(cli->inbuf,'\0',smb_size); + + set_message(cli->outbuf,7,0,True); + + SCVAL(cli->outbuf,smb_com,SMBsetattrE); + SSVAL(cli->outbuf,smb_tid,cli->cnum); + cli_setup_packet(cli); + + SSVAL(cli->outbuf,smb_vwv0, fd); + put_dos_date3(cli->outbuf,smb_vwv1, c_time); + put_dos_date3(cli->outbuf,smb_vwv3, a_time); + put_dos_date3(cli->outbuf,smb_vwv5, m_time); + + p = smb_buf(cli->outbuf); + *p++ = 4; + + cli_setup_bcc(cli, p); + + cli_send_smb(cli); + if (!cli_receive_smb(cli)) { + return False; + } + + if (cli_is_error(cli)) { + return False; + } + + return True; +} + +/**************************************************************************** Do a SMBsetatr call. ****************************************************************************/ |