lib: Convert callers of sid_blob_parse to sid_parse
authorVolker Lendecke <vl@samba.org>
Mon, 24 Aug 2015 14:46:12 +0000 (16:46 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 26 Aug 2015 19:41:12 +0000 (21:41 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/dsdb/common/util.c
source4/torture/unix/whoami.c

index 6447d06ef6a3801121be605496d007ee1308e428..c1b5d5a77f0b8e5e9bfcb311335b9a623984dacb 100644 (file)
@@ -360,7 +360,7 @@ struct dom_sid *samdb_result_dom_sid(TALLOC_CTX *mem_ctx, const struct ldb_messa
        if (sid == NULL) {
                return NULL;
        }
-       ok = sid_blob_parse(*v, sid);
+       ok = sid_parse(v->data, v->length, sid);
        if (!ok) {
                talloc_free(sid);
                return NULL;
index 00109eb35a27457a524c2bc28a4a08bc6c001989..53921d49201ec184678aa920cbc0af52c4dd61dd 100644 (file)
@@ -300,7 +300,10 @@ static bool test_against_ldap(struct torture_context *torture, struct ldb_contex
                        struct dom_sid *sid = talloc(torture, struct dom_sid);
                        torture_assert(torture, sid != NULL, "talloc failed");
                        
-                       torture_assert(torture, sid_blob_parse(el->values[i], sid), "sid parse failed");
+                       torture_assert(torture,
+                                      sid_parse(el->values[i].data,
+                                                el->values[i].length, sid),
+                                      "sid parse failed");
                        torture_assert_str_equal(torture, dom_sid_string(sid, sid), dom_sid_string(sid, whoami->sid_list[i]), "SID from LDAP and SID from CIFS does not match!");
                        talloc_free(sid);
                }
@@ -311,13 +314,20 @@ static bool test_against_ldap(struct torture_context *torture, struct ldb_contex
                struct dom_sid *dc_sids = talloc_array(torture, struct dom_sid, el->num_values);
                struct dom_sid *member_sids = talloc_array(torture, struct dom_sid, whoami->num_sids);
                torture_assert(torture, user_sid != NULL, "talloc failed");
-               torture_assert(torture, sid_blob_parse(el->values[0], user_sid), "sid parse failed");
+               torture_assert(torture, sid_parse(el->values[0].data,
+                                                 el->values[0].length,
+                                                 user_sid),
+                              "sid parse failed");
                torture_assert_ntstatus_equal(torture, dom_sid_split_rid(torture, user_sid, &dom_sid, NULL), NT_STATUS_OK, "failed to split domain SID from user SID");
                for (i = 0; i < el->num_values; i++) {
                        struct dom_sid *sid = talloc(dc_sids, struct dom_sid);
                        torture_assert(torture, sid != NULL, "talloc failed");
                        
-                       torture_assert(torture, sid_blob_parse(el->values[i], sid), "sid parse failed");
+                       torture_assert(torture,
+                                      sid_parse(el->values[i].data,
+                                                el->values[i].length,
+                                                sid),
+                                      "sid parse failed");
                        if (dom_sid_in_domain(dom_sid, sid)) {
                                dc_sids[num_domain_sids_dc] = *sid;
                                num_domain_sids_dc++;