summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_ildap
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-11-05 11:13:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:48 -0500
commitdf9af348761989a8a1f257a29e9209aed4bfb373 (patch)
tree6bfbbd9f36002c93257c01e9d1f14f8bf83769a3 /source4/lib/ldb/ldb_ildap
parent72820aaf9281acc2acec869793a95f3353c1034c (diff)
downloadsamba-df9af348761989a8a1f257a29e9209aed4bfb373.tar.gz
samba-df9af348761989a8a1f257a29e9209aed4bfb373.tar.bz2
samba-df9af348761989a8a1f257a29e9209aed4bfb373.zip
r11522: Add support for delegated credentials and machine account credentials
to ldb, based on the sessionInfo we now pass around. Andrew Bartlett (This used to be commit 84e16e4ea7240409f15efd9f64344f9e0cec8111)
Diffstat (limited to 'source4/lib/ldb/ldb_ildap')
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index 5fc326b425..06ff79b9a0 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -36,6 +36,7 @@
#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h"
+#include "auth/auth.h"
struct ildb_private {
struct ldap_connection *ldap;
@@ -459,9 +460,14 @@ int ildb_connect(struct ldb_context *ldb, const char *url,
ldb->modules->ops = &ildb_ops;
/* caller can optionally setup credentials using the opaque token 'credentials' */
- creds = ldb_get_opaque(ldb, "credentials");
+ creds = talloc_get_type(ldb_get_opaque(ldb, "credentials"), struct cli_credentials);
if (creds == NULL) {
- creds = cmdline_credentials;
+ struct auth_session_info *session_info = talloc_get_type(ldb_get_opaque(ldb, "sessionInfo"), struct auth_session_info);
+ if (session_info && session_info->credentials) {
+ creds = session_info->credentials;
+ } else {
+ creds = cmdline_credentials;
+ }
}
if (creds != NULL && cli_credentials_authentication_requested(creds)) {