]> git.ipfire.org Git - thirdparty/shadow.git/log
thirdparty/shadow.git
6 weeks agolib/string/README: streq(3) and strnul(3) are in libc
Alejandro Colomar [Sun, 22 Feb 2026 14:49:17 +0000 (15:49 +0100)] 
lib/string/README: streq(3) and strnul(3) are in libc

streq(3) and strnul(3) are now part of a libc implementation: gnulib.
They are also documented in a manual page.  Thus, refer to them as
streq(3) and strnul(3).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks agodoc/contributions/coding_style.md: Refer to the man-pages style guide
Alejandro Colomar [Wed, 25 Feb 2026 11:54:59 +0000 (12:54 +0100)] 
doc/contributions/coding_style.md: Refer to the man-pages style guide

Reported-by: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Reported-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks agouseradd: Correctly set subuid/subgid when using -F
ndostert [Mon, 23 Feb 2026 20:50:16 +0000 (21:50 +0100)] 
useradd: Correctly set subuid/subgid when using -F

The -F flag should bypass the -r flag and UID checks.

Closes: <shadow-maint#1255>
Signed-off-by: ndostert <crawax@cwxlab.fr>
Co-authored-by: Alejandro Colomar <alx@kernel.org>
Fixes: 3f7a72e9677b (2022-08-01; "useradd: add -F option for updating /etc/sub[ig]id for system accounts")
6 weeks ago*/: chgpasswd(8): -m,--md5: Remove option
Alejandro Colomar [Sat, 27 Dec 2025 11:52:14 +0000 (12:52 +0100)] 
*/: chgpasswd(8): -m,--md5: Remove option

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks ago*/: chpasswd(8): -m,--md5: Remove option
Alejandro Colomar [Sat, 27 Dec 2025 11:36:11 +0000 (12:36 +0100)] 
*/: chpasswd(8): -m,--md5: Remove option

This was the command-line equivalent of MD5_CRYPT_ENAB.  It deserves
the same fate.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks agolib/salt.c: Compact conditionals
Alejandro Colomar [Sat, 27 Dec 2025 01:07:15 +0000 (02:07 +0100)] 
lib/salt.c: Compact conditionals

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks ago*/: Remove support for MD5_CRYPT_ENAB
Alejandro Colomar [Sat, 27 Dec 2025 01:02:24 +0000 (02:02 +0100)] 
*/: Remove support for MD5_CRYPT_ENAB

It has been deprecated for a very long time.  In fact, the first commit
that documented MD5_CRYPT_ENAB already documented it as deprecated.
6e3ad7a27546 (2007-11-20).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks ago*/: expiry(1): Remove program
Alejandro Colomar [Mon, 15 Dec 2025 23:18:45 +0000 (00:18 +0100)] 
*/: expiry(1): Remove program

Password expiration is deprecated, and will be eventually removed.

The functionality of expiry(1) is the most superfluous of password
expiry and can be removed early.  This shouldn't conflict with any
existing regulations about password expiry.

Link: <https://github.com/shadow-maint/shadow/pull/1432>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks agosrc/: Cosmetic
Alejandro Colomar [Fri, 26 Dec 2025 17:29:10 +0000 (18:29 +0100)] 
src/: Cosmetic

Fix style.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 weeks ago*: Make support for SHA256 and SHA512 unconditional
Alejandro Colomar [Fri, 26 Dec 2025 14:14:17 +0000 (15:14 +0100)] 
*: Make support for SHA256 and SHA512 unconditional

This is necessary for later changing the fallback from the insecure DES
to something secure such as SHA512.

Link: <https://github.com/shadow-maint/shadow/issues/1278>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Cc: Andre Boscatto <andreboscatto@gmail.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agolib/btrfs.c: Remove hardcoded Paths and resolve them via env to increase portability
Hadi Chokr [Sat, 24 Jan 2026 17:54:33 +0000 (18:54 +0100)] 
lib/btrfs.c: Remove hardcoded Paths and resolve them via env to increase portability

Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
7 weeks agolib/setupenv.c: Remove code wrapped in '#if 0'
Alejandro Colomar [Sat, 3 Jan 2026 23:21:04 +0000 (00:21 +0100)] 
lib/setupenv.c: Remove code wrapped in '#if 0'

This has not been tested in a long time --if ever--.

If we ever want to implement something, we should start from scratch.
But if we've survived for so long without it, I suspect we don't want
it at all.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agoconfigure.ac: fix checks for lastlog support
Mike Gilbert [Wed, 18 Feb 2026 19:00:51 +0000 (14:00 -0500)] 
configure.ac: fix checks for lastlog support

The check for lastlog.h was removed by mistake in a previous changset.

The configure script should terminate with an error if lastlog support
was requested but lastlog.h is not available.

Partial functionality is provided if ll_host is not a member of
struct lastlog.

