Bug 23178

Summary: 'talk' not doing right thing
Product: Base System Reporter: angui.sh admin <root>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description angui.sh admin 2000-11-29 19:20:00 UTC
	when using xinetd to bind ntalkd to the internal interfaces
	(10.0.0.1 and 127.0.0.1) talk refuses to work properly. this
	is because in the talk source, it does a gethostname call to
	look up the hostname of the machine, and gets my external
	interface name/ip and attempts to talk to/through that. since
	ntalkd isn't bound to that interface, of course it fails.
	A local user to local user talk should use the loopback!

Fix: 

Edit the 'get_names.c' file, change the section where it has:

if (*cp == '\0') {
                /* this is a local to local talk */
                his_name = argv[1];
                his_machine_name = my_machine_name;

change that to:

if (*cp == '\0') {
                /* this is a local to local talk */
                his_name = argv[1];
                his_machine_name = "localhost";
                my_machine_name  = "localhost";
How-To-Repeat: 
	Just have a box with it's own hostname/domain on the external
	interface, watch the gethostname call return that. that
	name will be used later when the talk program tries to do
	its udp sending and recieving....
Comment 1 Chris D.Faulhaber freebsd_committer freebsd_triage 2000-11-30 16:32:20 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Misfiled PR
Comment 2 Bruce M Simpson freebsd_committer freebsd_triage 2004-06-14 23:34:23 UTC
State Changed
From-To: open->patched

Committed to -CURRENT with cleanup, thanks!
Comment 3 Gavin Atkinson freebsd_committer freebsd_triage 2007-06-09 19:53:35 UTC
State Changed
From-To: patched->closed

Fixed in all supported FreeBSD releases