s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned...
authorJeremy Allison <jra@samba.org>
Thu, 4 Jun 2020 04:23:21 +0000 (21:23 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 4 Jun 2020 17:11:39 +0000 (17:11 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/torture/torture.c

index 00fc7529c500954a921917e7a9d25534802534c1..ce9c56056f510cdd7d3b4bedfb0f15e137e2d1b3 100644 (file)
@@ -4015,6 +4015,13 @@ static bool run_attrtest(int dummy)
                return False;
        }
 
+       /* Ensure we can't unlink with out-of-range (unknown) attribute. */
+       status = cli_unlink(cli, fname, 0x20000);
+       if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) {
+               correct = false;
+               goto out;
+       }
+
        cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
        cli_openx(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
@@ -4035,6 +4042,13 @@ static bool run_attrtest(int dummy)
 
        t2 = t-60*60*24; /* 1 day ago */
 
+       /* Ensure we can't set with out-of-range (unknown) attribute. */
+       status = cli_setatr(cli, fname, 0x20000, t2);
+       if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) {
+               correct = false;
+               goto out;
+       }
+
        status = cli_setatr(cli, fname, 0, t2);
        if (!NT_STATUS_IS_OK(status)) {
                printf("setatr failed (%s)\n", nt_errstr(status));