1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-25 22:56:14 +00:00

Wrap the pledge-related sysctl code in SMALL_KERNEL, because it is big

and the ramdisk does not need it
ok mlarkin, discussed with dgl
This commit is contained in:
deraadt
2026-03-25 05:05:41 +00:00
parent 2734781db3
commit 0d3e0c9264
2 changed files with 6 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: kern_pledge.c,v 1.351 2026/03/24 05:48:09 deraadt Exp $ */
/* $OpenBSD: kern_pledge.c,v 1.352 2026/03/25 05:05:41 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -760,6 +760,7 @@ pledge_sendfd(struct proc *p, struct file *fp)
return pledge_fail(p, EINVAL, PLEDGE_SENDFD);
}
#ifndef SMALL_KERNEL
int
pledge_sysctl(struct proc *p, int miblen, int *mib, void *new)
{
@@ -951,6 +952,7 @@ pledge_sysctl(struct proc *p, int miblen, int *mib, void *new)
return pledge_fail(p, EINVAL, 0);
}
#endif /* SMALL_KERNEL */
int
pledge_chown(struct proc *p, uid_t uid, gid_t gid)

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: kern_sysctl.c,v 1.485 2026/02/11 22:34:41 deraadt Exp $ */
/* $OpenBSD: kern_sysctl.c,v 1.486 2026/03/25 05:05:41 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -251,10 +251,12 @@ sys_sysctl(struct proc *p, void *v, register_t *retval)
if (error)
return (error);
#ifndef SMALL_KERNEL
error = pledge_sysctl(p, SCARG(uap, namelen),
name, SCARG(uap, new));
if (error)
return (error);
#endif /* SMALL_KERNEL */
switch (name[0]) {
case CTL_KERN: