patch for utmpx corruption for openssh-2.1.0p3.tar.gz

Kenji Miyake kenji at miyake.org
Thu Jun 8 02:50:16 EST 2000


 if openssh-2.1.0p3 exec in USE_UTMPX enabled environment (ie. solaris
8) then utmpx file update to utmp format.

--- ./bsd-login.c.org	Sat May 20 14:03:00 2000
+++ ./bsd-login.c	Thu Jun  8 01:33:43 2000
@@ -148,10 +148,11 @@
 			if (utp->ut_type == USER_PROCESS) {
 #ifdef USE_UTMPX
 				if ((fd = open(_PATH_UTMPX, O_WRONLY|O_APPEND, 0)) >= 0) {
+					(void)write(fd, utx, sizeof(struct utmpx));
 #else /* USE_UTMPX */
 				if ((fd = open(_PATH_UTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
-#endif /* USE_UTMPX */
 					(void)write(fd, utp, sizeof(struct utmp));
+#endif /* USE_UTMPX */
 					(void)close(fd);
 				}
 			} else {





More information about the openssh-unix-dev mailing list