homectl: when chainloading a shell, prefix "-" rather than overriding first char
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Sep 2024 13:30:44 +0000 (15:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Sep 2024 15:24:21 +0000 (17:24 +0200)
commit34ed064f67345f24114f27b8d5b83b6ccf6f3d46
tree5eaecbc0caefd0a41995185dd077ff829caf768d
parent3a2a8585e6ee029bad107657eb0b6b80aa54b878
homectl: when chainloading a shell, prefix "-" rather than overriding first char

Login shells are supposed to marked via a dash as first char. We follow
that logic, but right now we simply overwrite the first char of the
shell. That might not be the right choice, given that this turns
"zsh" into "-sh", which suggests some bourne shell process.

Hence, let's correct things, and instead prefix a dash, which should be
safer.

Inspired by findings on https://github.com/systemd/systemd/issues/34153#issuecomment-2338104907
src/home/homectl.c