Fixes: 1bdcfa8d3710 (2023-07-15; "lastlog: stop building by default")
Fixes: 9eea4bc9cf95 (2024-11-12, 2025-02-07; "configure.ac: Remove unused AC_CHECK_HEADERS() checks")
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agosrc/useradd.c: Refactor long expression into many simple conditionals
Alejandro Colomar [Wed, 18 Feb 2026 20:10:05 +0000 (21:10 +0100)] 
src/useradd.c: Refactor long expression into many simple conditionals

Co-authored-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agosrc/useradd.c: Factor out logic to helper functions
Alejandro Colomar [Wed, 18 Feb 2026 20:02:10 +0000 (21:02 +0100)] 
src/useradd.c: Factor out logic to helper functions

Co-authored-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agolib/prefix_flag.c: Remove 't' flag from fopen(3)
Alejandro Colomar [Wed, 18 Feb 2026 13:54:43 +0000 (14:54 +0100)] 
lib/prefix_flag.c: Remove 't' flag from fopen(3)

It is a Windows extension ignored by musl and glibc.  It is not in POSIX
nor ISO C.

Since most of our calls to fopen(3) don't use it, let's be consistent
and not use it anywhere.

Closes: <https://github.com/shadow-maint/shadow/issues/1541>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agotests/unit/test_chkhash.c: add invalid hashes
Iker Pedrosa [Fri, 6 Feb 2026 15:20:37 +0000 (16:20 +0100)] 
tests/unit/test_chkhash.c: add invalid hashes

Add comprehensive negative testing condition validation:
- Invalid algorithm prefixes and hash length validation
- Invalid delimiter handling
- Invalid salt characters and rounds parameter testing

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add edge test cases
Iker Pedrosa [Fri, 6 Feb 2026 15:18:52 +0000 (16:18 +0100)] 
tests/unit/test_chkhash.c: add edge test cases

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add special test cases
Iker Pedrosa [Wed, 4 Feb 2026 10:15:56 +0000 (11:15 +0100)] 
tests/unit/test_chkhash.c: add special test cases

*, ! and empty strings are special valid cases for shadow's second
field. Add test cases for them.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add MD5 and DES hash validation tests
Iker Pedrosa [Wed, 4 Feb 2026 09:31:47 +0000 (10:31 +0100)] 
tests/unit/test_chkhash.c: add MD5 and DES hash validation tests

Add basic MD5 and DES algorithm validation tests.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add SHA-256 hash validation tests
Iker Pedrosa [Wed, 4 Feb 2026 09:22:29 +0000 (10:22 +0100)] 
tests/unit/test_chkhash.c: add SHA-256 hash validation tests

Add comprehensive SHA-256 algorithm validation tests covering rounds and
salt cases.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add SHA-512 hash validation tests
Iker Pedrosa [Sun, 1 Feb 2026 14:11:20 +0000 (15:11 +0100)] 
tests/unit/test_chkhash.c: add SHA-512 hash validation tests

Add comprehensive SHA-512 algorithm validation tests covering rounds and
salt cases.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add bcrypt hash validation tests
Iker Pedrosa [Sun, 1 Feb 2026 09:46:18 +0000 (10:46 +0100)] 
tests/unit/test_chkhash.c: add bcrypt hash validation tests

Add comprehensive bcrypt algorithm validation tests covering all
variants ($2a$, $2b$, $2x$, $2y$) with different cost factors.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agotests/unit/test_chkhash.c: add unit tests for `is_valid_hash()`
Iker Pedrosa [Fri, 30 Jan 2026 14:56:23 +0000 (15:56 +0100)] 
tests/unit/test_chkhash.c: add unit tests for `is_valid_hash()`

Introduce unit testing infrastructure for the `is_valid_hash()`
function. Add yescrypt algorithm validation tests.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agolib/chkhash.c: fix yescrypt hash length comment
Iker Pedrosa [Fri, 6 Feb 2026 15:31:56 +0000 (16:31 +0100)] 
lib/chkhash.c: fix yescrypt hash length comment

Fix misleading comment that stated "43-char (minimum) hash" when
the actual regex pattern requires exactly 43 characters. Update
comment to accurately reflect the implementation behavior.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
7 weeks agoconfigure.ac: simplify fgetpwent_r check
Mike Gilbert [Tue, 17 Feb 2026 18:48:41 +0000 (13:48 -0500)] 
configure.ac: simplify fgetpwent_r check

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoconfigure.ac: drop check for setpgrp
Mike Gilbert [Tue, 17 Feb 2026 18:44:55 +0000 (13:44 -0500)] 
configure.ac: drop check for setpgrp

The last use was dropped in eec97ce4c5a9fa57c387affeedd7a40c435b2b1f.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoconfigure.ac: drop AC_FUNC_UTIME_NULL
Mike Gilbert [Tue, 17 Feb 2026 18:42:01 +0000 (13:42 -0500)] 
configure.ac: drop AC_FUNC_UTIME_NULL

The codebase does not utilize the resulting HAVE_UTIME_NULL macro,
making this check pointless.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoconfigure.ac: drop unused libsubid_abi variable
Mike Gilbert [Tue, 17 Feb 2026 18:39:21 +0000 (13:39 -0500)] 
configure.ac: drop unused libsubid_abi variable

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoMerge remote-tracking branch 'alx/k'
Serge Hallyn [Tue, 17 Feb 2026 14:03:51 +0000 (08:03 -0600)] 
Merge remote-tracking branch 'alx/k'

