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

Bug#1123566: tcpspy.8: Some remarks and a patch with editorial changes for this man page



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

Dear Maintainer,

>From "/usr/share/doc/debian/bug-reporting.txt.gz":

  Don't file bugs upstream

   If you file a bug in Debian, don't send a copy to the upstream software
   maintainers yourself, as it is possible that the bug exists only in
   Debian. If necessary, the maintainer of the package will forward the
   bug upstream.

-.-

  I do not send reports upstream if I have to get an account there.
The Debian maintainers have one already.

  If I get a negative (or no) response from upstream, I send henceforth
bugs to Debian.

-.-

   * 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=0 -ww -z < "man page"

  [Use 

grep -n -e ' $' -e '\\~$' -e ' \\f.$' -e ' \\"' <file>

  to find (most) 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?

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

an.tmac:<stdin>:135: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split the argument.
an.tmac:<stdin>:138: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split the argument.
troff:<stdin>:187: warning: trailing space in the line
troff:<stdin>:194: 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: forky/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.17.11+deb14-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  init-system-helpers  1.69
ii  libc6                2.42-5

tcpspy recommends no packages.

tcpspy suggests no packages.

-- no debconf information
Input file is tcpspy.8

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

      2 STYLE: input text line longer than 80 bytes: 
      5 STYLE: whitespace at end of input line
      2 WARNING: skipping paragraph macro: PP empty


Find most trailing spaces with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

-.-.

Output from
test-nroff -mandoc -t -ww -z tcpspy.8: (shortened list)

      2 	Use macro '.B' for one argument or split the argument.
      2 .BI is for at least 2 arguments, got 1
      2 line(s) with a trailing space


Find most trailing spaces with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

-.-.

Input file is tcpspy.8

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

5

-.-.

Reduce space between words.

tcpspy.8:202:Expressions (including the  comparisons listed above) may be joined together

-.-.

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.

34:.RB [ "-dp" ]
35:.RB [ "-e"
37:.RB [ "-f"
39:.RB [ "-F"
41:.RB [ "-I"
43:.RB [ "-U"
45:.RB [ "-G"
55:.BI -e " 'rule'"
60:.BI -f " rulefile"
67:.B -e
69:.B -f
72:.BI -F " facility"
79:.BI -I " interval"
89:.BI -U " user"
94:.BI -G " group"
99:.B -U
101:.B -G
104:.B -d
109:.B -p
120:.B -e
145:.BI lport " [low] - [high]"
155:.I -high
191:.BR glob (7)-style
198:.B -p

-.-.

Wrong distance (not two spaces) 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.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

50:syslog. The following information is logged: username, local address and port,
56:Log only connections matching the specified rule. Rule syntax is outlined
57:below. If this option is specified more than once, connections matching any
58:of the specified rules are logged. You should quote the rule, as shown above.
63:Each rule is on a new line. The `#' character may be used to add comments;
75:instead of the compile-time default setting. See the
82:milliseconds, instead of the default of 1000 ms. Connections that last less
156:is used, low is assumed to be 0. It is an error to omit both
175:AND of the local address of the connection and "mask". If no mask is specified,
176:a default mask with all bits set (255.255.255.255) is used. The CIDR type netmask
177:is also possible. With IPv6 only a prefix length netmask is allowed, and the
178:length defaults to 128. Depending on the address family, these rules contain
224:Rules are evaluated from left to right. Whitespace (space, tab and newline)
225:characters are ignored between "words". Rules consisting of only whitespace
273:Tim J. Robbins <tim@robbins.dropbear.id.au>

-.-.

Split lines longer than 80 characters (fill completely
an A4 sized page line on a terminal)
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 176, length 81

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

Line 260, length 85

tcpspy \-e 'not raddr 10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or user "joe")'

-.-.

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

tcpspy.8:145:.BI lport " [low] - [high]"

-.-.

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

tcpspy.8:112:you do not own (this is a kernel limitation).
tcpspy.8:187:True if the full filename (including directory) of the executable that 
tcpspy.8:194:The pattern "" (an empty string) matches connections created/accepted by 
tcpspy.8:202:Expressions (including the  comparisons listed above) may be joined together
tcpspy.8:210:are true (logical OR).
tcpspy.8:217:are true (logical AND).
tcpspy.8:222:is false (logical NOT).
tcpspy.8:224:Rules are evaluated from left to right. Whitespace (space, tab and newline)
tcpspy.8:227:Parentheses, '(' and ')' may be placed around expressions to affect the order
tcpspy.8:260:tcpspy \-e 'not raddr 10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or user "joe")'
tcpspy.8:265:Log connections made by /usr/bin/irc (probably ircII).

-.-.

Only one space character is after a possible end of sentence
(after a punctuation, that can end a sentence).

[List of affected lines removed.]

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.

tcpspy.8:34:.RB [ "-dp" ]
tcpspy.8:35:.RB [ "-e"
tcpspy.8:36:.IR "rule" ]...
tcpspy.8:37:.RB [ "-f"
tcpspy.8:38:.IR "rulefile" ]...
tcpspy.8:39:.RB [ "-F"
tcpspy.8:40:.IR "facility" ]
tcpspy.8:41:.RB [ "-I"
tcpspy.8:42:.IR "interval" ]
tcpspy.8:43:.RB [ "-U"
tcpspy.8:44:.IR "user" ]
tcpspy.8:45:.RB [ "-G"
tcpspy.8:46:.IR "group" ]
tcpspy.8:53:.SS "Options"

-.-.

Add "\&" after an ellipsis, when it does not end a sentence.

36:.IR "rule" ]...
38:.IR "rulefile" ]...

-.-.

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

an.tmac:<stdin>:135: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split the argument.
an.tmac:<stdin>:138: misuse, warning: .BI is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split the argument.
troff:<stdin>:187: warning: trailing space in the line
troff:<stdin>:194: warning: trailing space in the line

-.-

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.

-.-

Tables:

  Put data, that are wider than the header in the (centered) last column,
in a "T{...\nT}" block(, when the table gets wider than the output line).

  Table headers, that are wider than any data in the corresponding column,
do not need to be centered, so left adjustment (l, L) is sufficient.
--- tcpspy.8	2025-12-18 07:37:28.968021225 +0000
+++ tcpspy.8.new	2025-12-18 07:57:39.196979179 +0000
@@ -1,8 +1,8 @@
 .\" This file is part of tcpspy, a TCP/IP connection monitor.
 .\"
-.\" Copyright (c) 2000, 2001, 2002 Tim J. Robbins. 
+.\" Copyright (c) 2000, 2001, 2002 Tim J. Robbins.
 .\" All rights reserved.
-.\" 
+.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -13,7 +13,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
@@ -31,52 +31,51 @@
 tcpspy \- TCP/IP Connection Monitor
 .SH SYNOPSIS
 .B tcpspy
-.RB [ "-dp" ]
-.RB [ "-e"
-.IR "rule" ]...
-.RB [ "-f"
-.IR "rulefile" ]...
-.RB [ "-F"
-.IR "facility" ]
-.RB [ "-I"
-.IR "interval" ]
-.RB [ "-U"
-.IR "user" ]
-.RB [ "-G"
-.IR "group" ]
+.RB [ \-dp ]
+.RB [ \-e
+.IR rule ]...\&
+.RB [ \-f
+.IR rulefile ]...\&
+.RB [ \-F
+.IR facility ]
+.RB [ \-I
+.IR interval ]
+.RB [ \-U
+.IR user ]
+.RB [ \-G
+.IR group ]
 .SH DESCRIPTION
 .I tcpspy
 logs information about selected incoming and outgoing TCP/IP connections to
 syslog. The following information is logged: username, local address and port,
 remote address, port, and optionally the filename of the executable.
-.PP
-.SS "Options"
+.SS Options
 .TP
-.BI -e " 'rule'"
+.BI \-e " 'rule'"
 Log only connections matching the specified rule. Rule syntax is outlined
 below. If this option is specified more than once, connections matching any
 of the specified rules are logged. You should quote the rule, as shown above.
 .TP
-.BI -f " rulefile"
+.BI \-f " rulefile"
 Read rules from
 .IR rulefile .
 Each rule is on a new line. The `#' character may be used to add comments;
 everything from this character to the end of the line is ignored.
 
 The
-.B -e
+.B \-e
 and
-.B -f
+.B \-f
 options may be used together.
 .TP
-.BI -F " facility"
+.BI \-F " facility"
 Log to syslog facility
 .I facility
 instead of the compile-time default setting. See the
 .BR syslog.conf (5)
 manual page for a list of facilities.
 .TP
-.BI -I " interval"
+.BI \-I " interval"
 Update the internal state every
 .I interval
 milliseconds, instead of the default of 1000 ms. Connections that last less
@@ -86,27 +85,27 @@ milliseconds may be missed, so you shoul
 enough that it catches most connections, but not so small that it causes
 tcpspy to use too much CPU time.
 .TP
-.BI -U " user"
+.BI \-U " user"
 Switch to the specified user after startup.
 .I user
 may be a numeric user id or a user name from the system password file.
 .TP
-.BI -G " group"
+.BI \-G " group"
 Switch to the specified group after startup.
 .I group
 may be a numeric group id or a group name from the system group file.
 If a username to switch to with the
-.B -U
+.B \-U
 option is specified but
-.B -G
+.B \-G
 is omitted, tcpspy will switch to that specified user's primary group.
 .TP
-.B -d
+.B \-d
 Debugging mode; if this option is specified, tcpspy will not detach from the
 console after initialisation, and will log connections to standard output
 instead of syslog.
 .TP
-.B -p
+.B \-p
 Log the filename of the executable that created/accepted the connection.
 You may require superuser privileges to obtain this information for processes
 you do not own (this is a kernel limitation).
@@ -114,10 +113,9 @@ you do not own (this is a kernel limitat
 This option can greatly increase the amount of CPU time required to
 process each connection/disconnection.
 
-.PP
 .SS "Rule Syntax"
 A rule may be specified with the
-.B -e
+.B \-e
 option to log information about connections matching this rule, overriding
 the default of logging all connections.
 .PP
@@ -132,17 +130,19 @@ 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]"
+.BI "lport "\c
+.RI [ low "] \(en [" high ]
 True if the local end of the connection has a port number
 greater than or equal to
 .I low
@@ -184,22 +184,22 @@ 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 
+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.
 
-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.
 
 If the
-.B -p
+.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
+Expressions (including the comparisons listed above) may be joined together
 with the following logical operations:
 .TP
 .IB expr1 " or " expr2
  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>

  To find trailing space use

grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

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

-.-

  For a style guide use

  mandoc -T lint

-.-

  For general input conventions consult the man page "nroff(7)" (item
"Input conventions") or the Texinfo manual about the same item.

-.-

  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 when that has been fixed.

  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: