Red Hat Bugzilla – Bug 18686
/etc/hosts causes denial of localhost-only services
Last modified: 2007-04-18 12:29:06 EDT
After a fresh install, xinetd will deny connections to any services listed
with "only_from = localhost", when attempting to connect from localhost.
/etc/hosts contains the following:
127.0.0.1 localhost.localdomain localhost foo.bar.net foo
changing /etc/hosts to read, for example:
127.0.0.1 localhost.localdomain localhost
192.168.0.1 foo.bar.net foo
fixes the problem.
I suspect, in the first case, xinetd is resolving 127.0.0.1 to "foo" rather
than localhost, and disallowing the connect?
See also bug #17839
Created attachment 3904 [details]
This one-liner fixes it for me. I don't think it's the right solution, but it shows where the problem is.
Verified - it segfaults when doing access control.
The oneliner does not fix the problem.
Huh? It does; I just tried it again, this time without building with -g or
running with -d, which I did the first time.
The problem is that the str_addr comes from a static variable that's overwritten
with each entry parsed. So the problem only shows itself on entries that are
not the last one to be read.
I installed -6 and telnet-server, and had just linuxconf-web and telnet in
xinetd.d. I modified telnet to have 'only_from = localhost', and restarted
xinetd. No problems. When I moved linuxconf-web to xlinuxconf-web and restart
xinetd, I could telnet localhost. After making the one line change and
restarting xinetd, I could.
There is another shallow copy a few lines above, so the one-liner clearly
doesn't _fix_ the problem entirely, but basically the problem is that shallow
rather than deep copies of that string are being performed.
For me, it still segfaults. I agree that the issue is shallow copies, which is
why I'm currently going though it with njamd.
Fixed in xinetd-22.214.171.124pre11-1
*** Bug 20516 has been marked as a duplicate of this bug. ***