2 This patch fixes bug #1211 crash during reload with bad dird.conf file.
4 Apply it to version 2.4.4 with:
7 patch -p0 <2.4.4-reload.patch
8 ./configure <your options>
14 Index: src/lib/parse_conf.c
15 ===================================================================
16 --- src/lib/parse_conf.c (revision 8393)
17 +++ src/lib/parse_conf.c (working copy)
20 if (token != T_EQUALS) {
21 scan_err1(lc, _("expected an =, got: %s"), lc->str);
27 Dmsg1(900, "store_msgs dest=%s:\n", NPRT(dest));
28 if (token != T_EQUALS) {
29 scan_err1(lc, _("expected an =, got: %s"), lc->str);
32 scan_types(lc, (MSGS *)(item->value), item->code, dest, NULL);
33 free_pool_memory(dest);
37 scan_err1(lc, _("Unknown item code: %d\n"), item->code);
46 scan_err1(lc, _("message type: %s not found"), str);
51 if (msg_type == M_MAX+1) { /* all? */
53 lex_get_token(lc, T_NAME);
54 if (!is_name_valid(lc->str, &msg)) {
55 scan_err1(lc, "%s\n", msg);
58 free_pool_memory(msg);
59 /* Store the name both pass 1 and pass 2 */
61 scan_err2(lc, _("Attempt to redefine name \"%s\" to \"%s\"."),
62 *(item->value), lc->str);
65 *(item->value) = bstrdup(lc->str);
69 scan_err3(lc, _("Could not find config Resource %s referenced on line %d : %s\n"),
70 lc->str, lc->line_no, lc->line);
74 scan_err3(lc, _("Attempt to redefine resource \"%s\" referenced on line %d : %s\n"),
75 item->name, lc->line_no, lc->line);
78 *(item->value) = (char *)res;
82 scan_err4(lc, _("Too many %s directives. Max. is %d. line %d: %s\n"),
83 lc->str, count, lc->line_no, lc->line);
86 list = New(alist(10, not_owned_by_alist));
90 scan_err3(lc, _("Could not find config Resource \"%s\" referenced on line %d : %s\n"),
91 item->name, lc->line_no, lc->line);
94 Dmsg5(900, "Append %p to alist %p size=%d i=%d %s\n",
95 res, list, list->size(), i, item->name);
98 scan_err3(lc, _("Missing config Resource \"%s\" referenced on line %d : %s\n"),
99 lc->str, lc->line_no, lc->line);
104 @@ -655,12 +664,13 @@
106 if (!size_to_uint64(bsize, strlen(bsize), &uvalue)) {
107 scan_err1(lc, _("expected a size number, got: %s"), lc->str);
110 *(uint64_t *)(item->value) = uvalue;
113 scan_err1(lc, _("expected a size, got: %s"), lc->str);
117 if (token != T_EOL) {
119 @@ -697,12 +707,13 @@
121 if (!duration_to_utime(period, &utime)) {
122 scan_err1(lc, _("expected a time period, got: %s"), period);
125 *(utime_t *)(item->value) = utime;
128 scan_err1(lc, _("expected a time period, got: %s"), lc->str);
132 if (token != T_EOL) {
135 *(uint32_t *)(item->value) &= ~(item->code);
137 scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */
141 set_bit(index, res_all.hdr.item_present);
143 *(bool *)(item->value) = false;
145 scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */
149 set_bit(index, res_all.hdr.item_present);
153 scan_err1(lc, _("Expected a Tape Label keyword, got: %s"), lc->str);
157 set_bit(index, res_all.hdr.item_present);
159 Dmsg0(900, "T_EOB => define new resource\n");
160 if (res_all.hdr.name == NULL) {
161 scan_err0(lc, _("Name not specified for resource"));
164 save_resource(res_type, items, pass); /* save resource */