summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-23 14:40:19 -0800
committerTim Prouty <tprouty@samba.org>2009-01-23 21:05:38 -0800
commit48b0016cff4bad621b94fc0bf678ec15260dd7d7 (patch)
tree960f825709d1a8eb2af5fb0afb31553262ee290f /source3/torture
parent7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3 (diff)
downloadsamba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.gz
samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.tar.bz2
samba-48b0016cff4bad621b94fc0bf678ec15260dd7d7.zip
Extend NTIMES to allow setting create_time
1) Add in smb_file_time struct to clarify code and make room for createtime. 2) Get and set create time from SMB messages. 3) Fixup existing VFS modules + examples Some OS'es allow for the setting of the birthtime through kernel interfaces. This value is generically used for Windows createtime, but is not settable in the code today.
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/cmd_vfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index d984dd661c..31eb27b756 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -795,14 +795,17 @@ static NTSTATUS cmd_getwd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
- struct timespec ts[2];
+ struct smb_file_time ft;
if (argc != 4) {
printf("Usage: utime <path> <access> <modify>\n");
return NT_STATUS_OK;
}
- ts[0] = convert_time_t_to_timespec(atoi(argv[2]));
- ts[1] = convert_time_t_to_timespec(atoi(argv[3]));
- if (SMB_VFS_NTIMES(vfs->conn, argv[1], ts) != 0) {
+
+ ZERO_STRUCT(ft);
+
+ ft.atime = convert_time_t_to_timespec(atoi(argv[2]));
+ ft.mtime = convert_time_t_to_timespec(atoi(argv[3]));
+ if (SMB_VFS_NTIMES(vfs->conn, argv[1], &ft) != 0) {
printf("utime: error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;
}