summaryrefslogtreecommitdiff
path: root/src/nss-systemd/userdb-glue.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/userdb-glue.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/userdb-glue.c')
-rw-r--r--src/nss-systemd/userdb-glue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nss-systemd/userdb-glue.c b/src/nss-systemd/userdb-glue.c
index 22af0fde60..0cc84bfac7 100644
--- a/src/nss-systemd/userdb-glue.c
+++ b/src/nss-systemd/userdb-glue.c
@@ -6,6 +6,7 @@
#include "strv.h"
#include "user-record-nss.h"
#include "user-record.h"
+#include "user-util.h"
#include "userdb-glue.h"
#include "userdb.h"
@@ -50,7 +51,7 @@ int nss_pack_user_record(
.pw_name = buffer,
.pw_uid = hr->uid,
.pw_gid = user_record_gid(hr),
- .pw_passwd = (char*) "x", /* means: see shadow file */
+ .pw_passwd = (char*) PASSWORD_SEE_SHADOW,
};
assert(buffer);
@@ -184,7 +185,7 @@ int nss_pack_group_record(
*gr = (struct group) {
.gr_name = strcpy(p, g->group_name),
.gr_gid = g->gid,
- .gr_passwd = (char*) "x", /* means: see shadow file */
+ .gr_passwd = (char*) PASSWORD_SEE_SHADOW,
.gr_mem = array,
};