From f9cde25fa492e071960e0857f5075222119a0d1c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Apr 2003 09:41:10 +0000 Subject: Make this code actually compile (--with-ldapsam). This might not actually be the 'right way' to do this, but it's better to have it compile... Andrew Bartlett (This used to be commit c7dc0b27aca8f7e4653b25dae37ea38d68fc045a) --- source3/nsswitch/winbindd_idmap_ldap.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_idmap_ldap.c b/source3/nsswitch/winbindd_idmap_ldap.c index eb10dd33e9..55efb7f45c 100644 --- a/source3/nsswitch/winbindd_idmap_ldap.c +++ b/source3/nsswitch/winbindd_idmap_ldap.c @@ -100,15 +100,18 @@ static BOOL ldap_idmap_init(void) #ifdef WITH_LDAP_SAMCONFIG { int ldap_port = lp_ldap_port(); - + char *uri; /* remap default port if not using SSL */ if (lp_ldap_ssl() != LDAP_SSL_ON && ldap_port == 636) { ldap_port = 389; } + + uri = NULL; - ldap_state->uri = asprintf("%s://%s:d", - lp_ldap_ssl() == LDAP_SSL_ON ? "ldaps" : "ldap", - lp_ldap_server(), ldap_port); + asprintf(&uri, "%s://%s:%d", + lp_ldap_ssl() == LDAP_SSL_ON ? "ldaps" : "ldap", + lp_ldap_server(), ldap_port); + ldap_state->uri = uri; if (!ldap_state->uri) { DEBUG(0,("Out of memory\n")); return False; -- cgit