From nobody Mon Feb 12 18:53:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TYYWh5KDkz5BM4X; Mon, 12 Feb 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TYYWh39qLz4m2y; Mon, 12 Feb 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707764016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+gfVE7STb4IDFBixMypTacmQVsHX6P1kugRK5fO0jQ=; b=nKJumsO7sJNleRPqRLx8PwYf0AabwzKP6g8BQrMX4z6kGvtR0/73+DNxiL5qpRSzYOcSUk tV+UkEPzODDxSsJTDWtOW8YDiWbccG6D+ZySrWNiVFdk21tXPiyAPQZNkKvkb7OEOhke7o OfUGL29nqis/6r23+zmoGtocA4Jtx5gLBO/xjUeAy5RPrhB1iXswBmhuJl6Tq6/X8Ckza1 Y3y2nCOAG49OFY9603Nt52yfBmMU+8sAVLTBlcHIFaWwQ8Ke264wuyrxRoFqo3+CtJI8L1 Q1gx/NCSvQk4Z4IquXDmJdCpuH4EcX3LKwxbxZYh8secssP9w3SoyWPMxzZ8vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707764016; a=rsa-sha256; cv=none; b=cSEG3C5ZvhzzxQsHtQEUSRB8S2gB8w3dGuwFvKNMq9mmV2eEMLPotmLTkJCUGugZ8kMadl hZc2uetcGzevNgJwI2/YmK5EnuF2vwgrFqdVwN+NfKijJrKI5H4q1agAH1izManb1bbhJ9 7bf4nEyN5SzLzO2evnjm1fuT7Tio6iixrzUxi55Nf6+85zLNdHWUFakayGvDh9o4R33Xce zKVrWU1S3vHB6/4D3yeEMRBlQYvMb8jVHEJA1lB2ZLtRZKe1XYfir4kwncB7H/4VQVgUEP srQEKSjqjzBM35qN49JRuUOG1PsBGldXkq7mAN9WLIAcW2hLHAoD3k+gJ62MAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707764016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+gfVE7STb4IDFBixMypTacmQVsHX6P1kugRK5fO0jQ=; b=TXAkPGdz02DpYpPRTQYu8RH8WcAzt/4F3kMoMpFQFV0DyZygyq2MTuIhxBiFhQpJLjaLiC qYp+91dqHpEFvh0hvrXA+5uWp49eTYjpRYob5+EcbqOXHCBTeK7P0SzdkhtBSOko2N4Lrz 6L5Mr7YtSJ4Ka3jzLqFinikfO6xjQcI8rWvSzN+xW0Hs6Yg+mGmDrKEE+6r0b7HsPhXNp9 dqyLw2x3mlVSAJZNvffw5MgO5u+Yz+MpIoMfGDfKnlNKqiEtnyYZIMzaQAV896GGktd0Wo l3Xs5dz397cTcWEey/4ZE2lOYTjNxXgtmOxwtXTfxNC92R6l9SE0bsEZotoN0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TYYWh2Fwpzjng; Mon, 12 Feb 2024 18:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41CIra5d030365; Mon, 12 Feb 2024 18:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41CIra1Q030362; Mon, 12 Feb 2024 18:53:36 GMT (envelope-from git) Date: Mon, 12 Feb 2024 18:53:36 GMT Message-Id: <202402121853.41CIra1Q030362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a78bc42bcc31 - main - reboot: Disallow -k and -r, it doesn't make sense. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a78bc42bcc31f04fdb3319f7b11c6d8da5a30bee Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a78bc42bcc31f04fdb3319f7b11c6d8da5a30bee commit a78bc42bcc31f04fdb3319f7b11c6d8da5a30bee Author: Warner Losh AuthorDate: 2024-02-12 18:44:43 +0000 Commit: Warner Losh CommitDate: 2024-02-12 18:44:43 +0000 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 --- sbin/reboot/reboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 7daf38b88a3e..90c67caf9d07 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -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);