]> git.ipfire.org Git - thirdparty/shadow.git/commit
newusers: Allow creation without aging information
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 15 Dec 2025 09:22:17 +0000 (10:22 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Mon, 15 Dec 2025 13:51:28 +0000 (14:51 +0100)
commitd5c03d66c052d1a089f2612e7e3e36fe645536ba
tree74e4fb0093036456cb407a23cf99b35aa24d94a9
parentfd4a8105042fd4a4b9d60145e5fbc4da9b33fa73
newusers: Allow creation without aging information

If PASS_MAX_DAYS is not set, newusers falls back to 10000 days, which is
considered "unlimited" in some parts of the source tree. All other tools
fall back to -1, which truely implies unlimited.

Sync newusers with all other shadow tools.

How to reproduce:

1. Remove or comment out PASS_MAX_DAYS from /etc/login.defs
2. Run `newusers <<< user:pass:1234:1234::/home/user:/bin/bash`
3. Check user line in /etc/shadow
```
/etc/shadow:user:HASH:19721:0:10000:7:::
```

Max days are set to 10000. Instead, this should be:

```
/etc/shadow:user:HASH:19721:0::7:::
```

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/newusers.c