s3-lsa: make lsa_lookup_trusted_domain_by_name() use pdb_get_trusted_domain().
authorSumit Bose <sbose@redhat.com>
Fri, 20 Aug 2010 09:28:43 +0000 (11:28 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 16 Feb 2011 10:43:18 +0000 (11:43 +0100)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_server/lsa/srv_lsa_nt.c

index 4e504cb221f551958ca4577daca9acd988e3933c..8a70a987d6b92643bbd77cc026fc8ea67b4f7c2d 100644 (file)
@@ -1447,11 +1447,13 @@ static NTSTATUS lsa_lookup_trusted_domain_by_name(TALLOC_CTX *mem_ctx,
                                                  const char *netbios_domain_name,
                                                  struct trustdom_info **info_p)
 {
-       struct dom_sid sid;
+       NTSTATUS status;
        struct trustdom_info *info;
+       struct pdb_trusted_domain *td;
 
-       if (!pdb_get_trusteddom_pw(netbios_domain_name, NULL, &sid, NULL)) {
-               return NT_STATUS_INVALID_PARAMETER;
+       status = pdb_get_trusted_domain(mem_ctx, netbios_domain_name, &td);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
 
        info = talloc(mem_ctx, struct trustdom_info);
@@ -1461,7 +1463,8 @@ static NTSTATUS lsa_lookup_trusted_domain_by_name(TALLOC_CTX *mem_ctx,
 
        info->name      = talloc_strdup(info, netbios_domain_name);
        NT_STATUS_HAVE_NO_MEMORY(info->name);
-       info->sid       = sid;
+
+       sid_copy(&info->sid, &td->security_identifier);
 
        *info_p = info;