diff options
Diffstat (limited to 'source/torture')
-rw-r--r-- | source/torture/cmd_vfs.c | 8 | ||||
-rw-r--r-- | source/torture/nsstest.c | 6 | ||||
-rw-r--r-- | source/torture/torture.c | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/source/torture/cmd_vfs.c b/source/torture/cmd_vfs.c index 6cecd693f83..455ca1c82c7 100644 --- a/source/torture/cmd_vfs.c +++ b/source/torture/cmd_vfs.c @@ -783,14 +783,14 @@ 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 utimbuf times; + struct timespec ts[2]; if (argc != 4) { printf("Usage: utime <path> <access> <modify>\n"); return NT_STATUS_OK; } - times.actime = atoi(argv[2]); - times.modtime = atoi(argv[3]); - if (SMB_VFS_UTIME(vfs->conn, argv[1], ×) != 0) { + 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) { printf("utime: error=%d (%s)\n", errno, strerror(errno)); return NT_STATUS_UNSUCCESSFUL; } diff --git a/source/torture/nsstest.c b/source/torture/nsstest.c index 4b894fbfc34..121679ed8cc 100644 --- a/source/torture/nsstest.c +++ b/source/torture/nsstest.c @@ -229,12 +229,15 @@ again: goto again; } if (status == NSS_STATUS_NOTFOUND) { + SAFE_FREE(buf); return NULL; } if (status != NSS_STATUS_SUCCESS) { report_nss_error("getgrnam", status); + SAFE_FREE(buf); return NULL; } + SAFE_FREE(buf); return &grp; } @@ -266,12 +269,15 @@ again: goto again; } if (status == NSS_STATUS_NOTFOUND) { + SAFE_FREE(buf); return NULL; } if (status != NSS_STATUS_SUCCESS) { report_nss_error("getgrgid", status); + SAFE_FREE(buf); return NULL; } + SAFE_FREE(buf); return &grp; } diff --git a/source/torture/torture.c b/source/torture/torture.c index 79444946122..5ab28438f21 100644 --- a/source/torture/torture.c +++ b/source/torture/torture.c @@ -4479,6 +4479,7 @@ static BOOL run_eatest(int dummy) printf("starting eatest\n"); if (!torture_open_connection(&cli, 0)) { + talloc_destroy(mem_ctx); return False; } @@ -4490,6 +4491,7 @@ static BOOL run_eatest(int dummy) if (fnum == -1) { printf("open failed - %s\n", cli_errstr(cli)); + talloc_destroy(mem_ctx); return False; } @@ -4500,6 +4502,7 @@ static BOOL run_eatest(int dummy) memset(ea_val, (char)i+1, i+1); if (!cli_set_ea_fnum(cli, fnum, ea_name, ea_val, i+1)) { printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli)); + talloc_destroy(mem_ctx); return False; } } @@ -4512,6 +4515,7 @@ static BOOL run_eatest(int dummy) memset(ea_val, (char)i+1, i+1); if (!cli_set_ea_path(cli, fname, ea_name, ea_val, i+1)) { printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli)); + talloc_destroy(mem_ctx); return False; } } @@ -4545,6 +4549,7 @@ static BOOL run_eatest(int dummy) slprintf(ea_name, sizeof(ea_name), "ea_%d", i); if (!cli_set_ea_path(cli, fname, ea_name, "", 0)) { printf("ea_set of name %s failed - %s\n", ea_name, cli_errstr(cli)); + talloc_destroy(mem_ctx); return False; } } |