document distributed with 4.1BSD
[unix-history] / usr / src / usr.bin / uucp / SMM.doc / uucpimpl / implement.ms
CommitLineData
10bd7bb5
KM
1.\" @(#)implement.ms 4.1 (Berkeley) %G%
2.\"
3.RP
4.TM 78-1273-5 39199 39199-11
5.ND October 31, 1978
6.if \n(TN>0 .FS
7.if \n(TN>0 * On internship from Department 9444.
8.if \n(TN>0 .FE
9.TL
10Uucp Implementation Description
11.AU "MH 2C-572" 3126
12.ie \n(TN>0 D. A. Nowitz\s-2\u*\d\s+2
13.el D. A. Nowitz
14.AB
15.PP
16Uucp is a series of programs designed to permit communication
17between
18UNIX
19systems using either dial-up or hardwired communication
20lines.
21This document gives a detailed implementation
22description of the current (second)
23implementation of uucp.
24.PP
25This document is
26for use by an administrator/installer of the system.
27It is not meant as a user's guide.
28.AE
29.CS 12 5 15
30.SH
31Introduction
32.LP
33Uucp is a series of programs designed to permit communication between
34.UX
35systems using either dial-up or
36hardwired communication lines.
37It is used for file transfers and remote command execution.
38The first version of the system was designed and implemented
39by M. E. Lesk.\s-2\u1\d\s+2
40.FS
411 M. E. Lesk and A. S. Cohen,
42.UX
43Software Distribution by Communication Link,
44.ie \n(TN>0 TM-77-1274-3, TM-77-8234-5.
45.el private communication.
46.FE
47This paper describes the current (second) implementation
48of the system.
49.LP
50Uucp is a batch type operation.
51Files are created in a spool directory for processing
52by the uucp demons.
53There are three types of files used for the execution
54of work.
55.I Data\ files
56contain data for transfer to remote systems.
57.I Work\ files
58contain directions for file transfers between systems.
59.I Execution\ files
60are directions for
61.UX
62command executions which
63involve the resources of one or more systems.
64.LP
65The uucp system consists of four primary and two
66secondary programs.
67The primary programs are:
68.RS
69.IP uucp 10
70This program creates work and gathers data files in the spool directory
71for the transmission of files.
72.IP uux
73This program creates work files, execute files and gathers data files for the remote execution of
74.UX
75commands.
76.IP uucico
77This program executes the work files for data transmission.
78.IP uuxqt
79This program executes the execution files for
80.UX
81command execution.
82.RE
83.ne 10
84.LP
85The secondary programs are:
86.RS
87.IP uulog 10
88This program updates the log file with new entries
89and reports on the status of uucp requests.
90.IP uuclean
91This program removes old files from the spool directory.
92.LP
93.RE
94The remainder of this paper will describe the operation
95of each program, the installation of the system,
96the security aspects of the system,
97the files required for execution,
98and the administration of the system.
99.NH
100Uucp - UNIX to UNIX File Copy
101.LP
102The
103.I uucp
104command is the user's primary interface with the system.
105The
106.I uucp
107command was designed to look like
108.I cp
109to the user.
110The syntax is
111.IP
112.I uucp\ \
113.B [
114option
115.B ]
116\ ...\ \ source\ ...\ \ destination
117.LP
118where the source and destination
119may contain the prefix
120.I system-name!
121which indicates the system on which the file
122or files reside
123or where they will be copied.
124.LP
125The options interpreted by
126.I uucp
127are:
128.RS
129.IP \-d 10
130Make directories when necessary for copying the file.
131.IP \-c
132Don't copy source files to the spool directory,
133but use the specified source when the actual
134transfer takes place.
135.IP \-g\fIletter\fR
136Put
137.I letter
138in as the grade in the name of the work file.
139(This can be used to change the order of work for a particular
140machine.)
141.IP \-m
142Send mail on completion of the work.
143.LP
144The following options are used primarily for debugging:
145.IP \-r 10
146Queue the job but do not start
147.I uucico
148program.
149.IP \-s\fIdir\fR
150Use directory
151.I dir
152for the spool directory.
153.IP \-x\fInum\fR
154.I Num
155is the level of debugging output desired.
156.RE
157.LP
158The destination may be a directory name,
159in which case the file name is taken from the last part of the
160source's name.
161The source
162name may contain special shell characters
163such as ``\fI?*[]\fR''.
164If a source argument has a
165.I system-name!
166prefix for a remote system,
167the file name expansion will be done on the remote system.
168.LP
169The command
170.IP "" 12
171uucp\ \ *.c\ \ usg!/usr/dan
172.LP
173will set up the transfer of all files whose names end with ``.c''
174to the ``/usr/dan'' directory on the``usg'' machine.
175.LP
176The source and/or destination names may also contain a
177.I ~user
178prefix.
179This translates to the login directory on
180the specified system.
181For names with partial path-names,
182the current directory is prepended to the file name.
183File names with
184.I ../
185are not permitted.
186.LP
187The command
188.IP "" 12
189uucp\ \ usg!~dan/*.h\ \ ~dan
190.LP
191will set up the transfer of files whose names end with ``.h''
192in dan's login
193directory on system ``usg'' to dan's local
194login directory.
195.LP
196For each source file,
197the program will check the source and destination
198file-names
199and the system-part of each to
200classify the work into one of five types:
201.RS
202.IP [1]
203Copy source to destination on local system.
204.IP [2]
205Receive files from other systems.
206.IP [3]
207Send files to a remote systems.
208.IP [4]
209Send files from remote systems
210to another remote system.
211.IP [5]
212Receive files from remote systems when the source
213contains special shell characters as
214mentioned above.
215.RE
216.LP
217After the work has been set up in the spool directory,
218the
219.I uucico
220program is started to try to contact the other
221machine to execute the work (unless the \-r option
222was specified).
223.SH
224Type 1
225.LP
226A
227.I cp
228command is used to do the work.
229The
230.I \-d
231and the
232.I \-m
233options are not honored in this case.
234.SH
235Type 2
236.LP
237A one line
238.I "work file"
239is created for each file requested and put in the spool directory
240with the following fields, each separated by a blank.
241(All
242.I "work files"
243and
244.I "execute files"
245use a blank as the field separator.)
246.RS
247.IP [1]
248R
249.IP [2]
250The full path-name of the source or a ~user/path-name.
251The
252.I ~user
253part will be expanded on the remote system.
254.IP [3]
255The full path-name of the destination file.
256If the
257.I ~user
258notation is used, it will be immediately
259expanded to be the login directory for the user.
260.IP [4]
261The user's login name.
262.IP [5]
263A ``\-'' followed by an option list.
264(Only the \-m and \-d options will appear in this list.)
265.RE
266.KS
267.SH
268Type 3
269.LP
270For each source file, a
271.I "work file"
272is created and the source file is copied into a
273.I "data file"
274in the spool directory.
275(A ``\-c'' option on the
276.I uucp
277command will prevent the
278.I "data file"
279from being made.)
280In this case, the file will be transmitted from
281the indicated source.)
282The fields of each entry are given below.
283.RS
284.IP [1]
285S
286.IP [2]
287The full-path name of the source file.
288.IP [3]
289The full-path name of the destination or
290~user/file-name.
291.IP [4]
292The user's login name.
293.IP [5]
294A ``\-'' followed by an option list.
295.IP [6]
296The name of the
297.I "data file"
298in the spool directory.
299.IP [7]
300The file mode bits of the source file
301in octal print format
302(e.g. 0666).
303.RE
304.KE
305.SH
306Type 4 and Type 5
307.LP
308.I Uucp
309generates a
310.I uucp
311command and sends it to the remote machine;
312the remote
313.I uucico
314executes the
315.I uucp
316command.
317.NH
318Uux - UNIX To UNIX Execution
319.LP
320The
321.I uux
322command is used to set up the execution of a
323.UX
324command
325where the execution machine and/or some of the
326files are remote.
327The syntax of the uux command is
328.IP
329.I uux\ \
330.B [
331\-
332.B "] ["
333option
334.B ]
335\ ...\ \ command-string
336.LP
337where the command-string is made up of one or more arguments.
338All special shell characters such as ``<>|^'' must be quoted
339either by quoting the entire command-string
340or quoting the character as a separate argument.
341Within the command-string, the command and file names may
342contain a
343.I system-name!
344prefix.
345All arguments which do not contain a ``!'' will not
346be treated as files.
347(They will not be copied to the execution machine.)
348The ``\-'' is used to indicate that the standard input
349for
350.I command-string
351should be inherited from the standard input
352of the
353.I uux
354command.
355The options, essentially for debugging, are:
356.RS
357.IP \-r 10
358Don't start
359.I uucico
360or
361.I uuxqt
362after queuing the job;
363.IP \-x\fInum\fR
364Num is the level of debugging output desired.
365.RE
366.LP
367The command
368.IP "" 12
369pr\ \ abc\ \ |\ \ uux\ \ \-\ \ usg!lpr
370.LP
371will set up the output of ``pr abc''
372as standard input to an lpr command
373to be executed on system ``usg''.
374.LP
375.I Uux
376generates an
377.I "execute file"
378which contains the
379names of the files required
380for execution (including standard input),
381the user's login name, the destination
382of the standard output, and the command to be executed.
383This file is either put in the spool directory
384for local execution or sent to the remote system using
385a generated send command (type 3 above).
386.LP
387For required files which are not on the execution machine,
388.I uux
389will generate receive command files (type 2 above).
390These command-files will be put on the execution machine and
391executed by the
392.I uucico
393program.
394(This will work only if the local system has permission
395to put files in the remote spool directory as controlled
396by the remote
397.I USERFILE .
398)
399.LP
400The
401.I "execute file"
402will be processed
403by the
404.I uuxqt
405program on the execution machine.
406It is made up of several lines,
407each of which contains an identification character
408and one or more arguments.
409The order of the lines in the file is not relevant
410and some of the lines may not be present.
411Each line is described below.
412.RS
413.SH
414User Line
415.IP
416U\ \ user\ \ system
417.LP
418where the
419.I user
420and
421.I system
422are the requester's login name and system.
423.SH
424Required File Line
425.IP
426F file-name real-name
427.LP
428where the
429.I file-name
430is the generated name of a file for the execute machine
431and
432.I real-name
433is the last part of the actual file name (contains no
434path information).
435Zero or more of these lines may be present in the
436.I "execute file" .
437The
438.I uuxqt
439program will check for the existence of all required
440files before the command is executed.
441.SH
442Standard Input Line
443.IP
444I\ \ file-name
445.LP
446The standard input is either specified by a ``<'' in the
447command-string or inherited from the standard input of the
448.I uux
449command if the ``\-'' option is used.
450If a standard input is not specified,
451``/dev/null'' is used.
452.SH
453Standard Output Line
454.IP
455O\ \ file-name\ \ system-name
456.LP
457The standard output is specified by a ``>'' within the
458command-string.
459If a standard output is not specified,
460``/dev/null'' is used.
461(Note \- the use of ``>>'' is not implemented.)
462.SH
463Command Line
464.IP
465C\ \ command\ \
466.B [
467arguments
468.B ]
469\ ...
470.LP
471The arguments are those specified in the command-string.
472The standard input and standard output will not appear on this
473line.
474All
475.I "required files"
476will be moved to the execution directory (a subdirectory
477of the spool directory)
478and the
479.UX
480command is executed using the Shell specified in the
481.I uucp.h
482header file.
483In addition, a shell ``PATH'' statement is prepended
484to the command line as specified in the
485.I uuxqt
486program.
487.LP
488After execution, the standard output is copied or set up to be
489sent to the proper place.
490.RE
491.NH
492Uucico - Copy In, Copy Out
493.LP
494The
495.I uucico
496program will perform the following major functions:
497.RS
498.IP -\ \ 3
499Scan the spool directory for work.
500.IP -\ \
501Place a call to a remote system.
502.IP -\ \
503Negotiate a line protocol to be used.
504.IP -\ \
505Execute all requests from both systems.
506.IP -\ \
507Log work requests and work completions.
508.RE
509.LP
510.I Uucico
511may be started in several ways;
512.RS
513.IP a) 5
514by a system daemon,
515.IP b)
516by one of the
517.I
518uucp, uux, uuxqt
519.R
520or
521.I uucico
522programs,
523.IP c)
524directly by the user (this is usually for testing),
525.IP d)
526by a remote system.
527(The uucico program should be specified as the ``shell''
528field in the ``/etc/passwd'' file for the ``uucp'' logins.)
529.RE
530.LP
531When started by method a, b or c, the program is considered to
532be in
533.I MASTER
534mode.
535In this mode, a connection will be made to a remote system.
536If started by a remote system (method d),
537the program is considered to be in
538.I SLAVE
539mode.
540.LP
541The
542.I MASTER
543mode will operate in one of two ways.
544If no system name is specified
545(\-s option not specified)
546the program will scan the spool directory for
547systems to call.
548If a system name is specified, that system will be called,
549and work will only be done for that system.
550.LP
551The
552.I uucico
553program is generally started by another program.
554There are several options used for execution:
555.RS
556.IP \-r1 10
557Start the program in
558.I MASTER
559mode.
560This is used when
561.I uucico
562is started by a program or ``cron'' shell.
563.IP \-s\fIsys\fR
564Do work only for system
565.I sys.
566If
567.I \-s
568is specified,
569a call to the specified system
570will be made even if there is no work for system
571.I sys
572in the spool directory.
573This is useful for polling systems which do not have
574the hardware to initiate a connection.
575.LP
576The following options are used primarily for debugging:
577.IP \-d\fIdir\fR
578Use directory
579.I dir
580for the spool directory.
581.IP \-x\fInum\fR
582.I Num
583is the level of debugging output desired.
584.RE
585.LP
586The next part of this section will describe the major steps within
587the
588.I uucico
589program.
590.SH
591Scan For Work
592.LP
593The names of the work related files in the spool directory have format
594.IP
595type . system-name grade number
596.LP
597where:
598.IP
599.I Type
600is an upper case letter,
601(
602.I C
603-\ copy command file,
604.I D
605-\ data file,
606.I X
607-\ execute file);
608.IP
609.I System-name
610is the remote system;
611.IP
612.I Grade
613is a character;
614.IP
615.I Number
616is a four digit, padded sequence number.
617.LP
618The file
619.IP "" 12
620C.res45n0031
621.LP
622would be a
623.I "work file"
624for a file transfer between the local
625machine and the ``res45'' machine.
626.LP
627The scan for work is done by looking through the
628spool directory for
629.I "work files"
630(files with prefix ``C.'').
631A list is made of all systems to be called.
632.I Uucico
633will then call each system and process all
634.I "work files" .
635.SH
636Call Remote System
637.LP
638The call is made using information from several
639files which reside in the uucp program directory.
640At the start of the call process, a lock is
641set to forbid multiple conversations
642between the same two systems.
643.LP
644The system name is found in the
645.I L.sys
646file.
647The information contained for each system is;
648.RS
649.IP [1]
650system name,
651.IP [2]
652times to call the system
653(days-of-week and times-of-day),
654.IP [3]
655device or device type to be used for call,
656.IP [4]
657line speed,
658.IP [5]
659phone number if field [3] is
660.I ACU
661or the device name (same as field [3])
662if not
663.I ACU,
664.IP [6]
665login information (multiple fields),
666.RE
667.LP
668The time field is checked against the present time to see
669if the call should be made.
670.LP
671The
672.I
673phone number
674.R
675may contain abbreviations (e.g. mh, py, boston) which get translated into dial
676sequences using the
677.I L-dialcodes
678file.
679.LP
680The
681.I L-devices
682file is scanned using fields [3] and [4] from the
683.I L.sys
684file to find an available device for the call.
685The program will try all devices which satisfy
686[3] and [4] until the call is made, or no more
687devices can be tried.
688If a device is successfully opened, a lock file
689is created so that another copy of
690.I uucico
691will not try to use it.
692If the call is complete, the
693.I
694login information
695.R
696(field [6] of
697.I L.sys )
698is used to login.
699.LP
700The conversation between the two
701.I uucico
702programs begins with a handshake started by the called,
703.I SLAVE ,
704system.
705The
706.I SLAVE
707sends a message to let the
708.I MASTER
709know it is ready to receive the system
710identification and conversation sequence number.
711The response from the
712.I MASTER
713is
714verified by the
715.I SLAVE
716and if acceptable, protocol selection begins.
717The
718.I SLAVE
719can also reply with a ``call-back required''
720message in which case, the current conversation
721is terminated.
722.SH
723Line Protocol Selection
724.LP
725The remote system sends a message
726.IP "" 12
727P\fIproto-list\fR
728.LP
729where proto-list is a string of characters, each
730representing a line protocol.
731.LP
732The calling program checks the proto-list
733for a letter corresponding to an available line
734protocol and returns a
735.I use-protocol
736message.
737The
738.I use-protocol
739message is
740.IP "" 12
741U\fIcode\fR
742.LP
743where code is either a one character
744protocol letter or
745.I N
746which means there is no common protocol.
747.SH
748Work Processing
749.LP
750The initial roles (
751.I MASTER
752or
753.I SLAVE
754) for the work processing are
755the mode in which each program starts.
756(The
757.I MASTER
758has been specified by the ``\-r1'' uucico option.)
759The
760.I MASTER
761program does a work search similar to the
762one used in the ``Scan For Work'' section.
763.LP
764There are five messages used during the
765work processing, each specified by the first
766character of the message.
767They are;
768.IP "" 12
769.RS
770.IP S 3
771send a file,
772.IP R
773receive a file,
774.IP C
775copy complete,
776.IP X
777execute a
778.I uucp
779command,
780.IP H
781hangup.
782.RE
783.LP
784The
785.I MASTER
786will send
787.I R ,
788.I S
789or
790.I X
791messages until all work from the spool directory is
792complete, at which point an
793.I H
794message will be sent.
795The
796.I SLAVE
797will reply with
798\fISY\fR, \fISN\fR, \fIRY\fR, \fIRN\fR, \fIHY\fR, \fIHN\fR,
799\fIXY\fR, \fIXN\fr,
800corresponding to
801.I yes
802or
803.I no
804for each request.
805.LP
806The send and receive replies are
807based on permission to access the
808requested file/directory using the
809.I USERFILE
810and read/write permissions of the file/directory.
811After each file is copied into the spool directory
812of the receiving system,
813a copy-complete message is sent by the receiver of the file.
814The message
815.I CY
816will be sent if the
817file has successfully been moved from the
818temporary spool file to the actual destination.
819Otherwise, a
820.I CN
821message is sent.
822(In the case of
823.I CN ,
824the transferred file will be in the spool
825directory with a name beginning with ``TM'.)
826The requests and results are logged on both systems.
827.LP
828The hangup response is determined by the
829.I SLAVE
830program by a work scan of the spool directory.
831If work for the remote system exists in the
832.I SLAVE's
833spool directory, an
834.I HN
835message is sent and the programs switch roles.
836If no work exists, an
837.I HY
838response is sent.
839.SH
840Conversation Termination
841.LP
842When a
843.I HY
844message is received by the
845.I MASTER
846it is echoed back to the
847.I SLAVE
848and the protocols are turned off.
849Each program sends a final ``OO'' message to the
850other.
851The original
852.I SLAVE
853program will clean up and terminate.
854The
855.I MASTER
856will proceed to call other systems
857and process work as long as possible
858or terminate if a
859.I \-s
860option was specified.
861.LP
862.NH
863Uuxqt - Uucp Command Execution
864.LP
865The
866.I uuxqt
867program is used to execute
868.I
869execute files
870.R
871generated by
872.I uux.
873The
874.I uuxqt
875program may be started by either the
876.I uucico
877or
878.I uux
879programs.
880The program scans the spool directory for
881.I
882execute files
883.R
884(prefix ``X.'').
885Each one is checked to see if all the required files are available and
886if so, the command line or send line is executed.
887.LP
888The
889.I
890execute file
891.R
892is described in the ``Uux''
893section above.
894.SH
895Command Execution
896.LP
897The execution is accomplished by executing a
898.I
899sh \-c
900.R
901of the command line after appropriate
902standard input and standard output have been opened.
903If a standard output is specified, the program
904will create a send command or copy the output
905file as appropriate.
906.NH
907Uulog - Uucp Log Inquiry
908.LP
909The
910.I uucp
911programs create individual
912log files for each program invocation.
913Periodically,
914.I uulog
915may be executed to prepend these files to the
916system logfile.
917This method of logging was chosen to minimize file
918locking of the logfile during program execution.
919.LP
920The
921.I uulog
922program merges the individual
923log files and outputs specified log entries.
924The output request is specified by the use of the
925following options:
926.RS
927.IP \-s\fIsys\fR 9
928Print entries where
929.I sys
930is the remote system name;
931.IP \-u\fIuser\fR
932Print entries for user
933.I user.
934.RE
935.LP
936The intersection of lines satisfying the two options is output.
937A null
938.I sys
939or
940.I user
941means all system names or users respectively.
942.NH
943Uuclean - Uucp Spool Directory Cleanup
944.LP
945This program is typically started by the daemon, once a day.
946Its function is to remove files from the spool directory which
947are more than 3 days old.
948These are usually files for work which can not be completed.
949.LP
950.LP
951The options available are:
952.RS
953.IP \-d\fIdir\fR 10
954The directory to be scanned is
955.I dir .
956.IP \-m
957Send mail to the owner of each file being removed.
958(Note that most files put into the spool directory
959will be owned by the owner of the
960uucp programs since the setuid bit will be set on these
961programs.
962The mail will therefore most often go to the owner
963of the uucp programs.)
964.IP \-n\fIhours\fR
965Change the aging time from 72 hours to
966.I hours
967hours.
968.IP \-p\fIpre\fR
969Examine files with prefix
970.I pre
971for deletion.
972(Up to 10 file prefixes may be specified.)
973.IP \-x\fInum\fR
974This is the level of debugging output desired.
975.RE
976.NH
977Security
978.LP
979.LG
980\fB
981The uucp system, left unrestricted,
982will let any outside user execute any commands
983and copy in/out any file which is readable/writable
984by the uucp login user.
985It is up to the individual sites to be aware of this and
986apply the protections that they feel are necessary.
987\fR
988.NL
989.LP
990There are several security features available aside from the
991normal file mode protections.
992These must be set up by the installer of the
993.I uucp
994system.
995.IP - 3
996The login for uucp does not get a standard shell.
997Instead, the
998.I uucico
999program is started.
1000Therefore, the only work that can be done is through
1001.I uucico .
1002.IP -
1003A path check is done on file names that are to be sent
1004or received.
1005The
1006.I USERFILE
1007supplies the information for these checks.
1008The
1009.I USERFILE
1010can also be set up to require call-back
1011for certain login-ids.
1012(See the ``Files required for execution'' section
1013for the file description.)
1014.IP -
1015A conversation sequence count can be set up so
1016that the called system
1017can be more confident that the caller
1018is who he says he is.
1019.IP -
1020The
1021.I uuxqt
1022program comes with a list of commands that it
1023will execute.
1024A ``PATH'' shell statement is prepended to the command
1025line as specifed in the
1026.I uuxqt
1027program.
1028The installer may modify the list or remove the
1029restrictions as desired.
1030.IP -
1031The
1032.I L.sys
1033file should be owned by uucp and have mode 0400
1034to protect the phone numbers and login information
1035for remote sites.
1036(Programs uucp, uucico, uux, uuxqt should be also
1037owned by uucp and have the setuid bit set.)
1038.NH
1039Uucp Installation
1040.LP
1041There are several source modifications that may be required
1042before the system programs are compiled.
1043These relate to the directories used during compilation,
1044the directories used during execution,
1045and the local
1046.I
1047uucp system-name.
1048.R
1049.LP
1050The four directories are:
1051.RS
1052.IP lib 12
1053(/usr/src/cmd/uucp)
1054This directory contains the source files for generating the
1055.I uucp
1056system.
1057.IP program
1058(/usr/lib/uucp)
1059This is the directory used for the executable system programs and
1060the system files.
1061.IP spool
1062(/usr/spool/uucp)
1063This is the spool directory used during
1064.I uucp
1065execution.
1066.IP xqtdir
1067(/usr/spool/uucp/.XQTDIR)
1068This directory is used during execution of
1069.I "execute files" .
1070.RE
1071.LP
1072The names given in parentheses above are the default values
1073for the directories.
1074The italicized named
1075.I
1076lib, program, xqtdir,
1077.R
1078and
1079.I spool
1080will be used in the following text to represent the
1081appropriate directory names.
1082.LP
1083There are two files which may require modification,
1084the
1085.I makefile
1086file and the
1087.I uucp.h
1088file.
1089The following paragraphs describe the modifications.
1090The modes of
1091.I spool
1092and
1093.I xqtdir
1094should be made ``0777''.
1095.SH
1096Uucp.h modification
1097.LP
1098Change the
1099.I program
1100and the
1101.I spool
1102names from the default values to the directory
1103names to be used on the local system using
1104global edit commands.
1105.LP
1106Change the
1107.I define
1108value for
1109.I MYNAME
1110to be the local
1111.I uucp
1112system-name.
1113.SH
1114makefile modification
1115.LP
1116There are several
1117.I make
1118variable definitions which may need modification.
1119.RS
1120.IP INSDIR 10
1121This is the
1122.I program
1123directory
1124(e.g. INSDIR=/usr/lib/uucp).
1125This parameter is used if ``make cp'' is
1126used after the programs are compiled.
1127.IP IOCTL
1128This is required to be set if an appropriate
1129.I ioctl
1130interface subroutine does not exist in the standard
1131``C'' library;
1132the statement
1133``IOCTL=ioctl.o'' is required in this case.
1134.IP PKON
1135The statement ``PKON=pkon.o'' is required if the
1136packet driver is not in the kernel.
1137.RE
1138.SH
1139Compile the system
1140The command
1141.IP "" 12
1142make
1143.LP
1144will compile the entire system.
1145The command
1146.IP "" 12
1147make cp
1148.LP
1149will copy the commands to the
1150to the appropriate directories.
1151.LP
1152The programs
1153.I uucp ,
1154.I uux ,
1155and
1156.I uulog
1157should be put in ``/usr/bin''.
1158The programs
1159.I uuxqt ,
1160.I uucico ,
1161and
1162.I uuclean
1163should be put in the
1164.I program
1165directory.
1166.SH
1167Files required for execution
1168.LP
1169There are four files which are required for execution,
1170all of which should reside in the
1171.I program
1172directory.
1173The field separator for all files is a space unless otherwise
1174specified.
1175.SH
1176L-devices
1177.LP
1178This file contains entries for the call-unit devices and
1179hardwired connections which are to be used by
1180.I uucp.
1181The special device files are assumed to be in the
1182.I /dev
1183directory.
1184The format for each entry is
1185.IP "" 12
1186line\ \ call-unit\ \ speed
1187.LP
1188where;
1189.RS
1190.IP line 12
1191is the device for the line (e.g. cul0),
1192.IP call-unit
1193is the automatic call unit associated with
1194.I line
1195(e.g. cua0),
1196(Hardwired lines have a number ``0'' in this field.),
1197.IP speed
1198is the line speed.
1199.RE
1200.LP
1201The line
1202.IP "" 12
1203cul0\ \ cua0\ \ 300
1204.LP
1205would be set up for a system which
1206had device cul0 wired to a call-unit
1207cua0 for use at 300 baud.
1208.SH
1209L-dialcodes
1210.LP
1211This file contains entries with location abbreviations used
1212in the
1213.I L.sys
1214file (e.g. py, mh, boston).
1215The entry format is
1216.IP "" 12
1217abb\ \ dial-seq
1218.LP
1219where;
1220.RS
1221.IP abb 12
1222is the abbreviation,
1223.IP dial-seq
1224is the dial sequence to call that location.
1225.RE
1226.LP
1227The line
1228.IP "" 12
1229py\ \ 165\-
1230.LP
1231would be set up so that entry py7777 would
1232send 165\-7777 to the dial-unit.
1233.SH
1234LOGIN/SYSTEM NAMES
1235.LP
1236It is assumed that the
1237.I "login name"
1238used by a remote computer to call into a local computer
1239is not the same as the login name of a normal user
1240of that local machine.
1241However, several remote computers may employ the same
1242login name.
1243.LP
1244Each computer is given a unique
1245.I "system name"
1246which is transmitted at the start of each call.
1247This name identifies the calling machine to the called machine.
1248.SH
1249USERFILE
1250.LP
1251This file contains user accessibility information.
1252It specifies four types of constraint;
1253.RS
1254.IP [1]
1255which files can be accessed by a normal user of the local machine,
1256.IP [2]
1257which files can be accessed from a remote computer,
1258.IP [3]
1259which login name is used by a particular remote computer,
1260.IP [4]
1261whether a remote computer should be called back in order to confirm
1262its identity.
1263.RE
1264.LP
1265Each line in the file has the following format
1266.IP "" 6
1267login,sys\ \
1268.B [
1269c
1270.B ]
1271\ \ path-name\ \
1272.B [
1273path-name
1274.B ]
1275\ ...
1276.LP
1277where;
1278.RS
1279.IP login 12
1280is the login name for a user or the remote computer,
1281.IP sys
1282is the system name for a remote computer,
1283.IP c
1284is the optional
1285.I
1286call-back required
1287.R
1288flag,
1289.IP path-name
1290is a path-name prefix that is acceptable for
1291.I user.
1292.LP
1293.RE
1294.LP
1295The constraints are implemented as follows.
1296.RS
1297.IP [1]
1298When the program is obeying a command stored on the local machine,
1299.I MASTER
1300mode,
1301the path-names allowed are those given for the first line in the
1302.I USERFILE
1303that has a login name that matches the login name of the user
1304who entered the command.
1305If no such line is found, the first line with a
1306.I null
1307login name is used.
1308.IP [2]
1309When the program is responding to a command from a remote machine,
1310.I SLAVE
1311mode, the path-names allowed are those given for the first line
1312in the file that has the system name that matches the system name
1313of the remote machine.
1314If no such line is found, the first one with a
1315.I null
1316system name is used.
1317.IP [3]
1318When a remote computer logs in, the login name that
1319it uses must appear in the
1320.I USERFILE .
1321There may be several lines with the same login name but one of them must
1322either have the name of the remote system or must contain a
1323.I null
1324system name.
1325.IP [4]
1326If the line matched in ([3]) contains a ``c'',
1327the remote machine is called back before any transactions take place.
1328.RE
1329.LP
1330The line
1331.IP "" 12
1332u,m /usr/xyz
1333.LP
1334allows machine
1335.I m
1336to login with name
1337.I u
1338and request the transfer of files whose names start with
1339``/usr/xyz''.
1340.LP
1341The line
1342.IP "" 12
1343dan, /usr/dan
1344.LP
1345allows the ordinary user
1346.I dan
1347to issue commands for files whose name starts with
1348``/usr/dan''.
1349.LP
1350The lines
1351.IP "" 12
1352u,m /usr/xyz /usr/spool
1353.br
1354u, /usr/spool
1355.LP
1356allows any remote machine to login with name
1357.I u ,
1358but if its system name is not
1359.I m ,
1360it can only ask to transfer files whose names start with
1361``/usr/spool''.
1362.LP
1363The lines
1364.IP "" 12
1365root, /
1366.br
1367, /usr
1368.LP
1369allows any user to transfer files beginning with ``/usr''
1370but the user with login
1371.I root
1372can transfer any file.
1373.SH
1374L.sys
1375.LP
1376Each entry in this file represents one system
1377which can be called by the local uucp programs.
1378The fields are described below.
1379.RS
1380.SH
1381system name
1382.LP
1383The name of the remote system.
1384.SH
1385time
1386.LP
1387This is a string which indicates the days-of-week
1388and times-of-day when the system should
1389be called
1390(e.g. MoTuTh0800\-1730).
1391.LP
1392The day portion may be a list containing
1393some of
1394.IP
1395.I
1396Su Mo Tu We Th Fr Sa
1397.R
1398.LP
1399or it may be
1400.I Wk
1401for any week-day or
1402.I Any
1403for any day.
1404.LP
1405The time should be a range of times (e.g. 0800\-1230).
1406If no time portion is specified, any time
1407of day is assumed to be ok for the call.
1408.SH
1409device
1410.LP
1411This is either
1412.I ACU
1413or the hardwired device to be used for the call.
1414For the hardwired case, the last part of the
1415special file name is used (e.g. tty0).
1416.SH
1417speed
1418.LP
1419This is the line speed for the call (e.g. 300).
1420.SH
1421phone
1422.LP
1423The phone number is made up of an optional
1424alphabetic abbreviation and a numeric part.
1425The abbreviation is one which appears in the
1426.I L-dialcodes
1427file (e.g. mh5900, boston995\-9980).
1428.LP
1429For the hardwired devices, this field contains
1430the same string as used for the
1431.I device
1432field.
1433.SH
1434login
1435.LP
1436The login information is given as a series of
1437fields and subfields in the format
1438.IP
1439expect\ \ send\
1440.B [
1441expect\ \ send
1442.B ]
1443\ ...
1444.LP
1445where;
1446.I expect
1447is the string expected to be read and
1448.I send
1449is the string to be sent when the
1450.I expect
1451string is received.
1452.LP
1453The expect field may be made up of subfields
1454of the form
1455.IP
1456expect\fB[\fR\-send\-expect\fB]\fR...
1457.LP
1458where the
1459.I send
1460is sent if the prior
1461.I expect
1462is not successfully read
1463and the
1464.I expect
1465following the
1466.I send
1467is the next expected string.
1468.LP
1469There are two special names available to be sent
1470during the login sequence.
1471The string
1472.I EOT
1473will send an EOT character and the string
1474.I BREAK
1475will try to send a BREAK character.
1476(The
1477.I BREAK
1478character is simulated using line speed changes
1479and null characters and may not work on all
1480devices and/or systems.)
1481.RE
1482.LP
1483A typical entry in the L.sys file would be
1484.IP "" 6
1485sys Any ACU 300 mh7654 login uucp ssword: word
1486.LP
1487The expect algorithm looks at the last part of the
1488string as illustrated in the password field.
1489.RE
1490.NH
1491Administration
1492.LP
1493This section indicates some events and files which must be
1494administered for the
1495.I uucp
1496system.
1497Some administration can be accomplished by
1498.I "shell files"
1499which can be initiated by
1500.I crontab
1501entries.
1502Others will require manual intervention.
1503Some sample
1504.I "shell files"
1505are given toward the end of this section.
1506.SH
1507SQFILE \- sequence check file
1508.LP
1509This file is set up in the
1510.I program
1511directory and contains an entry for each remote
1512system with which you agree to perform conversation
1513sequence checks.
1514The initial entry is just the system name of
1515the remote system.
1516The first conversation will add two items to the line,
1517the conversation count, and the date/time of the most
1518resent conversation.
1519These items will be updated with each conversation.
1520If a sequence check fails, the entry will have to
1521be adjusted.
1522.SH
1523TM \- temporary data files
1524.LP
1525These files are created in the
1526.I spool
1527directory while files are being copied
1528from a remote machine.
1529Their names have the form
1530.IP "" 12
1531\fBTM\fR.pid.ddd
1532.LP
1533where
1534.I pid
1535is a process-id and
1536.I ddd
1537is a sequential three digit number starting at zero
1538for each invocation of
1539.I uucico
1540and incremented for each file received.
1541
1542After the entire remote file is received, the
1543.I TM
1544file is moved/copied to the requested destination.
1545If processing is abnormally terminated or the
1546move/copy fails, the file will remain in the
1547spool directory.
1548.LP
1549The leftover files should be periodically removed;
1550the
1551.I uuclean
1552program is useful in this regard.
1553The command
1554.IP "" 12
1555uuclean\ \ \-pTM
1556.LP
1557will remove all
1558.I TM
1559files older than three days.
1560.SH
1561LOG \- log entry files
1562.LP
1563During execution of programs, individual
1564.I LOG
1565files are created in the
1566.I spool
1567directory with information about
1568queued requests, calls to remote systems,
1569execution of
1570.I uux
1571commands and file copy results.
1572These files should be combined into the
1573.I LOGFILE
1574by using the
1575.I uulog
1576program.
1577This program will put the new
1578.I LOG
1579files at the beginning of the existing
1580.I LOGFILE.
1581The command
1582.IP "" 12
1583uulog
1584.LP
1585will accomplish the merge.
1586Options are available to print some or all the
1587log entries after the files are merged.
1588The
1589.I LOGFILE
1590should be removed periodically
1591since it is copied each time new LOG
1592entries are put into the file.
1593.LP
1594The
1595.I LOG
1596files are created initially with mode 0222.
1597If the program which creates the file terminates normally,
1598it changes the
1599mode to 0666.
1600Aborted runs may leave the files with mode
16010222 and the
1602.I uulog
1603program will not read or remove them.
1604To remove them, either use
1605.I rm ,
1606.I uuclean ,
1607or change the mode to 0666 and let
1608.I uulog
1609merge them with the
1610.I LOGFILE .
1611.SH
1612STST \- system status files
1613.LP
1614These files are created in the spool directory by the
1615.I uucico
1616program.
1617They contain information of failures such as login, dialup or
1618sequence check and will contain a
1619.I TALKING
1620status when to machines are conversing.
1621The form of the file name is
1622.IP
1623\fBSTST\fR.sys
1624.LP
1625where
1626.I sys
1627is the remote system name.
1628.LP
1629For ordinary failures (dialup, login), the file will prevent
1630repeated tries for about one hour.
1631For sequence check failures, the file must be removed before
1632any future attempts to converse with that remote system.
1633.LP
1634If the file is left due to an aborted run, it may contain a
1635.I TALKING
1636status.
1637In this case, the file must be removed before a conversation
1638is attempted.
1639.SH
1640LCK \- lock files
1641.LP
1642Lock files are created for each device in use (e.g. automatic calling
1643unit) and each system conversing.
1644This prevents duplicate conversations and multiple attempts to use the
1645same devices.
1646The form of the lock file name is
1647.IP "" 12
1648\fBLCK..\fRstr
1649.LP
1650where
1651.I str
1652is either a device or system name.
1653The files may be left in the spool directory if runs abort.
1654They will be ignored (reused) after a time of about 24 hours.
1655When runs abort and calls are desired before the time limit,
1656the lock files should be removed.
1657.SH
1658Shell Files
1659.LP
1660The
1661.I uucp
1662program will spool work and attempt to start the
1663.I uucico
1664program, but the starting of
1665.I uucico
1666will sometimes fail.
1667(No devices available, login failures etc.).
1668Therefore, the
1669.I uucico
1670program should be periodically started.
1671The command to start
1672.I uucico
1673can be put in a ``shell'' file with a command to merge
1674.I LOG
1675files and started by a crontab entry on an hourly basis.
1676The file could contain the commands
1677.IP
1678.I program /uulog
1679.br
1680.I program /uucico
1681\ \ \-r1
1682.LP
1683Note that the ``\-r1'' option is required to start the
1684.I uucico
1685program in
1686.I MASTER
1687mode.
1688.LP
1689Another shell file may be set up on a daily basis to remove
1690.I TM ,
1691.I ST
1692and
1693.I LCK
1694files
1695and
1696.I C.
1697or
1698.I D.
1699files for work which can not be accomplished for
1700reasons like bad phone number, login changes etc.
1701A shell file containing commands like
1702.IP
1703.I program /uuclean
1704\ \ \-pTM \-pC. \-pD.
1705.br
1706.I program /uuclean
1707\ \ \-pST \-pLCK \-n12
1708.LP
1709can be used.
1710Note the ``\-n12'' option causes the
1711.I ST
1712and
1713.I LCK
1714files older than 12 hours to be deleted.
1715The absence of the ``\-n'' option will use a three day time
1716limit.
1717.LP
1718A daily or weekly shell should also be created
1719to remove or save old
1720.I LOGFILE s.
1721A shell like
1722.IP
1723cp
1724.I spool /LOGFILE
1725\ \
1726.I spool /o.LOGFILE
1727.br
1728rm
1729.I spool /LOGFILE
1730.LP
1731can be used.
1732.SH
1733Login Entry
1734.LP
1735One or more logins should be set up for
1736.I uucp .
1737Each of the ``/etc/passwd'' entries should
1738have the
1739``\fIprogram\fR/uucico''
1740as the shell to be executed.
1741The login directory is not used, but if the system
1742has a special directory for use by the users for
1743sending or receiving file, it should as the
1744login entry.
1745The various logins are used in conjunction with the
1746.I USERFILE
1747to restrict file access.
1748Specifying the
1749.I shell
1750argument limits the login to the use of uucp
1751(
1752.I uucico )
1753only.
1754.SH
1755File Modes
1756.LP
1757It is suggested that the owner and file modes of various
1758programs and files be set as follows.
1759.LP
1760The programs
1761.I uucp ,
1762.I uux ,
1763.I uucico
1764and
1765.I uuxqt
1766should be owned by the
1767.I uucp
1768login with the ``setuid'' bit set and only execute
1769permissions (e.g. mode 04111).
1770This will prevent outsiders from modifying the programs
1771to get at a standard
1772.I shell
1773for the
1774.I uucp
1775logins.
1776.LP
1777The
1778.I L.sys ,
1779.I SQFILE
1780and the
1781.I USERFILE
1782which are put in the
1783.I program
1784directory should be owned by
1785the
1786.I uucp
1787login and set with mode 0400.
1788.SG MH-1273-DAN-unix