summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-02 13:39:20 -0700
committerTim Prouty <tprouty@samba.org>2009-07-06 15:38:42 -0700
commit3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5 (patch)
tree22777dd2e4d6db9f30b19275a91a9dd3c21a2fbf /source3/torture
parentf39232a8fb93cfccfe1533ab613867572ff7f848 (diff)
downloadsamba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.tar.gz
samba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.tar.bz2
samba-3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5.zip
s3: Plumb smb_filename through SMB_VFS_NTIMES
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/cmd_vfs.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index e6a3940f4f..33ced8fa54 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -903,6 +903,9 @@ 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 smb_file_time ft;
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
+
if (argc != 4) {
printf("Usage: utime <path> <access> <modify>\n");
return NT_STATUS_OK;
@@ -912,11 +915,20 @@ static NTSTATUS cmd_utime(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
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) {
+
+ status = create_synthetic_smb_fname_split(mem_ctx, argv[1],
+ NULL, &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (SMB_VFS_NTIMES(vfs->conn, smb_fname, &ft) != 0) {
printf("utime: error=%d (%s)\n", errno, strerror(errno));
+ TALLOC_FREE(smb_fname);
return NT_STATUS_UNSUCCESSFUL;
}
+ TALLOC_FREE(smb_fname);
printf("utime: ok\n");
return NT_STATUS_OK;
}