diff options
Diffstat (limited to 'xdmshell.c')
-rw-r--r-- | xdmshell.c | 66 |
1 files changed, 2 insertions, 64 deletions
@@ -26,9 +26,7 @@ in this Software without prior written authorization from The Open Group. * * * Author: Jim Fulton, MIT X Consortium * - * This program should probably be setuid to root. On the macII, it must be - * run from the console so that getty doesn't get confused about zero-length - * reads. + * This program should probably be setuid to root. * * WARNING: Make sure that you tailor your Xresources file to have a * way of invoking the abort-display() action. Otherwise, you won't be able @@ -41,14 +39,6 @@ in this Software without prior written authorization from The Open Group. #include <errno.h> #include <unistd.h> -#ifdef macII -#define ON_CONSOLE_ONLY -#endif - -#ifdef ON_CONSOLE_ONLY -#include <sys/ioctl.h> -#endif - #ifndef BINDIR #define BINDIR "/usr/bin/X11" #endif @@ -97,7 +87,7 @@ static int exec_args ( return waitCode (status); } -#if defined(macII) || defined(sun) +#if defined(sun) static int exec_one_arg ( char *filename, char *arg) @@ -119,12 +109,6 @@ main ( int ttyfd; char cmdbuf[256]; char *args[10]; -#ifdef ON_CONSOLE_ONLY - int consfd; - int ttypgrp, conspgrp; - char *ttyName; - extern char *ttyname(); -#endif ProgramName = argv[0]; @@ -140,47 +124,8 @@ main ( ProgramName); exit (1); } -#ifdef ON_CONSOLE_ONLY - if (ioctl (ttyfd, TIOCGPGRP, (char *)&ttypgrp) != 0) { - fprintf (stderr, "%s: unable to get process group of /dev/tty\r\n", - ProgramName); - (void) close (ttyfd); - exit (1); - } -#endif (void) close (ttyfd); -#ifdef ON_CONSOLE_ONLY - ttyName = ttyname (0); - if (!ttyName || strcmp (ttyName, "/dev/console") != 0) { - fprintf (stderr, "%s: must login on /dev/console instead of %s\r\n", - ProgramName, ttyName ? ttyName : "non-terminal device"); - exit (1); - } - - consfd = open ("/dev/console", O_RDWR, 0); - if (consfd < 3) { /* stdin = 0, stdout = 1, stderr = 2 */ - fprintf (stderr, "%s: unable to open /dev/console\r\n", - ProgramName); - exit (1); - } - - if (ioctl (consfd, TIOCGPGRP, (char *)&conspgrp) != 0) { - fprintf (stderr, - "%s: unable to get process group of /dev/console\r\n", - ProgramName); - (void) close (consfd); - exit (1); - } - (void) close (consfd); - - if (ttypgrp != conspgrp) { - fprintf (stderr, "%s: must be run from /dev/console\r\n", - ProgramName); - exit (1); - } -#endif - /* make xdm run in a non-setuid environment */ if (setuid (geteuid()) == -1) { fprintf(stderr, "%s: cannot setuid (error %d, %s)\r\n", @@ -204,13 +149,6 @@ main ( exit (1); } -#ifdef macII - strcpy (cmdbuf, BINDIR); - strcat (cmdbuf, "/Xrepair"); - (void) exec_one_arg (cmdbuf, NULL); - (void) exec_one_arg ("/usr/bin/screenrestore", NULL); -#endif - #ifdef sun strcpy (cmdbuf, BINDIR); strcat (cmdbuf, "/kbd_mode"); |