From 397a6faed9061a6b814cc173cfe4056947ad88aa Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 23 Jan 2010 14:55:11 +0100 Subject: s3: Add a little torture test for dom_sid_parse --- source3/script/tests/test_smbtorture_s3.sh | 1 + source3/torture/torture.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh index 774ca94833..1cbfc23554 100755 --- a/source3/script/tests/test_smbtorture_s3.sh +++ b/source3/script/tests/test_smbtorture_s3.sh @@ -33,6 +33,7 @@ tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K" tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE CHAIN1" tests="$tests GETADDRINFO POSIX UID-REGRESSION-TEST SHORTNAME-TEST" tests="$tests LOCAL-BASE64 LOCAL-GENCACHE POSIX-APPEND" +tests="$tests LOCAL-dom_sid_parse" skipped1="RANDOMIPC NEGNOWAIT NBENCH ERRMAPEXTRACT TRANS2SCAN NTTRANSSCAN" skipped2="DENY1 DENY2 OPENATTR CASETABLE EATEST" diff --git a/source3/torture/torture.c b/source3/torture/torture.c index c7a69ae403..758bb60beb 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -21,6 +21,7 @@ #include "includes.h" #include "nsswitch/libwbclient/wbc_async.h" #include "torture/proto.h" +#include "libcli/security/dom_sid.h" extern char *optarg; extern int optind; @@ -6670,6 +6671,22 @@ static bool run_local_talloc_dict(int dummy) return true; } +static bool run_local_dom_sid_parse(int dummy) { + struct dom_sid sid; + + if (dom_sid_parse("S--1-5-32-545", &sid)) { + return false; + } + if (dom_sid_parse("S-1-5-32-+545", &sid)) { + return false; + } + if (dom_sid_parse("S-1-2-3-4-5-6-7-8-9-0-1-2-3-4-5-6-7-8-9-0", &sid)) { + return false; + } + + return true; +} + /* Split a path name into filename and stream name components. Canonicalise * such that an implicit $DATA token is always explicit. * @@ -7228,6 +7245,7 @@ static struct { { "LOCAL-MEMCACHE", run_local_memcache, 0}, { "LOCAL-STREAM-NAME", run_local_stream_name, 0}, { "LOCAL-WBCLIENT", run_local_wbclient, 0}, + { "LOCAL-dom_sid_parse", run_local_dom_sid_parse, 0}, {NULL, NULL, 0}}; -- cgit