amr_linux.c (192450) | amr_linux.c (224778) |
---|---|
1/*- 2 * Copyright (c) 2005 Paul Saab 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Paul Saab 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/amr/amr_linux.c 192450 2009-05-20 17:29:21Z imp $"); | 29__FBSDID("$FreeBSD: head/sys/dev/amr/amr_linux.c 224778 2011-08-11 12:30:23Z rwatson $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> | 30 31#include <sys/param.h> 32#include <sys/systm.h> |
33#include <sys/capability.h> |
|
33#include <sys/conf.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36#include <sys/file.h> 37#include <sys/proc.h> 38 39#if defined(__amd64__) /* Assume amd64 wants 32 bit Linux */ 40#include <machine/../linux32/linux.h> --- 28 unchanged lines hidden (view full) --- 69MODULE_DEPEND(amr, linux, 1, 1, 1); 70 71static int 72amr_linux_ioctl(struct thread *p, struct linux_ioctl_args *args) 73{ 74 struct file *fp; 75 int error; 76 | 34#include <sys/conf.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/file.h> 38#include <sys/proc.h> 39 40#if defined(__amd64__) /* Assume amd64 wants 32 bit Linux */ 41#include <machine/../linux32/linux.h> --- 28 unchanged lines hidden (view full) --- 70MODULE_DEPEND(amr, linux, 1, 1, 1); 71 72static int 73amr_linux_ioctl(struct thread *p, struct linux_ioctl_args *args) 74{ 75 struct file *fp; 76 int error; 77 |
77 if ((error = fget(p, args->fd, &fp)) != 0) | 78 if ((error = fget(p, args->fd, CAP_IOCTL, &fp)) != 0) |
78 return (error); 79 error = fo_ioctl(fp, args->cmd, (caddr_t)args->arg, p->td_ucred, p); 80 fdrop(fp, p); 81 return (error); 82} | 79 return (error); 80 error = fo_ioctl(fp, args->cmd, (caddr_t)args->arg, p->td_ucred, p); 81 fdrop(fp, p); 82 return (error); 83} |