Charles Levert
2000-Jul-26 19:45 UTC
[2.1.1p4] utmp related patches plus unresolved bugs description
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" ========================================================================
Ben Lindstrom
2000-Jul-26 20:10 UTC
[2.1.1p4] utmp related patches plus unresolved bugs description
On Wed, 26 Jul 2000, Charles Levert wrote: [..]> 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. >This is pretty much the same problem I had after getting logins to work under NeXT. I could not see a clean way of doing it besides tracking the orignal ttyslot() output until it was needed to clear the utmp file. I ended up just tracking what tty the user was on and wrote a primative ttyslot(char *) that took in the tty and returned the slot to change. That patch should help NeXT (I did something like that before, but it was not as clean nor was finished) resolve it's utmp/wtmp issues. Ben.
Damien Miller
2000-Aug-09 06:37 UTC
[2.1.1p4] utmp related patches plus unresolved bugs description
On Wed, 26 Jul 2000, Charles Levert wrote:> 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.Applied - thanks. Regards, Damien Miller -- | "Bombay is 250ms from New York in the new world order" - Alan Cox | Damien Miller - http://www.mindrot.org/ | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)