Bugzilla – Attachment 1016 Details for
Bug 1029
SIGTERM and cleanup of wtmp files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch
notprivsepcleanup.diff (text/plain), 2.49 KB, created by
Damien Miller
on 2005-10-30 12:16:09 AEDT
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2005-10-30 12:16:09 AEDT
Size:
2.49 KB
patch
obsolete
>Index: serverloop.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v >retrieving revision 1.119 >diff -u -p -r1.119 serverloop.c >--- serverloop.c 10 Oct 2005 10:23:08 -0000 1.119 >+++ serverloop.c 30 Oct 2005 01:15:34 -0000 >@@ -61,6 +61,7 @@ extern ServerOptions options; > /* XXX */ > extern Kex *xxx_kex; > extern Authctxt *the_authctxt; >+extern int use_privsep; > > static Buffer stdin_buffer; /* Buffer for stdin data. */ > static Buffer stdout_buffer; /* Buffer for stdout data. */ >@@ -90,6 +91,9 @@ static int client_alive_timeouts = 0; > > static volatile sig_atomic_t child_terminated = 0; /* The child has terminated. */ > >+/* Cleanup on signals (!use_privsep case only) */ >+static volatile sig_atomic_t received_sigterm = 0; >+ > /* prototypes */ > static void server_init_dispatch(void); > >@@ -149,6 +153,12 @@ sigchld_handler(int sig) > errno = save_errno; > } > >+static void >+sigterm_handler(int sig) >+{ >+ received_sigterm = sig; >+} >+ > /* > * Make packets from buffered stderr data, and buffer it for sending > * to the client. >@@ -500,6 +510,12 @@ server_loop(pid_t pid, int fdin_arg, int > child_terminated = 0; > signal(SIGCHLD, sigchld_handler); > >+ if (!use_privsep) { >+ signal(SIGTERM, sigterm_handler); >+ signal(SIGINT, sigterm_handler); >+ signal(SIGQUIT, sigterm_handler); >+ } >+ > /* Initialize our global variables. */ > fdin = fdin_arg; > fdout = fdout_arg; >@@ -627,6 +643,12 @@ server_loop(pid_t pid, int fdin_arg, int > wait_until_can_do_something(&readset, &writeset, &max_fd, > &nalloc, max_time_milliseconds); > >+ if (received_sigterm) { >+ logit("Exiting on signal %d", received_sigterm); >+ /* Clean up sessions, utmp, etc. */ >+ cleanup_exit(255); >+ } >+ > /* Process any channel events. */ > channel_after_select(readset, writeset); > >@@ -747,6 +769,12 @@ server_loop2(Authctxt *authctxt) > connection_in = packet_get_connection_in(); > connection_out = packet_get_connection_out(); > >+ if (!use_privsep) { >+ signal(SIGTERM, sigterm_handler); >+ signal(SIGINT, sigterm_handler); >+ signal(SIGQUIT, sigterm_handler); >+ } >+ > notify_setup(); > > max_fd = MAX(connection_in, connection_out); >@@ -763,6 +791,12 @@ server_loop2(Authctxt *authctxt) > channel_output_poll(); > wait_until_can_do_something(&readset, &writeset, &max_fd, > &nalloc, 0); >+ >+ if (received_sigterm) { >+ logit("Exiting on signal %d", received_sigterm); >+ /* Clean up sessions, utmp, etc. */ >+ cleanup_exit(255); >+ } > > collect_children(); > if (!rekeying) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1029
:
895
|
897
|
909
| 1016