40c40
< * $FreeBSD: head/sys/kern/kern_mib.c 80447 2001-07-27 15:52:49Z peter $
---
> * $FreeBSD: head/sys/kern/kern_mib.c 83990 2001-09-26 20:39:48Z rwatson $
175c175,184
< level = securelevel;
---
> /*
> * If the process is in jail, return the maximum of the
> * global and local levels; otherwise, return the global
> * level.
> */
> if (req->p->p_ucred->cr_prison != NULL)
> level = imax(securelevel,
> req->p->p_ucred->cr_prison->pr_securelevel);
> else
> level = securelevel;
179,181c188,201
< if (level < securelevel)
< return (EPERM);
< securelevel = level;
---
> /*
> * Permit update only if the new securelevel exceeds the
> * global level, and local level if any.
> */
> if (req->p->p_ucred->cr_prison != NULL) {
> if (level < imax(securelevel,
> req->p->p_ucred->cr_prison->pr_securelevel))
> return (EPERM);
> req->p->p_ucred->cr_prison->pr_securelevel = level;
> } else {
> if (level < securelevel)
> return (EPERM);
> securelevel = level;
> }
185,186c205,207
< SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, CTLTYPE_INT|CTLFLAG_RW,
< 0, 0, sysctl_kern_securelvl, "I", "Current secure level");
---
> SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
> CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
> "I", "Current secure level");
< * $FreeBSD: head/sys/kern/kern_mib.c 80447 2001-07-27 15:52:49Z peter $
---
> * $FreeBSD: head/sys/kern/kern_mib.c 83990 2001-09-26 20:39:48Z rwatson $
175c175,184
< level = securelevel;
---
> /*
> * If the process is in jail, return the maximum of the
> * global and local levels; otherwise, return the global
> * level.
> */
> if (req->p->p_ucred->cr_prison != NULL)
> level = imax(securelevel,
> req->p->p_ucred->cr_prison->pr_securelevel);
> else
> level = securelevel;
179,181c188,201
< if (level < securelevel)
< return (EPERM);
< securelevel = level;
---
> /*
> * Permit update only if the new securelevel exceeds the
> * global level, and local level if any.
> */
> if (req->p->p_ucred->cr_prison != NULL) {
> if (level < imax(securelevel,
> req->p->p_ucred->cr_prison->pr_securelevel))
> return (EPERM);
> req->p->p_ucred->cr_prison->pr_securelevel = level;
> } else {
> if (level < securelevel)
> return (EPERM);
> securelevel = level;
> }
185,186c205,207
< SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, CTLTYPE_INT|CTLFLAG_RW,
< 0, 0, sysctl_kern_securelvl, "I", "Current secure level");
---
> SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
> CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
> "I", "Current secure level");