Hi,
why the libraries loaded using local_preload_libraries need to be placed
in a different subdirectory than libraries loaded using
shared_preload_libraries?
And why it does not use dynamic_library_path but a hardcoded path
'$libdir/plugins'?
I do understand that leaving the users to load whatever libraries they
want is a bad idea, but when the library is loaded from postgresql.conf
it should be safe.
Therefore I'd expect / propose this behaviour:
1) libs loaded from shared_preload_libraries/local_preload_libraries
- any paths are allowed (relative and absolute)
- relative paths are resolved using dynamic_library_path if
specified, $libdir otherwise
- absolute paths are allowed, may load libraries from other locations
2) libs loaded using LOAD
- check that the library is loaded from dynamic_library_path (if
specified), $libdir otherwise
AFAIK this prevents '..' type attacks and makes it easier to install
extensions (shared libs are installed to $libdir, so if you need to load
a library using local_preload_libraries, you have to copy it manually).
Tomas
Responses
pgsql-hackers by date
| Next: | From: Magnus Hagander | Date: 2011-12-03 14:59:46 |
| Subject: Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64 |
| Previous: | From: NISHIYAMA Tomoaki | Date: 2011-12-03 14:49:47 |
| Subject: Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64 |