mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
[master] remove "none" from log messages when parsing global config
4309. [cleanup] Remove the spurious "none" filename from log messages when processing built-in configuration. [RT #41594]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
4309. [cleanup] Remove the spurious "none" filename from log messages
|
||||||
|
when processing built-in configuration. [RT #41594]
|
||||||
|
|
||||||
4308. [func] Added operating system details to "named -V"
|
4308. [func] Added operating system details to "named -V"
|
||||||
output. [RT #41452]
|
output. [RT #41452]
|
||||||
|
|
||||||
|
@@ -167,6 +167,7 @@ struct cfg_obj {
|
|||||||
isc_refcount_t references; /*%< reference counter */
|
isc_refcount_t references; /*%< reference counter */
|
||||||
const char * file;
|
const char * file;
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
|
cfg_parser_t * pctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2715,13 +2715,15 @@ cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
|
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
|
||||||
isc_log_write(lctx, CAT, MOD, level,
|
|
||||||
"%s:%u: %s",
|
|
||||||
obj->file == NULL ? "<unknown file>" : obj->file,
|
|
||||||
obj->line, msgbuf);
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
|
if (have_current_file(obj->pctx)) {
|
||||||
|
isc_log_write(lctx, CAT, MOD, level,
|
||||||
|
"%s:%u: %s", obj->file, obj->line, msgbuf);
|
||||||
|
} else {
|
||||||
|
isc_log_write(lctx, CAT, MOD, level, "%s", msgbuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
@@ -2742,15 +2744,19 @@ cfg_create_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
|
|||||||
obj = isc_mem_get(pctx->mctx, sizeof(cfg_obj_t));
|
obj = isc_mem_get(pctx->mctx, sizeof(cfg_obj_t));
|
||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
|
|
||||||
obj->type = type;
|
obj->type = type;
|
||||||
obj->file = current_file(pctx);
|
obj->file = current_file(pctx);
|
||||||
obj->line = pctx->line;
|
obj->line = pctx->line;
|
||||||
|
obj->pctx = pctx;
|
||||||
|
|
||||||
result = isc_refcount_init(&obj->references, 1);
|
result = isc_refcount_init(&obj->references, 1);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
isc_mem_put(pctx->mctx, obj, sizeof(cfg_obj_t));
|
isc_mem_put(pctx->mctx, obj, sizeof(cfg_obj_t));
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
*ret = obj;
|
*ret = obj;
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user