o Remove double-indentation of sysctl_kern_securelvl. This change is
consistent with the one other function in the file, and prevents long lines in up-coming changes. This nominally pulls kern_mib.c a little further down the long path to style(9) compliance.
This commit is contained in:
parent
b1b863c1b2
commit
9afc1eee4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86140
@ -183,42 +183,41 @@ int securelevel = -1;
|
||||
static int
|
||||
sysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error, level;
|
||||
int error, level;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
error = sysctl_handle_int(oidp, &level, 0, req);
|
||||
if (error || !req->newptr)
|
||||
return (error);
|
||||
/*
|
||||
* Permit update only if the new securelevel exceeds the
|
||||
* global level, and local level if any.
|
||||
*/
|
||||
if (req->p->p_ucred->cr_prison != NULL) {
|
||||
#ifdef REGRESSION
|
||||
if (!regression_securelevel_nonmonotonic)
|
||||
#endif /* !REGRESSION */
|
||||
if (level < imax(securelevel,
|
||||
req->p->p_ucred->cr_prison->pr_securelevel))
|
||||
return (EPERM);
|
||||
req->p->p_ucred->cr_prison->pr_securelevel = level;
|
||||
} else {
|
||||
#ifdef REGRESSION
|
||||
if (!regression_securelevel_nonmonotonic)
|
||||
#endif /* !REGRESSION */
|
||||
if (level < securelevel)
|
||||
return (EPERM);
|
||||
securelevel = level;
|
||||
}
|
||||
/*
|
||||
* 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;
|
||||
error = sysctl_handle_int(oidp, &level, 0, req);
|
||||
if (error || !req->newptr)
|
||||
return (error);
|
||||
/*
|
||||
* Permit update only if the new securelevel exceeds the
|
||||
* global level, and local level if any.
|
||||
*/
|
||||
if (req->p->p_ucred->cr_prison != NULL) {
|
||||
#ifdef REGRESSION
|
||||
if (!regression_securelevel_nonmonotonic)
|
||||
#endif /* !REGRESSION */
|
||||
if (level < imax(securelevel,
|
||||
req->p->p_ucred->cr_prison->pr_securelevel))
|
||||
return (EPERM);
|
||||
req->p->p_ucred->cr_prison->pr_securelevel = level;
|
||||
} else {
|
||||
#ifdef REGRESSION
|
||||
if (!regression_securelevel_nonmonotonic)
|
||||
#endif /* !REGRESSION */
|
||||
if (level < securelevel)
|
||||
return (EPERM);
|
||||
securelevel = level;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
|
||||
|
Loading…
Reference in New Issue
Block a user