mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-07 11:05:30 +03:00
Merge staging-next into staging
This commit is contained in:
commit
14b4aa3fd4
56 changed files with 412 additions and 146 deletions
|
@ -35,7 +35,7 @@ let
|
|||
'';
|
||||
|
||||
hashedPasswordDescription = ''
|
||||
To generate a hashed password run `mkpasswd -m sha-512`.
|
||||
To generate a hashed password run `mkpasswd`.
|
||||
|
||||
If set to an empty string (`""`), this user will
|
||||
be able to log in without being asked for a password (but not via remote
|
||||
|
@ -592,6 +592,26 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
# Warn about user accounts with deprecated password hashing schemes
|
||||
system.activationScripts.hashes = {
|
||||
deps = [ "users" ];
|
||||
text = ''
|
||||
users=()
|
||||
while IFS=: read -r user hash tail; do
|
||||
if [[ "$hash" = "$"* && ! "$hash" =~ ^\$(y|gy|7|2b|2y|2a|6)\$ ]]; then
|
||||
users+=("$user")
|
||||
fi
|
||||
done </etc/shadow
|
||||
|
||||
if (( "''${#users[@]}" )); then
|
||||
echo "
|
||||
WARNING: The following user accounts rely on password hashes that will
|
||||
be removed in NixOS 23.05. They should be renewed as soon as possible."
|
||||
printf ' - %s\n' "''${users[@]}"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# for backwards compatibility
|
||||
system.activationScripts.groups = stringAfter [ "users" ] "";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue