xdm login window - no hostname

I have a linux box (Redhat 5) running xdm.
When I log in from a Win 95 xserver, the xlogin window shows the hostname as '1' instead of its correct name.
I believe the name is supposed to come from the file etc/X11/xdm/Xresources, where the line
xlogin*greeting: CLIENTHOST appears - I believe this is supposed to be replaced with the correct line by Xsetup.
As far as I can tell, other files appear to be correct.
Who is Participating?
How funny!  (sorry! :-)

"linux" is ITSELF a macro, which the preprocessor defines with
the value 1.  How awkward.  You could prevent this happeining by passing the option -Ulinux to the /lib/cpp program, but I don't know of a way to do that.

The best solution is to add the line
      #undef linux

to /etc/X11/xdm/Xresources, somewhere before the first
line which references HOSTNAME.

Do the commands "uname -n" and/or "hostname" report the right name?

argoAuthor Commented:
Yes, the commands return the correct hostname.
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Did you enter the hostname in /etc/HOSTNAME ?
argoAuthor Commented:
the hostname is correct in etc/HOSTNAME
argoAuthor Commented:
Increased points to 300
the output of

# hostname -f

is correct? what if you "dig(1)" a bit?

argoAuthor Commented:

host name -f returns the correct name

what commands would you like me to enter within dig?
Coud you please send me the contents of the following files ?:

I don't understand theproblem issue. What is a 'Win 95 xserver'??
Do you use a X-emulator on a win 95 machine as X-client to a Linux-server??
Or do you use the win-95-look fvwm95 at the same machine??
Also, is it a possibility that you are getting the X display # rather than the hostname? Ie,
default on machine would be machine:0 for display, the next would be machine:1... does the client X viewer show you the display #? Have you tried another X client viewer on 95?

argoAuthor Commented:
This might be true - I am getting a '1' as the name, even if true, I cannot understand why only one of my three Linux machines does it.

Yes, I have tried Exceed 6, a demo copy of X-Win32 and MI/X - all with the same result.

The xdm configuration file is loaded via xrdb.  xrdb passes the input file through the C preprocessor.  The "1" is absolutely typical of what happens when you have a preprocessor macro defined, but with no specified value.  

To investigate this, please run this command:-
echo "foo: CLIENTHOST" | xrdb -n -merge -

This should just say "foo: your-host-name", not "foo: 1".  If it says the latter, run this:-
echo "foo: CLIENTHOST" | strace -f -o TRACE xrdb -n -merge -
and see whar arguments are passed to /lib/cpp in the exec call
("grep exec TRACE").

argoAuthor Commented:
The first command does return foo: 1

The second gives

373   execve("/usr/X11R6/bin/xrdb", ["xrdb", "-n", "-merge"], [/* 20 vars */]) = 0
374   execve("/bin/sh", ["sh", "-c", "/lib/cpp -traditional -Dlinux -D"...], [/* 20 vars */]) = 0
374   execve("/lib/cpp", ["/lib/cpp", "-traditional", "-Dlinux", "-D__i386__", "-D_POSIX_C_SOURCE=199309L", "-D_POSIX_SOURCE", "-D_BSD_SOURCE", "-D_SVID_SOURCE", "-DHOST=paul", "-DSERVERHOST=paul", "-DSRVR_paul", "-DDISPLAY_NUM=0", "-DCLIENTHOST=linux", "-DCLNT_linux", "-DVERSION=11", "-DREVISION=0", ...], [/* 20 vars */]) = 0

it appears to contain the correct definition, so I'm still stuck...

argoAuthor Commented:
It was funny - I didn't even want the box called 'linux' it was just a name I gave it while setting up...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.