* 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.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4779
dc483132-0cff-0310-8789-
dd5450dbe970
+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:
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
#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
#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);
#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
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