Skip to content
Snippets Groups Projects
Commit 16c12f1b authored by Robert Edmonds's avatar Robert Edmonds Committed by Robert Edmonds
Browse files

knotd: Simplify POSIX capabilities setup to drop all capabilities

This commit renames knotd's setup_capabilities() to drop_capabilities(),
and makes this function simply drop all capabilities.

The call to this function from main() was previously very early, prior
to sockets being bound. Since we most likely need to retain some
capabilities in order to bind to privileged sockets, this commit moves
the dropping of capabilities to be just after the dropping of
privileges, since we also need capabilities in order to change uid/gid.

Capabilities dropping is still performed prior to any daemonization or
spawning of threads, so the interaction of capabilities with threads and
child processes should be straight forward to analyze.

We also call drop_capabilities() prior to activating any global query
modules, so any threads spawned by those modules should see the same,
minimal set of privileges and capabilities that the main thread and
worker threads will see during runtime.
parent 8d53d75a
No related branches found
No related tags found
1 merge request!864Linux capabilities rewrite
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment