[Pkg-shadow-devel] Bug#1099521: chage.1: Some remarks and a patch with editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Tue Mar 4 12:36:20 GMT 2025


Package: passwd
Version: 1:4.17.3-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>:66: 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 passwd depends on:
ii  base-passwd     3.6.6
ii  libacl1         2.3.2-2+b1
ii  libattr1        1:2.5.2-3
ii  libaudit1       1:4.0.2-2+b2
ii  libbsd0         0.12.2-2
ii  libc6           2.40-7
ii  libcrypt1       1:4.4.38-1
ii  libpam-modules  1.7.0-3
ii  libpam0g        1.7.0-3
ii  libselinux1     3.8-4
ii  libsemanage2    3.8-1+b1
ii  login.defs      1:4.17.3-1

Versions of packages passwd recommends:
ii  sensible-utils  0.0.24

passwd suggests no packages.

-- no debconf information
-------------- next part --------------
Input file is chage.1

Output from "mandoc -T lint  chage.1": (shortened list)

      1 input text line longer than 80 bytes: Apply changes to con...
      1 input text line longer than 80 bytes: Set the date or numb...
      2 input text line longer than 80 bytes: Set the number of da...
      1 input text line longer than 80 bytes: The chage program wi...
      1 input text line longer than 80 bytes: command changes the ...
      1 input text line longer than 80 bytes: is less than the cur...
      1 input text line longer than 80 bytes: operates in an inter...
      2 input text line longer than 80 bytes: option is the number...
      1 input text line longer than 80 bytes: option, which may be...
      1 input text line longer than 80 bytes: program will also no...
      7 skipping paragraph macro: PP after SH

-.-.

Output from "test-groff -mandoc -t -ww -z chage.1": (shortened list)

      1 trailing space in the line

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

-.-.

Show if docman-to-man created this.

Who is actually creating this man page?  Debian or upstream?

Is the generating software out of date?

4:.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>

-.-.

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

1

-.-.

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.

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"

[List of affected lines removed.]

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.  

[List of affected lines removed.]

-.-

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

[List of affected lines removed.]

-.-.

No need for '\&' to be in front of a period (.),
if there is a character in front of it.

Remove with "sed -e 's/\\&\././g'".

[List of affected lines removed.]

-.-

Space after an end of sentence.

