Mailing List Archive

patch for utmpx corruption for openssh-2.1.0p3.tar.gz
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 {
Re: patch for utmpx corruption for openssh-2.1.0p3.tar.gz [ In reply to ]
On Thu, 8 Jun 2000, Kenji Miyake wrote:

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

Can you give this release a try:

http://www.mindrot.org/misc/junk/openssh-2.1.1p1-TEST-2000060700.tar.gz

It contains substantially improved login code.

-d

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
Re: patch for utmpx corruption for openssh-2.1.0p3.tar.gz [ In reply to ]
From: Damien Miller <djm@mindrot.org>
Subject: Re: patch for utmpx corruption for openssh-2.1.0p3.tar.gz
Date: Thu, 8 Jun 2000 14:42:39 +1000 (EST)

> On Thu, 8 Jun 2000, Kenji Miyake wrote:
>
> > if openssh-2.1.0p3 exec in USE_UTMPX enabled environment (ie. solaris
> > 8) then utmpx file update to utmp format.
>
> Can you give this release a try:
>
> http://www.mindrot.org/misc/junk/openssh-2.1.1p1-TEST-2000060700.tar.gz
>
> It contains substantially improved login code.

Your revised code is very clear and basically no problem, but some
little problem for solaris8 environment. Solaris8 don't have utmp and
wtmp file but configure script detect and use it(access utmpx and
wtmpx file twice for each.).

--- ./configure.in.org Wed Jun 7 21:20:23 2000
+++ ./configure.in Fri Jun 9 08:32:14 2000
@@ -106,6 +106,15 @@
need_dash_r=1
# hardwire lastlog location (can't detect it on some versions)
conf_lastlog_location="/var/adm/lastlog"
+ AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
+ sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
+ if test "$sol2ver" -ge 8; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(DISABLE_UTMP)
+ AC_DEFINE(DISABLE_WTMP)
+ else
+ AC_MSG_RESULT(no)
+ fi
;;
*-*-sunos4*)
CFLAGS="$CFLAGS -DSUNOS4"
Re: patch for utmpx corruption for openssh-2.1.0p3.tar.gz [ In reply to ]
On Fri, 9 Jun 2000, Kenji Miyake wrote:


> Your revised code is very clear and basically no problem,

The new code is actually by Andre Lucas, but yes - it is a great
improvement.

> but some
> little problem for solaris8 environment. Solaris8 don't have utmp and
> wtmp file but configure script detect and use it(access utmpx and
> wtmpx file twice for each.).

Thanks for this - I have applied the patch.

Expect a real 2.1.1p1 very soon.

Regards,
Damien Miller


--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
Re: patch for utmpx corruption for openssh-2.1.0p3.tar.gz [ In reply to ]
No problems so far on a handful of 2.6 boxen. I take it this should also
fix the utmp curruption reported by Lukas Karrer?

http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=95959541620508&w=2

> On Thu, 8 Jun 2000, Kenji Miyake wrote:
>
> > if openssh-2.1.0p3 exec in USE_UTMPX enabled environment (ie. solaris
> > 8) then utmpx file update to utmp format.
>
> Can you give this release a try:
>
> http://www.mindrot.org/misc/junk/openssh-2.1.1p1-TEST-2000060700.tar.gz
>
> It contains substantially improved login code.
>
> -d
>
> --
> | "Bombay is 250ms from New York in the new world order" - Alan Cox
> | Damien Miller - http://www.mindrot.org/
> | Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
>
>
>
>
>