summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd_irpc.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-05-08 16:49:13 +1200
committerAndrew Bartlett <abartlet@samba.org>2014-06-11 12:43:58 +0200
commitba4467ca65d5f85a2732da27d88760b684c6e30d (patch)
treec7c8ad4191091424d0071f1fe92bce8cc0d61461 /source3/winbindd/winbindd_irpc.c
parenteabe7d732e6d9b64004bbb477384a1eae999815f (diff)
downloadsamba-ba4467ca65d5f85a2732da27d88760b684c6e30d.tar.gz
samba-ba4467ca65d5f85a2732da27d88760b684c6e30d.tar.xz
samba-ba4467ca65d5f85a2732da27d88760b684c6e30d.zip
s3-winbindd: Implement SamLogon IRPC call
We do this by lifting parts of the winbindd_dual_pam_auth_crap() code into a new helper function winbind_dual_SamLogon(). This allows us to implement the semantics we need for IRPC, without the artifacts of the winbindd pipe protocol. Change-Id: Idb169217e6d68d387c99765d0af7ed394cb5b93a Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jun 11 12:43:58 CEST 2014 on sn-devel-104
Diffstat (limited to 'source3/winbindd/winbindd_irpc.c')
-rw-r--r--source3/winbindd/winbindd_irpc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_irpc.c b/source3/winbindd/winbindd_irpc.c
index 3c33076d61..cf58a088eb 100644
--- a/source3/winbindd/winbindd_irpc.c
+++ b/source3/winbindd/winbindd_irpc.c
@@ -128,10 +128,39 @@ static NTSTATUS wb_irpc_DsrUpdateReadOnlyServerDnsRecords(struct irpc_message *m
domain, IRPC_CALL_TIMEOUT);
}
+static NTSTATUS wb_irpc_SamLogon(struct irpc_message *msg,
+ struct winbind_SamLogon *req)
+{
+ struct winbindd_domain *domain;
+ const char *target_domain_name;
+ if (req->in.logon.network == NULL) {
+ return NT_STATUS_REQUEST_NOT_ACCEPTED;
+ }
+ target_domain_name = req->in.logon.network->identity_info.domain_name.string;
+
+ domain = find_auth_domain(0, target_domain_name);
+ if (domain == NULL) {
+ return NT_STATUS_NO_SUCH_USER;
+ }
+
+ DEBUG(5, ("wb_irpc_SamLogon called\n"));
+
+ return wb_irpc_forward_rpc_call(msg, msg,
+ winbind_event_context(),
+ req, NDR_WINBIND_SAMLOGON,
+ "winbind_SamLogon",
+ domain, IRPC_CALL_TIMEOUT);
+}
+
NTSTATUS wb_irpc_register(void)
{
NTSTATUS status;
status = IRPC_REGISTER(winbind_imessaging_context(), winbind, WINBIND_DSRUPDATEREADONLYSERVERDNSRECORDS,
wb_irpc_DsrUpdateReadOnlyServerDnsRecords, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ status = IRPC_REGISTER(winbind_imessaging_context(), winbind, WINBIND_SAMLOGON,
+ wb_irpc_SamLogon, NULL);
return status;
}