summaryrefslogtreecommitdiffstats
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-06-14 22:34:13 +0000
committerbms <bms@FreeBSD.org>2004-06-14 22:34:13 +0000
commitbe62d611636d6821a5b062dfacf428c80b99846a (patch)
tree819f86abf00c0fd16b18f7995e44faeb81b29f01 /usr.bin/talk
parentaa5653471f39b3a73792d3c8e3844be2077f5d0b (diff)
downloadFreeBSD-src-be62d611636d6821a5b062dfacf428c80b99846a.zip
FreeBSD-src-be62d611636d6821a5b062dfacf428c80b99846a.tar.gz
Change the default behaviour of talk(1) to use "localhost" as the
"machine name" in ntalkd(8) request packets, when the destination and source are local. This should make talk(1) use much more pleasant for those security- conscious individuals who have chosen to bind talkd to "localhost". Previous to this change, talk(1) would require that the hostname of the machine, as retrieved by gethostname(3), resolved to a valid and reachable IPv4 address, using gethostbyname(3). This makes talk(1) dependent on a valid host entry for "localhost" in /etc/hosts (or the Domain Name System). PR: bin/23178 Submitted by: angui.sh admin (with cleanups)
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/get_names.c2
-rw-r--r--usr.bin/talk/talk.117
2 files changed, 18 insertions, 1 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c
index f2346ee..ad6b823 100644
--- a/usr.bin/talk/get_names.c
+++ b/usr.bin/talk/get_names.c
@@ -90,7 +90,7 @@ get_names(argc, argv)
if (*cp == '\0') {
/* this is a local to local talk */
his_name = argv[1];
- his_machine_name = my_machine_name;
+ my_machine_name = his_machine_name = "localhost";
} else {
if (*cp++ == '@') {
/* user@host */
diff --git a/usr.bin/talk/talk.1 b/usr.bin/talk/talk.1
index 18965c9..bbd5084 100644
--- a/usr.bin/talk/talk.1
+++ b/usr.bin/talk/talk.1
@@ -142,3 +142,20 @@ The
.Nm
command appeared in
.Bx 4.2 .
+.Pp
+In
+.Fx 5.2 ,
+the default behaviour of
+.Nm
+was changed to treat local-to-local talk requests as originating
+and terminating at
+.Em localhost .
+Before this change, it was required that the hostname (as per
+.Xr gethostname 3 )
+resolved to a valid IPv4 address (via
+.Xr gethostbyname 3 ) ,
+making
+.Nm
+unsuitable for use in configurations where
+.Xr talkd 8
+was bound to the loopback interface (normally for security reasons).
OpenPOWER on IntegriCloud