Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ncoast!allbery From: forys@boulder.Colorado.EDU (Jeff Forys) Newsgroups: comp.sources.misc Subject: talk(1) enhancements (1 of 2) Message-ID: <4114@ncoast.UUCP> Date: Mon, 10-Aug-87 20:15:32 EDT Article-I.D.: ncoast.4114 Posted: Mon Aug 10 20:15:32 1987 Date-Received: Wed, 12-Aug-87 07:22:37 EDT Sender: allbery@ncoast.UUCP Organization: University of Colorado, Boulder Lines: 1825 Keywords: 4.3BSD, patches, compatible, portable Approved: allbery@ncoast.UUCP X-Archive: comp.sources.misc/8708/9 What follows is a set of patches that will enhance `talk' as distributed with 4.3BSD. No functionality is lost if these patches are applied (i.e. it is still compatible with other machines who run stock 4.3BSD talk). Here is a summary of what the patches do: 1) Fix a bug in 4.3BSD talk which results in bogus error messages being displayed under various circumstances. I posted this fix back in November, everyone should apply it, hence it is separate from the `enhancements'. 2) Makes the 4.3BSD version of talk portable to the following flavours of Unix: Pyramid (OSx2.5,OSx3.1,OSx4.0), Ultrix (1.2), Sun (3.0,3.1,3.2). This is nice, since few of these speak the 4.3BSD talk protocol; it'll probably port to 4.2BSD with OSx2.5. 3) Allow for special control codes to be expanded locally. (e.g. ^A maps into "", ^N displays a menu, etc) While it is possible to send the *mappings* out to people not running these enhancements, doing it `right' requires awful code (e.g. some control chars are only meaningful locally and shouldnt be sent). Instead, because of #2 above (easy portability), we simply run it everywhere here. 4) Resolve internet addresses (e.g. 128.138.240.1) so that things like `talk user@128.138.240.1' will work, and talkd may display "respond with: talk user@128.138.240.1". (this is good for internet hosts that dont yet run a nameserver, and dont have up-to-date /etc/hosts files) 5) If a person you are trying to contact has messages off, and they have a file called ".busy" in their home directory, it will be sent to you and displayed in their half of the screen. The file generally contains the `reason' your messages are off. 6) A "dumb terminal" interface called `chat'. This is good for consoles and terminals without termcaps. `chat' is hard-linked to `talk' and each does the right thing. 7) A revised manual page explaining these enhancements. One thing that would be easy to add to the talk daemon, and probably will be added in the future (if you or I ever get the time) is a ".talkrc" file that would contain options to: 1) list people you will talk to (when your messages are off). 2) list people who you wont talk to even though your messages are on. I have tested these `enhancements' under many circumstances for compatibility with 4.3BSD. Most of these mods have been running for a couple years and I've fixed any little bugs that have since appeared. Finally, this is available via anonymous ftp from boulder.Colorado.EDU. What follows, is a shar archive containing the files: 4.3talk_fix - a fix that should be applied to every 4.3BSD talk. talk.1_diffs - patch to /usr/man/man1/talk.1 (move the patched file to /usr/src/ucb/talk/talk.1 for `make install') talk_diffs - patches for talk; cd /usr/src/ucb/talk & patch... talkd_diffs - patches for talkd; cd /usr/src/etc/talkd & patch... talkd.h_diffs - patch to /usr/include/protocols/talkd.h [I split talkd_diffs into a separate file because of the 64K message limit on some machines. ++bsa] If you make any changes or fix a bug, please let me know... thanks! --- Jeff Forys @ UC/Boulder Engineering Research Comp Cntr (303-492-4991) forys@boulder.Colorado.Edu -or- ..!{hao|nbires}!boulder!forys #--------------------------------CUT HERE------------------------------------- #! /bin/sh # # This is a shell archive. Save this into a file, edit it # and delete all lines above this comment. Then give this # file to sh by executing the command "sh file". The files # will be extracted into the current directory owned by # you with default permissions. # # The files contained herein are: # # -rw-r--r-- 1 allbery System 1886 Aug 10 20:02 4.3talk_fix # -rw-r--r-- 1 allbery System 5947 Aug 10 20:02 talk.1_diffs # -rw-r--r-- 1 allbery System 38180 Aug 10 20:03 talk_diffs # -rw-r--r-- 1 allbery System 512 Aug 10 20:02 talkd.h_diffs # echo 'x - 4.3talk_fix' if test -f 4.3talk_fix; then echo 'shar: not overwriting 4.3talk_fix'; else sed 's/^X//' << '________This_Is_The_END________' > 4.3talk_fix XFrom: forys@sunybcs.UUCP (Jeff Forys) XNewsgroups: net.bugs.4bsd XSubject: talk(1) displays incorrect error messages XDate: 8 Nov 86 08:12:12 GMT X XIndex: /usr/src/ucb/talk/invite.c 4.3BSD +FIX X XDescription: X X talk(1) returns wrong error message under various circumstances. X XRepeat by: X X % talk foo # where `foo' is someone not logged in X [No connection yet] X >>> [Target machine does not recognize us] <<< X % X XFix: X The error messages do not jibe with their respective #define's X in "/usr/include/protocols/talkd.h". The solution is to reorder X the error messages properly as the following diff illustrates... X X*** invite.c_old Sat Nov 8 00:46:33 1986 X--- invite.c Sat Nov 8 00:46:32 1986 X*************** X*** 92,102 **** X } X X static char *answers[] = { X "Your party is not logged on", /* NOT_HERE */ X- "Target machine does not recognize us", /* MACHINE_UNKNOWN */ X- "Target machine can not handle remote talk", /* UNKNOWN_REQUEST */ X "Target machine is too confused to talk to us", /* FAILED */ X "Your party is refusing messages", /* PERMISSION_REFUSED */ X "Target machine indicates protocol mismatch", /* BADVERSION */ X "Target machine indicates protocol botch (addr)",/* BADADDR */ X "Target machine indicates protocol botch (ctl_addr)",/* BADCTLADDR */ X--- 92,103 ---- X } X X static char *answers[] = { X+ "", /* SUCCESS */ X "Your party is not logged on", /* NOT_HERE */ X "Target machine is too confused to talk to us", /* FAILED */ X+ "Target machine does not recognize us", /* MACHINE_UNKNOWN */ X "Your party is refusing messages", /* PERMISSION_REFUSED */ X+ "Target machine can not handle remote talk", /* UNKNOWN_REQUEST */ X "Target machine indicates protocol mismatch", /* BADVERSION */ X "Target machine indicates protocol botch (addr)",/* BADADDR */ X "Target machine indicates protocol botch (ctl_addr)",/* BADCTLADDR */ ________This_Is_The_END________ if test `wc -l < 4.3talk_fix` -ne 51; then echo 'shar: 4.3talk_fix was damaged during transit (should have been 51 bytes)' fi fi ; : end of overwriting check echo 'x - talk.1_diffs' if test -f talk.1_diffs; then echo 'shar: not overwriting talk.1_diffs'; else sed 's/^X//' << '________This_Is_The_END________' > talk.1_diffs X*** /tmp/,RCSt1019856 Fri Aug 7 17:36:46 1987 X--- talk.1 Fri Aug 7 17:36:43 1987 X*************** X*** 4,28 **** X .\" X .\" @(#)talk.1 6.2 (Berkeley) 5/5/86 X .\" X! .TH TALK 1 "May 5, 1986" X .UC 5 X .SH NAME X! talk \- talk to another user X .SH SYNOPSIS X .B talk X! person [ ttyname ] X .SH DESCRIPTION X .I Talk X! is a visual communication program which X! copies lines from your terminal to that of X! another user. X .PP X! If you wish to talk to someone on you own machine, then X .I person X is just the person's login name. If you wish to talk to X! a user on another host, then X .I person X! is of the form : X .sp X .in +2.0i X .I host!user X--- 4,39 ---- X .\" X .\" @(#)talk.1 6.2 (Berkeley) 5/5/86 X .\" X! .TH TALK 1 "Jun 15, 1987" X .UC 5 X .SH NAME X! talk, chat \- communicate with another user X .SH SYNOPSIS X .B talk X! person [tty] X! .br X! .B chat X! person [tty] X .SH DESCRIPTION X .I Talk X! and X! .I chat X! allow you to carry on conversations with other users. X! .I Talk X! uses windows to split the screen in half giving a clear X! picture of who is typing what. X! .I Chat X! displays characters in a line-by-line fashion which may X! cause confusion if both parties are typing at the same time. X! Characters are displayed and sent as soon as they are typed. X .PP X! The command line syntax for both programs is identical. X! If you wish to talk to someone on the same machine, then X .I person X is just the person's login name. If you wish to talk to X! a user on another machine, then X .I person X! can be of the form: X .sp X .in +2.0i X .I host!user X*************** X*** 39,96 **** X .in -2.0i X .sp X though X! .I host@user X! is perhaps preferred. X .PP X If you want to talk to a user who is logged in more than once, X the X! .I ttyname X argument may be used to indicate the X appropriate terminal name. X .PP X! When first called, X! it sends the message X .PP X! Message from TalkDaemon@his_machine... X talk: connection requested by your_name@your_machine. X! talk: respond with: talk your_name@your_machine X .PP X! to the user you wish to talk to. At this point, the recipient X! of the message should reply by X! typing X .PP X talk \ your_name@your_machine X .PP X It doesn't matter from X which machine the recipient replies, as long as his login-name is X the same. X! Once communication is established, the two parties may type X! simultaneously, with their output appearing in separate windows. X! Typing control L will cause the screen to be reprinted, while your X! erase, kill, and word kill characters will work in talk as normal. X! To exit, X! just type your interrupt character; X .I talk X! then moves the cursor to the bottom of the screen and restores X! the terminal. X .PP X Permission to talk may be denied or granted by use of the X .I mesg X command. X! At the outset talking is allowed. X! Certain commands, in particular X! .I nroff X! and X! .IR pr (1) X! disallow X! messages in order to prevent messy output. X .PP X .SH FILES X /etc/hosts to find the recipient's machine X .br X! /etc/utmp to find the recipient's tty X .SH "SEE ALSO" X! mesg(1), who(1), mail(1), write(1) X .SH BUGS X The version of X .IR talk (1) X--- 50,130 ---- X .in -2.0i X .sp X though X! .I user@host X! is perhaps preferred, since it allows X! .I host X! to be a domain name (e.g. boulder.Colorado.EDU) X! or an internet address (e.g. 128.138.240.1) X! as well as a local host. X .PP X If you want to talk to a user who is logged in more than once, X the X! .I tty X argument may be used to indicate the X appropriate terminal name. X .PP X! When first called the message: X .PP X! Message from Talk_Daemon@his_machine at