[Pkg-shadow-devel] Bug#374547: ^C and ^Z don't work in
init=/bin/login mode
Samuel Thibault
samuel.thibault at ens-lyon.org
Mon Jun 19 21:59:02 UTC 2006
Package: login
Version: 1:4.0.16-2youpi
Severity: normal
Tags: patch upstream
Hi,
When booting with init=/bin/login, tty controlling sequences like ^C
or ^Z don't work. The incurred unfortunate effect is that one can't
interrupt the programs one runs (like ping, e2fsck, badblocks, ...).
This is because login doesn't initialize a session, while it should.
The attached patch corrects that, please apply.
Regards,
Samuel
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (900, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17
Locale: LANG=fr_FR at euro, LC_CTYPE=fr_FR at euro (charmap=ISO-8859-15)
Versions of packages login depends on:
ii libc6 2.3.6-13 GNU C Library: Shared libraries
ii libpam-modules 0.79-3.1 Pluggable Authentication Modules f
ii libpam-runtime 0.79-3.1 Runtime support for the PAM librar
ii libpam0g 0.79-3.1 Pluggable Authentication Modules l
login recommends no packages.
-- no debconf information
-------------- next part --------------
diff -u shadow-4.0.16/src/login.c shadow-4.0.16youpi/src/login.c
--- shadow-4.0.16/src/login.c 2006-05-07 19:44:39.000000000 +0200
+++ shadow-4.0.16youpi/src/login.c 2006-06-19 23:45:48.000000000 +0200
@@ -41,6 +41,7 @@
#include <signal.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/ioctl.h>
#include "defines.h"
#include "faillog.h"
#include "failure.h"
@@ -1026,6 +1027,10 @@
}
/* child */
#endif
+ /* start new session */
+ setsid();
+ if (ioctl(0, TIOCSCTTY, 1))
+ fprintf(stderr,_("TIOCSCTTY failed on %s"),tty);
/* We call set_groups() above because this clobbers pam_groups.so */
#ifndef USE_PAM
--- shadow-4.0.16/src/sulogin.c 2006-05-13 01:13:10.000000000 +0200
+++ shadow-4.0.16youpi/src/sulogin.c 2006-06-19 23:46:22.000000000 +0200
@@ -35,6 +35,7 @@
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
+#include <sys/ioctl.h>
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
@@ -142,6 +143,10 @@
#endif
exit (1); /* must be a terminal */
}
+ /* start new session */
+ setsid();
+ if (ioctl(0, TIOCSCTTY, 1))
+ fprintf(stderr,_("TIOCSCTTY failed"));
while (*envp) /* add inherited environment, */
addenv (*envp++, NULL); /* some variables change later */
More information about the Pkg-shadow-devel
mailing list