Paranoia: if the process is setugid, set all sensitive files mode 0.

This commit is contained in:
Dag-Erling Smørgrav 2002-02-18 21:41:11 +00:00
parent 4fcc34b3d8
commit cd9e3b208c

View File

@ -94,7 +94,9 @@ int
procfs_attr(PFS_ATTR_ARGS)
{
/* XXX inefficient, split into separate functions */
if (strcmp(pn->pn_name, "ctl") == 0 ||
if (p->p_flag & P_SUGID)
vap->va_mode = 0;
else if (strcmp(pn->pn_name, "ctl") == 0 ||
strcmp(pn->pn_name, "note") == 0 ||
strcmp(pn->pn_name, "notepg") == 0)
vap->va_mode = 0200;