Skip to contentSkip to conversation

Daemon as non-root, high priority

Openvpn-devel Ian Pilcher 2 participants 2 messages Feb 5, 2004

lore
Share & tools
lore
#0 lore raw

I would like to put together a patch that will allow the openvpn daemon to run with elevated priority as a non-root user. This currently doesn't work, because the daemon changes its UID before it renices itself.

Questions:

* Are there any "philosophical" objections to this that would prevent such a patch from being accepted?

* Any gotchas? From my brief look at openvpn.c, it seems pretty simple.

Thanks!

Signature · 3 lines
========================================================================
Ian Pilcher                                        [email protected]...
========================================================================
#1 lore raw
Quoted 9 lines · Ian Pilcher

I would like to put together a patch that will allow the openvpn daemon to run with elevated priority as a non-root user. This currently doesn't work, because the daemon changes its UID before it renices itself.

Questions:

* Are there any "philosophical" objections to this that would prevent such a patch from being accepted?

The philosophy has always been to do as much as possible before losing root, so that privilege downgrades are practical.

Quoted 2 lines

* Any gotchas? From my brief look at openvpn.c, it seems pretty simple.

Probably not. Looking at the code, I think the nice call is where it is, rather than a few lines up (to put it before the UID/GID downgrade), because we wanted it to happen after work thread creation. But quite honestly, I don't really see why it's important that this be the case. The only thing you really gain by this approach is that the work thread doesn't inherit the priority from the main thread, meaning that the work thread can set priority independently. But I would agree that being able to raise the main thread priority in conjunction with a UID/GID downgrade is a more important capability.

So I would agree with you that we should relocate the nice call to before UID/GID downgrade.

James