Mailing List Archive

AIX and 2.1.1p1
The new login code works fine with AIX 4.3. Two nits, though. If
--disable-lastlog is defined, the code still tries to slog through wtmp
to determine the last login time. Is this a bug or a feature? If a
feature, change the DISABLE_LASTLOG test below to WITH_AIXAUTHENTICATE.
Also, a small typo in configure.in, plus an AIX tweak.

--- configure.in.orig Thu Jun 8 21:58:35 2000
+++ configure.in Mon Jun 12 16:27:54 2000
@@ -38,6 +38,8 @@
AC_DEFINE(BROKEN_GETADDRINFO)
dnl AIX handles lastlog as part of its login message
AC_DEFINE(DISABLE_LASTLOG)
+ MANTYPE='$(CATMAN)'
+ mansubdir=cat
;;
*-*-hpux10*)
if test -z "$GCC"; then
@@ -994,7 +996,7 @@
[ char *lastlog = _PATH_LASTLOG; ],
[ AC_MSG_RESULT(yes) ],
[
- AC_MSG_RESULT(no),
+ AC_MSG_RESULT(no)
system_lastlog_path=no
])
]
--- session.c.orig Mon Jun 12 16:52:59 2000
+++ session.c Mon Jun 12 16:54:24 2000
@@ -524,6 +524,9 @@
/* Get remote host name. */
hostname = get_canonical_hostname();

+#if defined(DISABLE_LASTLOG)
+ last_login_time = 0;
+#else
/*
* Get the time when the user last logged in. Buf will be set to
* contain the hostname the last login was from.
@@ -532,6 +535,7 @@
last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
buf, sizeof(buf));
}
+#endif

#ifdef USE_PAM
do_pam_session(pw->pw_name, s->tty);

--
Tom Bertelson "Any sufficiently advanced technology
RHI Consulting is indistinguishable from magic."
tbert@abac.com -- Arthur C. Clarke
Re: AIX and 2.1.1p1 [ In reply to ]
Tom Bertelson wrote:
>
> The new login code works fine with AIX 4.3. Two nits, though. If
> --disable-lastlog is defined, the code still tries to slog through wtmp
> to determine the last login time. Is this a bug or a feature? If a
> feature, change the DISABLE_LASTLOG test below to WITH_AIXAUTHENTICATE.
> Also, a small typo in configure.in, plus an AIX tweak.
>
8< 8<

Glad to hear it's working on AIX :) The DISABLE_LASTLOG issue you
mention is a bug, I've made some changes to loginrec.c that I hope will
fix it. If you have time please could you test the attached patch? All
it does is immediately return 0 if DISABLE_LASTLOG is defined.

USE_LASTLOG isn't the opposite of DISABLE_LASTLOG. A bit confusing, I
know. USE_LASTLOG means 'this system has some form of lastlog recording
of its own so use it', whereas DISABLE_LASTLOG should mean 'don't even
*try* to retrieve lastlog information from any source.'
USE_SYSTEM_LASTLOG might be a better symbol name than USE_LASTLOG.

Since the problem should be fixed in loginrec.c, no change is required
in session.c.

I've applied your changes to configure.in, thanks.

-Andre'

>
> --
> Tom Bertelson "Any sufficiently advanced technology
> RHI Consulting is indistinguishable from magic."
> tbert@abac.com -- Arthur C. Clarke
Re: AIX and 2.1.1p1 [ In reply to ]
Andre Lucas wrote:
> USE_LASTLOG isn't the opposite of DISABLE_LASTLOG. A bit confusing, I
> know. USE_LASTLOG means 'this system has some form of lastlog recording
> of its own so use it', whereas DISABLE_LASTLOG should mean 'don't even
> *try* to retrieve lastlog information from any source.'
> USE_SYSTEM_LASTLOG might be a better symbol name than USE_LASTLOG.

Your patch works fine with AIX - thanks!

The reason I wondered about the symbol names is because if configure
can't find a lastlog file anywhere, it sets DISABLE_LASTLOG. It may be
nice in this default case to search wtmp, since presumably the OS
doesn't have a real lastlog facility. --disable-lastlog could still be
used to override this.

Perhaps something like this? (untested):
--- configure.in.orig Thu Jun 8 21:58:35 2000
+++ configure.in Tue Jun 13 10:15:25 2000
@@ -1008,8 +1010,7 @@
fi
done
if test -z "$conf_lastlog_location"; then
- AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
- AC_DEFINE(DISABLE_LASTLOG)
+ AC_MSG_WARN([** Cannot find lastlog - resorting to wtmp search **])
fi
fi
fi

--
Tom Bertelson "Any sufficiently advanced technology
RHI Consulting is indistinguishable from magic."
tbert@abac.com -- Arthur C. Clarke
Re: AIX and 2.1.1p1 [ In reply to ]
Tom Bertelson wrote:
>
8<
> Your patch works fine with AIX - thanks!

Good news. Thanks for testing it.

> The reason I wondered about the symbol names is because if configure
> can't find a lastlog file anywhere, it sets DISABLE_LASTLOG. It may be
> nice in this default case to search wtmp, since presumably the OS
> doesn't have a real lastlog facility. --disable-lastlog could still be
> used to override this.

I agree, I made almost exactly the same change in the CVS yesterday :)

Ta,
-Andre'