浏览代码

Ticket 48040 - preserve the FD when disabling a listener

Bug Description:  Stopping the server when the listener is disabled
                  crashes the serveri becuase we close the listener
                  FD twice.

Fix Description:  When disabling a listener, pass the "preserve fd"
                  flag to ns_job_modify().  This prevents nunc-stans
                  from closing the FD out from underneath us.

https://fedorahosted.org/389/ticket/48040

Reviewed by: rmeggins(Thanks!)
Mark Reynolds 10 年之前
父节点
当前提交
c52b2d2b62
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ldap/servers/slapd/daemon.c

+ 2 - 2
ldap/servers/slapd/daemon.c

@@ -1202,7 +1202,7 @@ static void
 ns_disable_listener(listener_info *listener)
 ns_disable_listener(listener_info *listener)
 {
 {
 	/* tell the event framework not to listen for new connections on this listener */
 	/* tell the event framework not to listen for new connections on this listener */
-	ns_job_modify(listener->ns_job, NS_JOB_DISABLE_ONLY);
+	ns_job_modify(listener->ns_job, NS_JOB_DISABLE_ONLY|NS_JOB_PRESERVE_FD);
 	/* add the listener to our list of disabled listeners */
 	/* add the listener to our list of disabled listeners */
 	PR_StackPush(ns_disabled_listeners, (PRStackElem *)listener);
 	PR_StackPush(ns_disabled_listeners, (PRStackElem *)listener);
 	PR_AtomicIncrement(&num_disabled_listeners);
 	PR_AtomicIncrement(&num_disabled_listeners);
@@ -3492,7 +3492,7 @@ ns_set_shutdown(struct ns_job_t *job)
 
 
 	/* Signal all the worker threads to stop */
 	/* Signal all the worker threads to stop */
 	ns_thrpool_shutdown(ns_job_get_tp(job));
 	ns_thrpool_shutdown(ns_job_get_tp(job));
-	ns_job_done(job)
+	ns_job_done(job);
 }
 }
 #endif
 #endif