summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-11-15 23:57:58 +0100
committerGünther Deschner <gd@samba.org>2011-11-16 12:26:26 +0100
commite81d5505f48de800d2314cf6971a1417ca915fde (patch)
tree8bf7555a9905c89e7490740a6ad5ac300171b04a /source3/lib
parent65e2944c678a7d4d111ee00e9e964fde14b163a6 (diff)
downloadsamba-e81d5505f48de800d2314cf6971a1417ca915fde.tar.gz
samba-e81d5505f48de800d2314cf6971a1417ca915fde.tar.xz
samba-e81d5505f48de800d2314cf6971a1417ca915fde.zip
s3-smbldap: remove dependency to secrets subsystem.
Guenther
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbldap.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 5a1ba09ff1..51bcabd5eb 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "smbldap.h"
-#include "secrets.h"
#include "../libcli/security/security.h"
#include <tevent.h>
@@ -953,22 +952,6 @@ static int smbldap_connect_system(struct smbldap_state *ldap_state)
int rc;
int version;
- if (!ldap_state->anonymous && !ldap_state->bind_dn) {
- char *bind_dn = NULL;
- char *bind_secret = NULL;
-
- /* get the default dn and password only if they are not set already */
- if (!fetch_ldap_pw(&bind_dn, &bind_secret)) {
- DEBUG(0, ("ldap_connect_system: Failed to retrieve password from secrets.tdb\n"));
- rc = LDAP_INVALID_CREDENTIALS;
- goto done;
- }
- smbldap_set_creds(ldap_state, false, bind_dn, bind_secret);
- SAFE_FREE(bind_dn);
- memset(bind_secret, '\0', strlen(bind_secret));
- SAFE_FREE(bind_secret);
- }
-
/* removed the sasl_bind_s "EXTERNAL" stuff, as my testsuite
(OpenLDAP) doesnt' seem to support it */
@@ -1722,6 +1705,10 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct tevent_context *tevent_ctx,
(*smbldap_state)->tevent_context = tevent_ctx;
+ if (bind_dn && bind_secret) {
+ smbldap_set_creds(*smbldap_state, anon, bind_dn, bind_secret);
+ }
+
talloc_set_destructor(*smbldap_state, smbldap_state_destructor);
return NT_STATUS_OK;
}