[1151] in Moira

home help back first fref pref prev next nref lref last post

mailmaint

daemon@ATHENA.MIT.EDU (Craig Fields)
Fri Jan 30 17:51:07 1998

Date: Fri, 30 Jan 1998 17:50:56 -0500
From: Craig Fields <cfields@MIT.EDU>
To: bug-moira@MIT.EDU
Cc: mvsilis@MIT.EDU

mvsilis mentioned to me that they have been getting reports of
mailmaint frequently starting up using the username of the previous
user who had logged in to the machine (on the O2s, I think). He also
demonstrated it to me on not-a-guppy. I had a look at the code:

  if (!(username = getlogin()))
    {
      struct passwd *getpwuid();

      username = getpwuid(getuid())->pw_name;
    }

and it looks like the only thing that could really be going wrong to
cause this is that something is doing the wrong thing with utmp. I
imagine it must be either getlogin() or xterm that is causing the
problems, neither of which is our code. And thinking about it, I'm not
so sure I hadn't heard of this bug in the past for another
architecture. The simplest fix would be to just eliminate the call to
getlogin() and use the password file, though the ideal fix might be to
get the username out of the ticket file.

Craig

home help back first fref pref prev next nref lref last post