-/* $OpenBSD: firmload.c,v 1.15 2018/08/05 23:19:49 deraadt Exp $ */
+/* $OpenBSD: firmload.c,v 1.16 2018/08/13 23:12:39 deraadt Exp $ */
/*
* Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/device.h>
+#include <sys/pledge.h>
int
loadfirmware(const char *name, u_char **bufp, size_t *buflen)
goto err;
}
- NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
- nid.ni_cnd.cn_flags |= BYPASSUNVEIL;
+ NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF|KERNELPATH,
+ UIO_SYSSPACE, path, p);
+ nid.ni_pledge = PLEDGE_RPATH;
error = namei(&nid);
#ifdef RAMDISK_HOOKS
/* try again with mounted disk */
goto err;
}
- NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF, UIO_SYSSPACE, path, p);
- nid.ni_cnd.cn_flags |= BYPASSUNVEIL;
+ NDINIT(&nid, LOOKUP, NOFOLLOW|LOCKLEAF|KERNELPATH,
+ UIO_SYSSPACE, path, p);
+ nid.ni_pledge = PLEDGE_RPATH;
error = namei(&nid);
}
#endif