Page MenuHomeFreeBSD

head(1): Capsicumify
AbandonedPublic

Authored by cem on Sep 18 2016, 1:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 15, 6:39 PM
Unknown Object (File)
Sat, Dec 14, 1:15 PM
Unknown Object (File)
Thu, Dec 5, 9:28 PM
Unknown Object (File)
Nov 8 2024, 5:21 PM
Unknown Object (File)
Sep 30 2024, 3:01 PM
Unknown Object (File)
Sep 26 2024, 12:44 AM
Unknown Object (File)
Sep 23 2024, 12:32 PM
Unknown Object (File)
Sep 21 2024, 4:57 AM
Subscribers

Details

Summary

Capsicumify head(1) by restricting it to a readonly view of the
filesystem. This is both easy to do and impacts performance minimally.

Access to the filesystem could be restricted further, but requires more
elaborate implementation and may suffer from performance trade-off.
This is left as future work.

Test Plan
  • Tested 'head foobar.txt'
  • Tested 'head < foobar.txt'
  • Tested 'head -c10 < foobar.txt'

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6174
Build 6428: arc lint + arc unit

Event Timeline

cem retitled this revision from to head(1): Capsicumify last input file.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: emaste, allanjude, oshogbo.

I think the approach is fine - we'll revisit all of these "capsicumify on last file" cases once a file service is available. Can you update with capsicum_helpers though?

cem edited edge metadata.

Update to use helpers.

Use https://reviews.freebsd.org/D8743 to enter sandbox over all inputs.

It feels like something like 'abspath' should be available in a library for
similarly-sandboxed applications.

cem retitled this revision from head(1): Capsicumify last input file to head(1): Capsicumify.Dec 9 2016, 9:24 PM
cem updated this object.