#! /bin/sh /usr/share/dpatch/dpatch-run ## 66_init_ermg_tty.dpatch by Samuel Thibault ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Fix emergency mode's tty, making sure ^C and ^Z work when ## DP: booting with 'emergency' kernel option. Closes bug #374543. @DPATCH@ Index: sysvinit/src/init.c =================================================================== --- sysvinit/src/init.c (revisjon 808) +++ sysvinit/src/init.c (arbeidskopi) @@ -89,7 +89,7 @@ CHILD *newFamily = NULL; /* The list after inittab re-read */ CHILD ch_emerg = { /* Emergency shell */ - 0, 0, 0, 0, 0, + WAITING, 0, 0, 0, 0, "~~", "S", 3, Index: sysvinit/src/sulogin.c =================================================================== --- sysvinit/src/sulogin.c (revisjon 808) +++ sysvinit/src/sulogin.c (arbeidskopi) @@ -23,6 +23,7 @@ #include #include #include +#include #include #if defined(__GLIBC__) # include @@ -410,7 +411,6 @@ if (pid != getsid(0)) { if (pid == getpgid(0)) setpgid(0, getpgid(getppid())); - setsid(); } signal(SIGHUP, SIG_IGN); @@ -421,13 +421,15 @@ close(2); close(fd); fd = open(tty, O_RDWR); - ioctl(0, TIOCSCTTY, (char *)1); dup(fd); dup(fd); } else close(fd); } } + setsid(); + if (ioctl(0, TIOCSCTTY, (char *)1)) + perror("ioctl(TIOCSCTTY)"); /* * Get the root password.