diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/appl/bsd/ChangeLog | 15 | ||||
-rw-r--r-- | src/appl/bsd/configure.in | 1 | ||||
-rw-r--r-- | src/appl/bsd/krlogind.c | 20 | ||||
-rw-r--r-- | src/appl/bsd/logutil.c | 2 |
4 files changed, 26 insertions, 12 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 118e072cb7..71fe387019 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,18 @@ +Thu Dec 29 10:12:48 1994 Richard Basch (probe@tardis) + + * krlogind.c + * logutil.c + Conditionalized references to ut_type. + + * krlogind.c + * configure.in + Conditionalize grantpt/unlockpt on HAVE_GRANTPT + (added check to configure.in) + + * krlogind.c + Try all the pty master devices. Other systems frequently + use the same names. + Thu Dec 29 01:38:17 1994 Richard Basch <probe@k9> * krlogind.c: diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index 9726462ad4..1c459b0a58 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -36,6 +36,7 @@ AC_FUNC_CHECK(waitpid,AC_DEFINE(HAVE_WAITPID)) AC_FUNC_CHECK(setsid,AC_DEFINE(HAVE_SETSID)) AC_FUNC_CHECK(line_push,AC_DEFINE(HAVE_LINE_PUSH)) AC_FUNC_CHECK(ptsname,AC_DEFINE(HAVE_PTSNAME)) +AC_FUNC_CHECK(grantpt,AC_DEFINE(HAVE_GRANTPT)) AC_HAVE_HEADERS(sys/filio.h sys/sockio.h unistd.h stdlib.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h) AC_REPLACE_FUNCS(getdtablesize) CHECK_SIGNALS diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index 85ded8eacc..31d34c7782 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -769,7 +769,9 @@ void doit(f, fromp) #ifndef NO_UT_PID ent.ut_pid = getpid(); #endif +#ifndef NO_UT_TYPE ent.ut_type = LOGIN_PROCESS; +#endif update_utmp(&ent, "rlogin", line, ""/*host*/); } #endif @@ -1043,7 +1045,7 @@ krb5_sigtype cleanup() #ifndef NO_UT_PID ut.ut_pid = 0; #endif -#ifdef HAVE_SETUTENT +#ifndef NO_UT_TYPE ut.ut_type = DEAD_PROCESS; #endif update_utmp(&ut, "", line, (char *)0); @@ -1374,20 +1376,14 @@ getpty(fd,slave) #ifdef HAVE_STREAMS -#ifdef sun -#define PTY_MASTER "/dev/ptmx" -#endif -#ifdef sysvimp -#define PTY_MASTER "/dev/pty" -#endif -#ifndef PTY_MASTER -#define PTY_MASTER "/dev/ptc" -#endif + *fd = open("/dev/ptmx", O_RDWR|O_NDELAY); /* Solaris, IRIX */ + if (*fd < 0) *fd = open("/dev/ptc", O_RDWR|O_NDELAY); /* AIX */ + if (*fd < 0) *fd = open("/dev/ptm", O_RDWR|O_NDELAY); /* OSF/1 */ + if (*fd < 0) *fd = open("/dev/pty", O_RDWR|O_NDELAY); /* sysvimp */ - *fd = open(PTY_MASTER, O_RDWR|O_NDELAY); if (*fd < 0) return 1; -#ifdef sun +#ifdef HAVE_GRANTPT if (grantpt(*fd) || unlockpt(*fd)) return 1; #endif diff --git a/src/appl/bsd/logutil.c b/src/appl/bsd/logutil.c index ac5b459361..22e67a72b9 100644 --- a/src/appl/bsd/logutil.c +++ b/src/appl/bsd/logutil.c @@ -165,7 +165,9 @@ void logwtmp(tty, locuser, host, loggingin) sprintf(utmp_id, "kr%s", tmpx); strncpy(ut.ut_id, utmp_id, sizeof(ut.ut_id)); +#ifndef NO_UT_TYPE ut.ut_type = (loggingin ? USER_PROCESS : DEAD_PROCESS); +#endif #ifndef NO_UT_PID ut.ut_pid = (loggingin ? getpid() : 0); #endif |