diff options
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r-- | src/backend/utils/misc/guc-file.l | 5 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 88245475d1c..f7e4457dedc 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -202,7 +202,7 @@ ParseConfigFile(const char *config_file, bool strict, * avoid dumping core due to stack overflow if an include file loops back * to itself. The maximum nesting depth is pretty arbitrary. */ - if (depth > 10) + if (depth > CONF_FILE_MAX_DEPTH) { ereport(elevel, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), @@ -321,7 +321,8 @@ GUC_flex_fatal(const char *msg) * Input parameters: * fp: file pointer from AllocateFile for the configuration file to parse * config_file: absolute or relative path name of the configuration file - * depth: recursion depth (should be 0 in the outermost call) + * depth: recursion depth (should be CONF_FILE_START_DEPTH in the outermost + * call) * elevel: error logging level to use * Input/Output parameters: * head_p, tail_p: head and tail of linked list of name/value pairs diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 117a2d26a0e..28313b3a94a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -44,6 +44,7 @@ #include "utils/acl.h" #include "utils/backend_status.h" #include "utils/builtins.h" +#include "utils/conffiles.h" #include "utils/float.h" #include "utils/guc_tables.h" #include "utils/memutils.h" @@ -287,7 +288,7 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) head = tail = NULL; if (!ParseConfigFile(ConfigFileName, true, - NULL, 0, 0, elevel, + NULL, 0, CONF_FILE_START_DEPTH, elevel, &head, &tail)) { /* Syntax error(s) detected in the file, so bail out */ @@ -304,7 +305,7 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) if (DataDir) { if (!ParseConfigFile(PG_AUTOCONF_FILENAME, false, - NULL, 0, 0, elevel, + NULL, 0, CONF_FILE_START_DEPTH, elevel, &head, &tail)) { /* Syntax error(s) detected in the file, so bail out */ @@ -4582,7 +4583,8 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) AutoConfFileName))); /* parse it */ - if (!ParseConfigFp(infile, AutoConfFileName, 0, LOG, &head, &tail)) + if (!ParseConfigFp(infile, AutoConfFileName, CONF_FILE_START_DEPTH, + LOG, &head, &tail)) ereport(ERROR, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("could not parse contents of file \"%s\"", |