diff options
author | Toomas Soome <tsoome@me.com> | 2022-11-29 14:12:24 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2022-12-05 21:34:39 +0200 |
commit | d094b9b6950402cc8187f6a82d3d403d3892e7e7 (patch) | |
tree | 3b23324174ce74f02ed7d547bdce0ed9e527af40 | |
parent | eaf9751f5dce3a91368ffd99bccc978d5812e4fb (diff) | |
download | illumos-gate-d094b9b6950402cc8187f6a82d3d403d3892e7e7.tar.gz |
15201 bootadm list-menu segfaults for non-existent datasets
Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@mnx.io>
-rw-r--r-- | usr/src/cmd/boot/bootadm/bootadm_loader.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/src/cmd/boot/bootadm/bootadm_loader.c b/usr/src/cmd/boot/bootadm/bootadm_loader.c index 2d15fdbc42..a9dde19132 100644 --- a/usr/src/cmd/boot/bootadm/bootadm_loader.c +++ b/usr/src/cmd/boot/bootadm/bootadm_loader.c @@ -766,6 +766,11 @@ bam_mount_be(menu_entry_t *entry, char **dir) if (strcmp(be_node->be_root_ds, entry->me_bootfs) == 0) break; + if (be_node == NULL) { + ret = BE_ERR_BE_NOENT; + goto out; + } + if (nvlist_add_string(be_attrs, BE_ATTR_ORIG_BE_NAME, be_node->be_node_name) != 0) { ret = BE_ERR_NOMEM; @@ -843,7 +848,8 @@ list_menu_entry(menu_entry_t *entry, char *setting) (void) rmdir(dir); free(dir); } - bam_error(_("%s is not mounted\n"), entry->me_title); + bam_error(_("%s is not mounted: %s\n"), entry->me_title, + be_err_to_str(mounted)); return (BAM_ERROR); } |