capsicum: propagate const correctness

This commit is contained in:
mmacy 2018-05-19 05:14:05 +00:00
parent b862678077
commit 3886da5a93
3 changed files with 10 additions and 10 deletions

View File

@ -2625,9 +2625,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
struct file **fpp, seq_t *seqp)
{
#ifdef CAPABILITIES
struct filedescent *fde;
const struct filedescent *fde;
#endif
struct fdescenttbl *fdt;
const struct fdescenttbl *fdt;
struct file *fp;
u_int count;
#ifdef CAPABILITIES
@ -2673,7 +2673,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
* table before this fd was closed, so it possible that
* there is a stale fp pointer in cached version.
*/
fdt = *(struct fdescenttbl * volatile *)&(fdp->fd_files);
fdt = *(const struct fdescenttbl * const volatile *)&(fdp->fd_files);
continue;
}
/*

View File

@ -183,7 +183,7 @@ cap_check(const cap_rights_t *havep, const cap_rights_t *needp)
* Convert capability rights into VM access flags.
*/
u_char
cap_rights_to_vmprot(cap_rights_t *havep)
cap_rights_to_vmprot(const cap_rights_t *havep)
{
u_char maxprot;
@ -204,14 +204,14 @@ cap_rights_to_vmprot(cap_rights_t *havep)
* this one file.
*/
cap_rights_t *
cap_rights_fde(struct filedescent *fdep)
const cap_rights_t *
cap_rights_fde(const struct filedescent *fdep)
{
return (&fdep->fde_rights);
}
cap_rights_t *
const cap_rights_t *
cap_rights(struct filedesc *fdp, int fd)
{

View File

@ -444,14 +444,14 @@ int cap_check(const cap_rights_t *havep, const cap_rights_t *needp);
/*
* Convert capability rights into VM access flags.
*/
u_char cap_rights_to_vmprot(cap_rights_t *havep);
u_char cap_rights_to_vmprot(const cap_rights_t *havep);
/*
* For the purposes of procstat(1) and similar tools, allow kern_descrip.c to
* extract the rights from a capability.
*/
cap_rights_t *cap_rights_fde(struct filedescent *fde);
cap_rights_t *cap_rights(struct filedesc *fdp, int fd);
const cap_rights_t *cap_rights_fde(const struct filedescent *fde);
const cap_rights_t *cap_rights(struct filedesc *fdp, int fd);
int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd);
int cap_fcntl_check_fde(struct filedescent *fde, int cmd);