Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.1:Update
login
bnc652633.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc652633.patch of Package login
--- src/login.c +++ src/login.c 2011-02-16 11:14:57.407927008 +0000 @@ -454,6 +454,22 @@ logaudit (const char *tty, const char *u # define logaudit(tty, username, hostname, pwd, status) #endif /* HAVE_LIBAUDIT */ +static pid_t childPid; +static volatile sig_atomic_t signaled; + +static void +sig_handler (int sig) +{ + if (childPid) + { + if (sig == SIGTERM) + kill(-childPid, SIGHUP); + kill(-childPid, sig); + } + else + signaled++; +} + int main (int argc, char **argv) { @@ -470,7 +486,6 @@ main (int argc, char **argv) int retcode; pam_handle_t *pamh = NULL; struct pam_conv conv = { misc_conv, NULL }; - pid_t childPid; const char *hushfile; gid_t gid; char *hostname; @@ -1236,7 +1251,8 @@ main (int argc, char **argv) closelog(); signal (SIGHUP, SIG_IGN); ioctl(0, TIOCNOTTY, NULL); - signal (SIGHUP, SIG_DFL); + signal (SIGHUP, sig_handler); + signal (SIGTERM, sig_handler); #ifdef WITH_DEBUG debug ("fork child process"); #endif @@ -1276,6 +1292,13 @@ main (int argc, char **argv) exit (0); } /* child */ + + signal (SIGHUP, SIG_DFL); + signal (SIGTERM, SIG_DFL); + + if (signaled) + exit (1); + /* start new session */ setsid(); if (ioctl (0, TIOCSCTTY, (char *) 1) == -1)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor