summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-08-17 17:20:57 +0200
committerGünther Deschner <gd@samba.org>2011-02-16 11:35:07 +0100
commit162fd0e89104d885ef9269e0aba0db88eb1fb4ad (patch)
treef9b249eac153e50ec34535b79dbf390002add927
parenta6bd93b8c359c5ab672a9546e77c3ae581b96cbd (diff)
downloadsamba-162fd0e89104d885ef9269e0aba0db88eb1fb4ad.tar.gz
samba-162fd0e89104d885ef9269e0aba0db88eb1fb4ad.tar.bz2
samba-162fd0e89104d885ef9269e0aba0db88eb1fb4ad.zip
s3-lsa: Let _lsa_CreateTrustedDomainEx2() use pdb_set_trusted_domain().
Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source3/rpc_server/lsa/srv_lsa_nt.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 2f0695c122..7ce2edaf28 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -1437,6 +1437,7 @@ NTSTATUS _lsa_CreateTrustedDomainEx2(struct pipes_struct *p,
uint32_t acc_granted;
struct security_descriptor *psd;
size_t sd_size;
+ struct pdb_trusted_domain td;
if (!IS_DC) {
return NT_STATUS_NOT_SUPPORTED;
@@ -1478,10 +1479,22 @@ NTSTATUS _lsa_CreateTrustedDomainEx2(struct pipes_struct *p,
return status;
}
- if (!pdb_set_trusteddom_pw(r->in.info->netbios_name.string,
- generate_random_str(p->mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH),
- r->in.info->sid)) {
- return NT_STATUS_ACCESS_DENIED;
+ ZERO_STRUCT(td);
+
+ td.domain_name = r->in.info->domain_name.string;
+ td.netbios_name = r->in.info->netbios_name.string;
+ sid_copy(&td.security_identifier, r->in.info->sid);
+ td.trust_auth_incoming.data = NULL;
+ td.trust_auth_incoming.length = 0;
+ td.trust_auth_outgoing.data = NULL;
+ td.trust_auth_outgoing.length = 0;
+ td.trust_direction = r->in.info->trust_direction;
+ td.trust_type = r->in.info->trust_type;
+ td.trust_attributes = r->in.info->trust_attributes;
+
+ status = pdb_set_trusted_domain(r->in.info->domain_name.string, &td);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
status = create_lsa_policy_handle(p->mem_ctx, p,