summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2004-08-20 20:07:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:25 -0500
commit3eb42d3b6e64c817396ee4391e0dcaacc5db0029 (patch)
treef652bb235027fa6e7ff8a0be92a85b42be10ea90
parent455bc1db4113ed8248cb8d7f41a30899f5aace81 (diff)
downloadsamba-3eb42d3b6e64c817396ee4391e0dcaacc5db0029.tar.gz
samba-3eb42d3b6e64c817396ee4391e0dcaacc5db0029.tar.bz2
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)
-rw-r--r--source3/libsmb/clifile.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 398c7cc4f0..ff0edc6bb4 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.
****************************************************************************/