summaryrefslogtreecommitdiffstats
path: root/src/sysusers/sysusers.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@inai.de>2015-09-23 16:55:38 +0200
committerJan Engelhardt <jengelh@inai.de>2015-09-24 16:20:01 +0200
commit65d60552f2f1c198df06acef80431cbc460fbab6 (patch)
tree1197789cf7f523a0c7834ec6d329a6137dd6606e /src/sysusers/sysusers.c
parentMerge pull request #1366 from pocek/sd-event-fixes (diff)
downloadsystemd-65d60552f2f1c198df06acef80431cbc460fbab6.tar.xz
systemd-65d60552f2f1c198df06acef80431cbc460fbab6.zip
sysusers: improve error reporting
Creating group input with gid 491. Failed to write files: File exists "Why is the presence of /etc/group a problem?"
Diffstat (limited to 'src/sysusers/sysusers.c')
-rw-r--r--src/sysusers/sysusers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index aaa33354f4..c40f833788 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -392,11 +392,13 @@ static int write_files(void) {
i = hashmap_get(groups, gr->gr_name);
if (i && i->todo_group) {
+ log_error("%s: Group \"%s\" already exists.", group_path, gr->gr_name);
r = -EEXIST;
goto finish;
}
if (hashmap_contains(todo_gids, GID_TO_PTR(gr->gr_gid))) {
+ log_error("%s: Detected collision for GID %d.", group_path, gr->gr_gid);
r = -EEXIST;
goto finish;
}
@@ -464,6 +466,7 @@ static int write_files(void) {
i = hashmap_get(groups, sg->sg_namp);
if (i && i->todo_group) {
+ log_error("%s: Group \"%s\" already exists.", gshadow_path, sg->sg_namp);
r = -EEXIST;
goto finish;
}
@@ -530,11 +533,13 @@ static int write_files(void) {
i = hashmap_get(users, pw->pw_name);
if (i && i->todo_user) {
+ log_error("%s: User \"%s\" already exists.", passwd_path, pw->pw_name);
r = -EEXIST;
goto finish;
}
if (hashmap_contains(todo_uids, UID_TO_PTR(pw->pw_uid))) {
+ log_error("%s: Detected collision for UID %d.", passwd_path, pw->pw_uid);
r = -EEXIST;
goto finish;
}