]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r1965: add cli_setattrE (inspired by samba4-code). needed for further
authorGünther Deschner <gd@samba.org>
Fri, 20 Aug 2004 20:07:17 +0000 (20:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:25 +0000 (10:52 -0500)
migration-work. could someone possibly double-check the byte-count?

Guenther

source/libsmb/clifile.c

index 398c7cc4f0afa5290eb938f8c80e28b58b675ab8..ff0edc6bb4e40c1dcee02cddcdf197b53f773105 100644 (file)
@@ -982,6 +982,47 @@ BOOL cli_getatr(struct cli_state *cli, const char *fname,
        return True;
 }
 
+/****************************************************************************
+ 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.
 ****************************************************************************/