mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
reboot: Disallow -k and -r, it doesn't make sense.
When we're re-rooting to a new /, there is no next kernel. Error out rather than leaving a timebomb in /boot/nextboot.conf. Sponsored by: Netflix Reviewed by: kevans, kib, emaste Differential Revision: https://reviews.freebsd.org/D43800
This commit is contained in:
parent
ac4847e6b0
commit
a78bc42bcc
|
@ -115,6 +115,8 @@ main(int argc, char *argv[])
|
|||
errx(1, "-c and -p cannot be used together");
|
||||
if ((howto & RB_REROOT) != 0 && howto != RB_REROOT)
|
||||
errx(1, "-r cannot be used with -c, -d, -n, or -p");
|
||||
if ((howto & RB_REROOT) != 0 && kernel != NULL)
|
||||
errx(1, "-r and -k cannot be used together, there is no next kernel");
|
||||
if (geteuid()) {
|
||||
errno = EPERM;
|
||||
err(1, NULL);
|
||||
|
|
Loading…
Reference in a new issue