Bug 254441 - bectl should prevent creating BEs with unbootable names
Summary: bectl should prevent creating BEs with unbootable names
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Wing
URL: https://reviews.freebsd.org/D30194
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-20 19:41 UTC by probono
Modified: 2021-06-11 18:04 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description probono 2021-03-20 19:41:31 UTC
bectl should pervent users from using names for Boot Environments that cannot be booted.

Example:
sudo -A -E bectl create "$(uname -v) $(date '+%Y-%m-%d-%H%M%S')"
created a Boot Environment called
FreeBSD 12.1-RELEASE-p13 GENERIC 2021-03-20-192857
which turned out to be unbootable, presumably due to the spaces and possibly other special characters in the name.
Comment 1 Graham Perrin 2021-03-20 19:51:51 UTC
Context: <https://github.com/helloSystem/Utilities/issues/33#issuecomment-803451767>

Please provide output from these two commands: 

bectl -c creation -s

bectl -s
Comment 2 Graham Perrin 2021-03-20 19:54:18 UTC
(In reply to Graham Perrin from comment #1)

Sorry, these four: 

bectl list -c creation

bectl list -c creation -s

beadm list

beadm list -s
Comment 4 commit-hook freebsd_committer 2021-06-03 16:48:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0e6549c8745049e3d6fba3ad748034de2d5cbd2a

commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2021-06-03 16:36:11 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2021-06-03 16:36:11 +0000

    bectl(8): don't allow creation of boot environments with spaces

    Boot environment datasets that contain spaces are not bootable.

    When a user attempts to create a boot environment with a space, abort
    the creation and print an error message.

    PR:             254441
    Reviewed by:    allanjude
    Differential Revision:  https://reviews.freebsd.org/D30194

 sbin/bectl/bectl.c             | 9 ++++++++-
 sbin/bectl/tests/bectl_test.sh | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 5 commit-hook freebsd_committer 2021-06-11 17:59:35 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=01cf73198d1e0b3d00f9bb75027e75327c2c5b9b

commit 01cf73198d1e0b3d00f9bb75027e75327c2c5b9b
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2021-06-03 16:36:11 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2021-06-11 17:28:41 +0000

    bectl(8): don't allow creation of boot environments with spaces

    Boot environment datasets that contain spaces are not bootable.

    When a user attempts to create a boot environment with a space, abort
    the creation and print an error message.

    PR:             254441
    Reviewed by:    allanjude
    Differential Revision:  https://reviews.freebsd.org/D30194

    (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a)

 sbin/bectl/bectl.c             | 9 ++++++++-
 sbin/bectl/tests/bectl_test.sh | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer 2021-06-11 18:03:37 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1dfdff10967d294f8c9acb22812380901be3f80

commit e1dfdff10967d294f8c9acb22812380901be3f80
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2021-06-03 16:36:11 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2021-06-11 17:41:51 +0000

    bectl(8): don't allow creation of boot environments with spaces

    Boot environment datasets that contain spaces are not bootable.

    When a user attempts to create a boot environment with a space, abort
    the creation and print an error message.

    PR:             254441
    Reviewed by:    allanjude
    Differential Revision:  https://reviews.freebsd.org/D30194

    (cherry picked from commit 0e6549c8745049e3d6fba3ad748034de2d5cbd2a)

 sbin/bectl/bectl.c             | 9 ++++++++-
 sbin/bectl/tests/bectl_test.sh | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)