tst2005googlecode / umurmur

Automatically exported from code.google.com/p/umurmur
1 stars 0 forks source link

Drop privileges optionally #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This patch allows users to put a username (and optionally a group name) in 
their config file; after daemonizing umurmur will then switch to the given uid 
and gid.

If username is set in the config file but group name isn't, then umurmur will 
just use the given user's login group.

I've chosen to only drop privileges in daemon mode since we also only write the 
PID file in daemon mode, too. PID files usually go in /var/run, which is only 
writable by root. So having privilege-dropping in the same code path as writing 
the PID file seems to make sense (and the order is important obviously).

-> In a future patch, we could write the PID file and drop privileges even if 
daemonization is disabled, I think.

Original issue reported on code.google.com by tilm...@googlemail.com on 20 Jan 2011 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by fatbob.s...@gmail.com on 23 Jan 2011 at 10:54

GoogleCodeExporter commented 9 years ago
Committed with minor changes in r152.
Thanks!

Original comment by fatbob.s...@gmail.com on 23 Jan 2011 at 12:00