Rename CAP_*_KEVENT to CAP_*_EVENT.
Change the names of a couple of capability rights to be less FreeBSD-specific. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc
This commit is contained in:
@@ -817,7 +817,7 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
|
||||
struct file *fp;
|
||||
int i, n, nerrors, error;
|
||||
|
||||
if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0)
|
||||
if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0)
|
||||
return (error);
|
||||
if ((error = kqueue_acquire(fp, &kq)) != 0)
|
||||
goto done_norel;
|
||||
@@ -973,7 +973,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int wa
|
||||
findkn:
|
||||
if (fops->f_isfd) {
|
||||
KASSERT(td != NULL, ("td is NULL"));
|
||||
error = fget(td, kev->ident, CAP_POLL_KEVENT, &fp);
|
||||
error = fget(td, kev->ident, CAP_POLL_EVENT, &fp);
|
||||
if (error)
|
||||
goto done;
|
||||
|
||||
@@ -2182,7 +2182,7 @@ kqfd_register(int fd, struct kevent *kev, struct thread *td, int waitok)
|
||||
struct file *fp;
|
||||
int error;
|
||||
|
||||
if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0)
|
||||
if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0)
|
||||
return (error);
|
||||
if ((error = kqueue_acquire(fp, &kq)) != 0)
|
||||
goto noacquire;
|
||||
|
||||
@@ -1072,7 +1072,7 @@ getselfd_cap(struct filedesc *fdp, int fd, struct file **fpp)
|
||||
* If the file descriptor is for a capability, test rights and use
|
||||
* the file descriptor references by the capability.
|
||||
*/
|
||||
error = cap_funwrap(fp, CAP_POLL_KEVENT, &fp_fromcap);
|
||||
error = cap_funwrap(fp, CAP_POLL_EVENT, &fp_fromcap);
|
||||
if (error) {
|
||||
fdrop(fp, curthread);
|
||||
return (error);
|
||||
|
||||
@@ -2119,7 +2119,7 @@ static __inline int
|
||||
getmq(struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn,
|
||||
struct mqueue **pmq)
|
||||
{
|
||||
return _getmq(td, fd, CAP_POLL_KEVENT, fget, fpp, ppn, pmq);
|
||||
return _getmq(td, fd, CAP_POLL_EVENT, fget, fpp, ppn, pmq);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
@@ -2274,7 +2274,7 @@ kmq_notify(struct thread *td, struct kmq_notify_args *uap)
|
||||
error = EBADF;
|
||||
goto out;
|
||||
}
|
||||
error = cap_funwrap(fp2, CAP_POLL_KEVENT, &fp2);
|
||||
error = cap_funwrap(fp2, CAP_POLL_EVENT, &fp2);
|
||||
if (error) {
|
||||
FILEDESC_SUNLOCK(fdp);
|
||||
goto out;
|
||||
|
||||
@@ -124,8 +124,8 @@
|
||||
#define CAP_SEM_WAIT 0x0000800000000000ULL
|
||||
|
||||
/* kqueue events. */
|
||||
#define CAP_POLL_KEVENT 0x0001000000000000ULL
|
||||
#define CAP_POST_KEVENT 0x0002000000000000ULL
|
||||
#define CAP_POLL_EVENT 0x0001000000000000ULL
|
||||
#define CAP_POST_EVENT 0x0002000000000000ULL
|
||||
|
||||
/* Strange and powerful rights that should not be given lightly. */
|
||||
#define CAP_IOCTL 0x0004000000000000ULL
|
||||
|
||||
@@ -237,8 +237,8 @@ test_capabilities(void)
|
||||
TRY(fd, CAP_MMAP | CAP_MAPEXEC | CAP_WRITE);
|
||||
TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC);
|
||||
TRY(fd, CAP_FCNTL);
|
||||
TRY(fd, CAP_POST_KEVENT);
|
||||
TRY(fd, CAP_POLL_KEVENT);
|
||||
TRY(fd, CAP_POST_EVENT);
|
||||
TRY(fd, CAP_POLL_EVENT);
|
||||
TRY(fd, CAP_FSYNC);
|
||||
TRY(fd, CAP_FCHOWN);
|
||||
TRY(fd, CAP_FCHMOD);
|
||||
|
||||
Reference in New Issue
Block a user