Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming and creds #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nicowilliams
Copy link
Contributor

These commits make the API a bit more symmetric and allow more control (and document it) over when credentials are released, which is useful for privilege dropping purposes.

We should do something even more likely to drop access to privileged data: provide an export/import interface so you can: a) export a knc context, b) exec a child and pass it the exported context via an open, unlinked tmp file or shared memory, c) re-import the context. Actually, this needn't even look like an export/import pair of functions, more like:

int
knc_allow_inherit(knc_ctx); /* returns an fd to import from */

void
knc_ctx knc_inherit(int);

Even the knc_stream info, including fildes numbers, needed for the event loop should be passed via this one fd.

So an app would accept a context, knc_set_cred(ctx, GSS_C_NO_CREDENTIAL), do something with the deleg cred (possibly gss_export_cred(), possibly gss_store_cred()), knc_free_deleg_cred(ctx), then fork(), knc_allow_inherit(), setuid() and so on, then exec(), then knc_inherit().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant