procfs.c (158880) | procfs.c (159283) |
---|---|
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 158880 2006-05-24 14:03:51Z ghelmer $ | 40 * $FreeBSD: head/sys/fs/procfs/procfs.c 159283 2006-06-05 16:41:27Z ghelmer $ |
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> --- 44 unchanged lines hidden (view full) --- 93 * Adjust mode for some nodes that need it 94 */ 95int 96procfs_attr(PFS_ATTR_ARGS) 97{ 98 PROC_LOCK_ASSERT(p, MA_OWNED); 99 100 /* XXX inefficient, split into separate functions */ | 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> --- 44 unchanged lines hidden (view full) --- 93 * Adjust mode for some nodes that need it 94 */ 95int 96procfs_attr(PFS_ATTR_ARGS) 97{ 98 PROC_LOCK_ASSERT(p, MA_OWNED); 99 100 /* XXX inefficient, split into separate functions */ |
101 if (p->p_flag & P_SUGID) { 102 if (pn->pn_type == pfstype_procdir) 103 vap->va_mode = 0555; 104 else 105 vap->va_mode = 0; 106 } else if (strcmp(pn->pn_name, "ctl") == 0 || | 101 if (strcmp(pn->pn_name, "ctl") == 0 || |
107 strcmp(pn->pn_name, "note") == 0 || 108 strcmp(pn->pn_name, "notepg") == 0) 109 vap->va_mode = 0200; 110 else if (strcmp(pn->pn_name, "mem") == 0 || 111 strcmp(pn->pn_name, "regs") == 0 || 112 strcmp(pn->pn_name, "dbregs") == 0 || 113 strcmp(pn->pn_name, "fpregs") == 0) 114 vap->va_mode = 0600; 115 | 102 strcmp(pn->pn_name, "note") == 0 || 103 strcmp(pn->pn_name, "notepg") == 0) 104 vap->va_mode = 0200; 105 else if (strcmp(pn->pn_name, "mem") == 0 || 106 strcmp(pn->pn_name, "regs") == 0 || 107 strcmp(pn->pn_name, "dbregs") == 0 || 108 strcmp(pn->pn_name, "fpregs") == 0) 109 vap->va_mode = 0600; 110 |
111 if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir) 112 vap->va_mode = 0; 113 |
|
116 vap->va_uid = p->p_ucred->cr_uid; 117 vap->va_gid = p->p_ucred->cr_gid; 118 119 return (0); 120} 121 122/* 123 * Visibility: some files only exist for non-system processes --- 81 unchanged lines hidden --- | 114 vap->va_uid = p->p_ucred->cr_uid; 115 vap->va_gid = p->p_ucred->cr_gid; 116 117 return (0); 118} 119 120/* 121 * Visibility: some files only exist for non-system processes --- 81 unchanged lines hidden --- |