7 weeks agolib/utmp.c: get_current_utmp(): Use memdup_T() instead of its pattern
Alejandro Colomar [Wed, 16 Jul 2025 15:44:26 +0000 (17:44 +0200)] 
lib/utmp.c: get_current_utmp(): Use memdup_T() instead of its pattern

Reviewed-by: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agolib/string/strdup/: memdup_T(): Add API
Alejandro Colomar [Wed, 16 Jul 2025 15:38:48 +0000 (17:38 +0200)] 
lib/string/strdup/: memdup_T(): Add API

And update lib/string/README:
-  Rename MEMDUP() => memdup_T(), as we're moving away from upper-case
   macros to ones that actually say something about what they do in the
   name (_T for type-safe, and _a for array-safe).
-  memdup() is unimplemented.

Cc: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agolib/utmp.c: get_current_utmp(): Use simple assignment instead of memcpy(3)
Alejandro Colomar [Wed, 10 Dec 2025 14:21:15 +0000 (15:21 +0100)] 
lib/utmp.c: get_current_utmp(): Use simple assignment instead of memcpy(3)

memcpy(3) is overkill, and much more dangerous than simple assignment.
Simple assignment adds type safety, and removes any possibility of
buffer overflow due to accidentally specifying a wrong size.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agolib/utmp.c: get_current_utmp(): Don't exit(3) from library code
Alejandro Colomar [Wed, 16 Jul 2025 15:41:33 +0000 (17:41 +0200)] 
lib/utmp.c: get_current_utmp(): Don't exit(3) from library code

This function already returned NULL on some errors.  It didn't make any
sense to exit(3) on allocation failure.  Instead, just return NULL.

Reviewed-by: "Evgeny Grin (Karlson2k)" <k2k@drgrin.dev>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
7 weeks agoUpdate Serge's certificate
Serge Hallyn [Sun, 15 Feb 2026 02:14:28 +0000 (20:14 -0600)] 
Update Serge's certificate

Closes #1525

7 weeks agoconfigure.ac: fix detection of secure_getenv
Mike Gilbert [Mon, 16 Feb 2026 20:36:37 +0000 (15:36 -0500)] 
configure.ac: fix detection of secure_getenv

lib/defines.h was looking for HAVE_SECURE_GETENV instead of of
HAS_SECURE_GETENV as defined in configure. This resulted in
shadow_getenv always being defined to getenv.

AC_CHECK_FUNC is linker test; it does not check for declarations.
Replace this with AC_CHECK_DECLS/HAVE_DECL_SECURE_GETENV.

Fixes: 3d921155e0a7 (2019-03-31; "gettime: Use secure_getenv over getenv.")
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoconfigure.ac: remove redundant check for pam_fail_delay
Mike Gilbert [Mon, 16 Feb 2026 21:01:18 +0000 (16:01 -0500)] 
configure.ac: remove redundant check for pam_fail_delay

This check was introduced in 276e406c (support for OpenPAM).
OpenPAM has never declared pam_fail_delay.

linux-pam has defined HAVE_PAM_FAIL_DELAY in its headers for a very long
time (before version history).

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
7 weeks agoClarify allowed user and group names
Marko Myllynen [Mon, 16 Feb 2026 15:40:20 +0000 (17:40 +0200)] 
Clarify allowed user and group names

Resolves #1536

7 weeks agosrc/passwd.c: add audit messages for aging operations
Iker Pedrosa [Fri, 13 Feb 2026 08:09:55 +0000 (09:09 +0100)] 
src/passwd.c: add audit messages for aging operations

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
7 weeks agosrc/passwd.c: add audit messages for passwd
Iker Pedrosa [Fri, 13 Feb 2026 08:08:46 +0000 (09:08 +0100)] 
src/passwd.c: add audit messages for passwd

Add comprehensive audit messages for password operations, including
unlock, delete and expire operations.

Change update_shadow() to look up the actual target user instead of
using a dummy `passwd` struct. This ensures audit logging gets the
correct target UID. Audit logs should record the UID of the user being
affected (target), not the UID of whoever is running the passwd command
(source).

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
8 weeks agotests/unit: improve .gitignore to ignore all test executables
Iker Pedrosa [Wed, 11 Feb 2026 09:12:17 +0000 (10:12 +0100)] 
tests/unit: improve .gitignore to ignore all test executables

Replace specific test file entries with pattern-based ignoring of all
test_* executables while preserving test_*.c source files.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2 months agokeys/: Refresh my public key 1527/head
Alejandro Colomar [Mon, 2 Feb 2026 13:55:46 +0000 (14:55 +0100)] 
keys/: Refresh my public key

Updated with:

$ gpg --armor \
--output A9348594CE31283A826FBDD8D57633D441E25BB5.asc \
--export alx@kernel.org;

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agoupdated Dutch translation
Frans Spiesschaert [Sun, 1 Feb 2026 19:41:10 +0000 (20:41 +0100)] 
updated Dutch translation

