s3: Remove some pointless uses of string_sid_talloc
authorVolker Lendecke <vl@samba.org>
Sat, 23 Jan 2010 12:18:00 +0000 (13:18 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 23 Jan 2010 13:35:37 +0000 (14:35 +0100)
source3/lib/eventlog/eventlog.c
source3/passdb/pdb_ldap.c
source3/rpcclient/cmd_lsarpc.c

index 42b2a06ce3f3822e1d618f88dfacb19825cfc0a6..1c0dba980d54deffb181888f8ce412d4630b2576 100644 (file)
@@ -940,7 +940,7 @@ NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
                        return NT_STATUS_INVALID_SID;
                }
                if (len > 0) {
-                       e->UserSid = *string_sid_talloc(mem_ctx, sid_str);
+                       string_to_sid(&e->UserSid, sid_str);
                }
        }
 
index 758701bcb84bf028b7c3c6d5aecc7298f8f1f735..68e0c220508d759b5c2a4a10e225502a92ff990a 100644 (file)
@@ -5012,7 +5012,7 @@ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
        LDAPMessage *entry = NULL;
        bool ret = false;
        char *user_sid_string;
-       DOM_SID *user_sid;
+       struct dom_sid user_sid;
        int rc;
        TALLOC_CTX *tmp_ctx = talloc_stackframe();
 
@@ -5051,14 +5051,13 @@ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
                goto done;
        }
 
-       user_sid = string_sid_talloc(tmp_ctx, user_sid_string);
-       if (user_sid == NULL) {
+       if (!string_to_sid(&user_sid, user_sid_string)) {
                DEBUG(3, ("Error calling sid_string_talloc for sid '%s'\n",
                          user_sid_string));
                goto done;
        }
 
-       sid_copy(sid, user_sid);
+       sid_copy(sid, &user_sid);
 
        store_uid_sid_cache(sid, uid);
        idmap_cache_set_sid2uid(sid, uid);
@@ -6048,18 +6047,17 @@ static bool ldapsam_get_trusteddom_pw(struct pdb_methods *methods,
        /* domain sid */
        if (sid != NULL) {
                char *sid_str;
-               DOM_SID *dom_sid;
+               struct dom_sid dom_sid;
                sid_str = smbldap_talloc_single_attribute(priv2ld(ldap_state),
                                                          entry, "sambaSID",
                                                          talloc_tos());
                if (sid_str == NULL) {
                        return False;
                }
-               dom_sid = string_sid_talloc(talloc_tos(), sid_str);
-               if (dom_sid == NULL) {
+               if (!string_to_sid(&dom_sid, sid_str)) {
                        return False;
                }
-               sid_copy(sid, dom_sid);
+               sid_copy(sid, &dom_sid);
        }
 
        return True;
index 11ff046f6d716d7b4ebd298da75f1848284f4f74..488f8f545c6f3b618e063fe28e365b9d230ce55b 100644 (file)
@@ -1843,6 +1843,7 @@ static NTSTATUS cmd_lsa_create_trusted_domain(struct rpc_pipe_client *cli,
 {
        NTSTATUS status;
        struct policy_handle handle, trustdom_handle;
+       struct dom_sid sid;
        struct lsa_DomainInfo info;
 
        if (argc < 3) {
@@ -1859,7 +1860,8 @@ static NTSTATUS cmd_lsa_create_trusted_domain(struct rpc_pipe_client *cli,
        }
 
        init_lsa_StringLarge(&info.name, argv[1]);
-       info.sid = string_sid_talloc(mem_ctx, argv[2]);
+       info.sid = &sid;
+       string_to_sid(&sid, argv[2]);
 
        status = rpccli_lsa_CreateTrustedDomain(cli, mem_ctx,
                                                &handle,