Make this code actually compile (--with-ldapsam).
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2003 09:41:10 +0000 (09:41 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Apr 2003 09:41:10 +0000 (09:41 +0000)
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

index eb10dd33e98d77ceaabec03dc5c5f33fd809ec5a..55efb7f45cc09d84cd6ead76f9c67d2c60a404bb 100644 (file)
@@ -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;