summaryrefslogtreecommitdiffstats
path: root/src/appl
diff options
context:
space:
mode:
authorRichard Basch <probe@mit.edu>1994-12-30 04:38:18 +0000
committerRichard Basch <probe@mit.edu>1994-12-30 04:38:18 +0000
commitdba0e1cfe0fb2cbc2245818155d28ddd81c15db3 (patch)
tree344e19442c7570fb9465c5bbbc7c4eafa621748e /src/appl
parentbac7604245e6a68194a1e017890f6735b4a280bc (diff)
downloadkrb5-dba0e1cfe0fb2cbc2245818155d28ddd81c15db3.tar.gz
krb5-dba0e1cfe0fb2cbc2245818155d28ddd81c15db3.tar.xz
krb5-dba0e1cfe0fb2cbc2245818155d28ddd81c15db3.zip
configure.in: Removed extraneous characters
krlogind.c: Try all the forms of tty access (for most types of machines) logutil.c: Corrected conditionalization for ut_pid. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4780 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl')
-rw-r--r--src/appl/bsd/ChangeLog27
-rw-r--r--src/appl/bsd/configure.in4
-rw-r--r--src/appl/bsd/krlogind.c67
-rw-r--r--src/appl/bsd/logutil.c9
4 files changed, 53 insertions, 54 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index 71fe38701..5afde16cd 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,28 +1,27 @@
Thu Dec 29 10:12:48 1994 Richard Basch (probe@tardis)
* krlogind.c
+ Conditionalize grantpt/unlockpt on HAVE_GRANTPT (not just Sun)
+ Conditionalized references to ut_type and ut_pid.
+ Try all the methods for getting a pty...
+
* logutil.c
- Conditionalized references to ut_type.
+ Conditionalized references to ut_type and ut_pid.
- * 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.
+ Corrected a minor syntactical error with extraneous "],"
Thu Dec 29 01:38:17 1994 Richard Basch <probe@k9>
* krlogind.c:
- More error checking for Solaris tty setup routines (grantpt/unlockpt)
- Commented out the OOB code, as it causes problems currently.
- Cleaned up some of the #ifdef's for logging incoming users
- Removed extraneous declaration of malloc()
- Pass a "" for the hostname rather than NULL to update_utmp.
- Some additional cosmetic changes.
- Included/excluded #ifdef SYSV code (SYSV is not defined anywhere)
+ Error checks for Solaris tty setup routines (grantpt/unlockpt)
+ Commented out the OOB code, as it causes problems currently.
+ Cleaned up some of the #ifdef's for logging incoming users
+ Removed extraneous declaration of malloc()
+ Pass a "" for the hostname rather than NULL to update_utmp.
+ Some additional cosmetic changes.
+ Included/excluded SYSV code (SYSV is not defined anywhere)
Wed Dec 28 14:59:58 1994 Richard Basch (probe@tardis)
diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in
index 1c459b0a5..a265b05ca 100644
--- a/src/appl/bsd/configure.in
+++ b/src/appl/bsd/configure.in
@@ -44,7 +44,7 @@ CHECK_SETJMP
CHECK_DIRENT
CHECK_FCNTL
CHECK_WAIT_TYPE
-AC_HEADER_CHECK(termios.h,AC_FUNC_CHECK([cfsetispeed],AC_DEFINE(POSIX_TERMIOS)))
+AC_HEADER_CHECK(termios.h,AC_FUNC_CHECK(cfsetispeed,AC_DEFINE(POSIX_TERMIOS)))
KRB_INCLUDE
CHECK_UTMP
WITH_KRB5ROOT
@@ -123,7 +123,7 @@ AC_CACHE_VAL(krb5_cv_setpgrp_args,
krb5_cv_setpgrp_args=two, krb5_cv_setpgrp_args=void)])
AC_MSG_RESULT($krb5_cv_setpgrp_args)
if test $krb5_cv_setpgrp_args = two; then
-AC_DEFINE(SETPGRP_TWOARG)],
+AC_DEFINE(SETPGRP_TWOARG)
fi
dnl
dnl
diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c
index 31d34c778..32dd82eb7 100644
--- a/src/appl/bsd/krlogind.c
+++ b/src/appl/bsd/krlogind.c
@@ -1374,57 +1374,54 @@ getpty(fd,slave)
int i,ptynum;
struct stat stb;
-#ifdef HAVE_STREAMS
-
*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 */
- if (*fd < 0) return 1;
+ if (*fd >= 0) {
#ifdef HAVE_GRANTPT
- if (grantpt(*fd) || unlockpt(*fd)) return 1;
+ if (grantpt(*fd) || unlockpt(*fd)) return 1;
#endif
#ifdef HAVE_PTSNAME
- p = ptsname(*fd);
+ p = ptsname(*fd);
#else
- p = ttyname(*fd);
+ p = ttyname(*fd);
#endif
- if (p) {
- strcpy(slave, p);
+ if (p) {
+ strcpy(slave, p);
+ return 0;
+ }
+
+ if (fstat(*fd, &stb) < 0) {
+ close(*fd);
+ return 1;
+ }
+ ptynum = (int)(stb.st_rdev&0xFF);
+ sprintf(slave, "/dev/ttyp%x", ptynum);
return 0;
- }
- if (fstat(*fd, &stb) < 0) {
- close(*fd);
- return 1;
- }
- ptynum = (int)(stb.st_rdev&0xFF);
- sprintf(slave, "/dev/ttyp%x", ptynum);
- return 0;
+ } else {
-#else /* NOT STREAMS */
-
- for (c = 'p'; c <= 's'; c++) {
- sprintf(slave,"/dev/ptyXX");
- slave[strlen("/dev/pty")] = c;
- slave[strlen("/dev/ptyp")] = '0';
- if (stat(slave, &stb) < 0)
- break;
- for (i = 0; i < 16; i++) {
- slave[sizeof("/dev/ptyp") - 1] = "0123456789abcdef"[i];
- *fd = open(slave, O_RDWR);
- if (*fd > 0)
- goto gotpty;
+ for (c = 'p'; c <= 's'; c++) {
+ sprintf(slave,"/dev/ptyXX");
+ slave[strlen("/dev/pty")] = c;
+ slave[strlen("/dev/ptyp")] = '0';
+ if (stat(slave, &stb) < 0)
+ break;
+ for (i = 0; i < 16; i++) {
+ slave[sizeof("/dev/ptyp") - 1] = "0123456789abcdef"[i];
+ *fd = open(slave, O_RDWR);
+ if (*fd < 0) continue;
+
+ /* got pty */
+ slave[strlen("/dev/")] = 't';
+ return 0;
+ }
}
+ return 1;
}
- return 1;
- gotpty:
- slave[strlen("/dev/")] = 't';
- return 0;
-#endif /* STREAMS */
}
diff --git a/src/appl/bsd/logutil.c b/src/appl/bsd/logutil.c
index 22e67a72b..d92eac7b7 100644
--- a/src/appl/bsd/logutil.c
+++ b/src/appl/bsd/logutil.c
@@ -74,7 +74,7 @@ void update_utmp(ent, username, line, host)
ent->ut_host[0] = '\0';
#endif
-#ifdef HAVE_SETUTENT
+#ifndef NO_UT_PID
tmpx = line + strlen(line)-1;
if (*(tmpx-1) != '/') tmpx--; /* last two characters, unless it's a / */
sprintf(utmp_id, "kl%s", tmpx);
@@ -158,12 +158,16 @@ void logwtmp(tty, locuser, host, loggingin)
strncpy(ut.ut_line, tty, sizeof(ut.ut_line));
ut.ut_time = time(0);
-#ifdef HAVE_SETUTENT
+#ifndef NO_UT_PID
+ ut.ut_pid = getpid();
strncpy(ut.ut_user, locuser, sizeof(ut.ut_user));
tmpx = tty + strlen(tty) - 2;
sprintf(utmp_id, "kr%s", tmpx);
strncpy(ut.ut_id, utmp_id, sizeof(ut.ut_id));
+#else
+ strncpy(ut.ut_name, locuser, sizeof(ut.ut_name));
+#endif
#ifndef NO_UT_TYPE
ut.ut_type = (loggingin ? USER_PROCESS : DEAD_PROCESS);
@@ -171,7 +175,6 @@ void logwtmp(tty, locuser, host, loggingin)
#ifndef NO_UT_PID
ut.ut_pid = (loggingin ? getpid() : 0);
#endif
-#endif
update_wtmp(&ut);
}