summaryrefslogtreecommitdiff
path: root/src/nss-systemd/nss-systemd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-05-05 15:32:43 +0200
committerLennart Poettering <lennart@poettering.net>2021-05-06 21:55:58 +0200
commit53c25ac968ab8b868506c3a1820d8c76beb0cd88 (patch)
tree28affe0c2d1613e7a27ede615c90e1d2d88ae59c /src/nss-systemd/nss-systemd.c
parenta7bd1656f3ee3d43126c50e4baad9da77620022e (diff)
downloadsystemd-53c25ac968ab8b868506c3a1820d8c76beb0cd88.tar.gz
user-util: add generic definition for special password hash values in /etc/passwd + /etc/shadow
Let's add three defines for the 3 special cases of passwords. Some of our tools used different values for the "locked"/"invalid" case, let's settle on using "!*" which means the password is both locked *and* invalid. Other tools like to use "!!" for this case, which however is less than ideal I think, since the this could also be a considered an entry with an empty password, that can be enabled again by unlocking it twice.
Diffstat (limited to 'src/nss-systemd/nss-systemd.c')
-rw-r--r--src/nss-systemd/nss-systemd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c
index 0b716d22dd..38c214499e 100644
--- a/src/nss-systemd/nss-systemd.c
+++ b/src/nss-systemd/nss-systemd.c
@@ -20,7 +20,7 @@
static const struct passwd root_passwd = {
.pw_name = (char*) "root",
- .pw_passwd = (char*) "x", /* see shadow file */
+ .pw_passwd = (char*) PASSWORD_SEE_SHADOW,
.pw_uid = 0,
.pw_gid = 0,
.pw_gecos = (char*) "Super User",
@@ -30,7 +30,7 @@ static const struct passwd root_passwd = {
static const struct passwd nobody_passwd = {
.pw_name = (char*) NOBODY_USER_NAME,
- .pw_passwd = (char*) "*", /* locked */
+ .pw_passwd = (char*) PASSWORD_LOCKED_AND_INVALID,
.pw_uid = UID_NOBODY,
.pw_gid = GID_NOBODY,
.pw_gecos = (char*) "User Nobody",
@@ -41,14 +41,14 @@ static const struct passwd nobody_passwd = {
static const struct group root_group = {
.gr_name = (char*) "root",
.gr_gid = 0,
- .gr_passwd = (char*) "x", /* see shadow file */
+ .gr_passwd = (char*) PASSWORD_SEE_SHADOW,
.gr_mem = (char*[]) { NULL },
};
static const struct group nobody_group = {
.gr_name = (char*) NOBODY_GROUP_NAME,
.gr_gid = GID_NOBODY,
- .gr_passwd = (char*) "*", /* locked */
+ .gr_passwd = (char*) PASSWORD_LOCKED_AND_INVALID,
.gr_mem = (char*[]) { NULL },
};