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