[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: who am i

* George Nelson <ghnelson_(_at_)_ux1_(_dot_)_cso_(_dot_)_uiuc_(_dot_)_edu> [001128 20:21]:
> I'm trying to setup my login script to get the name of the machine that I'm
> remotely connecting from, store that to a variable called DISPLAY then
> export DISPLAY.  I'm having trouble getting the name, the rest is easy.  It
> seems who am i only outputs the first 16 bits of the hostname.  Is there any
> way to get the full remote host name?
> borrowedtime 10:05PM ~ % who am i
> USER     LINE     WHEN          FROM
> ghnelson ttyp1    Nov 28 21:58  (opcenter2.cso.ui)

George, I do not think you can get more than the first 16 chars of the
hostname easily. Take a look at /usr/src/include/utmp.h -- it defines
UT_HOSTSIZE to be 16.

Now, this is pure conjecture, but I would be interested in knowing
whether recompiling the kernel and userland tools to expect a
UT_HOSTSIZE to be larger, say 64 or 128 chars, would work or not. I bet
it would, and I bet nothing would be worse off for it. But, as always,
test on test servers, not production servers. :)

Of course, another alternative is to hack away at the login program (or
whatever else login programs you are using) to store this information
somewhere, but .. that might be hairy.

Another completely different alternative -- use ssh and its automatic X
forwarding abilities. This is what I use and suggest.

As for your last question (which I snipped too quickly I fear :) --
setting display to be may cause X to use TCP/IP for local
display in a situation where it would likely use unix domain sockets
instead. The unix domain sockets would be much faster, but I do not know
if you would notice it or not. <shrug>


``Oh Lord; Ooh you are so big; So absolutely huge; Gosh we're all
really impressed down here, I can tell you.''