--- mingetty.c.orig 2010-09-19 07:51:59.000000000 +0000 +++ mingetty.c.orig 2010-09-19 08:00:09.000000000 +0000 @@ -431,12 +431,20 @@ int main (int argc, char **argv) while ((logname = get_logname ()) == 0) /* do nothing */ ; - if (ch_root) - chroot (ch_root); - if (ch_dir) - chdir (ch_dir); - if (priority) - nice (priority); + if (ch_root) { + if (chroot (ch_root)) + error ("chroot(): %s", strerror (errno)); + if (chdir("/")) + error ("chdir(\"/\"): %s", strerror (errno)); + } + if (ch_dir) { + if (chdir (ch_dir)) + error ("chdir(): %s", strerror (errno)); + } + if (priority) { + if (nice (priority)) + error ("nice(): %s", strerror (errno)); + } execl (loginprog, loginprog, autologin? "-f" : "--", logname, NULL); error ("%s: can't exec %s: %s", tty, loginprog, strerror (errno));