inconsistent ut_id values in the utmp(x) file
Damien Miller
djm at mindrot.org
Thu Jun 30 19:19:56 EST 2005
Senthil Kumar wrote:
> I think the inconsistency can be avoided by choosing only the number part of
> the terminal file path, something like below in line_abbrevname() of
> loginrec.c
>
> * Always skip prefix if present */
> if (strncmp(src, "/dev/pts/", 9) == 0)
> src += 9;
>
> and then logging only the number part residing in src.
>
> But I also wonder the reason that makes OpenSSH to log terminal type too in
> ut_id[4]?
If you are asking "why do we log (part of) the pty name in ut_id in
addition to ut_line?" then the answer is that some platforms expect it
(e.g. Linux).
If instead you are asking "why do we log the 'pts' part and not just the
numeric line number?", I suppose the answer is because we aren't aware
of any documented rules on the relevant platform.
Generally speaking, the [uwb]tmp/lastlog code is probably the most
agonisingly platform-dependant part of OpenSSH (yes, worse than PAM) and
there are lots of poorly-documented subtleties, like pty name mangling
above. Therefore it is most likely to be the buggy on platforms we don't
have regular access to.
I.e. this code really depends on users testing it and reporting bugs on
their platforms.
-d
More information about the openssh-unix-dev
mailing list