Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148319037
D13728.id37385.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D13728.id37385.diff
View Options
Index: head/usr.sbin/rpcbind/rpcb_svc_com.c
===================================================================
--- head/usr.sbin/rpcbind/rpcb_svc_com.c
+++ head/usr.sbin/rpcbind/rpcb_svc_com.c
@@ -1136,6 +1136,16 @@
* that it was set by the signal handlers (or any
* other outside event) and not caused by poll().
*/
+ if (doterminate != 0) {
+ close(rpcbindlockfd);
+#ifdef WARMSTART
+ syslog(LOG_ERR,
+ "rpcbind terminating on signal %d. Restart with \"rpcbind -w\"",
+ (int)doterminate);
+ write_warmstart(); /* Dump yourself */
+#endif
+ exit(2);
+ }
case 0:
cleanfds = svc_fdset;
__svc_clean_idle(&cleanfds, 30, FALSE);
Index: head/usr.sbin/rpcbind/rpcbind.h
===================================================================
--- head/usr.sbin/rpcbind/rpcbind.h
+++ head/usr.sbin/rpcbind/rpcbind.h
@@ -44,6 +44,8 @@
#ifndef rpcbind_h
#define rpcbind_h
+#include <signal.h>
+
#ifdef PORTMAP
#include <rpc/pmap_prot.h>
#endif
@@ -68,6 +70,7 @@
extern int debugging;
extern int doabort;
+extern volatile sig_atomic_t doterminate;
#ifdef LIBWRAP
extern int libwrap;
#endif
@@ -75,6 +78,7 @@
extern int insecure;
extern int oldstyle_local;
extern rpcblist_ptr list_rbl; /* A list of version 3 & 4 rpcbind services */
+extern int rpcbindlockfd;
#ifdef PORTMAP
extern struct pmaplist *list_pml; /* A list of version 2 rpcbind services */
Index: head/usr.sbin/rpcbind/rpcbind.c
===================================================================
--- head/usr.sbin/rpcbind/rpcbind.c
+++ head/usr.sbin/rpcbind/rpcbind.c
@@ -79,7 +79,9 @@
/* Global variables */
int debugging = 0; /* Tell me what's going on */
int doabort = 0; /* When debugging, do an abort on errors */
+volatile sig_atomic_t doterminate = 0; /* Terminal signal received */
rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */
+int rpcbindlockfd;
/* who to suid to if -s is given */
#define RUN_AS "daemon"
@@ -99,7 +101,6 @@
static int ipv6_only = 0;
static int nhosts = 0;
static int on = 1;
-static int rpcbindlockfd;
#ifdef WARMSTART
/* Local Variable */
@@ -758,16 +759,10 @@
* Catch the signal and die
*/
static void
-terminate(int signum __unused)
+terminate(int signum)
{
- close(rpcbindlockfd);
-#ifdef WARMSTART
- syslog(LOG_ERR,
- "rpcbind terminating on signal %d. Restart with \"rpcbind -w\"",
- signum);
- write_warmstart(); /* Dump yourself */
-#endif
- exit(2);
+
+ doterminate = signum;
}
void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 3:49 AM (25 m, 5 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29816245
Default Alt Text
D13728.id37385.diff (2 KB)
Attached To
Mode
D13728: PR 224503: rpcbind: Do not use signal-unsafe functions in SIGTERM handler
Attached
Detach File
Event Timeline
Log In to Comment