r11112: listen on the global catalog ldap server port as well if we are a
authorAndrew Tridgell <tridge@samba.org>
Mon, 17 Oct 2005 11:32:20 +0000 (11:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:44:51 +0000 (13:44 -0500)
PDC. I suspect we should behave slightly differently on the two ports,
but this is a lot closer than not listening at all. When creating a
user with mmc the global catalog port is used to check for an existing
user
(This used to be commit f8430c3f41313d0a71cea23e1a2ef98f088aff44)

source4/ldap_server/ldap_server.c

index dac7feecfb1416a9c0e4c28668f4e9c3a5067a33..d9631573c72b7548fcf162870c971c6b0db996fa 100644 (file)
@@ -462,6 +462,17 @@ static NTSTATUS add_socket(struct event_context *event_context,
                }
        }
 
+       /* if we are a PDC, then also enable the global catalog server port, 3268 */
+       if (lp_server_role() == ROLE_DOMAIN_PDC) {
+               port = 3268;
+               status = stream_setup_socket(event_context, model_ops, &ldap_stream_ops, 
+                                            "ipv4", address, &port, ldap_service);
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
+                                address, port, nt_errstr(status)));
+               }
+       }
+
        return status;
 }