summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Eichin <eichin@mit.edu>1994-08-08 00:39:59 +0000
committerMark Eichin <eichin@mit.edu>1994-08-08 00:39:59 +0000
commitbe033c87a3655383f41884d0a2169956187527e8 (patch)
treeb173252dc31f9adad809bae8ae189f36821788c4 /src
parentc30b32c3b00b157ad7bd0d408d1c083685e5ee07 (diff)
some linux/posix and alpha fixes
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4061 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/bsd/krlogind.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c
index 808a2ab99..518f6c5bc 100644
--- a/src/appl/bsd/krlogind.c
+++ b/src/appl/bsd/krlogind.c
@@ -141,7 +141,9 @@ static char sccsid[] = "@(#)rlogind.c 5.17 (Berkeley) 8/31/88";
#include <sys/stropts.h>
#endif
-#ifndef POSIX_TERMIOS
+#ifdef POSIX_TERMIOS
+#include <termios.h>
+#else
#ifdef SYSV
#define USE_TERMIO
#endif
@@ -567,6 +569,10 @@ void doit(f, fromp)
/* Make sure we can open slave pty, then close it for system 5 so that
the process group is set correctly..... */
+#ifdef __alpha
+ /* osf/1 method of losing controlling tty...*/
+ setsid();
+#endif
#ifdef VHANG_FIRST
vfd = open(line, O_RDWR);
if (vfd < 0)
@@ -597,6 +603,10 @@ void doit(f, fromp)
#endif /* VHANG_FIRST */
if (t < 0)
fatalperror(f, line);
+#ifdef __alpha
+ if(ioctl(t, TIOCSCTTY, 0) < 0) /* set controlling tty */
+ fatalperror(f, "setting controlling tty");
+#endif
#ifdef SYSV
close(t);
#endif
@@ -608,19 +618,23 @@ void doit(f, fromp)
fatalperror(f, "", errno);
if (pid == 0) {
{
+#ifdef POSIX_TERMIOS
+ struct termios new_termio;
+#else
#ifdef USE_TERMIO
struct termio b;
-#define TIOCGETP TCGETA
-#define TIOCSETP TCSETA
-#ifdef MIN
-#undef MIN
-#endif
-#define MIN 1
-#define TIME 0
+# define TIOCGETP TCGETA
+# define TIOCSETP TCSETA
+# ifdef MIN
+# undef MIN
+# endif
+# define MIN 1
+# define TIME 0
#else
struct sgttyb b;
-#endif
+#endif /* USE_TERMIO */
+#endif /* POSIX_TERMIOS */
#ifdef SYSV
(void) setpgrp();
/* SYSV open slave device: We closed it above so pgrp
@@ -666,6 +680,17 @@ void doit(f, fromp)
if (line_push(t) < 0)
fatalperror(f, "IPUSH",errno);
#endif
+#ifdef POSIX_TERMIOS
+ tcgetattr(t,&new_termio);
+ new_termio.c_lflag &= ~(ICANON|ECHO|ISIG|IEXTEN);
+ /* so that login can read the authenticator */
+ new_termio.c_iflag &= ~(IXON|IXANY|BRKINT|INLCR|ICRNL|ISTRIP);
+ /* new_termio.c_iflag = 0; */
+ /* new_termio.c_oflag = 0; */
+ new_termio.c_cc[VMIN] = 1;
+ new_termio.c_cc[VTIME] = 0;
+ tcsetattr(t,TCSANOW,&new_termio);
+#else
(void)ioctl(t, TIOCGETP, &b);
#ifdef USE_TERMIO
/* The key here is to just turn off echo */
@@ -678,8 +703,9 @@ void doit(f, fromp)
b.c_cc[VTIME] = TIME;
#else
b.sg_flags = RAW|ANYP;
-#endif
+#endif /* USE_TERMIO */
(void)ioctl(t, TIOCSETP, &b);
+#endif /* POSIX_TERMIOS */
/*
** signal the parent that we have turned off echo
** on the slave side of the pty ... he's waiting