FreeBSD/sys/fs/procfs/procfs.c
/*
 * Adjust mode for some nodes that need it
 */
Adjust mode for some nodes that need it
Adjust mode for some nodes that need it
int
procfs_attr(PFS_ATTR_ARGS)
{
	if (strcmp(pn->pn_name, "ctl") == 0 ||
	    strcmp(pn->pn_name, "note") == 0 ||
	    strcmp(pn->pn_name, "notepg") == 0)
		vap->va_mode = 0200;
	else if (strcmp(pn->pn_name, "mem") == 0 ||
	    strcmp(pn->pn_name, "regs") == 0 ||
	    strcmp(pn->pn_name, "dbregs") == 0 ||
	    strcmp(pn->pn_name, "fpregs") == 0 ||
	    strcmp(pn->pn_name, "osrel") == 0)
		vap->va_mode = 0600;
	if (p != NULL) {
		PROC_LOCK_ASSERT(p, MA_OWNED);
		if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir)
			vap->va_mode = 0;
	}
	return (0);
}
int procfs_attr ( PFS_ATTR_ARGS ) { if ( strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 ) vap -> va_mode = 0200 ; else if ( strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 || strcmp ( pn -> pn_name , " " ) == 0 ) vap -> va_mode = 0600 ; if ( p != NULL ) { PROC_LOCK_ASSERT ( p , MA_OWNED ) ; if ( ( p -> p_flag & P_SUGID ) && pn -> pn_type != pfstype_procdir ) vap -> va_mode = 0 ; } return ( 0 ) ; }
Adjust mode for some nodes that need it
Adjust mode for some nodes that need it
/* XXX inefficient, split into separate functions */