s4:ldap_server: don't start if we can't bind to port 389
authorStefan Metzmacher <metze@samba.org>
Mon, 28 Jun 2010 07:57:33 +0000 (09:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 28 Jun 2010 07:58:13 +0000 (09:58 +0200)
metze

source4/ldap_server/ldap_server.c

index 00698eec46c68277b976f2fe70b76e9576c885bf..49d3d58edf95e0f6d5a431c01efd76ee0ea1d583 100644 (file)
@@ -506,6 +506,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
                         address, port, nt_errstr(status)));
+               return status;
        }
 
        if (tls_support(ldap_service->tls_params)) {
@@ -520,6 +521,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
                                 address, port, nt_errstr(status)));
+                       return status;
                }
        }
 
@@ -541,6 +543,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
                                 address, port, nt_errstr(status)));
+                       return status;
                }
        }
 
@@ -548,7 +551,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
         * connect again on each incoming LDAP connection */
        talloc_unlink(ldap_service, ldb);
 
-       return status;
+       return NT_STATUS_OK;
 }
 
 /*