userdb: Add missing .membership extension to membership files

Follow up for fe0342edf4

This also drops the mkosi testuser from the wheel and systemd-journal
groups as the integration tests rely on the testuser not being to read
the full journal.
This commit is contained in:
Daan De Meyer
2025-10-30 22:21:46 +01:00
parent 097b6d3f66
commit 472161f368
2 changed files with 2 additions and 6 deletions

View File

@@ -3,10 +3,6 @@
"uid": 4711,
"disposition": "regular",
"enforcePasswordPolicy": false,
"memberOf": [
"wheel",
"systemd-journal"
],
"shell": "/bin/bash",
"privileged": {
"hashedPassword": ["$1$kqp7NF1f$tNnQcshPX53CSfRKTQD0R1"]

View File

@@ -1430,7 +1430,7 @@ static int load_credential_one(
if (ur)
STRV_FOREACH(g, ur->member_of) {
_cleanup_free_ char *membership = strjoin(ur->user_name, ":", *g);
_cleanup_free_ char *membership = strjoin(ur->user_name, ":", *g, ".membership");
if (!membership)
return log_oom();
@@ -1442,7 +1442,7 @@ static int load_credential_one(
}
else
STRV_FOREACH(u, gr->members) {
_cleanup_free_ char *membership = strjoin(*u, ":", gr->group_name);
_cleanup_free_ char *membership = strjoin(*u, ":", gr->group_name, ".membership");
if (!membership)
return log_oom();