mirror of
https://github.com/systemd/systemd.git
synced 2026-08-09 09:32:04 +00:00
systemd-sysusers currently skips entries for groups that already exists. However, if a group exists only in /etc/gshadow and not in /etc/group, systemd-sysusers panics: ~# groupdel sgx ~# systemd-sysusers; echo $? Creating group 'sgx' with GID 106. 0 ~# systemd-sysusers; echo $? 0 ~# sed -i '/sgx/d' /etc/group ~# systemd-sysusers; echo $? Creating group 'sgx' with GID 106. /etc/gshadow: Group "sgx" already exists. 1 To fix this, let's mirror the logic from the user path (write_temporary_shadow()) where we simply drop the user from the "todo" queue if it already exists in /etc/shadow instead of throwing an error.