git: 079f82d129b8 - main - UPDATING: note login-name validation in pw(8)/pwd_mkdb(8)

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sat, 14 Nov 2026 17:11:40 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/src/commit/?id=079f82d129b8d551d07fc39f8343ebb8115375c6

commit 079f82d129b8d551d07fc39f8343ebb8115375c6
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2026-11-13 13:03:31 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2026-11-14 17:11:29 +0000

    UPDATING: note login-name validation in pw(8)/pwd_mkdb(8)
    
    An existing master.passwd with a login name containing a now-disallowed
    charater will make pwd_mkdb(8) fail until the name is fixed, which blocks
    passwd(1), chpass(1) and pw(8).  Warn users to audit their accounts
    befroe updating.
    
    Reviewed by:    bcr
    Differential Revision:  https://reviews.freebsd.org/D61507
---
 UPDATING | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/UPDATING b/UPDATING
index d1709da0dd13..56904191e819 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,29 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW:
 	world, or to merely disable the most expensive debugging functionality
 	at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20261113:
+	pwd_mkdb(8) now validates login names using the same character rules
+	that pw(8) applies, so names containing shell metacharacters or other
+	disallowed characters can no longer be introduced through vipw(8),
+	chpass(1) or a hand-edited master.passwd.  pw(8) has also been changed
+	to reject the single quote (') and backtick (`) in user and group
+	names.
+
+	As a result, an existing master.passwd that already contains a login
+	name with a now-disallowed character will cause every pwd_mkdb(8) run
+	to fail with "invalid login name", which in turn blocks passwd(1),
+	chpass(1) and pw(8) until the offending name is corrected.  The
+	disallowed characters are whitespace, control and 8-bit characters,
+	and any of
+
+	, : + & # % $ ^ ( ) ! @ ~ * ? < > = | \ / " ; ' `
+
+	A leading '-' is also rejected.  A single trailing '$' remains
+	permitted for Samba machine accounts, and the NIS compatibilty
+	prefixes (a leading '+' or '-', optionally followed by '@') are still
+	allowed.  Review /etc/master.passwd and rename any affected acconuts
+	before updating the password database.
+
 20261102:
 	The USB stack now supports SuperSpeedPlus links.  This adds new values
 	to enum usb_dev_speed and enum usb_revision, turns USB_SPEED_MAX and