procfs.c (90873) | procfs.c (96886) |
---|---|
1/* 2 * Copyright (c) 2001 Dag-Erling Sm�rgrav 3 * Copyright (c) 1993 Jan-Simon Pendry 4 * Copyright (c) 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Jan-Simon Pendry. --- 23 unchanged lines hidden (view full) --- 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 39 * | 1/* 2 * Copyright (c) 2001 Dag-Erling Sm�rgrav 3 * Copyright (c) 1993 Jan-Simon Pendry 4 * Copyright (c) 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Jan-Simon Pendry. --- 23 unchanged lines hidden (view full) --- 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 39 * |
40 * $FreeBSD: head/sys/fs/procfs/procfs.c 90873 2002-02-18 21:41:11Z des $ | 40 * $FreeBSD: head/sys/fs/procfs/procfs.c 96886 2002-05-19 00:14:50Z jhb $ |
41 */ 42 43#include <sys/param.h> 44#include <sys/queue.h> 45#include <sys/exec.h> 46#include <sys/lock.h> 47#include <sys/kernel.h> 48#include <sys/malloc.h> --- 53 unchanged lines hidden (view full) --- 102 vap->va_mode = 0200; 103 else if (strcmp(pn->pn_name, "mem") == 0 || 104 strcmp(pn->pn_name, "regs") == 0 || 105 strcmp(pn->pn_name, "dbregs") == 0 || 106 strcmp(pn->pn_name, "fpregs") == 0) 107 vap->va_mode = 0600; 108 109 /* p is locked by caller */ | 41 */ 42 43#include <sys/param.h> 44#include <sys/queue.h> 45#include <sys/exec.h> 46#include <sys/lock.h> 47#include <sys/kernel.h> 48#include <sys/malloc.h> --- 53 unchanged lines hidden (view full) --- 102 vap->va_mode = 0200; 103 else if (strcmp(pn->pn_name, "mem") == 0 || 104 strcmp(pn->pn_name, "regs") == 0 || 105 strcmp(pn->pn_name, "dbregs") == 0 || 106 strcmp(pn->pn_name, "fpregs") == 0) 107 vap->va_mode = 0600; 108 109 /* p is locked by caller */ |
110 PROC_LOCK_ASSERT(p, MA_OWNED); |
|
110 vap->va_uid = p->p_ucred->cr_uid; 111 vap->va_gid = p->p_ucred->cr_gid; 112 113 return (0); 114} 115 116/* 117 * Visibility: some files only exist for non-system processes --- 7 unchanged lines hidden (view full) --- 125 126/* 127 * Visibility: some files are only visible to process that can debug 128 * the target process. 129 */ 130int 131procfs_candebug(PFS_VIS_ARGS) 132{ | 111 vap->va_uid = p->p_ucred->cr_uid; 112 vap->va_gid = p->p_ucred->cr_gid; 113 114 return (0); 115} 116 117/* 118 * Visibility: some files only exist for non-system processes --- 7 unchanged lines hidden (view full) --- 126 127/* 128 * Visibility: some files are only visible to process that can debug 129 * the target process. 130 */ 131int 132procfs_candebug(PFS_VIS_ARGS) 133{ |
134 PROC_LOCK_ASSERT(p, MA_OWNED); |
|
133 return ((p->p_flag & P_SYSTEM) == 0 && | 135 return ((p->p_flag & P_SYSTEM) == 0 && |
134 p_candebug(td->td_proc, p) == 0); | 136 p_candebug(td, p) == 0); |
135} 136 137/* 138 * Constructor 139 */ 140static int 141procfs_init(PFS_INIT_ARGS) 142{ --- 56 unchanged lines hidden --- | 137} 138 139/* 140 * Constructor 141 */ 142static int 143procfs_init(PFS_INIT_ARGS) 144{ --- 56 unchanged lines hidden --- |