inconsistent ut_id values in the utmp(x) file

Senthil Kumar senthilkumar_sen at hotpop.com
Thu Jun 30 17:35:47 EST 2005


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]?

Thanks,
Senthil Kumar.


----- Original Message ----- 
From: "Logu" <logsnaath at gmail.com>
To: <openssh-unix-dev at mindrot.org>
Sent: Wednesday, June 29, 2005 7:22 PM
Subject: inconsistent ut_id values in the utmp(x) file


> 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
>
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
> 





More information about the openssh-unix-dev mailing list