s3: Rename LOCAL-dom_sid_parse to LOCAL-string_to_sid, add some tests
authorVolker Lendecke <vl@samba.org>
Sat, 20 Feb 2010 20:31:16 +0000 (21:31 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 20 Feb 2010 20:35:03 +0000 (21:35 +0100)
source3/script/tests/test_smbtorture_s3.sh
source3/torture/torture.c

index 3e0e3de9117940fde78eee0c09a5c563c2567169..851e58a47cf96f82bf9bcf98593713bf7d7749d4 100755 (executable)
@@ -33,7 +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"
+tests="$tests LOCAL-string_to_sid"
 
 skipped1="RANDOMIPC NEGNOWAIT NBENCH ERRMAPEXTRACT TRANS2SCAN NTTRANSSCAN"
 skipped2="DENY1 DENY2 OPENATTR CASETABLE EATEST"
index 52cd016cb34f3fae173ca63d364c3b1ac97b51c0..24aea3ceee21eca9efcb4f5bb710d0917345d392 100644 (file)
@@ -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}};