]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Rework _fget to accept capability parameters.
authorjonathan <jonathan@FreeBSD.org>
Tue, 5 Jul 2011 13:45:10 +0000 (13:45 +0000)
committerjonathan <jonathan@FreeBSD.org>
Tue, 5 Jul 2011 13:45:10 +0000 (13:45 +0000)
commit6abbb93d5fb70390974d5b0bb73e75616bd9c39a
tree8fac81f33159cf57a8796a6cf8aa7178f0a65066
parent3628e4b620c60e8668761c26fe1f11c9a2ad06ad
Rework _fget to accept capability parameters.

This new version of _fget() requires new parameters:
- cap_rights_t needrights
    the rights that we expect the capability's rights mask to include
    (e.g. CAP_READ if we are going to read from the file)

- cap_rights_t *haverights
    used to return the capability's rights mask (ignored if NULL)

- u_char *maxprotp
    the maximum mmap() rights (e.g. VM_PROT_READ) that can be permitted
    (only used if we are going to mmap the file; ignored if NULL)

- int fget_flags
    FGET_GETCAP if we want to return the capability itself, rather than
    the underlying object which it wraps

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc
sys/kern/kern_descrip.c
sys/sys/file.h