From: Jeremy Allison Date: Thu, 4 Jun 2020 04:23:21 +0000 (-0700) Subject: s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned... X-Git-Tag: ldb-2.2.0~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7e3a003967ba50e2eeb311fd5e8ac5f641064c4;p=thirdparty%2Fsamba.git s3: torture: Add simple tests to samba3.base.attr to check INVALID_PARAMETER returned on SMB1 out-of-range attribute use. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 00fc7529c50..ce9c56056f5 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -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));