Avoid use of cap_rights_t

This commit is contained in:
Sebastian Huber 2016-04-18 14:50:39 +02:00
parent c5fde4960c
commit 22257c7d81
3 changed files with 11 additions and 4 deletions

View File

@ -1033,18 +1033,22 @@ kern_sendit(td, s, mp, flags, control, segflg)
struct socket *so;
int i, error;
ssize_t len;
#ifndef __rtems__
cap_rights_t rights;
#endif /* __rtems__ */
#ifdef KTRACE
struct uio *ktruio = NULL;
#endif
AUDIT_ARG_FD(s);
#ifndef __rtems__
rights = CAP_WRITE;
if (mp->msg_name != NULL)
rights |= CAP_CONNECT;
error = getsock_cap(td->td_proc->p_fd, s, rights, &fp, NULL);
if (error)
return (error);
#endif /* __rtems__ */
so = (struct socket *)fp->f_data;
#ifdef KTRACE

View File

@ -309,17 +309,16 @@ int fget(struct thread *td, int fd, cap_rights_t rights, struct file **fpp);
struct file *rtems_bsd_get_file(int fd);
static inline int
fget(struct thread *td, int fd, cap_rights_t rights, struct file **fpp)
rtems_bsd_do_fget(int fd, struct file **fpp)
{
struct file *fp = rtems_bsd_get_file(fd);
(void) td;
(void) rights;
*fpp = fp;
return fp != NULL ? 0 : EBADF;
}
#define fget(td, fd, rights, fpp) rtems_bsd_do_fget(fd, fpp)
#endif /* __rtems__ */
int fget_mmap(struct thread *td, int fd, cap_rights_t rights,
u_char *maxprotp, struct file **fpp);

View File

@ -327,6 +327,7 @@ struct kinfo_ofile {
#endif
struct kinfo_file {
#ifndef __rtems__
int kf_structsize; /* Variable size of record. */
int kf_type; /* Descriptor type. */
int kf_fd; /* Array index. */
@ -397,6 +398,9 @@ struct kinfo_file {
int _kf_ispare[4]; /* Space for more stuff. */
/* Truncated before copyout in sysctl */
char kf_path[PATH_MAX]; /* Path to file, if any. */
#else /* __rtems__ */
int kf_dummy;
#endif /* __rtems__ */
};
/*