procfs_ioctl.c (162711) | procfs_ioctl.c (164033) |
---|---|
1/*- 2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav 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 --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav 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 --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/fs/procfs/procfs_ioctl.c 162711 2006-09-27 19:57:02Z ru $ | 28 * $FreeBSD: head/sys/fs/procfs/procfs_ioctl.c 164033 2006-11-06 13:42:10Z rwatson $ |
29 */ 30 31#include "opt_compat.h" 32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/pioctl.h> | 29 */ 30 31#include "opt_compat.h" 32 33#include <sys/param.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/pioctl.h> |
37#include <sys/priv.h> |
|
37#include <sys/proc.h> 38#include <sys/signalvar.h> 39#include <sys/systm.h> 40 41#include <fs/pseudofs/pseudofs.h> 42#include <fs/procfs/procfs.h> 43 44#ifdef COMPAT_IA32 --- 54 unchanged lines hidden (view full) --- 99#endif 100#ifdef COMPAT_FREEBSD6 101 case _IO('p', 3): 102 ival = IOCPARM_IVAL(data); 103 data = &ival; 104#endif 105 case PIOCSFL: 106 flags = *(unsigned int *)data; | 38#include <sys/proc.h> 39#include <sys/signalvar.h> 40#include <sys/systm.h> 41 42#include <fs/pseudofs/pseudofs.h> 43#include <fs/procfs/procfs.h> 44 45#ifdef COMPAT_IA32 --- 54 unchanged lines hidden (view full) --- 100#endif 101#ifdef COMPAT_FREEBSD6 102 case _IO('p', 3): 103 ival = IOCPARM_IVAL(data); 104 data = &ival; 105#endif 106 case PIOCSFL: 107 flags = *(unsigned int *)data; |
107 if (flags & PF_ISUGID && (error = suser(td)) != 0) 108 break; | 108 if (flags & PF_ISUGID) { 109 /* 110 * XXXRW: Is this specific check required here, as 111 * p_candebug() should implement it, or other checks 112 * are missing. 113 * 114 * XXXRW: Other debugging privileges are granted in 115 * jail, why isn't this? 116 */ 117 error = priv_check(td, PRIV_DEBUG_SUGID); 118 if (error) 119 break; 120 } |
109 p->p_pfsflags = flags; 110 break; 111 case PIOCGFL: 112 *(unsigned int *)data = p->p_pfsflags; 113 break; 114 case PIOCWAIT: 115 while (p->p_step == 0) { 116 /* sleep until p stops */ --- 89 unchanged lines hidden --- | 121 p->p_pfsflags = flags; 122 break; 123 case PIOCGFL: 124 *(unsigned int *)data = p->p_pfsflags; 125 break; 126 case PIOCWAIT: 127 while (p->p_step == 0) { 128 /* sleep until p stops */ --- 89 unchanged lines hidden --- |