processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.03k stars 1.5k forks source link

Fix SIGINT of ejabberdctl foreground by exec(1) on privilege drop #4047

Closed sideeffect42 closed 1 year ago

sideeffect42 commented 1 year ago

When ejabberdctl foreground is executed as root, it will su to the ejabberd user before starting Erlang. If a user then hits ^C, su(1) kills the login shell it started and the Erlang process is interited by PID 1 instead of being stopped.

Prepending the command sent to the ejabberd user's shell with "exec" fixes this behaviour for me, because su(1) then kills the Erlang process instead of the login shell.

p1bot commented 1 year ago

Hi @sideeffect42, many thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Neustradamus commented 1 year ago

@sideeffect42: Can you sign the CLA?

Neustradamus commented 1 year ago

@prefiks, @badlop: What do you think about this PR?