[DSE-Dev] Bug#1118765: semanage.conf.5: Some remarks and a patch with editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Sat Oct 25 02:39:33 BST 2025
Package: libsemanage-common
Version: 3.9-1
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
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-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=0 -ww -z ":
an.tmac:<stdin>:129: misuse, warning: .BR is for at least 2 arguments, got 1
Use macro '.B' for one argument or split the argument.
an.tmac:<stdin>:210: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:219: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:228: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:234: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:236: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:278: misuse, warning: .BR is for at least 2 arguments, got 1
Use macro '.B' for one argument or split the argument.
an-end-check:<stdin>: Warning: Different number of .RS and .RE calls, an-RS-open=1 at end of file
* 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.16.12+deb14+1-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)
-- no debconf information
-------------- next part --------------
Input file is semanage.conf.5
Output from
test-nroff -mandoc -t -ww -z semanage.conf.5: (shortened list)
2 Use macro '.B' for one argument or split the argument.
5 Use macro '.I' for one argument or split the argument.
2 .BR is for at least 2 arguments, got 1
5 .IR is for at least 2 arguments, got 1
-.-.
Change two HYPHEN-MINUSES (code 0x2D) to an em-dash (\(em),
if one is intended.
" \(em " creates a too big gap in the text (in "troff").
An en-dash is usually surrounded by a space,
while an em-dash is used without spaces.
"man" (1 byte characters in input) transforms an en-dash (\(en) to one
HYPHEN-MINUS,
and an em-dash to two HYPHEN-MINUSES without considering the space
around it.
If "--" are two single "-"
(begin of an option or end of options)
then use "\-\-".
semanage.conf.5:248:args = --flag
-.-.
Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-
248:args = --flag
-.-.
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.
248:args = --flag
263:args = -r $@
-.-.
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"
85:command. It can be set to either "0"
-.-.
The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).
278:.BR semanage(8)
-.-.
Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".
semanage.conf.5:270:verify source modules (\fBverify module\fR), linked modules
semanage.conf.5:271:(\fBverify linked\fR), and kernel policies (\fBverify kernel\fR).
-.-.
Only one space character is after a possible end of sentence
(after a punctuation, that can end a sentence).
semanage.conf.5:85:command. It can be set to either "0"
-.-.
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.
semanage.conf.5:1:.TH SEMANAGE.CONF 5 "September 2011" "semanage.conf"
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=0 -ww -z ":
an.tmac:<stdin>:129: misuse, warning: .BR is for at least 2 arguments, got 1
Use macro '.B' for one argument or split the argument.
an.tmac:<stdin>:210: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:219: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:228: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:234: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:236: misuse, warning: .IR is for at least 2 arguments, got 1
Use macro '.I' for one argument or split the argument.
an.tmac:<stdin>:278: misuse, warning: .BR is for at least 2 arguments, got 1
Use macro '.B' for one argument or split the argument.
an-end-check:<stdin>: Warning: Different number of .RS and .RE calls, an-RS-open=1 at end of file
-.-
Generally:
Split (sometimes) lines after a punctuation mark; before a conjunction.
-.-
-------------- next part --------------
--- semanage.conf.5 2025-10-25 01:18:16.404982882 +0000
+++ semanage.conf.5.new 2025-10-25 01:28:15.591961485 +0000
@@ -126,7 +126,7 @@ Some distributions use this to stop labe
.TP
.B usepasswd
Whether or not to enable the use
-.BR getpwent()
+.BR getpwent ()
to obtain a list of home directories to label.
It can be set to either "true" or "false".
By default it is set to "true".
@@ -201,13 +201,12 @@ external commands. For the following co
be overridden:
.
.RS
-.RS
.TP
.B load_policy
Command to load a kernel policy.
Requires no argument.
Defaults to
-.IR /sbin/load_policy
+.I /sbin/load_policy
with no arguments.
.
.TP
@@ -216,7 +215,7 @@ Command to verify file context definitio
Requires two arguments, the path to the kernel policy and the path to the
file context definition file.
Defaults to
-.IR /sbin/setfiles
+.I /sbin/setfiles
with the arguments '\-q \-c $@ $<'.
.
.TP
@@ -225,15 +224,15 @@ Command to compile a file context defini
Requires one argument, the path to the to be compiled file context
definition file.
Defaults to
-.IR /sbin/sefcontext_compile
+.I /sbin/sefcontext_compile
with the argument '$@'.
.
.RE
.PP
Either
-.IR path
+.I path
or
-.IR args
+.I args
can be omitted.
The argument string must contain '$@' for the first required argument,
and '$<' for the second one.
@@ -245,7 +244,7 @@ The syntax for overriding an external co
.sp 0
path = /path/to/command
.sp 0
-args = --flag
+args = \-\-flag
.sp 0
[end]
.
@@ -260,7 +259,7 @@ Example
.sp 0
path = /usr/sbin/sefcontext_compile
.sp 0
-args = -r $@
+args = \-r $@
.sp 0
[end]
.
@@ -275,7 +274,7 @@ failure.
.
.SH SEE ALSO
.TP
-.BR semanage(8)
+.BR semanage (8)
.
.SH AUTHOR
This manual page was written by Guido Trentalancia <guido at trentalancia.com>.
-------------- next part --------------
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.
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)
-.-
More information about the SELinux-devel
mailing list