summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-02-20 21:31:16 +0100
committerVolker Lendecke <vl@samba.org>2010-02-20 21:35:03 +0100
commite38908ea65966387076b59352fd1ac6bccf13e33 (patch)
tree62cad499fddd2e40caa5b1e472a7da92849748c7 /source3/torture
parent1e8a84aac73f02ac6eec53b5a13ec31347070210 (diff)
downloadsamba-e38908ea65966387076b59352fd1ac6bccf13e33.tar.gz
samba-e38908ea65966387076b59352fd1ac6bccf13e33.tar.bz2
samba-e38908ea65966387076b59352fd1ac6bccf13e33.zip
s3: Rename LOCAL-dom_sid_parse to LOCAL-string_to_sid, add some tests
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 52cd016cb3..24aea3ceee 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -6757,22 +6757,34 @@ static bool run_local_talloc_dict(int dummy)
return true;
}
-static bool run_local_dom_sid_parse(int dummy) {
+static bool run_local_string_to_sid(int dummy) {
struct dom_sid sid;
- if (dom_sid_parse("S--1-5-32-545", &sid)) {
+ if (string_to_sid(&sid, "S--1-5-32-545")) {
printf("allowing S--1-5-32-545\n");
return false;
}
- if (dom_sid_parse("S-1-5-32-+545", &sid)) {
+ if (string_to_sid(&sid, "S-1-5-32-+545")) {
printf("allowing S-1-5-32-+545\n");
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)) {
+ if (string_to_sid(&sid, "S-1-2-3-4-5-6-7-8-9-0-1-2-3-4-5-6-7-8-9-0")) {
printf("allowing S-1-2-3-4-5-6-7-8-9-0-1-2-3-4-5-6-7-8-9-0\n");
return false;
}
-
+ if (string_to_sid(&sid, "S-1-5-32-545-abc")) {
+ printf("allowing S-1-5-32-545-abc\n");
+ return false;
+ }
+ if (!string_to_sid(&sid, "S-1-5-32-545")) {
+ printf("could not parse S-1-5-32-545\n");
+ return false;
+ }
+ if (!sid_equal(&sid, &global_sid_Builtin_Users)) {
+ printf("mis-parsed S-1-5-32-545 as %s\n",
+ sid_string_tos(&sid));
+ return false;
+ }
return true;
}
@@ -7464,7 +7476,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},
+ { "LOCAL-string_to_sid", run_local_string_to_sid, 0},
{ "LOCAL-DBTRANS", run_local_dbtrans, 0},
{NULL, NULL, 0}};