Page MenuHomeFreeBSD

Capsicumize file(1)
Needs ReviewPublic

Authored by shubh on Aug 30 2020, 4:48 PM.
Referenced Files
Unknown Object (File)
Sun, Apr 12, 1:49 AM
Unknown Object (File)
Sat, Apr 11, 11:13 PM
Unknown Object (File)
Sat, Apr 11, 6:22 AM
Unknown Object (File)
Mon, Apr 6, 7:28 PM
Unknown Object (File)
Sat, Mar 21, 2:33 PM
Unknown Object (File)
Tue, Mar 17, 6:37 PM
Unknown Object (File)
Tue, Mar 17, 6:29 PM
Unknown Object (File)
Mar 14 2026, 9:55 AM

Details

Summary

Used the cap_fileargs to open the files in capability mode.

file <multiple argument of files>

works in capability mode

This patch has a limitation:

  • file -f a.txt where a.txt has a list of files, doesn't work in capability mode
Test Plan

ktrace file a.txt
kdump | grep cap

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

shubh requested review of this revision.Aug 30 2020, 4:48 PM
delphij added a subscriber: delphij.

Please be sure to talk with upstream (Christos) before making changes.

contrib/file/src/file.c
181

style.

429

I'm not sure if I'm fun of this.
Why we have two diffrent place to enter capability mode?
We can't enter one time like seccomp above?