]> andersk Git - openssh.git/commitdiff
- (djm) More SunOS 4.1.x fixes from Nate Itkin <nitkin@europa.com>
authordjm <djm>
Tue, 15 Aug 2000 00:01:22 +0000 (00:01 +0000)
committerdjm <djm>
Tue, 15 Aug 2000 00:01:22 +0000 (00:01 +0000)
CREDITS
ChangeLog
configure.in
includes.h
loginrec.c
session.c

diff --git a/CREDITS b/CREDITS
index 59ffd5531636ced454a55694ee685a607f64dfb6..67f694bcdc9f5afac87fc6bf9d0132e677663ba1 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -49,6 +49,7 @@ Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches
 Matt Richards <v2matt@btv.ibm.com> - AIX patches
 Michael Stone <mstone@cs.loyola.edu> - Irix enhancements
 Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - PAM environment patch
+Nate Itkin <nitkin@europa.com> - SunOS 4.1.x fixes
 Niels Kristian Bech Jensen <nkbj@image.dk> - Assorted patches
 Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
 Phil Hands <phil@hands.com> - Debian scripts, assorted patches
index f6e8746c8a08ccbabf5df06a099ef138e5acfe2d..de8ddf38e8da429ad263762a210f46709b4d0a3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20000815
+ - (djm) More SunOS 4.1.x fixes from Nate Itkin <nitkin@europa.com>
+
 20000813
  - (djm) Add $(srcdir) to includes when compiling (for VPATH). Report from
    Fabrice bacchella <fabrice.bacchella@marchfirst.fr>
index c74f65b91d625d6be6d0aac212f8d00e0e07e5a3..0c9e4fc669438bff6241666b26c57ab5eda78738 100644 (file)
@@ -221,10 +221,10 @@ if test -z "$no_libnsl" ; then
 fi
 
 # Checks for header files.
-AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h usersec.h util.h utmp.h utmpx.h)
+AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h)
 
 # Checks for library functions.
-AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage inet_aton innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
+AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage getttyent inet_aton innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop)
 dnl    checks for time functions
 AC_CHECK_FUNCS(gettimeofday time)
 dnl    checks for libutil functions
index 2f3a56ec6cbc2ec55cb998b05fa62a67e73452e6..13042fd21522a7a9dcac94ee4379e1a4be1c0bbd 100644 (file)
@@ -70,6 +70,9 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #ifdef HAVE_SYS_BSDTTY_H
 # include <sys/bsdtty.h>
 #endif
+#ifdef HAVE_TTYENT_H
+# include <ttyent.h>
+#endif
 #ifdef USE_PAM
 # include <security/pam_appl.h>
 #endif
index 7e7d7dd0c0f1cb831f8ee59344030b9a482cef3c..48ab29c7cc852ba5f7dcf3607a3d8c2c94ea80f4 100644 (file)
@@ -273,7 +273,7 @@ login_get_lastlog(struct logininfo *li, const int uid)
 {
        struct passwd *pw;
 
-       memset(li, '\0', sizeof(struct logininfo));
+       memset(li, '\0', sizeof(*li));
        li->uid = uid;
 
        /* 
@@ -311,7 +311,7 @@ logininfo *login_alloc_entry(int pid, const char *username,
 {
        struct logininfo *newli;
 
-       newli = (struct logininfo *) xmalloc (sizeof(struct logininfo));
+       newli = (struct logininfo *) xmalloc (sizeof(*newli));
        (void)login_init_entry(newli, pid, username, hostname, line);
        return newli;
 }
@@ -339,7 +339,7 @@ login_init_entry(struct logininfo *li, int pid, const char *username,
 {
        struct passwd *pw;
        
-       memset(li, 0, sizeof(struct logininfo));
+       memset(li, 0, sizeof(*li));
   
        li->pid = pid;
 
@@ -569,7 +569,7 @@ void
 construct_utmp(struct logininfo *li,
                    struct utmp *ut)
 {
-       memset(ut, '\0', sizeof(struct utmp));
+       memset(ut, '\0', sizeof(*ut));
 
        /* First fill out fields used for both logins and logouts */
 
@@ -643,7 +643,7 @@ set_utmpx_time(struct logininfo *li, struct utmpx *utx)
 void
 construct_utmpx(struct logininfo *li, struct utmpx *utx)
 {
-       memset(utx, '\0', sizeof(struct utmpx));
+       memset(utx, '\0', sizeof(*utx));
 # ifdef HAVE_ID_IN_UTMPX
        line_abbrevname(utx->ut_id, li->line, sizeof(utx->ut_id));
 # endif
@@ -723,8 +723,30 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
        int tty;
 
        /* FIXME: (ATL) ttyslot() needs local implementation */
+
+#if defined(SUNOS4) && defined(HAVE_GETTTYENT)
+       register struct ttyent *ty;
+
+       tty=0;
+
+       setttyent();
+       while ((struct ttyent *)0 != (ty = getttyent())) {
+               tty++;
+               if (!strncmp(ty->ty_name, ut->ut_line, sizeof(ut->ut_line)))
+                       break;
+       }
+       endttyent();
+
+       if((struct ttyent *)0 == ty) {
+               log("utmp_write_entry: tty not found");
+               return(1);
+       }
+#else /* FIXME */
+
        tty = ttyslot(); /* seems only to work for /dev/ttyp? style names */
 
+#endif /* SUNOS4 && HAVE_GETTTYENT */
+
        if (tty > 0 && (fd = open(UTMP_FILE, O_RDWR|O_CREAT, 0644)) >= 0) {
                (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
                /*
@@ -1031,7 +1053,7 @@ wtmp_get_entry(struct logininfo *li)
        }
 
        /* Seek to the start of the last struct utmp */
-       if (lseek(fd, (off_t)(0-sizeof(struct utmp)), SEEK_END) == -1) {
+       if (lseek(fd, (off_t)(0 - sizeof(struct utmp)), SEEK_END) == -1) {
                /* Looks like we've got a fresh wtmp file */
                close(fd);
                return 0;
@@ -1238,7 +1260,7 @@ syslogin_perform_login(struct logininfo *li)
 {
        struct utmp *ut;
 
-       if (! (ut = (struct utmp *)malloc(sizeof(struct utmp)))) {
+       if (! (ut = (struct utmp *)malloc(sizeof(*ut)))) {
                log("syslogin_perform_login: couldn't malloc()");
                return 0;
        }
@@ -1301,7 +1323,7 @@ static void
 lastlog_construct(struct logininfo *li, struct lastlog *last)
 {
        /* clear the structure */
-       memset(last, '\0', sizeof(struct lastlog));
+       memset(last, '\0', sizeof(*last));
   
        (void)line_stripname(last->ll_line, li->line, sizeof(last->ll_line));
        strlcpy(last->ll_host, li->hostname,
index 388d96bb2c24b613922065efe030363c913e2210..47787e778a0767dd7a0928a24735a3cfeb9f1316 100644 (file)
--- a/session.c
+++ b/session.c
@@ -601,8 +601,9 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw)
                        }
                }
                /* Record that there was a login on that terminal. */
-               record_login(pid, s->tty, pw->pw_name, pw->pw_uid, hostname, 
-                    (struct sockaddr *)&from);
+               if (!options.use_login || command != NULL)
+                       record_login(pid, s->tty, pw->pw_name, pw->pw_uid, 
+                           hostname, (struct sockaddr *)&from);
 
                /* Check if .hushlogin exists. */
                snprintf(line, sizeof line, "%.200s/.hushlogin", pw->pw_dir);
This page took 0.062062 seconds and 5 git commands to generate.