postgresql/src/backend
Tom Lane ef47d284db Reject empty names and recursion in config-file include directives.
An empty file name or subdirectory name leads join_path_components() to
just produce the parent directory name, which leads to weird failures or
recursive inclusions.  Let's throw a specific error for that.  It takes
only slightly more code to detect all-blank names, so do so.

Also, detect direct recursion, ie a file calling itself.  As coded
this will also detect recursion via "include_dir '.'", which is
perhaps more likely than explicitly including the file itself.

Detecting indirect recursion would require API changes for guc-file.l
functions, which seems not worth it since extensions might call them.
The nesting depth limit will catch such cases eventually, just not
with such an on-point error message.

In passing, adjust the example usages in postgresql.conf.sample
to perhaps eliminate the problem at the source: there's no reason
for the examples to suggest that an empty value is valid.

Per a trouble report from Brent Bates.  Back-patch to 9.5; the
issue is old, but the code in 9.4 is enough different that the
patch doesn't apply easily, and it doesn't seem worth the trouble
to fix there.

Ian Barwick and Tom Lane

Discussion: https://postgr.es/m/8c8bcbca-3bd9-dc6e-8986-04a5abdef142@2ndquadrant.com
2019-08-27 14:44:26 -04:00
..
access Fix bogus comment 2019-08-20 16:04:09 -04:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Require the schema qualification in pg_temp.type_name(arg). 2019-08-05 07:48:45 -07:00
commands Disallow changing an inherited column's type if not all parents changed. 2019-08-18 17:11:58 -04:00
executor Fix misleading comment in nodeIndexonlyscan.c. 2019-06-28 17:18:06 +12:00
foreign Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:45:49 -03:00
libpq Server-side fix for delayed NOTIFY and SIGTERM processing. 2018-10-19 21:39:22 -04:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:04 -08:00
nodes Add stack depth checks to key recursive functions in backend/nodes/*.c. 2018-12-10 11:12:43 -05:00
optimizer Repair logic for reordering grouping sets optimization. 2019-06-30 23:49:31 +01:00
parser Require the schema qualification in pg_temp.type_name(arg). 2019-08-05 07:48:45 -07:00
po Translation updates 2019-08-05 15:36:58 +02:00
port Cope with EINVAL and EIDRM shmat() failures in PGSharedMemoryAttach. 2019-05-10 14:56:41 -04:00
postmaster Rearrange pgstat_bestart() to avoid failures within its critical section. 2019-05-11 21:27:13 -04:00
regex Fix misoptimization of "{1,1}" quantifiers in regular expressions. 2019-05-12 18:53:43 -04:00
replication Fix typo 2019-08-21 11:12:44 -04:00
rewrite Perform RLS subquery checks as the right user when going via a view. 2019-04-02 08:22:48 +01:00
snowball Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
storage Remove obsolete comments about sempahores from proc.c. 2019-06-21 10:58:52 +12:00
tcop Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:43 -07:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Reject empty names and recursion in config-file include directives. 2019-08-27 14:44:26 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls.mk Translation updates 2015-02-01 23:23:40 -05:00