2 months agoetc/pam.d/: Remove the old unused PAM configs for setuid account tools
Hadi Chokr [Tue, 27 Jan 2026 14:36:26 +0000 (15:36 +0100)] 
etc/pam.d/: Remove the old unused PAM configs for setuid account tools

Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2 months agosrc/: Disable and remove account-tools-setuid conditionals
Hadi Chokr [Tue, 27 Jan 2026 14:35:42 +0000 (15:35 +0100)] 
src/: Disable and remove account-tools-setuid conditionals

Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2 months agoconfigure.ac: permanently remove setuid account management tools
Hadi Chokr [Tue, 27 Jan 2026 14:34:33 +0000 (15:34 +0100)] 
configure.ac: permanently remove setuid account management tools

Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2 months agolib/chkhash.c: fix escaping in SHA-256 / SHA-512 / MD5 regexes
Adam Williamson [Tue, 27 Jan 2026 23:11:07 +0000 (15:11 -0800)] 
lib/chkhash.c: fix escaping in SHA-256 / SHA-512 / MD5 regexes

`\\n` inside square brackets doesn't include or exclude the
newline character. It includes or excludes a literal slash and
the literal character 'n'.

Fixes: c44f1e096a19 (2025-07-20; "chpasswd: Check hash before write when using -e")
Closes: <https://github.com/shadow-maint/shadow/issues/1519>
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2 months agoman/po: copy over login.defs.d/*.xml
Serge Hallyn [Fri, 23 Jan 2026 02:07:48 +0000 (20:07 -0600)] 
man/po: copy over login.defs.d/*.xml

When doing update-po, we copy man/*.xml into a tempdir, but
some of those files reference login.defs.d/*.xml, so copy
over those as well.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
Tested-by: Alejandro Colomar <alx@kernel.org>
2 months agoman/shadow.5.xml: Document "*"
Alejandro Colomar [Fri, 16 Jan 2026 00:52:32 +0000 (01:52 +0100)] 
man/shadow.5.xml: Document "*"

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agolib/chkhash.c: is_valid_hash(): Comment meaning of !hash and *
Alejandro Colomar [Thu, 15 Jan 2026 00:24:10 +0000 (01:24 +0100)] 
lib/chkhash.c: is_valid_hash(): Comment meaning of !hash and *

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agolib/chkhash.c: is_valid_hash(): Update comment
Alejandro Colomar [Thu, 15 Jan 2026 00:14:46 +0000 (01:14 +0100)] 
lib/chkhash.c: is_valid_hash(): Update comment

This checks the entire shadow(5) 2nd field, which is more than just
a hash.

Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agolib/chkhash.c: is_valid_hash(): Accept an empty hash
Alejandro Colomar [Thu, 15 Jan 2026 00:11:52 +0000 (01:11 +0100)] 
lib/chkhash.c: is_valid_hash(): Accept an empty hash

It represents a passwordless account.
That is discouraged, but accepted.

Fixes: c44f1e096a19 (2025-07-20; "chpasswd: Check hash before write when using -e")
Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124835>
Reported-by: Marc 'Zugschlus' Haber <mh+githubvisible@zugschlus.de>
Reported-by: "Serge E. Hallyn" <serge@hallyn.com>
Reported-by: Adam Williamson <awilliam@redhat.com>
Co-authored-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agotests/system/framework/utils/tools.py: apply style fix for tuple unpacking
Iker Pedrosa [Wed, 21 Jan 2026 08:23:31 +0000 (09:23 +0100)] 
tests/system/framework/utils/tools.py: apply style fix for tuple unpacking

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2 months agoRevert "src/usermod.c: Remove optimizations"
Alejandro Colomar [Fri, 16 Jan 2026 23:56:21 +0000 (00:56 +0100)] 
Revert "src/usermod.c: Remove optimizations"

This wasn't only an optimization; it also skipped some checks that were
now spuriously triggering errors.  We may be able to get rid of the
optimizations, but that will need more analysis.  For now, let's revert
to a known-good state.

Fixes: 6a8a25dc7de6 (2025-10-15; "src/usermod.c: Remove optimizations")
Reverts: 6a8a25dc7de6 (2025-10-15; "src/usermod.c: Remove optimizations")
Closes: <https://github.com/shadow-maint/shadow/issues/1509>
Reported-by: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agosrc/usermod.c: -U: Report E_PASSWORDLESS on error due to passwordless account
Alejandro Colomar [Mon, 5 Jan 2026 23:01:07 +0000 (00:01 +0100)] 
src/usermod.c: -U: Report E_PASSWORDLESS on error due to passwordless account

Reproducer:

$ useradd foo
$ grep foo /etc/passwd /etc/shadow
/etc/passwd:foo:x:1001:1001::/home/foo:/usr/bin/bash
/etc/shadow:foo:!:20458:0:99999:7:::
$ usermod -U testuser
usermod: unlocking the user's password would result in a passwordless account.
You should set a password with usermod -p to unlock this user's password.
$ echo $?
0
$ grep foo /etc/passwd /etc/shadow
/etc/passwd:foo:x:1001:1001::/home/foo:/usr/bin/bash
/etc/shadow:foo:!:20458:0:99999:7:::

The program failed (didn't change anything, and reported the problem to
stderr) but reported success (0).  After this patch, the error is
reported as E_PASSWORDLESS (20).

Closes: <https://github.com/shadow-maint/shadow/issues/1479>
Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Acked-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2 months agolib/commonio.c: Drop lrename
Tobias Stoeckmann [Sun, 11 Jan 2026 14:23:26 +0000 (15:23 +0100)] 
lib/commonio.c: Drop lrename

The lrename function follows symlinks when renaming files. Since the
source is a temporary file and the target is the database file itself,
which is opened with O_NOFOLLOW, this function is only useful for an
attacker who manages to win some form of race.

Fixes: 0fa908302660 (2007-10-07; "[svn-upgrade] Integrating new upstream version, shadow (4.0.16)")
Fixes: 391a3847157c (2010-03-04; "2010-01-30 Paweł Hajdan, Jr. <phajdan.jr@gentoo.org>")
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/commonio.c: Call utime for correct target
Tobias Stoeckmann [Wed, 14 Jan 2026 21:26:00 +0000 (22:26 +0100)] 
lib/commonio.c: Call utime for correct target

Since tmpf has been already renamed to target at this point, call utime
with target instead of tmpf.

Fixes: f8732b17dd1d (2026-01-14; "lib/commonio.c: Use unpredictable temporary names")
Reported-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agovipw: Set correct pattern for fmkomstemp
Tobias Stoeckmann [Wed, 14 Jan 2026 21:58:51 +0000 (22:58 +0100)] 
vipw: Set correct pattern for fmkomstemp

The fmkomstemp call requires a suffix of XXXXXX for correct operation.
Do so in TCB case as well.

Note: If something fails and the file resides in this directory, it
could be interpreted as a username. Use the ',' character as an illegal
character to prevent shadow tools from erroneously accessing this file
and assuming that the user actually exists.

Fixes: a5b3d56e2902 (2026-01-09; "vipw: Use fmkomstemp for temporary file")
Reported-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agovipw: Set ownership, then mode
Tobias Stoeckmann [Wed, 14 Jan 2026 18:58:40 +0000 (19:58 +0100)] 
vipw: Set ownership, then mode

This is a safer approach, which handles cases in which a file would have
less permissions for a group than others.

A rare edge case, but let's be safe than sorry.

Reported-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agovipw: Prefer fchmod/fchown over chmod/chown
Tobias Stoeckmann [Wed, 14 Jan 2026 18:57:00 +0000 (19:57 +0100)] 
vipw: Prefer fchmod/fchown over chmod/chown

Use file descriptor functions when file descriptor is available, instead
of path based operations. The latter resolve symbolic links and are
prone to race conditions.

Reported-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/commonio.c: Larger buffer size for file names
Tobias Stoeckmann [Mon, 12 Jan 2026 17:29:54 +0000 (18:29 +0100)] 
lib/commonio.c: Larger buffer size for file names

Make sure that enough bytes exist for file name of temporary file which
is used to construct the next database file.

While at it, use a better variable name.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/commonio.c: Use unpredictable temporary names
Tobias Stoeckmann [Sun, 11 Jan 2026 15:33:16 +0000 (16:33 +0100)] 
lib/commonio.c: Use unpredictable temporary names

Make sure that an attacker with sufficient privileges cannot simply
create a file with expected temporary name to retrieve content of
previous and/or future database.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/commonio.c: Unlink backup file on error
Tobias Stoeckmann [Sun, 11 Jan 2026 22:18:48 +0000 (23:18 +0100)] 
lib/commonio.c: Unlink backup file on error

It doesn't make sense to keep a file around if it's not even a proper
backup.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/shadowlog_internal.h: Hide shadow_progname
Tobias Stoeckmann [Sun, 11 Jan 2026 11:34:46 +0000 (12:34 +0100)] 
lib/shadowlog_internal.h: Hide shadow_progname

Accessing and setting shadow_progname is not as straight-forward as it
might seem due to the way of linking libshadow_la with libsubid and
programs.

Enforce the usage of log_get_progname to make this less messy.

With last entry of shadowlog_internal.h gone, remove the file entirely.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/shadowlog_internal.h: Drop shadow_logfd
Tobias Stoeckmann [Sun, 11 Jan 2026 11:28:46 +0000 (12:28 +0100)] 
lib/shadowlog_internal.h: Drop shadow_logfd

Accessing this variable directly is a recipe for disaster, because
binaries and libraries can have different versions in them due to how
libshadow_la linking is performed.

Make sure that at least NULL check is always performed by calling the
proper getter function.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolibsubid: Avoid shadow_logfd as variable name
Tobias Stoeckmann [Sun, 11 Jan 2026 11:28:02 +0000 (12:28 +0100)] 
libsubid: Avoid shadow_logfd as variable name

A global shadow_logfd variable exists, so this effectively shadows it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agoRemove unused `logoutd` utility
Iker Pedrosa [Mon, 25 Aug 2025 07:58:51 +0000 (09:58 +0200)] 
Remove unused `logoutd` utility

Link: <https://github.com/shadow-maint/shadow/issues/999>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2 months agosrc/: Properly set up libsubid tools
Tobias Stoeckmann [Sun, 11 Jan 2026 11:46:24 +0000 (12:46 +0100)] 
src/: Properly set up libsubid tools

Do not call any shadowlog functions directly from program source files
which are also linked with libsubid.

Both, the program and the library, will have their own version of the
static variables within shadowlog.c and thus would have different
logging mechanisms.

Use subid_init instead.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Use exit instead of _exit in kill_child
Tobias Stoeckmann [Fri, 9 Jan 2026 16:49:39 +0000 (17:49 +0100)] 
su: Use exit instead of _exit in kill_child

Since this is no signal handler anymore, allow regular exit routine to
flush stderr etc.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Mark kill_child with NORETURN
Tobias Stoeckmann [Fri, 9 Jan 2026 16:34:20 +0000 (17:34 +0100)] 
su: Mark kill_child with NORETURN

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Remove dead code
Tobias Stoeckmann [Fri, 9 Jan 2026 16:32:37 +0000 (17:32 +0100)] 
su: Remove dead code

The pid_child is never 0 when reaching kill_child, since kill_child
is called within an if-block which checks explicitly for pid_child not
being 0.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Turn pid_child into local variable
Tobias Stoeckmann [Fri, 9 Jan 2026 16:30:25 +0000 (17:30 +0100)] 
su: Turn pid_child into local variable

The pid_child can be passed into kill_child, since it is no signal
handler anymore.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Drop unneeded char buffers
Tobias Stoeckmann [Fri, 9 Jan 2026 16:28:53 +0000 (17:28 +0100)] 
su: Drop unneeded char buffers

Since kill_child is no signal handler any longer, it is safe to call the
gettext macros directly and only when needed.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Kill child outside of signal handler
Tobias Stoeckmann [Fri, 9 Jan 2026 16:23:38 +0000 (17:23 +0100)] 
su: Kill child outside of signal handler

This simplifies the alarm handler to just set a volatile
sig_atomic_t like catch_signals does, which makes the handler way
easier to review.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Turn caught into volatile sig_atomic_t
Tobias Stoeckmann [Fri, 9 Jan 2026 16:20:07 +0000 (17:20 +0100)] 
su: Turn caught into volatile sig_atomic_t

Only these shared variables can be safely written to by signal handlers.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agosu: Fix typos in comment
Tobias Stoeckmann [Fri, 9 Jan 2026 16:19:57 +0000 (17:19 +0100)] 
su: Fix typos in comment

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/motd.c: Remove unused include
Tobias Stoeckmann [Sat, 10 Jan 2026 23:25:07 +0000 (00:25 +0100)] 
lib/motd.c: Remove unused include

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agovipw: set SIGCHLD before fork
Tobias Stoeckmann [Wed, 7 Jan 2026 16:34:36 +0000 (17:34 +0100)] 
vipw: set SIGCHLD before fork

It could happen that, if SIGCHLD was set to SIG_IGN before calling vipw,
the forked child is already gone before SIGCHLD is set to SIG_DFL after
the fork.

Prevent this race condition and also properly set up SIGCHLD for child
handling within the fork, even though system() should take care of that.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agovipw: Use fmkomstemp for temporary file
Tobias Stoeckmann [Wed, 7 Jan 2026 16:39:42 +0000 (17:39 +0100)] 
vipw: Use fmkomstemp for temporary file

Avoid fixed and thus predictable temporary file names. Especially avoid
just opening already existing ones.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoFix typos
Tobias Stoeckmann [Thu, 8 Jan 2026 19:02:01 +0000 (20:02 +0100)] 
Fix typos

Typos found with codespell

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoconfigure.ac: Drop libattr linking
Tobias Stoeckmann [Sat, 3 Jan 2026 18:03:32 +0000 (19:03 +0100)] 
configure.ac: Drop libattr linking

The libattr dependency is no longer needed.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/copydir.c: Drop reset_selinux
Tobias Stoeckmann [Sat, 3 Jan 2026 17:55:55 +0000 (18:55 +0100)] 
lib/copydir.c: Drop reset_selinux

The reset_selinux flag is always true, so it can be removed.
Remove all functions which are not used anymore as well.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/chkhash.c: is_valid_hash(): Accept '*' as the hash
Alejandro Colomar [Wed, 7 Jan 2026 22:44:26 +0000 (23:44 +0100)] 
lib/chkhash.c: is_valid_hash(): Accept '*' as the hash

This is widely accepted as an invalid hash, to remove password access
for an account (that is, no passwords will match the "hash").

Fixes: c44f1e096a19 (2025-07-20; "chpasswd: Check hash before write when using -e")
Closes: <https://github.com/shadow-maint/shadow/issues/1483>
Closes: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124835>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Cc: vinz <mmpx09@protonmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agolib/chkhash.c: is_valid_hash(): Accept a leading '!'
Alejandro Colomar [Wed, 7 Jan 2026 22:39:53 +0000 (23:39 +0100)] 
lib/chkhash.c: is_valid_hash(): Accept a leading '!'

A leading '!' means that the account is locked.

Fixes: c44f1e096a19 (2025-07-20; "chpasswd: Check hash before write when using -e")
Link: <https://github.com/shadow-maint/shadow/issues/1483>
Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124835>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Cc: vinz <mmpx09@protonmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/chage.1: Drop empty configuration section
Tobias Stoeckmann [Mon, 5 Jan 2026 17:11:06 +0000 (18:11 +0100)] 
man/chage.1: Drop empty configuration section

If TCB is not in use, the whole configuration section is a stub,
containing no useful information. Make it conditional so it
disappears if TCB is not in use.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoman/groupmems: Fix grammar
Tobias Stoeckmann [Sun, 4 Jan 2026 17:26:50 +0000 (18:26 +0100)] 
man/groupmems: Fix grammar

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agosrc/useradd: Support config for creating home dirs as Btrfs subvolumes
Hadi Chokr [Fri, 12 Dec 2025 10:18:06 +0000 (11:18 +0100)] 
src/useradd: Support config for creating home dirs as Btrfs subvolumes

Closes: #1162
Co-authored-by: Neal Gompa <ngompa@velocitylimitless.com>
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
Signed-off-by: Neal Gompa <ngompa@velocitylimitless.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
3 months agotests/system/tests/test_groupmod.py: add test for groupmod -U with user list
Iker Pedrosa [Tue, 23 Dec 2025 08:51:56 +0000 (09:51 +0100)] 
tests/system/tests/test_groupmod.py: add test for groupmod -U with user list

Add comprehensive test for the groupmod -U option when provided with a
list of users to set group membership. This test verifies:

- Setting initial group membership with multiple users
- Proper membership verification in both group and gshadow entries
- Updating group membership by modifying the user list
- Correct handling of membership changes in group databases

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 months agotests/system/framework/utils/tools.py: fix GShadowEntry
Iker Pedrosa [Tue, 23 Dec 2025 09:26:33 +0000 (10:26 +0100)] 
tests/system/framework/utils/tools.py: fix GShadowEntry

GShadowEntry administrators and members represent a list of usernames,
not a single string. Thus, set them to `list[str]`. This fixes type
safety and clarifies the expected data structure.

Fixes: 458700b5d670 (2025-09-10; "tests/system/framework/: fix Python linter issues")
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 months agoRelease 4.19.0 1459/head 4.19.0
Alejandro Colomar [Mon, 29 Dec 2025 12:38:53 +0000 (13:38 +0100)] 
Release 4.19.0

Breaking changes:

-  Remove support for escaped newlines in configuration files.
   It never worked correctly.
   b0a7ce58b924 (2025-12-05; "lib/, po/: Remove fgetsx() and fputsx()")

-  Some user names and group names are too dangerous and are rejected,
   even with --badname.
   25aea7422615 (2025-12-25; "lib/chkname.c, src/: Strictly disallow really bad names")

Future breaking changes:

-  SHA512 and SHA256 will be supported unconditionally in the next
   release.  The build-time flag '--with-sha-crypt' will be removed.
   See <https://github.com/shadow-maint/shadow/pull/1452>.

Support:

-  Several years ago, there were talks about deprecating su(1) and
   login(1), back when this project was maintained as part of Debian.
   However, nothing was clearly stated, and there were doubts about the
   status of these programs.  Let's clarify them now.

   Our implementations of su(1) and login(1) are fully supported, and we
   don't have any plans to remove them.  They are NOT deprecated.
   See <https://github.com/shadow-maint/shadow/issues/464>.

Deprecations:

-  groupmems(8)
The program will be removed in a future release.
See <https://github.com/shadow-maint/shadow/issues/1343>.

-  logoutd(8)
The program will be removed in the next release.
See <https://github.com/shadow-maint/shadow/issues/999>,
and <https://github.com/shadow-maint/shadow/pull/1344>.

-  DES
This hashing algorithm has been deprecated for a long time,
and support for it will be removed in a future release.
See <https://github.com/shadow-maint/shadow/pull/1456>

-  MD5
This hashing algorithm has been deprecated for a long time,
and support for it will be removed in a future release.
See <https://github.com/shadow-maint/shadow/pull/1457>

-  login.defs(5): MD_CRYPT_ENAB
This feature had been deprecated for decades.  It will be
removed in a future release.
The command-line equivalents (-m, --md5) of this feature in
chpasswd(8) and chgpasswd(8) will also be removed in a future
release.
See <https://github.com/shadow-maint/shadow/pull/1455>.

-  login.defs(5): PASS_MAX_LEN
This feature is ignored except for DES.  Once DES is removed,
it makes no sense keeping it.  It may be removed in a future
release.

-  Password aging
Scientific research shows that periodic password expiration
leads to predictable password patterns, and that even in a
theoretical scenario where that wouldn't happen the gains in
security are mathematically negligible.
<https://people.scs.carleton.ca/~paulv/papers/expiration-authorcopy.pdf>

Modern security standards, such as NIST SP 800-63B-4 in the USA,
prohibit periodic password expiration.
<https://pages.nist.gov/800-63-4/sp800-63b.html#passwordver>
<https://pages.nist.gov/800-63-FAQ/#q-b05>
<https://www.ncsc.gov.uk/collection/passwords/updating-your-approach#PasswordGuidance:UpdatingYourApproach-Don'tenforceregularpasswordexpiry>

To align with these, we're deprecating the ability to
periodically expire passwords.  The specifics and long-term
roadmap are currently being discussed, and we invite feedback
from users, particularly from those in regulated environments.
See <https://github.com/shadow-maint/shadow/pull/1432>.

This deprecation includes the following programs and features:

expiry(1)
chage(1):
-I,--inactive (also the interactive version)
-m,--mindays (also the interactive version)
-M,--maxdays (also the interactive version)
-W,--warndays (also the interactive version)
passwd(1):
-k,--keep-tokens
-n,--mindays
-x,--maxdays
-i,--inactive
-w,--warndays
useradd(8):
-f,--inactive
usermod(8):
-f,--inactive
login.defs(5):
PASS_MIN_DAYS
PASS_MAX_DAYS
PASS_WARN_AGE
/etc/default/useradd:
INACTIVE
shadow(5):
sp_lstchg: Restrict to just the values 0 and empty.
sp_min
sp_max
sp_warn
sp_inact

We recognize that many users operate in environments with
regulatory or contractual requirements that still mandate
password aging.  To minimize disruption, these features will
remain functional for a significant period.  However, we
encourage administrators to review their internal policies,
talk to their regulators if appropriate, and participate in the
roadmap discussion linked above.

Co-authored-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agopo/: Update
Alejandro Colomar [Tue, 30 Dec 2025 13:25:16 +0000 (14:25 +0100)] 
po/: Update

I don't know what this commit does, to be honest.  I just
did './autogen.sh && make && make dist' and committed the
changes to .po files.  Why?  I don't know.

BTW, I kept out some changes that were actually bad.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agopo/shadow.pot: Update
Alejandro Colomar [Mon, 29 Dec 2025 22:37:18 +0000 (23:37 +0100)] 
po/shadow.pot: Update

I don't know what this commit does, to be honest.  I just
did './autogen.sh && make && make dist' and committed the
changes to .pot files.  Why?  I don't know.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agolib/: Use non-empty compound literals
Alejandro Colomar [Tue, 30 Dec 2025 15:17:55 +0000 (16:17 +0100)] 
lib/: Use non-empty compound literals

While the empty one is more correct, {0} will also work, and will
likely silence diagnostics in old compiler versions.

Empty compound literals are only supported in GCC since commit
gcc.git 14cfa01755a6 (2022-08-25; "c: Support C2x empty initializer braces")

Reported-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoAdd ubuntu-22.04 to the CI test matrix
Serge Hallyn [Tue, 30 Dec 2025 15:52:10 +0000 (09:52 -0600)] 
Add ubuntu-22.04 to the CI test matrix

we need to check against older compilers.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 months agoman/lastlog.8: Drop redundant closing brackets
Tobias Stoeckmann [Tue, 30 Dec 2025 11:52:35 +0000 (12:52 +0100)] 
man/lastlog.8: Drop redundant closing brackets

Only one opening bracket is used before two closing brackets are
encountered for "(--user)".

Drop redundant ones within the file.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoman/: Fix SELinux note formatting
Tobias Stoeckmann [Tue, 30 Dec 2025 11:11:33 +0000 (12:11 +0100)] 
man/: Fix SELinux note formatting

Use tab instead of spaces to comply with rest of files.

Fixes: 923aeac250d0 (2025-07-04; "man/: update `--root` flag with no SELinux support")
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agosg: Properly document synopsis and options
Tobias Stoeckmann [Sun, 28 Dec 2025 15:36:19 +0000 (16:36 +0100)] 
sg: Properly document synopsis and options

The usage message of sg and synopsis of its manual page diverged. The
difference was even noted in a comment, instead of fixing it.

Synchronize both, add information about hidden options and document
what they do.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agosg: group is not optional
Tobias Stoeckmann [Mon, 29 Dec 2025 18:06:33 +0000 (19:06 +0100)] 
sg: group is not optional

The group argument is not optional, so do not specify it as such in the
manual page.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agosg: Fix grammar in documentation
Tobias Stoeckmann [Sun, 28 Dec 2025 15:34:54 +0000 (16:34 +0100)] 
sg: Fix grammar in documentation

Use "an" in front of sg due to its pronounciation. Also, start a comment
with capital letter in its first sentence to comply with other comments.

No functional change.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/, src/: Reduce scope of local variables
Alejandro Colomar [Sat, 13 Dec 2025 23:57:19 +0000 (00:57 +0100)] 
lib/, src/: Reduce scope of local variables

Signed-off-by: Alejandro Colomar <alx@kernel.org>