Solved

xdm login window - no hostname

Posted on 1998-06-23
15
411 Views
Last Modified: 2010-03-18
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.
0
Comment
Question by:argo
15 Comments
 

Expert Comment

by:xilef
ID: 1584577
Do the commands "uname -n" and/or "hostname" report the right name?

0
 

Author Comment

by:argo
ID: 1584578
Yes, the commands return the correct hostname.
0
 
LVL 1

Expert Comment

by:henckens
ID: 1584579
Did you enter the hostname in /etc/HOSTNAME ?
0
 

Author Comment

by:argo
ID: 1584580
the hostname is correct in etc/HOSTNAME
0
 

Author Comment

by:argo
ID: 1584581
Increased points to 300
0
 
LVL 3

Expert Comment

by:marcelofr
ID: 1584582
the output of

# hostname -f

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


0
 

Author Comment

by:argo
ID: 1584583

host name -f returns the correct name

what commands would you like me to enter within dig?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Expert Comment

by:chytrace
ID: 1584584
Coud you please send me the contents of the following files ?:
/etc/hosts
/usr/lib/X11/xdm/Xservers
/usr/lib/X11/xdm/Xresources
/etc/sysconfig/network

Regards
               Radovan
0
 

Expert Comment

by:spjuver
ID: 1584585
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??
0
 
LVL 1

Expert Comment

by:stormerider
ID: 1584586
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?


0
 

Author Comment

by:argo
ID: 1584587
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.

0
 
LVL 2

Expert Comment

by:JYoungman
ID: 1584588
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").

0
 

Author Comment

by:argo
ID: 1584589
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...

0
 
LVL 2

Accepted Solution

by:
JYoungman earned 300 total points
ID: 1584590
Aha!
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.

0
 

Author Comment

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

Thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now