summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-07-16 02:27:51 +0200
committerGünther Deschner <gd@samba.org>2011-02-16 11:43:28 +0100
commit12d16af9d6a5a790f8d0849c9a3e1d01cbb2266d (patch)
treea564332a253161d0efd135140743011db422a0da /source3/rpc_server
parentf6004a1cfd484ecc908bfc77883f03e9fbf3ab88 (diff)
downloadsamba-12d16af9d6a5a790f8d0849c9a3e1d01cbb2266d.tar.gz
samba-12d16af9d6a5a790f8d0849c9a3e1d01cbb2266d.tar.bz2
samba-12d16af9d6a5a790f8d0849c9a3e1d01cbb2266d.zip
s3-lsa: implement _lsa_DeleteTrustedDomain().
Guenther Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/lsa/srv_lsa_nt.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 8a70a987d6..4a8da2f092 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -1623,6 +1623,44 @@ NTSTATUS _lsa_CreateTrustedDomain(struct pipes_struct *p,
}
/***************************************************************************
+ _lsa_DeleteTrustedDomain
+ ***************************************************************************/
+
+NTSTATUS _lsa_DeleteTrustedDomain(struct pipes_struct *p,
+ struct lsa_DeleteTrustedDomain *r)
+{
+ NTSTATUS status;
+ struct lsa_info *handle;
+ struct trustdom_info *info;
+
+ /* find the connection policy handle. */
+ if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&handle)) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
+ if (handle->type != LSA_HANDLE_POLICY_TYPE) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
+ if (!(handle->access & LSA_POLICY_TRUST_ADMIN)) {
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
+ status = lsa_lookup_trusted_domain_by_sid(p->mem_ctx,
+ r->in.dom_sid,
+ &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (!pdb_del_trusteddom_pw(info->name)) {
+ return NT_STATUS_NO_TRUST_LSA_SECRET;
+ }
+
+ return NT_STATUS_OK;
+}
+
+/***************************************************************************
***************************************************************************/
NTSTATUS _lsa_CreateSecret(struct pipes_struct *p, struct lsa_CreateSecret *r)
@@ -2753,13 +2791,6 @@ NTSTATUS _lsa_SetTrustedDomainInfo(struct pipes_struct *p,
return NT_STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS _lsa_DeleteTrustedDomain(struct pipes_struct *p,
- struct lsa_DeleteTrustedDomain *r)
-{
- p->rng_fault_state = True;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
NTSTATUS _lsa_StorePrivateData(struct pipes_struct *p,
struct lsa_StorePrivateData *r)
{