From: Michal Rakowski Date: Tue, 26 Jan 2021 13:17:35 +0000 (+0100) Subject: Fix #7222 About 'yes' parameter for 'label barcodes' command X-Git-Tag: Release-11.3.2~764 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b2de9861bc091459314419138a703fb8b8e3c4d;p=thirdparty%2Fbacula.git Fix #7222 About 'yes' parameter for 'label barcodes' command --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 1ae44956d..28a3b5d99 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -129,7 +129,7 @@ static struct cmdstruct commands[] = { /* C "\n\tsetbandwidth setdebug setip show sqlquery time trace unmount\n\tumount update use var version wait" "\n\tsnapshot cloud " DEDUP_KW), false}, - { NT_("label"), label_cmd, _("Label a tape"), NT_("storage= volume= pool= slot= drive= barcodes"), false}, + { NT_("label"), label_cmd, _("Label a tape"), NT_("storage= volume= pool= slot= drive= barcodes [yes]"), false}, { NT_("list"), list_cmd, _("List objects from catalog"), NT_("jobs [client=] [jobid=] [ujobid=] [job=] [tag=] [joberrors] [jobstatus=] [level=] [jobtype=] [limit=] [order=]|\n" "\tjobtotals | pools | volume | media | files [type=] jobid= | copies jobid= |\n" diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index c464d6e38..5c146dbbf 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -544,10 +544,12 @@ static void label_from_barcodes(UAContext *ua, int drive) } ua->send_msg("%4d %s\n", vl->Slot, vl->VolName); } - if (!get_yesno(ua, _("Do you want to label these Volumes? (yes|no): ")) || - (ua->pint32_val == 0)) { - goto bail_out; - } + if ((find_arg(ua, "yes") < 0) && + (!get_yesno(ua, _("Do you want to label these Volumes? (yes|no): ")) || + (ua->pint32_val == 0))) { + goto bail_out; + } + /* Select a pool */ bmemset(&pr, 0, sizeof(pr)); if (!select_pool_dbr(ua, &pr)) {