inconsistent ut_id values in the utmp(x) file

Logu logsnaath at gmail.com
Wed Jun 29 23:52:01 EST 2005


Hi,

In loginrec.c,  the 'line' string utility function line_abbrevname() returns 
the last four characters of the terminal file path.  This returned value is 
assigned to the utmp structure member ut_id[4].

Some sample ut_id values are shown below:

/dev/pts/1   will have ut_id set to ts/1
/dev/pts/2   will have ut_id set to ts/2
.
.
/dev/pts/9   will have ut_id set to ts/9
/dev/pts/10 will have ut_id set to s/10
                                                 ^^^^
/dev/pts/11 will have ut_id set to s/11
                                                  ^^^^

Just by way of a contrast,  the corresponding rlogin (or telnet) records 
would show just the number part of the terminal device file path.  This 
inconsistency creates issues for HP-UX users, particularly in environments 
where specific tools are being used to read and analyze utmp information.

I am wondering what the reason was for choosing that approach. Wouldn't it 
have been better to assign just the number part to ut_id?

thanks
-logu




More information about the openssh-unix-dev mailing list