chage.1:39:command changes the number of days between password changes and the date of the last password change\&. This information is used by the system to determine when a user must change their password\&.
chage.1:48:Set the number of days since January 1st, 1970 when the password was last changed\&. The date may also be expressed in the format YYYY\-MM\-DD (or the format more commonly used in your area)\&. If the
chage.1:57:Set the date or number of days since January 1, 1970 on which the user\*(Aqs account will no longer be accessible\&. The date may also be expressed in the format YYYY\-MM\-DD (or the format more commonly used in your area)\&. A user whose account is locked must contact the system administrator before being able to use the system again\&.
chage.1:91:Set the number of days of inactivity after a password has expired before the account is locked\&. The
chage.1:93:option is the number of days of inactivity\&. A user whose account is locked must contact the system administrator before being able to use the system again\&.
chage.1:110:\fIMIN_DAYS\fR\&. A value of zero for this field indicates that the user may change their password at any time\&.
chage.1:115:Set the maximum number of days during which a password is valid\&. When
chage.1:119:is less than the current day, the user will be required to change their password before being able to use their account\&. This occurrence can be planned for in advance by use of the
chage.1:136:directory\&. Only absolute paths are supported\&.
chage.1:142:\fIPREFIX_DIR\fR\&. This option does not chroot and is intended for preparing a cross\-compilation target\&. Some limitations: NIS and LDAP users/groups are not verified\&. No SELINUX support\&.
chage.1:147:Set the number of days of warning before a password change is required\&. The
chage.1:154:operates in an interactive fashion, prompting the user with the current values for all of the fields\&. Enter the new value to change the field, or leave the line blank to use the current value\&. The current value is displayed between a pair of
chage.1:163:The chage program will report only the information from the shadow password file\&. This implies that configuration from other sources (e\&.g\&. LDAP or empty password hash field from the passwd file) that affect the user\*(Aqs login will not be shown in the chage output\&.
chage.1:167:program will also not report any inconsistency between the shadow and passwd files (e\&.g\&. missing x in the passwd file)\&. The

-.-.

Put a subordinate sentence (after a comma) on a new line.

chage.1:48:Set the number of days since January 1st, 1970 when the password was last changed\&. The date may also be expressed in the format YYYY\-MM\-DD (or the format more commonly used in your area)\&. If the
chage.1:57:Set the date or number of days since January 1, 1970 on which the user\*(Aqs account will no longer be accessible\&. The date may also be expressed in the format YYYY\-MM\-DD (or the format more commonly used in your area)\&. A user whose account is locked must contact the system administrator before being able to use the system again\&.
chage.1:86:When printing dates, use YYYY\-MM\-DD format\&.
chage.1:119:is less than the current day, the user will be required to change their password before being able to use their account\&. This occurrence can be planned for in advance by use of the
chage.1:121:option, which provides the user with advance warning\&.
chage.1:154:operates in an interactive fashion, prompting the user with the current values for all of the fields\&. Enter the new value to change the field, or leave the line blank to use the current value\&. The current value is displayed between a pair of
chage.1:173:command is restricted to the root user, except for the
chage.1:175:option, which may be used by an unprivileged user to determine when their password or account is due to expire\&.

-.-.

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.

chage.1:10:.TH "CHAGE" "1" "02/24/2025" "shadow\-utils 4\&.17\&.3" "User Commands"
chage.1:30:.SH "NAME"
chage.1:32:.SH "SYNOPSIS"
chage.1:35:.SH "DESCRIPTION"
chage.1:40:.SH "OPTIONS"
chage.1:157:.SH "NOTE"
chage.1:176:.SH "CONFIGURATION"
chage.1:181:.SH "FILES"

-.-.

Use ".na" (no adjustment) instead of ".ad l" (and ".ad" to begin the
same adjustment again as before).

26:.ad l

-.-.

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

30:.SH "NAME"
32:.SH "SYNOPSIS"
35:.SH "DESCRIPTION"
40:.SH "OPTIONS"
157:.SH "NOTE"
176:.SH "CONFIGURATION"
181:.SH "FILES"
192:.SH "EXIT VALUES"
217:.SH "SEE ALSO"

-.-.

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

troff:<stdin>:66: warning: trailing space in the line

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
-------------- next part --------------
--- chage.1	2025-03-04 12:12:48.937671776 +0000
+++ chage.1.new	2025-03-04 12:27:24.888110170 +0000
@@ -7,7 +7,7 @@
 .\"    Source: shadow-utils 4.17.3
 .\"  Language: English
 .\"
-.TH "CHAGE" "1" "02/24/2025" "shadow\-utils 4\&.17\&.3" "User Commands"
+.TH CHAGE 1 02/24/2025 "shadow\-utils 4.17.3" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -23,22 +23,20 @@
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
-.ad l
+.na
 .\" -----------------------------------------------------------------
 .\" * MAIN CONTENT STARTS HERE *
 .\" -----------------------------------------------------------------
-.SH "NAME"
+.SH NAME
 chage \- change user password expiry information
-.SH "SYNOPSIS"
+.SH SYNOPSIS
 .HP \w'\fBchage\fR\ 'u
 \fBchage\fR [\fIoptions\fR] \fILOGIN\fR
-.SH "DESCRIPTION"
-.PP
+.SH DESCRIPTION
 The
 \fBchage\fR
 command changes the number of days between password changes and the date of the last password change\&. This information is used by the system to determine when a user must change their password\&.
-.SH "OPTIONS"
-.PP
+.SH OPTIONS
 The options which apply to the
 \fBchage\fR
 command are:
@@ -63,7 +61,7 @@ For example the following can be used to
 .\}
 .nf
 	    chage \-E $(date \-d +180days +%Y\-%m\-%d)
-	  
+
 .fi
 .if n \{\
 .RE
@@ -154,8 +152,7 @@ If none of the options are selected,
 operates in an interactive fashion, prompting the user with the current values for all of the fields\&. Enter the new value to change the field, or leave the line blank to use the current value\&. The current value is displayed between a pair of
 \fI[ ]\fR
 marks\&.
-.SH "NOTE"
-.PP
+.SH NOTE
 The
 \fBchage\fR
 program requires a shadow password file to be available\&.
@@ -173,13 +170,11 @@ The
 command is restricted to the root user, except for the
 \fB\-l\fR
 option, which may be used by an unprivileged user to determine when their password or account is due to expire\&.
-.SH "CONFIGURATION"
-.PP
+.SH CONFIGURATION
 The following configuration variables in
 /etc/login\&.defs
 change the behavior of this tool:
-.SH "FILES"
-.PP
+.SH FILES
 /etc/passwd
 .RS 4
 User account information\&.
@@ -189,8 +184,7 @@ User account information\&.
 .RS 4
 Secure user account information\&.
 .RE
-.SH "EXIT VALUES"
-.PP
+.SH EXIT VALUES
 The
 \fBchage\fR
 command exits with the following values:
@@ -214,7 +208,6 @@ invalid command syntax
 .RS 4
 can\*(Aqt find the shadow password file
 .RE
-.SH "SEE ALSO"
-.PP
+.SH SEE ALSO
 \fBpasswd\fR(5),
 \fBshadow\fR(5)\&.
-------------- 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>

  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)

-.-


More information about the Pkg-shadow-devel mailing list