diff options
author | Volker Lendecke <vl@samba.org> | 2010-01-23 14:55:11 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-01-23 16:28:11 +0100 |
commit | 397a6faed9061a6b814cc173cfe4056947ad88aa (patch) | |
tree | f658fa4071422f460d7f0c20da49be9f65fca00a /source3 | |
parent | 1fbeae41655b8305834f2149b1268077eba8633d (diff) | |
download | samba-397a6faed9061a6b814cc173cfe4056947ad88aa.tar.gz samba-397a6faed9061a6b814cc173cfe4056947ad88aa.tar.bz2 samba-397a6faed9061a6b814cc173cfe4056947ad88aa.zip |
s3: Add a little torture test for dom_sid_parse
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_smbtorture_s3.sh | 1 | ||||
-rw-r--r-- | source3/torture/torture.c | 18 |
2 files changed, 19 insertions, 0 deletions
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}}; |