From: Junio C Hamano Date: Thu, 21 Oct 2010 23:17:04 GMT Subject: Re: [PATCH v4 15/15] daemon: opt-out on features that require posix Message-ID: <7veibjrv9r.fsf@alter.siamese.dyndns.org> In-Reply-To: Erik Faye-Lund writes: > OK, I did another stab at this, and this is the best I could come up > with right now, what do you think? Getting warmer ;-) Similarly to drop_privileges() you can create prepare_credential that takes "struct cred *, const char *username, const char *groupname" as another helper, and make its implementation on the NO_POSIX side barf/die when called, saying that switching credentials is not supported in NO_POSIX implementation. That way, you can keep the main clean without any conditionals. Command line argument parser can (and probably should) stay the same between implementations. Thanks.