From 29d1c1cd0206974f2c780ab1d73dffc931b6e9ff Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 30 Sep 2016 14:02:11 +0200 Subject: [PATCH] Fix junk in print of resource[rindex] + tweak the messages --- bacula/src/console/console_conf.c | 6 +++--- bacula/src/dird/dird_conf.c | 18 +++++++++--------- bacula/src/filed/filed_conf.c | 8 ++++---- bacula/src/lib/parse_conf.c | 2 +- bacula/src/qt-console/bat_conf.cpp | 6 +++--- .../src/qt-console/tray-monitor/tray_conf.cpp | 8 ++++---- bacula/src/stored/stored_conf.c | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/bacula/src/console/console_conf.c b/bacula/src/console/console_conf.c index 202c21eaf6..8eee61926c 100644 --- a/bacula/src/console/console_conf.c +++ b/bacula/src/console/console_conf.c @@ -252,8 +252,8 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } } @@ -315,7 +315,7 @@ void save_resource(int type, RES_ITEM *items, int pass) last = next; if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"\"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->res_dir.hdr.name); } } diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 64a1b40775..0dec091aba 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2015 Kern Sibbald + Copyright (C) 2000-2016 Kern Sibbald The original author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -1464,13 +1464,13 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("Too many directive in \"%s\" resource\n"), resources[rindex].name); } } } else if (type == R_JOB) { @@ -1479,8 +1479,8 @@ void save_resource(int type, RES_ITEM *items, int pass) */ if (items[0].flags & ITEM_REQUIRED) { if (!bit_is_set(0, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[0].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[0].name, resources[rindex].name); } } } @@ -1695,15 +1695,15 @@ void save_resource(int type, RES_ITEM *items, int pass) } else { RES *next, *last; if (res->res_dir.hdr.name == NULL) { - Emsg1(M_ERROR_TERM, 0, _("Name item is required in %s resource, but not found.\n"), - resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("A Name directive is required in \"%s\" resource, but not found.\n"), + resources[rindex].name); } /* Add new res to end of chain */ for (last=next=res_head[rindex]; next; next=next->next) { last = next; if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->res_dir.hdr.name); } } diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index 71fbf5bb7e..a091bbaba0 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -1,7 +1,7 @@ /* Bacula(R) - The Network Backup Solution - Copyright (C) 2000-2015 Kern Sibbald + Copyright (C) 2000-2016 Kern Sibbald The original author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -446,8 +446,8 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } } @@ -533,7 +533,7 @@ void save_resource(int type, RES_ITEM *items, int pass) last = next; if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->res_dir.hdr.name); } } diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index c00a4e642e..1da62d6306 100644 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -208,7 +208,7 @@ static void init_resource(CONFIG *config, int type, RES_ITEM *items, int pass) } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("Too many directives in \"%s\" resource\n"), resources[rindex].name); } } } diff --git a/bacula/src/qt-console/bat_conf.cpp b/bacula/src/qt-console/bat_conf.cpp index 0f8dcc2c9b..c240ed6ca0 100644 --- a/bacula/src/qt-console/bat_conf.cpp +++ b/bacula/src/qt-console/bat_conf.cpp @@ -258,8 +258,8 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.dir_res.hdr.item_present)) { - Emsg2(M_ABORT, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ABORT, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } } @@ -327,7 +327,7 @@ void save_resource(int type, RES_ITEM *items, int pass) last = next; if (strcmp(next->name, res->dir_res.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->dir_res.hdr.name); } } diff --git a/bacula/src/qt-console/tray-monitor/tray_conf.cpp b/bacula/src/qt-console/tray-monitor/tray_conf.cpp index a1e35ce7ff..6fab08f6ea 100644 --- a/bacula/src/qt-console/tray-monitor/tray_conf.cpp +++ b/bacula/src/qt-console/tray-monitor/tray_conf.cpp @@ -276,13 +276,13 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("Too many directives in \"%s\" resource\n"), resources[rindex].name); } } @@ -360,7 +360,7 @@ void save_resource(int type, RES_ITEM *items, int pass) last = next; if (strcmp(next->name, res->res_monitor.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->res_monitor.hdr.name); } } diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index c903c39d6e..99da6309ab 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -575,13 +575,13 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("\"%s\" item is required in \"%s\" resource, but not found.\n"), - items[i].name, resources[rindex]); + Emsg2(M_ERROR_TERM, 0, _("\"%s\" directive is required in \"%s\" resource, but not found.\n"), + items[i].name, resources[rindex].name); } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ERROR_TERM, 0, _("Too many items in \"%s\" resource\n"), resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("Too many directives in \"%s\" resource\n"), resources[rindex].name); } } @@ -689,7 +689,7 @@ void save_resource(int type, RES_ITEM *items, int pass) last = next; if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + _("Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n"), resources[rindex].name, res->res_dir.hdr.name); } } -- 2.39.5