Minor tidying and typo correction.
[fwd] / fw.1
CommitLineData
10a454ad 1.\" -*-nroff-*-
667fb920 2.\"
96bc31ba 3.\" $Id: fw.1,v 1.3 1999/07/30 06:49:00 mdw Exp $
667fb920 4.\"
5.\" Manual page for fw
6.\"
7.\" (c) 1999 Straylight/Edgeware
8.\"
9.
10.\"----- Licensing notice ---------------------------------------------------
11.\"
12.\" This file is part of the `fw' port forwarder.
13.\"
14.\" `fw' is free software; you can redistribute it and/or modify
15.\" it under the terms of the GNU General Public License as published by
16.\" the Free Software Foundation; either version 2 of the License, or
17.\" (at your option) any later version.
18.\"
19.\" `fw' is distributed in the hope that it will be useful,
20.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
21.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.\" GNU General Public License for more details.
23.\"
24.\" You should have received a copy of the GNU General Public License
25.\" along with `fw'; if not, write to the Free Software Foundation,
26.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27.
28.\" ---- Revision history ---------------------------------------------------
29.\"
30.\" $Log: fw.1,v $
96bc31ba 31.\" Revision 1.3 1999/07/30 06:49:00 mdw
32.\" Minor tidying and typo correction.
33.\"
667fb920 34.\" Revision 1.2 1999/07/26 23:31:04 mdw
35.\" Document lots of new features and syntax.
36.\"
37.
38.\"----- Various bits of fancy styling --------------------------------------
39.
40.\" --- Indented paragraphs with right-aligned tags ---
41.
10a454ad 42.de hP
43.IP
44\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
45..
667fb920 46.
47.\" --- Verbatim-oid typesetting ---
48.de VS
49.sp 1
50.RS
51.nf
52.ft B
53..
54.de VE
55.ft R
56.fi
57.RE
58.sp 1
59..
60.
61.\" --- Other bits of styling ---
62.
63.ie t \{\
64. ds o \(bu
65. ds ss \s8\u
66. ds se \d\s0
67. if \n(.g \{\
68. fam P
69. \}
70.\}
71.el \{\
72. ds o o
73. ds ss ^
74. ds se
75.\}
76.
77.\"--------------------------------------------------------------------------
78.
10a454ad 79.TH fw 1 "1 July 1999" fw
667fb920 80.
81.\"--------------------------------------------------------------------------
10a454ad 82.SH NAME
667fb920 83.
10a454ad 84fw \- port forwarder
667fb920 85.
86.\"--------------------------------------------------------------------------
10a454ad 87.SH SYNOPSIS
667fb920 88.
10a454ad 89.B fw
667fb920 90.RB [ \-dq ]
10a454ad 91.RB [ \-f
92.IR file ]
93.IR config-stmt ...
667fb920 94.
95.\"--------------------------------------------------------------------------
96.SH "DESCRIPTION"
97.
10a454ad 98The
99.B fw
100program is a simple port forwarder. It supports a number of features
101the author hasn't found in similar programs:
102.TP
103.I "Connection logging"
104Each connection attempt to the forwarder is logged, giving the time of
105the connection, the DNS-resolved hostname (if available), and the user
106name resulting from an RFC931 lookup. These lookups are done
107asynchronously to the main forwarder's operation.
108.TP
109.I "Access control"
110Each forwarded port may have an access control list attached to it.
111Only authorized hosts are allowed to connect. Access control checks are
112performed by quick checks on the client's IP address.
113.TP
114.I "Nonblocking single-process design"
115The internal structure of the server is completely nonblocking. The
116connections don't block; the reading and writing don't block; the name
117lookups don't block. This is all done in a single process, with the
118single exception of the DNS resolver.
667fb920 119.TP
120.I "Support for Unix-domain sockets"
121Connections from and to Unix-domain sockets can be handled just as
96bc31ba 122easily as more normal Internet sockets. Access control doesn't work on
667fb920 123Unix domain sockets, though. (Yet.)
10a454ad 124.SS "Command line options"
125The
126.B fw
127program understands a few simple command line options:
128.TP
129.B "\-h, \-\-help"
130Displays a screen of help text on standard output and exits
131successfully.
132.TP
133.B "\-v, \-\-version"
134Writes the version number to standard output and exits successfully.
135.TP
136.B "\-u, \-\-usage"
137Writes a terse usage summary to standard output and exits successfully.
138.TP
139.BI "\-f, \-\-file=" file
140Read configuration information from
141.IR file .
667fb920 142Equivalent to an
143.RB ` include
144.IR file '
145configuration file statement.
10a454ad 146.TP
667fb920 147.B "\-d, \-\-daemon, \-\-fork"
10a454ad 148Forks into the background after reading the configuration and
149initializing properly.
667fb920 150.TP
151.B "-q, \-\-quiet"
152Don't output any logging information. This option is not recommended
153for normal use, although it can make system call traces clearer so I use
154it when debugging.
10a454ad 155.PP
156Any further command line arguments are interpreted as configuration
157lines to be read. Configuration supplied in command line arguments has
158precisely the same syntax as configuration in files. If there are no
96bc31ba 159configuration statements on the command line, and no
10a454ad 160.B \-f
161options were supplied, configuration is read from standard input, if
162stdin is not a terminal.
667fb920 163.
164.\"--------------------------------------------------------------------------
165.SH "CONFIGURATION LANGUAGE"
166.
167The
168.B fw
169program has a fairly sophisticated configuration language to let you
170describe which things should be forwarded where and what special
171features there should be.
172.SS "Lexical structure"
173There are four types of characters.
174.TP
175.I "word constituent characters"
96bc31ba 176Word constituent characters are gathered together into words.
667fb920 177Depending on its surrounding context, a word might act as a keyword or a
178string. All alphanumerics are word constituents, as is the hyphen
179.RB ` \- '.
180Other characters may change their status in future versions.
181.TP
182.I "self-delimiting characters"
183Self-delimiting characters always stand alone. They act as punctuation,
184shaping the sequence of words into more complex grammatical forms. The
185characters
186.RB ` { ',
187.RB ` } ',
188.RB ` [ ',
189.RB ` ] ',
190.RB ` / ',
191.RB ` , ',
192.RB ` = ',
193.RB ` : ',
194.RB ` ; '
195and
196.RB ` . '
197are self-delimiting. Note that while some characters, e.g.,
198.RB ` [ '
199and
200.RB ` ; ',
201require escaping by the shell, they are strictly optional in the grammar
202and can be omitted in quick hacks at the shell prompt.
203.TP
204.I "whitespace characters"
205Whitespace characters separate words but are otherwise ignored. All
206`normal' whitespace characters (e.g., space, tab and newline) are
207considered to be whitespace for these purposes.
208.TP
209.I "special characters"
210There are three special characters. The
211.RB ` # '
212character, if it appears at the start of a word, introduces a
213.I comment
214which extends to the end of the current line or command-line argument.
215Within a word, it behaves like a normal word-constituent character. The
216backslash
217.RB ` \e '
218escapes the following character causing it to be interpreted as a word
219constituent regardless of its normal type. The double-quote
220.RB ` """" '
221escapes all characters other than backslashes up to the next
222double-quote and causes them to be regarded as word constituents. Note
223that you don't have to quote a whole word. The backslash can escape a
224quote character allowing you to insert it into a word if really
225necessary.
226.
227.SS "Basic syntax"
228The overall syntax looks a bit like this:
10a454ad 229.PP
667fb920 230.I file
10a454ad 231::=
667fb920 232.I empty
233|
234.I file
235.I stmt
236.RB [ ; ]
10a454ad 237.br
238.I stmt
239::=
667fb920 240.I option-stmt
241|
242.I fw-stmt
243.br
244.I fw-stmt
245::=
246.B fw
247.I source
248.I options
249.RB [ to | \-> ]
250.I target
251.I options
252.br
253.I options
254::=
255.B {
256.I option-seq
257.B }
258.br
259.I option-seq
260::=
261.I empty
262|
263.I option-stmt
264.RB [ ; ]
265.I option-seq
266.PP
267If you prefer, the keyword
268.RB ` fw '
269may be spelt
270.RB ` forward '
271or
272.RB ` from '.
273All are equivalent.
274.
275.SS "Sources and targets"
276Forwarding is set up by attaching
277.I targets
278to
279.IR sources .
280Sources are things which are capable of
281.I initiating
282one end of a data flow on their own, while targets are things which are
283capable of setting up the other end on demand. In the case of a TCP
284port forwarder, the part which listens for incoming client connections
285is the source, while the part which sets up outgoing connections to the
286destination server is the target.
287.PP
288Essentially, all
289.B fw
290does is set up a collection of sources and targets based on your
291configuration file so that when a source decides to initiate a data
292flow, it tells its target to set its end up, and then squirts data back
293and forth between the two until there's no more.
294.PP
295Some sources are
296.IR persistent :
297they stay around indefinitely setting up multiple attachments to
298targets. Others are
299.IR transient :
300they set up one connection and then disappear. If all the sources
301defined are transient, then
302.B fw
303will quit when no more active sources remain and all connections have
304terminated.
305.PP
306The
307.B fw
308program is fairly versatile. It allows you to attach any supported type
309of source to any supported type of target. This will, I hope, be the
310case in all future versions.
311.PP
312The syntax of a
313.I source
314or
315.I target
316depend on the source or target type, and are therefore described in the
317sections specific to the various types.
318.
319.SS "Options structure"
320Most of the objects that
321.B fw
322knows about (including sources and targets, but also other more specific
323things such as socket address types) can have their behaviour modified
324by
325.IR options .
326The options available at a particular point in the configuration depend
327on the
328.IR context .
329A global option, outside of a
330.I fw-stmt
331has no context unless it is explicitly qualified, and affects global
332behaviour. Local options, applied to a source or target in a
333.I fw-stmt
334has the context of the type of source or target to which it is applied,
335and affects only that source or target.
336.PP
337Note that it's important to distinguish between an option's context
338(which is affected by its qualification) and its local or global
339status. No matter how qualified, a global option will always control
340default options for objects, and a local option will only affect a
341specific source or target.
342.PP
343The syntax for qualifying options is like this:
344.PP
345.I option-stmt
346::=
347.I q-option
348.br
349.I q-option
350::=
351.I option
352.br
353 |
354.I prefix
355.B .
356.I q-option
357.br
358 |
359.I prefix
360.B {
361.I option-seq
362.B }
363.br
364.I prefix
365::=
366.I word
367.PP
368Thus, you may qualify either an individual option or a sequence of
369options. The two are equivalent; for example,
370.VS
371exec.rlimit {
372 core = 0;
373 cpu = 60;
374}
375.VE
376is equivalent to
377.VS
378exec.rlimit.core = 0;
379exec.rlimit.cpu = 0;
380.VE
381For each option, there is a sequence of prefixes which maximally qualify
382that option. An option prefixed with this sequence is
383.IR "fully qualified" .
384In actual use, some or all of those prefixes may be omitted. However,
385it's possible for the option to become
386.I ambiguous
387if you do this. For example, the option
388.B fattr.owner
389may refer either to
390.B file.fattr.owner
391or to
392.BR socket.unix.fattr.owner .
393In this case, the ambiguity is benign: a local option will have as its
394context an appropriate source or target, and both global options
395actually control the same default. However, the option
396.B logging
397may mean either
398.B socket.logging
399or
400.BR exec.logging ,
401which have separate defaults, and which one you actually get depends on
402the exact implementation of
403.BR fw 's
404option parser. (Currently this would resolve to
405.BR exec.logging ,
406although this may change in a later version.)
407.PP
408In this manual, options are usually shown in their fully-qualified form.
409.
410.SS "The `file' source and target types"
411The
412.B file
413source and target allow data to move to and from objects other
414than sockets within the Unix filesystem. (Unix-domain sockets are
415handled using the
416.B socket
417source and target.)
418.PP
419If a
420.B file
421is used as a source, it is set up immediately.
422.PP
423The syntax of
424.B file
425sources and targets is like this:
426.PP
427.I source
428::=
429.I file
430.br
431.I target
432::=
433.I file
434.br
435.I file
436::=
437.B file
438.RB [ . ]
439.I fspec
440.RB [ ,
441.IR fspec ]
442.br
443.I fspec
444::=
445.I fd-spec
446|
447.I name-spec
448|
449.I null-spec
450.br
451.I fd-spec
452::=
453.RB [[ : ] fd [ : ]]
454.IR number \c
455.RB | stdin | stdout
456.br
457.I name-spec
458::=
459.RB [[ : ] file [ : ]]
460.I file-name
461.br
462.I file-name
463::=
464.I path-seq
465|
466.B [
467.I path-seq
468.B ]
469.br
470.I path-seq
471::=
472.I path-elt
473|
474.I path-seq
475.I path-elt
476.br
477.I path-elt
478::=
479.B /
480|
481.I word
482.br
483.I null-spec
484::=
485.RB [[ : ] null [ : ]]
486.PP
487The
488.I file
489specification describes two files, the first to be used as input, the
490second to be used as output, each described by an
491.IR fspec .
492.PP
493If none of the keywords
494.RB ` fd ',
495.RB ` name '
496or
497.RB ` null '
498are given, the type of an
499.I fspec
500is deduced from its nature: if it matches one of the strings
501.RB ` stdin '
502or
503.RB ` stdout ',
504or begins with a digit, it's considered to be a file descriptor;
505otherwise it's interpreted as a filename.
506.PP
507A
508.RB ` name '
509spec describes a file by its name within the filesystem. It is opened
510when needed and closed again after use. For output files, the precise
511behaviour is controlled by options described below.
512.PP
513A
514.RB ` null '
515spec attaches the input or output of the source or target to
516.BR /dev/null .
517.PP
518An
519.RB ` fd '
520spec uses an existing open file descriptor, given either by number or a
521symbolic name. The name
522.RB ` stdin '
523refers to standard input (file descriptor 0 on normal systems) and
524.RB ` stdout '
525refers to standard output (file descriptor 1). The names work in
526exactly the same way as the equivalent file descriptor numbers.
527.PP
528If the output
529.I fspec
530is omitted, the input
531.I fspec
532is used for both input and output. Exception: if the input refers to
533standard input then the output will refer to standard output instead.
534.PP
535All
536.B file
537options apply equally to sources and targets. The options are as
538follows:
539.PP
540.B file.create
541.RB [ = ]
542.BR yes | no
543.RS
544Whether to create the output file if it doesn't exist. If
545.B no
546(the default), an error is reported if the file doesn't exist. If
547.BR yes ,
548the file is created if it doesn't exist.
549.RE
550.PP
551.B file.open
552.RB [ = ]
553.BR no | truncate | append
554.RS
555Controls the behaviour if the output file already exists. If
556.BR no ,
557an error is reported. If
558.B truncate
559(the default), the existing file is replaced by the new data. If
560.BR append ,
561the new data is appended to the file.
562.RE
563.PP
564Under no circumstances will
565.B fw
566create a file through a `dangling' symbolic link.
567.PP
568The
569.B file
570source and target also accept
571.B fattr
572options for controlling the attributes of the created file. The prefix
573for setting file attributes is
574.BR file.fattr .
575.
576.SS "File attributes for created files `fattr'"
577Both the
578.B file
579and
580.B socket
581sources and targets can create new filesystem objects. The
582.B fattr
583options allow control over the attributes of the newly-created objects.
584Both
585.B file
586and
587.B socket
588use the same set of defaults, so a prefix of
589.B fattr
590is good enough for setting global options, and the implicit context
591disambiguates local options.
592.PP
593The following file attribute options are supported:
594.PP
595.IB prefix .fattr.mode
596.RB [ = ]
597.I mode
598.RS
599Sets the permissions mode for a new file. The
600.I mode
601argument may be either an octal number or a
602.BR chmod (1)-style
603string which acts on the default permissions established by the
604prevailing
605.BR umask (2)
606setting. Note that
607.BR chmod -style
608strings may contain
609.RB ` = '
610and
611.RB ` , '
612characters that will need to be escaped or quoted.
613.RE
614.PP
615.IB prefix .fattr.owner
616.RB [ = ]
617.I user
618.RS
619Sets the owner for newly created files. On non-broken systems you will
620need to be the superuser to set the owner on a file. The
621.I user
622may either be a numeric uid or a username. The default is not to change
623the owner of the file once it's created. The synonyms
624.B uid
625and
626.B user
627are accepted in place of
628.BR owner .
629.RE
630.PP
631.IB prefix .fattr.group
632.RB [ = ]
633.I group
634.RS
635Sets the group for newly created files. You will usually need to be a
636member of the group in question order to set the group of a file. The
637.I group
638may either be a numeric gid or a group name. The default is not to
639change the group of the file once it's created. The synonym
640.B gid
641is accepted in place of
642.BR group .
643.RE
644.
645.SS "The `exec' source and target types"
646The
647.B exec
648source and target execute programs and allow access to their standard
649input and output streams. Both source and target have the same syntax,
650which is as follows:
651.PP
652.I source
653::=
654.I exec
655.br
656.I target
657::=
658exec
659.br
660.I exec
661::=
662.BR exec
663.RB [ . ]
664.I cmd-spec
665.br
666.I cmd-spec
667::=
668.I shell-cmd
10a454ad 669|
667fb920 670.RI [ prog-name ]
671.B [
672.I argv0
673.I arg-seq
674.B ]
675.br
676.I arg-seq
677::=
678.I word
679|
680.I arg-seq
681.I word
682.br
683.I shell-cmd
684::=
685.I word
686.br
687.I argv0
688::=
689.I word
690.PP
691If a single word is given, it is a
692.I shell-cmd
693and will be passed to the Bourne shell for execution. If a
694bracket-enclosed sequence of words is given, it is considered to be a
695list of arguments to pass to the program: if a
696.I prog-name
697is also supplied, it names the file containing the program to execute;
698otherwise the file named by the first argument
699.RI ( argv0 )
700is used.
701.PP
702The standard input and output of the program are forwarded to the other
703end of the connection. The standard error stream is caught by
704.B fw
705and logged.
706.PP
707The
708.B exec
709source and target both understand the same set of options. The list of
710options supported is as follows:
711.PP
712.B exec.logging
713.RB [ = ]
714.BR yes | no
715.RS
716Whether to log the start and end of executed programs. If
717.B yes
718(the default), a log message is emitted when the program is started
719listing its process id, and another is emitted when the program finishes
720giving its process id and exit status. If
721.BR no ,
722these messages are not emitted. However the standard error stream is
723still logged. The
724.B log
725abbreviation is accepted as a synonym for
726.BR logging .
727.RE
728.PP
729.B exec.dir
730.RB [ = ]
731.I file-name
732.RS
733Sets the current directory from which the the program should be run.
734The default is not to change directory. The synonyms
735.BR cd ,
736.B chdir
737and
738.B cwd
739are accepted in place of
740.BR dir .
741.RE
742.PP
743.B exec.root
744.RB [ = ]
745.I file-name
746.RS
747Sets the root directory for the program, using the
748.BR chroot (2)
749system call. You must be the superuser for this option to work. The
750default is not to set a root directory. The synonyms
751.BR cd ,
752.B chdir
753and
754.B cwd
755are accepted in place of
756.B dir .
757.RE
758.PP
759.B exec.user
760.RB [ = ]
761.I user
762.RS
763Sets the user (real and effective uid) to run the program as. This will
764usually require superuser privileges to work. The default is not to
765change uid. The synonym
766.B uid
767is accepted in place of
768.BR user .
769.RE
770.PP
771.B exec.group
772.RB [ = ]
773.I group
774.RS
775Sets the group (real and effective gid) to run the program as. If
776running with superuser privileges, the supplementary groups list is
777cleared at the same time. The default is not to change gid (or clear
778the supplementary groups list). The synonym
779.B gid
780is accepted in place of
781.BR group .
782.RE
783.PP
784.BI exec.rlimit. limit \c
785.RB [ .hard | .soft ]
786.RB [ = ]
787.I value
788.RS
789Set resource limits for the program. The
790.I limit
791may be one of the resource limit names described in
792.BR setrlimit (2),
793in lower-case and without the
794.B RLIMIT_
795prefix; for example,
796.B RLIMIT_CORE
797becomes simply
798.BR core .
799The
800.I value
801is a number, followed optionally by
802.B k
803to multiply by 1024 (2\*(ss10\*(se),
804.B m
805to multiply by 1048576 (2\*(ss20\*(se), or
806.B g
807to multiply by 1073741824 (2\*(ss30\*(se); purists can use upper-case
808versions of these if they want. If
809.B .hard
810or
811.B .soft
812was specified, only the hard or soft limit is set; otherwise both are
813set to the same value. Only the superuser can raise the hard limit.
814The soft limit cannot be set above the hard limit.
815.RE
816.PP
817.B exec.env.clear
818.RS
819Clears the program's environment.
820.RE
821.PP
822.B exec.env.unset
823.I var
824.RS
825Removes
826.I var
827from the program's environment. It is not an error if no variable named
828.I var
829exists.
830.RE
831.PP
832.BR exec.env. [ set ]
833.I var
834.RB [ = ]
835.I value
836.RS
96bc31ba 837Assigns the variable
667fb920 838.I var
839the value
840.I value
841in the program's environment, possibly replacing the existing value.
842The
843.B set
844may be omitted if the
845.B env
846qualifier is present.
847.RE
848.PP
849Note that environment variable modifications are performed in order,
850global modifications before local ones.
851.
852.SS "The `socket' source and target types"
853The
854.B socket
855source and target provide access to network services. Support is
856currently provided for TCP/IP and Unix-domain sockets, although other
857address types can be added with reasonable ease.
858.PP
859The syntax for socket sources and targets is:
860.PP
861.ll +8i
862.I source
863::=
864.I socket-source
10a454ad 865.br
667fb920 866.I target
867::=
868.I socket-target
869.br
870.I socket-source
871::=
872.RB [ socket [ . ]]
873.RB [[ : ] \c
874.IR addr-type \c
875.RB [ : ]]
876.I source-addr
877.br
878.I socket-target
879::=
880.RB [ socket [ . ]]
881.RB [[ : ] \c
882.IR addr-type \c
883.RB [ : ]]
884.I target-addr
885.ll -8i
886.PP
887The syntax of the source and target addresses depend on the address
888types, which are described below. The default address type, if no
889.I addr-type
890is given, is
891.BR inet .
892.PP
893Socket sources support options; socket targets do not. The source
894options provided are:
895.PP
896.B socket.conn
897.RB [ = ]
898.I number
899.RS
900Limits the number of simultaneous connections to this socket to the
901.I number
902given. The default is 256.
903.RE
904.PP
905.B socket.logging
906.RB [ = ]
907.BR yes | no
908.RS
909Whether to log incoming connections. If
910.B yes
911(the default) incoming connections are logged, together with information
912about the client (where available) and whether the connection was
913accepted or refused. If
914.BR no ,
915log messages are not generated.
916.RE
917.PP
918Address types also provide their own options.
919.
920.SS "The `inet' socket address type"
921The
922.B inet
923address type provides access to TCP ports. The
924.B inet
925source and target addresses have the following syntax:
926.PP
927.I inet-source-addr
10a454ad 928::=
10a454ad 929.RB [ port ]
930.I port
667fb920 931.br
932.I inet-target-addr
933::=
934.I address
10a454ad 935.RB [ : ]
936.I port
10a454ad 937.br
667fb920 938.I address
10a454ad 939::=
667fb920 940.I addr-elt
941|
942.I address
943.I addr-elt
10a454ad 944.br
667fb920 945.I addr-elt
10a454ad 946::=
667fb920 947.B .
10a454ad 948|
667fb920 949.I word
950.PP
951A
952.I port
953may be given as a port number or a service name from the
954.B /etc/services
955file (or YP map if you do that sort of thing). A
956.B hostname
957may be a textual hostname or a numerical IP address.
958.PP
959The
960.B inet
961source address accepts the following options:
962.PP
963.BR socket.inet. [ allow | deny ]
10a454ad 964.RB [ from ]
667fb920 965.I address
10a454ad 966.RB [ /
667fb920 967.IR address ]
968.RS
969Adds an entry to the source's access control list. If only one
970.I address
971is given, the entry applies only to that address; if two are given, the
972first is a network address and the second is a netmask either in
973dotted-quad format or a simple number of bits (e.g.,
974.B /255.255.255.192
975and
976.B /26
977mean the same), and the entry applies to any address which, when masked
978by the netmask, is equal to the masked network address.
10a454ad 979.PP
667fb920 980The access
981control rules are examined in the order: local entries first, then
982global ones, each in the order given in the configuration file. The
983first matching entry is used. If no entries match, the behaviour is the
984.I opposite
985of the last entry tried. If there are no entries defined, the default
986is to allow all clients.
987.RE
988.
989.SS "The `unix' socket address type"
10a454ad 990The
667fb920 991.B unix
992address type allows access to Unix-domain sockets. The syntax for
993.B unix
994source and target addresses is like this:
995.PP
996.I source-addr
997::=
998.I unix-addr
999.br
1000.I target-addr
1001::=
1002.I unix-addr
1003.br
1004.I unix-addr
1005::=
1006.I file-name
1007.PP
1008The
1009.B unix
1010source address accepts
1011.B fattr
1012options to control the attributes of the socket file created. Sockets
1013are removed if
10a454ad 1014.B fw
667fb920 1015exits normally (which it will do if it runs out of sources or
1016connections, or if killed by SIGINT or SIGTERM).
1017.SH "EXAMPLES"
1018To forward the local port 25 to a main mail server:
1019.VS
1020from 25 to mailserv:25
1021.VE
1022To attach a fortune server to a Unix-domain socket:
1023.VS
1024from unix:/tmp/fortunes
1025to exec [/usr/games/fortune] { user nobody }
1026.VE
1027To fetch a fortune from the server:
1028.VS
1029from file stdin, stdout to unix:/tmp/fortunes
1030.VE
1031To emulate
1032.BR cat (1):
1033.VS
1034from stdin, null to null, stdout
1035.VE
1036.
1037.\"--------------------------------------------------------------------------
10a454ad 1038.SH "BUGS"
667fb920 1039.
1040The syntax for IP addresses and filenames is nasty. The requirement
1041that textual permissions strings be quoted is probably nastier.
10a454ad 1042.PP
667fb920 1043IPv6 is not supported yet. It's probably not a major piece of work to
1044add.
10a454ad 1045.PP
667fb920 1046Please inform me of any security problems you think you've identified in
1047this program. I take security very seriously, and I will fix security
1048holes as a matter of priority when I find out about them. I will be
1049annoyed if I have to read about problems on Bugtraq because they weren't
1050mailed to me first.
1051.
1052.\"--------------------------------------------------------------------------
10a454ad 1053.SH "AUTHOR"
667fb920 1054.
10a454ad 1055Mark Wooding, <mdw@nsict.org>
667fb920 1056.
1057.\"----- That's all, folks --------------------------------------------------