r14938: add smbcli_fsetatr() as a convenient interface to a setfileinfo for
authorAndrew Tridgell <tridge@samba.org>
Thu, 6 Apr 2006 03:31:31 +0000 (03:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:00:20 +0000 (14:00 -0500)
torture testing. Used by RAW-NOTIFY.
(This used to be commit 517db1b1b0061be57c67ea02d42000fb8ace844d)

source4/libcli/clifile.c

index cc0c14a2e8412f068a9d4632dce5a77bade78f84..3acd215f3ea9a910a14a5a0631a64742d25071cb 100644 (file)
@@ -588,6 +588,29 @@ NTSTATUS smbcli_setatr(struct smbcli_tree *tree, const char *fname, uint16_t mod
        return status;
 }
 
+/****************************************************************************
+ Do a setfileinfo basic_info call.
+****************************************************************************/
+NTSTATUS smbcli_fsetatr(struct smbcli_tree *tree, int fnum, uint16_t mode, 
+                       NTTIME create_time, NTTIME access_time, 
+                       NTTIME write_time, NTTIME change_time)
+{
+       union smb_setfileinfo parms;
+       NTSTATUS status;
+
+       parms.basic_info.level = RAW_SFILEINFO_BASIC_INFO;
+       parms.basic_info.in.file.fnum = fnum;
+       parms.basic_info.in.attrib = mode;
+       parms.basic_info.in.create_time = create_time;
+       parms.basic_info.in.access_time = access_time;
+       parms.basic_info.in.write_time = write_time;
+       parms.basic_info.in.change_time = change_time;
+       
+       status = smb_raw_setfileinfo(tree, &parms);
+
+       return status;
+}
+
 
 /****************************************************************************
  Check for existence of a dir.