[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1096159: tcpspy.rules.5: Some remarks and a patch with editorial changes for this man page



Package: tcpspy
Version: 1.7d-16
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"

  [Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?

an.tmac:<stdin>:40: misuse, warning: .IR is for at least 2 arguments, got 1
	Use macro '.I' for one argument or split argument.
an.tmac:<stdin>:83: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:86: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
troff:<stdin>:135: warning: trailing space in the line
troff:<stdin>:142: warning: trailing space in the line

   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.12-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages tcpspy depends on:
ii  libc6  2.40-6

tcpspy recommends no packages.

tcpspy suggests no packages.

-- no debconf information
Input file is tcpspy.rules.5

Output from "mandoc -T lint  tcpspy.rules.5": (shortened list)


Remove trailing space with: sed -e 's/  *$//'

      1 input text line longer than 80 bytes: a default mask with ...
      1 skipping paragraph macro: PP after SH
      3 skipping paragraph macro: PP empty
      5 whitespace at end of input line

-.-.

Output from "test-groff -mandoc -t -ww -z tcpspy.rules.5": (shortened list)

Remove trailing space with: sed -e 's/  *$//'

      2 	Use macro '.B' for one argument or split argument.
      1 	Use macro '.I' for one argument or split argument.
      2 .BI is for at least 2 arguments, got 1
      1 .IR is for at least 2 arguments, got 1
      2 trailing space in the line

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

3

-.-.

Use the correct macro for the font change of a single argument or
split the argument into two.

40:.IR /etc/init.d/tcpspy 

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

103:.I -high
146:.B -p

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

104:is used, low is assumed to be 0. It is an error to omit both
123:AND of the local address of the connection and "mask". If no mask is specified,
124:a default mask with all bits set (255.255.255.255) is used. The CIDR type netmask
125:is also possible. With IPv6 only a prefix length netmask is allowed, and the
126:length defaults to 128. Depending on the address family, these rules contain
172:Rules are evaluated from left to right. Whitespace (space, tab and newline)
173:characters are ignored between "words". Rules consisting of only whitespace
195:Tim J. Robbins (tcpspy),

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 124, length 81

a default mask with all bits set (255.255.255.255) is used. The CIDR type netmask

-.-.

Use \(en (en-dash) for a dash at the beginning (en) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

tcpspy.rules.5:55:to 4 rules (line 1 to line 4 - one per each line) using the boolean
tcpspy.rules.5:60:line 1 - for user "joedoe" connecting to 192.168.1.10:22 (remote)
tcpspy.rules.5:62:line 2 - for user whose UID is 1003
tcpspy.rules.5:64:line 3 - to *:22 or *:21 (both locally)
tcpspy.rules.5:66:line 4 - for user "joedoe" to *:23 (local) or to 192.168.1.20 (remote)
tcpspy.rules.5:71:.SS "Rule Syntax - just extracted from tcpspy(8)"
tcpspy.rules.5:93:.BI lport " [low] - [high]"

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

42:tcpspy (see tcpspy(8)) logger filtering rules.
71:.SS "Rule Syntax - just extracted from tcpspy(8)"

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

tcpspy.rules.5:42:tcpspy (see tcpspy(8)) logger filtering rules.
tcpspy.rules.5:55:to 4 rules (line 1 to line 4 - one per each line) using the boolean
tcpspy.rules.5:56:logic (see below) to evaluate each rule.
tcpspy.rules.5:64:line 3 - to *:22 or *:21 (both locally)
tcpspy.rules.5:135:True if the full filename (including directory) of the executable that 
tcpspy.rules.5:150:Expressions (including the  comparisons listed above) may be joined together
tcpspy.rules.5:172:Rules are evaluated from left to right. Whitespace (space, tab and newline)

-.-.

Use thousand markers to make large numbers easy to read

101:is used, high is assumed to be 65535.

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

32:.TH TCPSPY.RULES 5 "April 2001" Spectra "tcpspy.rules"
178:.SS "Examples"

-.-.

Trailing space in a macro call.
Remove with "sed -i -e 's/  *$//'"

40:.IR /etc/init.d/tcpspy 

-.-.

Section headings (.SH and .SS) do not need quoting.

71:.SS "Rule Syntax - just extracted from tcpspy(8)"
178:.SS "Examples"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:40: misuse, warning: .IR is for at least 2 arguments, got 1
	Use macro '.I' for one argument or split argument.
an.tmac:<stdin>:83: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:86: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
troff:<stdin>:135: warning: trailing space in the line
troff:<stdin>:142: warning: trailing space in the line
--- tcpspy.rules.5	2025-02-16 15:38:18.840142782 +0000
+++ tcpspy.rules.5.new	2025-02-16 16:10:56.793468823 +0000
@@ -5,7 +5,7 @@
 .\" Copyright (c) 2001 Pablo Lorenzzoni.
 .\" Copyright (c) 2011 Mats Erik Andersson
 .\" All rights reserved.
-.\" 
+.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -16,7 +16,7 @@
 .\"    documentation and/or other materials provided with the distribution.
 .\" 3. The name of the author may not be used to endorse or promote products
 .\"    derived from this software without specific prior written permission.
-.\" 
+.\"
 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 .\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
@@ -29,17 +29,18 @@
 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" $Id: tcpspy.rules.5,v 1.33 2001/01/28 13:09:12 fyre Exp $
-.TH TCPSPY.RULES 5 "April 2001" Spectra "tcpspy.rules"
+.TH TCPSPY.RULES 5 "April 2001" Spectra tcpspy.rules
 .SH NAME
 tcpspy.rules \- configuration file for tcpspy
 .SH DESCRIPTION
-.LP
 This file, by default
 .IR /etc/tcpspy.rules ,
 is read by the
-.IR /etc/init.d/tcpspy 
-script at init time in order to configure
-tcpspy (see tcpspy(8)) logger filtering rules.
+.I /etc/init.d/tcpspy
+script at init time in order to configure tcpspy
+(see
+.BR tcpspy (8))
+logger filtering rules.
 .LP
 It might look like:
 .IP
@@ -52,23 +53,22 @@ lport 22 or lport 21
 .fi
 .LP
 This rules file specifies that tcpspy logs tcp connections according
-to 4 rules (line 1 to line 4 - one per each line) using the boolean
-logic (see below) to evaluate each rule.
+to 4 rules
+(line 1 to line 4 \(en one per each line)
+using the boolean logic (see below) to evaluate each rule.
 .LP
 This particular example logs connections:
 .TP
-line 1 - for user "joedoe" connecting to 192.168.1.10:22 (remote)
+line 1 \(en for user "joedoe" connecting to 192.168.1.10:22 (remote)
 .TP
-line 2 - for user whose UID is 1003
+line 2 \(en for user whose UID is 1003
 .TP
-line 3 - to *:22 or *:21 (both locally)
+line 3 \(en to *:22 or *:21 (both locally)
 .TP
-line 4 - for user "joedoe" to *:23 (local) or to 192.168.1.20 (remote)
+line 4 \(en for user "joedoe" to *:23 (local) or to 192.168.1.20 (remote)
 .LP
 Everything from an "#" signal and the end of the line will not be evaluated.
-.LP
-.PP
-.SS "Rule Syntax - just extracted from tcpspy(8)"
+.SS "Rule Syntax \(en just extracted from tcpspy(8)"
 A rule may be specified with the following comparison operators:
 .TP
 .BI user " uid"
@@ -80,28 +80,30 @@ user id
 .BI user " \N'34'username\N'34'"
 Same as above, but using a username instead of a user id.
 .TP
-.BI ip
+.B ip
 True if the connection is IPv4.
 .TP
-.BI ip6
+.B ip6
 True if the connection is IPv6.
 .TP
 .BI lport " port"
 True if the local end of the connection has port number
 .IR port .
 .TP
-.BI lport " [low] - [high]"
+.BI lport " [low] \(en [high]"
 True if the local end of the connection has a port number
 greater than or equal to
 .I low
 and less than or equal to
 .IR high .
 If the form
-.I low-
-is used, high is assumed to be 65535.
+.I low\-
+is used, high is assumed to be 65,535.
 If the form
-.I -high
-is used, low is assumed to be 0. It is an error to omit both
+.I \-high
+is used,
+low is assumed to be 0.
+It is an error to omit both
 .IR low " and " high .
 .TP
 .BI lport " \N'34'service\N'34'"
@@ -119,12 +121,17 @@ but compares the port number of the remo
 .BI laddr " n.n.n.n/m"
 .TP
 .BI laddr " ip6-addr[/m]"
-Interpreted as a "net/mask" expression; true if "net" is equal to the bitwise
-AND of the local address of the connection and "mask". If no mask is specified,
-a default mask with all bits set (255.255.255.255) is used. The CIDR type netmask
-is also possible. With IPv6 only a prefix length netmask is allowed, and the
-length defaults to 128. Depending on the address family, these rules contain
-an implicit match condition "ip" or "ip6", respectively.
+Interpreted as a "net/mask" expression;
+true if "net" is equal to the bitwise AND of the local address of the
+connection and "mask".
+If no mask is specified,
+a default mask with all bits set (255.255.255.255) is used.
+The CIDR type netmask is also possible.
+With IPv6 only a prefix length netmask is allowed,
+and the length defaults to 128.
+Depending on the address family,
+these rules contain an implicit match condition "ip" or "ip6",
+respectively.
 .TP
 .B raddr
 Same as
@@ -132,23 +139,27 @@ Same as
 but compares the remote address.
 .TP
 .BI exe " \N'34'pattern\N'34'"
-True if the full filename (including directory) of the executable that 
-created/accepted the connection matches
+True if the full filename
+(including directory)
+of the executable
+that created/accepted the connection matches
 .IR pattern ,
 a
 .BR glob (7)-style
 wildcard pattern.
 .IP
-The pattern "" (an empty string) matches connections created/accepted by 
+The pattern "" (an empty string) matches connections created/accepted by
 processes whose executable filename is unknown.
 .IP
 If the
-.B -p
-option is not specified, a warning message will be printed, and the result of
-this comparison will always be true.
+.B \-p
+option is not specified,
+a warning message will be printed,
+and the result of this comparison will always be true.
 .PP
-Expressions (including the  comparisons listed above) may be joined together
-with the following logical operations:
+Expressions
+(including the  comparisons listed above)
+may be joined together with the following logical operations:
 .TP
 .IB expr1 " or " expr2
 True if either of
@@ -169,13 +180,15 @@ True if
 .I expr
 is false (logical NOT).
 .PP
-Rules are evaluated from left to right. Whitespace (space, tab and newline)
-characters are ignored between "words". Rules consisting of only whitespace
-match no connections, but do not cause an error.
+Rules are evaluated from left to right.
+Whitespace
+(space, tab and newline)
+characters are ignored between "words".
+Rules consisting of only whitespace match no connections,
+but do not cause an error.
 Parentheses, '(' and ')' may be placed around expressions to affect the order
 of evaluation.
-.PP
-.SS "Examples"
+.SS Examples
 .TP
 These are some sample rules which further demonstrate how they are constructed:
 .TP
@@ -192,7 +205,7 @@ Log connections made by users "bob" and
 not on a fictional "intranet".
 
 .SH AUTHOR
-Tim J. Robbins (tcpspy),
+Tim J.\& Robbins (tcpspy),
 Pablo Lorenzzoni (this manpage) and  Mats Erik Andersson (changes for IPv6)
 
 .SH SEE ALSO
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option \"-warnings=w\"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT=\"-ww -b -z\"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

Reply to: