[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
rpms/mgetty/FC-3 mgetty-1.1.31-162174_tcflush.patch, 1.1, 1.2 mgetty.spec, 1.24, 1.25
- From: fedora-cvs-commits redhat com
- To: fedora-cvs-commits redhat com
- Subject: rpms/mgetty/FC-3 mgetty-1.1.31-162174_tcflush.patch, 1.1, 1.2 mgetty.spec, 1.24, 1.25
- Date: Wed, 27 Jul 2005 11:55:31 -0400
Author: jvdias
Update of /cvs/dist/rpms/mgetty/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv24944
Modified Files:
mgetty-1.1.31-162174_tcflush.patch mgetty.spec
Log Message:
further fix for 162174: disable alarm before sleep; tcflush(1,TCOFLUSH) before exit() in sig_goodbye(); block signals before entering syslog();
mgetty-1.1.31-162174_tcflush.patch:
logfile.c | 33 +++++++++++++++++++++++++++++++++
logname.c | 4 +++-
mgetty.c | 1 +
3 files changed, 37 insertions(+), 1 deletion(-)
Index: mgetty-1.1.31-162174_tcflush.patch
===================================================================
RCS file: /cvs/dist/rpms/mgetty/FC-3/mgetty-1.1.31-162174_tcflush.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mgetty-1.1.31-162174_tcflush.patch 23 Jul 2005 00:14:27 -0000 1.1
+++ mgetty-1.1.31-162174_tcflush.patch 27 Jul 2005 15:55:28 -0000 1.2
@@ -1,11 +1,12 @@
---- mgetty-1.1.31/logname.c.162174_tcflush 2005-07-22 17:11:17.650852000 -0400
-+++ mgetty-1.1.31/logname.c 2005-07-22 17:13:13.114273000 -0400
-@@ -368,10 +368,11 @@
+--- mgetty-1.1.31/logname.c.161174_tcflush 2005-07-27 10:41:10.076619000 -0400
++++ mgetty-1.1.31/logname.c 2005-07-27 10:44:39.675810000 -0400
+@@ -368,10 +368,12 @@
{
printf( "\r\n\07\r\nYour login time (%d minutes) ran out. Goodbye.\r\n",
(max_login_time / 60)+1 );
-
-+ alarm(0); /* turn off alarm */
++ signal(SIGALRM,SIG_DFL);/* turn off alarm */
++ alarm(0);
sleep(3); /* give message time to xmit */
lprintf( L_AUDIT, "failed dev=%s, pid=%d, login time out",
Device, getpid() );
@@ -13,3 +14,78 @@
exit(0); /* bye bye... */
}
ch = CKILL; /* timeout #1 -> clear input */
+--- mgetty-1.1.31/mgetty.c.161174_tcflush 2003-11-17 14:09:41.000000000 -0500
++++ mgetty-1.1.31/mgetty.c 2005-07-27 10:41:43.155507000 -0400
+@@ -94,6 +94,7 @@
+ lprintf( L_AUDIT, "failed dev=%s, pid=%d, got signal %d, exiting",
+ Device, getpid(), signo );
+ rmlocks();
++ tcflush(1,TCOFLUSH);
+ exit(10);
+ }
+
+--- mgetty-1.1.31/logfile.c.161174_tcflush 2003-01-14 16:30:20.000000000 -0500
++++ mgetty-1.1.31/logfile.c 2005-07-27 10:43:49.279257000 -0400
+@@ -22,6 +22,7 @@
+ #endif
+
+ #ifdef SYSLOG
++#include <signal.h>
+ #include <syslog.h>
+
+ #if !defined(linux) && !defined(BSD) && !defined(_SCO_DS) && \
+@@ -212,6 +213,7 @@
+ int errnr;
+ char * p;
+ static int first_open = TRUE;
++sigset_t ss, oss;
+
+ if ( level > log_level ) /* log level high enough? */
+ {
+@@ -315,7 +317,24 @@
+ tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec, ws );
+ #ifdef SYSLOG
++ /* block all handled signals before syslog(), else an lprintf in
++ * a signal handler could deadlock
++ */
++ sigemptyset(&ss);
++ sigaddset(&ss, SIGALRM);
++ sigaddset(&ss, SIGCHLD);
++ sigaddset(&ss, SIGHUP);
++ sigaddset(&ss, SIGINT);
++ sigaddset(&ss, SIGPIPE);
++ sigaddset(&ss, SIGQUIT);
++ sigaddset(&ss, SIGTERM);
++ sigaddset(&ss, SIGUSR1);
++ sigaddset(&ss, SIGUSR2);
++ sigprocmask(SIG_BLOCK, &ss, &oss);
++
+ syslog( LOG_NOTICE, "%s", ws );
++
++ sigprocmask(SIG_SETMASK, &oss, 0L);
+ #endif
+ }
+ else if ( level != L_ERROR && level != L_FATAL )
+@@ -334,7 +353,21 @@
+ ( errnr <= sys_nerr ) ? sys_errlist[errnr]:
+ "<error not in list>" );
+ #ifdef SYSLOG
++ sigemptyset(&ss);
++ sigaddset(&ss, SIGALRM);
++ sigaddset(&ss, SIGCHLD);
++ sigaddset(&ss, SIGHUP);
++ sigaddset(&ss, SIGINT);
++ sigaddset(&ss, SIGPIPE);
++ sigaddset(&ss, SIGQUIT);
++ sigaddset(&ss, SIGTERM);
++ sigaddset(&ss, SIGUSR1);
++ sigaddset(&ss, SIGUSR2);
++ sigprocmask(SIG_BLOCK, &ss, &oss);
++
+ syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws );
++
++ sigprocmask(SIG_SETMASK, &oss, 0L);
+ #endif
+
+ #ifndef SYSLOG
Index: mgetty.spec
===================================================================
RCS file: /cvs/dist/rpms/mgetty/FC-3/mgetty.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- mgetty.spec 23 Jul 2005 00:15:23 -0000 1.24
+++ mgetty.spec 27 Jul 2005 15:55:28 -0000 1.25
@@ -5,7 +5,7 @@
Summary: A getty replacement for use with data and fax modems.
Name: mgetty
Version: 1.1.31
-Release: 3_FC3
+Release: 4_FC3
Source: ftp://alpha.greenie.net/pub/mgetty/source/1.1/mgetty%{version}-Jul24.tar.gz
Source1: ftp://alpha.greenie.net/pub/mgetty/source/1.1/mgetty%{version}-Jul24.tar.gz.asc
Source2: logrotate.mgetty
@@ -335,6 +335,8 @@
* Fri Jul 22 2005 Jason Vas Dias <jvdias redhat com> 1.1.31-10
- fix bug 162174: prevent uninterruptable hang on exit() when
direct line disconnected (kernel bug 164002)
+ do tcflush(1,TCOFLUSH) before exit() in sig_goodbye()
+ block signals before entering syslog()
* Thu Apr 21 2005 Peter Vrabec <pvrabec redhat com> 1.1.31-6
- support FILE_OFFSET_BITS=64 in statvfs (#155440)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]