Page MenuHomeFreeBSD

Sandbox head(1) with fileargs.
ClosedPublic

Authored by oshogbo on Feb 17 2018, 12:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 2:42 AM
Unknown Object (File)
Feb 19 2024, 5:50 PM
Unknown Object (File)
Jan 15 2024, 11:46 PM
Unknown Object (File)
Dec 24 2023, 11:15 AM
Unknown Object (File)
Dec 24 2023, 11:15 AM
Unknown Object (File)
Dec 24 2023, 11:15 AM
Unknown Object (File)
Dec 24 2023, 11:15 AM
Unknown Object (File)
Dec 23 2023, 6:46 AM

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

usr.bin/head/head.c
46–47

If either <sys/types.h> or <sys/param.h> is needed, include it before other include files.

from style(9)

Still sys/cdefs.h first.

142

Should we call fileargs_free?

We handle now empty argc and argv.

usr.bin/head/head.c
89–90

These additions maintain non-style(9) of variable declarations.

It's a pedantic comment, but as this change will likely be used as a reference for future fileargs additions we may want to address it; if we do, we should probably style(9) head.c first in a separate commit.

usr.bin/head/head.c
89–90

I created another review for making it more style(9) https://reviews.freebsd.org/D14498

This revision was not accepted when it landed; it landed in state Needs Review.Nov 12 2018, 5:48 PM
This revision was automatically updated to reflect the committed changes.

How this can works on kernels build without 'options CAPABILITIES'? Note that CAPABILITIES option is
not included in kernel option for small embedded boards (arm, mips...)?
We should change CAPSICUM to mandatory or implement fallback here (as we already do in rest of tree)

Also, how this can be complied with WITHOUT_CAPSICUM=YES in make.conf? (imho, nanobsd uses it)

(same for wc and brandelf)

What you afraid of?
If you build system without capsicum/casper everything works caph_enter_casper don't fail in that case, the filearsgs_open is changed to the standard open(2) call>
Please check ot this header file: https://svnweb.freebsd.org/base/head/lib/libcasper/services/cap_fileargs/cap_fileargs.h?view=markup

Ahh, right, I overlooked this, sorry. So I taking back WITHOUT_CAPSICUM case.

But first part on my previous message is still applicable, if you run 'head' on
kernel compiled without 'option CAPSICUM' then it fail with 'function not implemented'.

In D14409#392398, @mmel wrote:

if you run 'head' on
kernel compiled without 'option CAPSICUM' then it fail with 'function not implemented'.

Why do you think that? Maybe you don't have r341347?

bingo! I'm on r341345. And yes, r341347 fixed it.
Thanks and sorry for noise.