Re: [PATCH v4 15/15] daemon: opt-out on features that require posix
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 21, 2010, 23:17 UTC
- Message-ID
- <7veibjrv9r.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTi=ydzrvy6_PbFLpA_qcHzF-8s3xbu3XvU5GnQ_k@mail.gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> 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.