diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-08-27 15:46:39 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-08-27 15:49:58 +0200 |
commit | 990c8db1827c0c96fb20cb4fbfcc9690e9b45e15 (patch) | |
tree | 39a7ff799ef58e467f7ea7ed3c9f0c04198c8680 /src/interfaces/libpq/fe-gssapi-common.h | |
parent | ef5b87b970dc28adeeb88191fbf66c9d6298b112 (diff) | |
download | postgresql-master.tar.gz postgresql-master.zip |
This patch fixes a bug in how 'load_external_function' handles
'$libdir/ prefixes in module paths.
Previously, 'load_external_function' would unconditionally strip
'$libdir/' from the beginning of the 'filename' string. This caused
an issue when the path was nested, such as "$libdir/nested/my_lib".
Stripping the prefix resulted in a path of "nested/my_lib", which
would fail to be found by the expand_dynamic_library_name function
because the original '$libdir' macro was removed.
To fix this, the code now checks for the presence of an additional
directory separator ('/' or '\') after the '$libdir/' prefix. The
prefix is only stripped if the remaining string does not contain a
separator. This ensures that simple filenames like '"$libdir/my_lib"'
are correctly handled, while nested paths are left intact for
'expand_dynamic_library_name' to process correctly.
Reported-by: Dilip Kumar <dilipbalaut@gmail.com>
Co-authored-by: Matheus Alcantara <matheusssilv97@gmail.com>
Co-authored-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAFiTN-uKNzAro4tVwtJhF1UqcygfJ%2BR%2BRL%3Db-_ZMYE3LdHoGhA%40mail.gmail.com
Diffstat (limited to 'src/interfaces/libpq/fe-gssapi-common.h')
0 files changed, 0 insertions, 0 deletions