Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: call dynamic_user_acquire() only when 'group' is non-null
When unit is reloaded, and the reloaded unit has bad-setting, then unit_patch_contexts() is not called and exec_context::user and group may not be configured. A minimum reproducer for the case is: - step 1. $ sudo systemctl edit --full hoge.service [Service] oneshot ExecStart=sleep 1h - step 2. $ sudo systemctl start hoge.service - step 3. $ sudo systemctl edit --full hoge.service [Service] Type=oneshot ExecStart=@bindir@/sleep 1h DynamicUser=yes Then pid1 crashed. Fixes systemd#14733.
- Loading branch information