Question on 'who'; finding source host

Question on 'who'; finding source host

Post by Markus Baumeist » Wed, 21 Jul 1993 22:51:45



Hello

We switched some of our Sparc 10 to Solaris 2.2 and struck the first problems
while adapting our standard '.login'-files, which automatically set the
DISPLAY-Variable (used by X-Windows).

In BSD the 'who am I' command displayed the host from which someone 'rlogin'ed
to the machine. e.g.:
goya% who am i
goya!baumeist ttyp3   Jul 20 13:23      (spitzweg)
                                        ==========
On System V this information is missing. e.g.
spitzweg% who am i
baumeist   /dev/pts/4   Jul 20 14:50

I can't find any option to regain this information (and using the normal 'who'
which still displays the host is much to difficult since then the output
have to be heavily parsed).

Any solutions?

Thanks
        Markus Baumeister

--

 
 
 

Question on 'who'; finding source host

Post by Eckhard Rueggebe » Thu, 22 Jul 1993 18:07:02



Quote:

>Hello

>We switched some of our Sparc 10 to Solaris 2.2 and struck the first problems
>while adapting our standard '.login'-files, which automatically set the
>DISPLAY-Variable (used by X-Windows).

>In BSD the 'who am I' command displayed the host from which someone 'rlogin'ed
>to the machine. e.g.:
>goya% who am i
>goya!baumeist ttyp3   Jul 20 13:23      (spitzweg)
>                                        ==========
>On System V this information is missing. e.g.
>spitzweg% who am i
>baumeist   /dev/pts/4   Jul 20 14:50

I found the following on a Classic running Solaris 2.2 :

umpsun1:/opt/users/eckhard 41 > who am i
eckhard    pts/0        Jul 21 10:59    (ikarus.ts.go.dlr.de)

Not only the required info is there, but it is complete !
In former SunOSes (and other UNICES) the length was limited, so the domain
part was partially cut off. The following in .login makes me happy :

if ("`tty`" != "/dev/console") then
        setenv DISPLAY `who am i | awk '{print substr($6,2,length($6)-2) }'`:0
        echo Display auf : $DISPLAY
endif

---
Eckhard R"uggeberg


 
 
 

Question on 'who'; finding source host

Post by Guy Harr » Fri, 23 Jul 1993 04:28:44


Quote:>Not only the required info is there, but it is complete !

Yup.  When AT&T put the remote host name into the "wtmpx" and "utmpx"
files in SVR4, they didn't make it no wimpy 16-character field; it's 257
bytes, for 256 characters of host name plus a trailing '\0'.