[2.1.1p4] utmp related patches plus unresolved bugs description

Charles Levert charles at comm.polymtl.ca
Thu Jul 27 05:45:09 EST 2000


Fixed:

	-- On systems such as SunOS4 where the system include files
	are no help in locating the utmp file (et al.), configure
	can define their location in CONF_*, but defines.h never used
	these.

	-- Might as well put in the usual location for SunOS4.

	-- In loginrec.c (utmp_write_direct), writing to the utmp file
	was not done correctly.

Remaining:

	-- At logout, the utmp entry cannot be cleared since ttyslot
	cannot find the offset for the terminal since it is the parent
	process that calls this stuff and it does not execute in the
	context of the terminal.  It works at login since it is then
	done by the child process (the one that will eventually exec
	the user shell).  The solution involves having the child
	process inform the parent process of the ttyslot and of the
	fact that a utmp entry was written at login and needs to be
	removed.


========================================================================
--- loginrec.c.orig-2.1.1p4	Mon Jul 10 22:15:54 2000
+++ loginrec.c	Wed Jul 26 15:25:49 2000
@@ -740,7 +740,7 @@
 		}
 		
 		(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
-		if (atomicio(write, fd, ut, sizeof(ut)) != sizeof(ut))
+		if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut))
 			log("utmp_write_direct: error writing %s: %s",
 			    UTMP_FILE, strerror(errno));
       
--- defines.h.orig-2.1.1p4	Thu Jun 22 18:23:34 2000
+++ defines.h	Tue Jul 25 00:43:22 2000
@@ -329,18 +329,33 @@
 #endif
 
 /* FIXME: put default paths back in */
-#if !defined(UTMP_FILE) && defined(_PATH_UTMP)
-#  define UTMP_FILE _PATH_UTMP
+#ifndef UTMP_FILE
+#  ifdef _PATH_UTMP
+#    define UTMP_FILE _PATH_UTMP
+#  else
+#    ifdef CONF_UTMP_FILE
+#      define UTMP_FILE CONF_UTMP_FILE
+#    endif
+#  endif
 #endif
-#if !defined(WTMP_FILE) && defined(_PATH_WTMP)
-#  define WTMP_FILE _PATH_WTMP
+#ifndef WTMP_FILE
+#  ifdef _PATH_WTMP
+#    define WTMP_FILE _PATH_WTMP
+#  else
+#    ifdef CONF_WTMP_FILE
+#      define WTMP_FILE CONF_WTMP_FILE
+#    endif
+#  endif
 #endif
 /* pick up the user's location for lastlog if given */
-#if !defined(LASTLOG_FILE) && defined(_PATH_LASTLOG)
-#  define LASTLOG_FILE _PATH_LASTLOG
-#endif
-#if !defined(LASTLOG_FILE) && defined(CONF_LASTLOG_FILE)
-#  define LASTLOG_FILE CONF_LASTLOG_FILE
+#ifndef LASTLOG_FILE
+#  ifdef _PATH_LASTLOG
+#    define LASTLOG_FILE _PATH_LASTLOG
+#  else
+#    ifdef CONF_LASTLOG_FILE
+#      define LASTLOG_FILE CONF_LASTLOG_FILE
+#    endif
+#  endif
 #endif
 
 
--- configure.in.orig-2.1.1p4	Sat Jul 15 00:59:14 2000
+++ configure.in	Tue Jul 25 00:23:52 2000
@@ -137,6 +137,11 @@
 *-*-sunos4*)
 	CFLAGS="$CFLAGS -DSUNOS4"
 	AC_CHECK_FUNCS(getpwanam)
+	conf_utmp_location=/etc/utmp
+	conf_wtmp_location=/var/adm/wtmp
+	conf_lastlog_location=/var/adm/lastlog
+	MANTYPE='$(CATMAN)'
+	mansubdir=cat
 	;;
 *-sni-sysv*)
 	CFLAGS="$CFLAGS -I/usr/local/include"
========================================================================





More information about the openssh-unix-dev mailing list