* krlogind.c
authorRichard Basch <probe@mit.edu>
Thu, 29 Dec 1994 15:17:28 +0000 (15:17 +0000)
committerRichard Basch <probe@mit.edu>
Thu, 29 Dec 1994 15:17:28 +0000 (15:17 +0000)
* 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

src/appl/bsd/ChangeLog
src/appl/bsd/configure.in
src/appl/bsd/krlogind.c
src/appl/bsd/logutil.c

index 118e072cb7a14ba6484a4fa731c7cf2c0d461a82..71fe3870199b24cb7418410af24c973fcc372a50 100644 (file)
@@ -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:
index 9726462ad4ced1a33b962d9b2e6b04c5d2a10fb7..1c459b0a58e439e5d9be0a9477f5682f3204d419 100644 (file)
@@ -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
index 85ded8eaccc722a6b819cef3eae0533257c537d8..31d34c7782ced6bba21eb4d02b20ab272e7e4894 100644 (file)
@@ -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
     
index ac5b459361b8db3354d93b01f9230bbd5be25ed1..22e67a72b9a1b0dd46768728d61358879db1f917 100644 (file)
@@ -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