Page MenuHomeFreeBSD

capsicum_helpers: split stream cap bits out of caph_limit_stream()
ClosedPublic

Authored by kevans on Jan 1 2020, 8:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 5:51 AM
Unknown Object (File)
Nov 15 2024, 11:02 AM
Unknown Object (File)
Nov 4 2024, 3:38 PM
Unknown Object (File)
Oct 26 2024, 10:47 AM
Unknown Object (File)
Oct 22 2024, 8:55 PM
Unknown Object (File)
Oct 5 2024, 4:50 AM
Unknown Object (File)
Oct 4 2024, 8:26 PM
Unknown Object (File)
Oct 3 2024, 11:29 PM
Subscribers

Details

Summary

The goal here is to make it so applications can take the rights one would normally get by calling caph_limit_stream() on a descriptor and build on them as needed.

My current use-case is inetd, where the control socket's rights will be caph_stream_rights() + ACCEPT/BIND/LISTEN/SETSOCKOPT, and once a client connects we limit those sockets further to caph_stream_rights() + SETSOCKOPT. inetd must at least use a superset of caph_stream_rights in case invoked program leads to caph_limit_stdio(), which is quite common. I *think* this is a feasible approach, at least.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This seems ok to me. Shouldn't caph_stream_rights() be documented?

It might also be nice to have a caph_limit_stream_rights() or whatever which uses a caller-supplied rights set and limits ioctls like caph_limit_stream() does. I'm not sure if that's really useful though.

lib/libcapsicum/capsicum_helpers.h
51 ↗(On Diff #66218)

I think the backslash is not needed.

This revision is now accepted and ready to land.Jan 2 2020, 2:41 PM

LGTM.
Like @markj mentioned please add it to man page.

kevans marked an inline comment as done.

Amend capsicum_helpers(3) and remove useless escape.

This revision now requires review to proceed.Jan 2 2020, 9:30 PM
This revision is now accepted and ready to land.Jan 2 2020, 10:36 PM