- Added capsicum support to sandbox fsck_msdosfs.
- Added HAVE_CAPSICUM, so that the code can be used on different platforms
- Added cap_fileargs support
ktrace fsck_msdosfs <device_msdosfs_1> <device_msdosfs_2>
kdump | grep cap
truss fsck_msdosfs <device_msdosfs> <device_msdosfs_2>
Unit Tests Skipped
Don't we need a makefile change as well, to set -DWITH_CASPER?
Style, missing a space after #include.
We also don't need the blank line between this and the rest of the includes.
Judging from this #ifdef I guess we'll want an explicit #ifdef HAVE_CASPER rather than relying on capsicum_helpers?
Look at how this function is called in main(). If multiple filesystems are passed on the command line, with this patch we will fail after the first. You would need to use cap_fileargs to open them.
- Added cap_fileargs for multiple filesystems as arguments.
- 2 instances of cap_fileargs have been used to imitate the open() calls for different flag cases
- Wrapped the sandboxing logic under HAVE_CAPSICUM flag
We don't need this else part. The fileargs_open will be converted to normal open if capser is unavilable.
Why we are using HAVE_CAPSICUM.
Wrong sort. We went over this in the other review.
This is not a good practice to have everything as a global variables. Maybe we can pass this as a arguments to the function?
fileargs_init creates an casper instance, it's not a big deal but we may use fileargs_cinit and create casper only once.
I'm not sure I'm getting this cap_right_init part. The ident is broken.