Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102779136
D30194.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30194.diff
View Options
diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c
--- a/sbin/bectl/bectl.c
+++ b/sbin/bectl/bectl.c
@@ -233,7 +233,10 @@
bootenv = *argv;
err = BE_ERR_SUCCESS;
- if ((atpos = strchr(bootenv, '@')) != NULL) {
+ if (strchr(bootenv, ' ') != NULL)
+ /* BE datasets with spaces are not bootable */
+ err = BE_ERR_INVALIDNAME;
+ else if ((atpos = strchr(bootenv, '@')) != NULL) {
/*
* This is the "create a snapshot variant". No new boot
* environment is to be created here.
@@ -261,6 +264,10 @@
switch (err) {
case BE_ERR_SUCCESS:
break;
+ case BE_ERR_INVALIDNAME:
+ fprintf(stderr,
+ "bectl create: boot environment name must not contain spaces\n");
+ break;
default:
if (atpos != NULL)
fprintf(stderr,
diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh
--- a/sbin/bectl/tests/bectl_test.sh
+++ b/sbin/bectl/tests/bectl_test.sh
@@ -122,6 +122,10 @@
atf_check zfs create -o mountpoint=/usr -o canmount=noauto \
${zpool}/ROOT/default/usr
+ # BE datasets with spaces are not bootable, PR 254441.
+ atf_check -e not-empty -s not-exit:0 \
+ bectl -r ${zpool}/ROOT create "foo bar"
+
# Test standard creation, creation of a snapshot, and creation from a
# snapshot.
atf_check bectl -r ${zpool}/ROOT create -e default default2
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 1:54 AM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688305
Default Alt Text
D30194.diff (1 KB)
Attached To
Mode
D30194: bectl(8): don't allow creation of boot environments with spaces
Attached
Detach File
Event Timeline
Log In to Comment