mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Bug #11754014: 45549: udf plugin_dir path separator inconsistency
and cryptic error 1126 message The problem was that dlopen() related code was using just a subset of the path normalization routines used in other places. Fixed the expansion of the pre-dlopen() behavior for plugins and UDFs to use a platform-dependent consistent encoding of the paths. Fixed the error dlopen() error handling to take the correct error message and strip off the trailing newline character(s). Fixed tests to do a platform independent replace of directories and to account for the traling slash.
This commit is contained in:
@ -463,18 +463,22 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
|
||||
dlpathlen=
|
||||
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
|
||||
dlpath;
|
||||
(void) unpack_filename(dlpath, dlpath);
|
||||
plugin_dl.ref_count= 1;
|
||||
/* Open new dll handle */
|
||||
if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
|
||||
{
|
||||
const char *errmsg=dlerror();
|
||||
const char *errmsg;
|
||||
int error_number= dlopen_errno;
|
||||
DLERROR_GENERATE(errmsg, error_number);
|
||||
|
||||
if (!strncmp(dlpath, errmsg, dlpathlen))
|
||||
{ // if errmsg starts from dlpath, trim this prefix.
|
||||
errmsg+=dlpathlen;
|
||||
if (*errmsg == ':') errmsg++;
|
||||
if (*errmsg == ' ') errmsg++;
|
||||
}
|
||||
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
|
||||
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, error_number, errmsg);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
/* Determine interface version */
|
||||
|
Reference in New Issue
Block a user