From b89ab75cd6a77d2c069051f7bb174882cb5d1e68 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 26 Mar 2020 14:38:45 +0100 Subject: [PATCH] smbtorture3: Call cli_setpathinfo_ext() instead of .._basic() The timestamps were never looked at Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/torture/torture.c | 82 ++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 2ff735b3d22..562957a34b0 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4075,7 +4075,7 @@ static bool run_attrtest(int dummy) cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); - /* Check cli_setpathinfo_basic() */ + /* Check cli_setpathinfo_ext() */ /* Re-create the file. */ status = cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum); @@ -4086,17 +4086,18 @@ static bool run_attrtest(int dummy) } cli_close(cli, fnum); - status = cli_setpathinfo_basic(cli, - fname, - 0, /* create */ - 0, /* access */ - 0, /* write */ - 0, /* change */ - FILE_ATTRIBUTE_SYSTEM | - FILE_ATTRIBUTE_HIDDEN | - FILE_ATTRIBUTE_READONLY); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_setpathinfo_basic failed with %s\n", + status = cli_setpathinfo_ext( + cli, + fname, + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* create */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* access */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* write */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* change */ + FILE_ATTRIBUTE_SYSTEM | + FILE_ATTRIBUTE_HIDDEN | + FILE_ATTRIBUTE_READONLY); + if (!NT_STATUS_IS_OK(status)) { + printf("cli_setpathinfo_ext failed with %s\n", nt_errstr(status)); correct = false; } @@ -4112,15 +4113,16 @@ static bool run_attrtest(int dummy) } /* Setting to FILE_ATTRIBUTE_NORMAL should be ignored. */ - status = cli_setpathinfo_basic(cli, - fname, - 0, /* create */ - 0, /* access */ - 0, /* write */ - 0, /* change */ - FILE_ATTRIBUTE_NORMAL); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_setpathinfo_basic failed with %s\n", + status = cli_setpathinfo_ext( + cli, + fname, + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* create */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* access */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* write */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* change */ + FILE_ATTRIBUTE_NORMAL); + if (!NT_STATUS_IS_OK(status)) { + printf("cli_setpathinfo_ext failed with %s\n", nt_errstr(status)); correct = false; } @@ -4136,15 +4138,16 @@ static bool run_attrtest(int dummy) } /* Setting to (uint16_t)-1 should also be ignored. */ - status = cli_setpathinfo_basic(cli, - fname, - 0, /* create */ - 0, /* access */ - 0, /* write */ - 0, /* change */ - (uint16_t)-1); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_setpathinfo_basic failed with %s\n", + status = cli_setpathinfo_ext( + cli, + fname, + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* create */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* access */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* write */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* change */ + (uint16_t)-1); + if (!NT_STATUS_IS_OK(status)) { + printf("cli_setpathinfo_ext failed with %s\n", nt_errstr(status)); correct = false; } @@ -4160,15 +4163,16 @@ static bool run_attrtest(int dummy) } /* Setting to 0 should clear them all. */ - status = cli_setpathinfo_basic(cli, - fname, - 0, /* create */ - 0, /* access */ - 0, /* write */ - 0, /* change */ - 0); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_setpathinfo_basic failed with %s\n", + status = cli_setpathinfo_ext( + cli, + fname, + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* create */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* access */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* write */ + (struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* change */ + 0); + if (!NT_STATUS_IS_OK(status)) { + printf("cli_setpathinfo_ext failed with %s\n", nt_errstr(status)); correct = false; } -- 2.34.1