Page MenuHomeFreeBSD

Capsicumize file(1)
Needs ReviewPublic

Authored by shubh on Aug 30 2020, 4:48 PM.
Referenced Files
Unknown Object (File)
Sat, Nov 1, 8:54 PM
Unknown Object (File)
Mon, Oct 20, 10:16 PM
Unknown Object (File)
Oct 8 2025, 7:00 AM
Unknown Object (File)
Sep 27 2025, 7:33 AM
Unknown Object (File)
Sep 17 2025, 12:20 PM
Unknown Object (File)
Sep 10 2025, 11:37 AM
Unknown Object (File)
Sep 6 2025, 4:15 PM
Unknown Object (File)
Sep 2 2025, 9:04 PM

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?