Jeff McNeil wrote:

> Sure, start the daemon as root, write the appropriate files, and then
> drop permissions using os.setegid and then os.seteuid. You can chown
> the file before priv. drop to your target user so that it can be
> removed when your exit handlers run.  Alternatively, you can reclaim
> root at cleanup as it's stored as your saved UID.

Nice.  One thing: how do I get the uid and gid for the target user?  In
general, I know the name of the target user, but the uid/gid assigned by
the OS to that user could be different on different systems.
-- 
Jeffrey Barish

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to