RES_ITEM msgs_items[] = {
{"Name", store_name, ITEM(res_msgs.hdr.name), 0, 0, 0},
{"Description", store_str, ITEM(res_msgs.hdr.desc), 0, 0, 0},
- {"MailCommand", store_str, ITEM(res_msgs.mail_cmd), 0, 0, 0},
- {"OperatorCommand", store_str, ITEM(res_msgs.operator_cmd), 0, 0, 0},
+ {"MailCommand", store_str, ITEM(res_msgs.mail_cmd), 0, ITEM_ALLOW_DUPS, 0},
+ {"OperatorCommand", store_str, ITEM(res_msgs.operator_cmd), 0, ITEM_ALLOW_DUPS, 0},
{"Syslog", store_msgs, ITEM(res_msgs), MD_SYSLOG, 0, 0},
{"Mail", store_msgs, ITEM(res_msgs), MD_MAIL, 0, 0},
{"MailOnError", store_msgs, ITEM(res_msgs), MD_MAIL_ON_ERROR, 0, 0},
{
lex_get_token(lc, T_STRING);
if (pass == 1) {
+ if (*(item->value) && (item->flags & ITEM_ALLOW_DUPS)) {
+ free(*(item->value));
+ *(item->value) = NULL;
+ }
if (*(item->value)) {
scan_err5(lc, _("Attempt to redefine \"%s\" from \"%s\" to \"%s\" referenced on line %d : %s\n"),
item->name, *(item->value), lc->str, lc->line_no, lc->line);
#define MAX_RES_NAME_LENGTH MAX_NAME_LENGTH-1 /* maximum resource name length */
-#define ITEM_REQUIRED 0x1 /* item required */
-#define ITEM_DEFAULT 0x2 /* default supplied */
-#define ITEM_NO_EQUALS 0x4 /* Don't scan = after name */
-#define ITEM_LAST 0x8 /* Last item in list */
+/* Permitted bits in Flags field */
+#define ITEM_REQUIRED (1<<0) /* item required */
+#define ITEM_DEFAULT (1<<1) /* default supplied */
+#define ITEM_NO_EQUALS (1<<2) /* Don't scan = after name */
+#define ITEM_LAST (1<<3) /* Last item in list */
+#define ITEM_ALLOW_DUPS (1<<4) /* Allow duplicate directives */
/* Message Resource */
class MSGS {