Package: mutt Version: 2.2.13-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 "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? troff:<stdin>:44: warning: trailing space in the line troff:<stdin>:57: warning: trailing space in the line troff:<stdin>:62: warning: trailing space in the line troff:<stdin>:66: warning: trailing space in the line troff:<stdin>:70: warning: trailing space in the line troff:<stdin>:74: warning: trailing space in the line troff:<stdin>:96: warning: trailing space in the line troff:<stdin>:98: warning: trailing space in the line troff:<stdin>:102: warning: trailing space in the line troff:<stdin>:108: warning: trailing space in the line troff:<stdin>:111: warning: trailing space in the line troff:<stdin>:131: warning: trailing space in the line troff:<stdin>:133: warning: trailing space in the line troff:<stdin>:136: 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.17-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 mutt depends on: ii libc6 2.41-4 ii libgnutls30t64 3.8.9-2 ii libgpg-error0 1.51-3 ii libgpgme11t64 1.24.2-1+b1 ii libgsasl18 2.2.1-1+b2 ii libgssapi-krb5-2 1.21.3-5 ii libidn2-0 2.3.8-1 ii libncursesw6 6.5+20250216-2 ii libtinfo6 6.5+20250216-2 ii libtokyocabinet9t64 1.4.48-15.1+b1 ii zlib1g 1:1.3.dfsg+really1.3.1-1+b1 Versions of packages mutt recommends: ii locales 2.41-4 ii mailcap 3.74 ii sensible-utils 0.0.24 Versions of packages mutt suggests: ii aspell 0.60.8.1-4 ii ca-certificates 20241223 ii exim4-daemon-light [mail-transport-agent] 4.98.1-1 ii gnupg 2.2.46-1 ii ispell 3.4.06-1 ii openssl 3.4.1-1 pn urlview <none> Versions of packages mutt is related to: ii mutt 2.2.13-1 -- no debconf information
Input file is mutt_dotlock.1 Output from "mandoc -T lint mutt_dotlock.1": (shortened list) 6 skipping paragraph macro: PP after SH 2 skipping paragraph macro: PP empty 27 whitespace at end of input line Remove trailing space with: sed -e 's/ *$//' -.-. Output from "test-nroff -mandoc -t -ww -z mutt_dotlock.1": (shortened list) 14 trailing space in the line Remove trailing space with: sed -e 's/ *$//' -.-. 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 27 -.-. 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. 37:.IP "-t" 42:.IP "-f" 47:.IP "-u" 51:.IP "-d" 56:.IP "-p" 61:.IP "-r \fIretries\fP" 67:.B -f 101:.B -f 112:.B -t 122:.B -t -.-. 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" 33:created. The program operates with group mail privileges 141:spool files. The code carefully avoids race conditions -.-. FSF office address update. See https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00004.html 19:.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -.-. Only one space character after a possible end of sentence (after a punctuation, that can end a sentence). mutt_dotlock.1:33:created. The program operates with group mail privileges mutt_dotlock.1:141:spool files. The code carefully avoids race conditions -.-. Put a subordinate sentence (after a comma) on a new line. mutt_dotlock.1:32:To lock \fIfile\fP, a file named \fIfile\fP.lock is mutt_dotlock.1:40:won't actually lock a file, but inform the invoking mutt_dotlock.1:54:will lock \fIfile\fP, remove it if it has length 0, and afterwards mutt_dotlock.1:104:won't generate this error, but break other processes' -.-. 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. mutt_dotlock.1:37:.IP "-t" mutt_dotlock.1:42:.IP "-f" mutt_dotlock.1:47:.IP "-u" mutt_dotlock.1:51:.IP "-d" mutt_dotlock.1:56:.IP "-p" mutt_dotlock.1:73:.IP "\fIfile\fP.lock" -.-. Space character after a macro call. 26:.B mutt_dotlock 49:.B mutt_dotlock 63:.B mutt_dotlock 90:.TP 94:.TP 101:.B -f 106:.TP 109:.B mutt_dotlock 124:.B mutt_dotlock 137:.B mutt_dotlock -.-. Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ": troff:<stdin>:44: warning: trailing space in the line troff:<stdin>:57: warning: trailing space in the line troff:<stdin>:62: warning: trailing space in the line troff:<stdin>:66: warning: trailing space in the line troff:<stdin>:70: warning: trailing space in the line troff:<stdin>:74: warning: trailing space in the line troff:<stdin>:96: warning: trailing space in the line troff:<stdin>:98: warning: trailing space in the line troff:<stdin>:102: warning: trailing space in the line troff:<stdin>:108: warning: trailing space in the line troff:<stdin>:111: warning: trailing space in the line troff:<stdin>:131: warning: trailing space in the line troff:<stdin>:133: warning: trailing space in the line troff:<stdin>:136: warning: trailing space in the line -.-. Generally: Split (sometimes) lines after a punctuation mark; before a conjunction.
--- mutt_dotlock.1 2025-03-20 03:34:57.463632603 +0000 +++ mutt_dotlock.1.new 2025-03-20 03:48:48.592850970 +0000 @@ -3,17 +3,17 @@ .\" .\" Copyright (C) 1996-8 Michael R. Elkins <m...@cs.hmc.edu> .\" Copyright (C) 1998-9 Thomas Roessler <roess...@does-not-exist.org> -.\" +.\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. -.\" +.\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. -.\" +.\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -22,94 +22,91 @@ .SH NAME mutt_dotlock \- Lock mail spool files. .SH SYNOPSIS -.PP -.B mutt_dotlock +.B mutt_dotlock [\-t|\-f|\-u|\-d] [\-p] [\-r \fIretries\fP] \fIfile\fP .SH DESCRIPTION -.PP .B mutt_dotlock implements the traditional mail spool file locking method: -To lock \fIfile\fP, a file named \fIfile\fP.lock is -created. The program operates with group mail privileges +To lock \fIfile\fP, +a file named \fIfile\fP.lock is created. +The program operates with group mail privileges if necessary. .SH OPTIONS -.PP -.IP "-t" +.IP \-t Just try. .B mutt_dotlock -won't actually lock a file, but inform the invoking -process if it's at all possible to lock \fIfile\fP. -.IP "-f" +won't actually lock a file, +but inform the invoking process +if it's at all possible to lock \fIfile\fP. +.IP \-f Force the lock. If another process holds a lock on -\fIfile\fP longer than a certain amount of time, +\fIfile\fP longer than a certain amount of time, .B mutt_dotlock will break that lock by removing the lockfile. -.IP "-u" +.IP \-u Unlock. -.B mutt_dotlock +.B mutt_dotlock will remove \fIfile\fP.lock. -.IP "-d" +.IP \-d Delete. .B mutt_dotlock -will lock \fIfile\fP, remove it if it has length 0, and afterwards -remove \fIfile\fP.lock. -.IP "-p" -Use privileges. If given this option, +will lock \fIfile\fP, +remove it if it has length 0, +and afterwards remove \fIfile\fP.lock. +.IP \-p +Use privileges. If given this option, .B mutt_dotlock will operate with group mail privileges when creating and deleting lock files. -.IP "-r \fIretries\fP" -This command line option tells -.B mutt_dotlock +.IP "\-r \fIretries\fP" +This command line option tells +.B mutt_dotlock to try locking \fIretries\fP times before giving up or (if invoked with -the -.B -f +the +.B \-f command line option) break a lock. The default value is 5. .B mutt_dotlock -waits one second between successive locking attempts. +waits one second between successive locking attempts. .SH FILES -.PP -.IP "\fIfile\fP.lock" -The lock file +.IP \fIfile\fP.lock +The lock file .B mutt_dotlock generates. .SH SEE ALSO -.PP .BR fcntl (2), .BR flock (2), .BR lockfile (1), .BR mutt (1) .SH DIAGNOSTICS -.PP .B mutt_dotlock gives all diagnostics in its return values: .TP .B "0 \- DL_EX_OK" The program was successful. -.TP +.TP .B "1 \- DL_EX_ERROR" An unspecified error such as bad command line parameters, lack of system memory and the like has occurred. -.TP +.TP .B "3 \- DL_EX_EXIST" -The +The user wants to lock a file which has been locked by -another process already. If +another process already. If .B mutt_dotlock is invoked with the -.B -f -command line option, +.B \-f +command line option, .B mutt_dotlock -won't generate this error, but break other processes' -locks. -.TP +won't generate this error, +but break other processes' locks. +.TP .B "4 \- DL_EX_NEED_RPIVS" -This return value only occurs if -.B mutt_dotlock +This return value only occurs if +.B mutt_dotlock has been invoked -with the -.B -t +with the +.B \-t command line option. It means that .B mutt_dotlock will have to use its group mail privileges to lock @@ -119,30 +116,29 @@ will have to use its group mail privileg This return value only occurs if .B mutt_dotlock has been invoked with the -.B -t +.B \-t command line option. It means that -.B mutt_dotlock +.B mutt_dotlock is unable to lock \fIfile\fP even with group mail privileges. .SH NOTES -.PP .B mutt_dotlock tries to implement an NFS-safe dotlocking method which was -borrowed from +borrowed from .B lockfile -(1). +(1). .PP If the user can't open \fIfile\fP for reading with his -normal privileges, -.B mutt_dotlock +normal privileges, +.B mutt_dotlock will return the .B DL_EX_ERROR exit value to avoid certain attacks against other users' -spool files. The code carefully avoids race conditions -when checking permissions; for details of all this see the -comments in dotlock.c. +spool files. +The code carefully avoids race conditions +when checking permissions; +for details of all this see the comments in dotlock.c. .SH HISTORY -.PP .B mutt_dotlock is part of the Mutt mail user agent package. It has been created to avoid running mutt with group mail privileges.
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) -.-