summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-01-23 14:55:11 +0100
committerVolker Lendecke <vl@samba.org>2010-01-23 16:28:11 +0100
commit397a6faed9061a6b814cc173cfe4056947ad88aa (patch)
treef658fa4071422f460d7f0c20da49be9f65fca00a /source3/torture
parent1fbeae41655b8305834f2149b1268077eba8633d (diff)
downloadsamba-397a6faed9061a6b814cc173cfe4056947ad88aa.tar.gz
samba-397a6faed9061a6b814cc173cfe4056947ad88aa.tar.bz2
samba-397a6faed9061a6b814cc173cfe4056947ad88aa.zip
s3: Add a little torture test for dom_sid_parse
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c18
1 files changed, 18 insertions, 0 deletions
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}};