Hello,
I have the problem, when file "libsqlite3.so" is not installed in the folder /lib then the database would not work.
I have copy this SO into the same folder from the application, but it does not work.
I want make a application where can run with a simple USB Stick without installation. In Windows, it works fine. But in Linux the system seek only in the folder /lib.
Can I do alter the file ZPlainSqlLiteDriver.pas:
constructor TZSQLite3PlainDriver.Create;
begin
inherited Create;
{$IFNDEF UNIX}
FLoader.AddLocation(WINDOWS_DLL3_LOCATION);
{$ELSE}
if FileExists('./' + LINUX_DLL3_LOCATION) then
FLoader.AddLocation('./' + LINUX_DLL3_LOCATION)
else
FLoader.AddLocation(LINUX_DLL3_LOCATION);
{$ENDIF}
end;
What think you about this?
Is it possible include it into V7.0.1 ?
Thanks for answer, regards Markus
Update for SQLite for Linux
Moderators: gto, EgonHugeist, olehs
Why is it a security risc?
For exaple, there gives a lot of other tools who want running on USB Stick without installation and use SQLite. I want build so an application.
One customer have an problem with the SQLite SO file, I have write him to do:
sudo apt-get install sqlite3
but the install said, all are allready existing, but zeos said, the libsqlite3.so file is not found.
When Zeos find the so file in the same folder as the application is, then there where no Problem. I'm not a linux expert, the costomer have need 3 days to find out the mistake.
I want make more easy my application. I have change my ZEOS code and it works fine.
For exaple, there gives a lot of other tools who want running on USB Stick without installation and use SQLite. I want build so an application.
One customer have an problem with the SQLite SO file, I have write him to do:
sudo apt-get install sqlite3
but the install said, all are allready existing, but zeos said, the libsqlite3.so file is not found.
When Zeos find the so file in the same folder as the application is, then there where no Problem. I'm not a linux expert, the costomer have need 3 days to find out the mistake.
I want make more easy my application. I have change my ZEOS code and it works fine.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
mmvisual,
I'm not sure it's a security hazard either. But if somebody can help us with the real 'UNIX/LINUX way' we should use that method, I believe.
You can make your code easier:
Testing for existance is done automatically.
BTW : I'm looking for someone who can help me making 'Adding locations' possible from outside the zeoslib code. If you can find a way to implement this I hope you can share this with us.
Mark
I'm not sure it's a security hazard either. But if somebody can help us with the real 'UNIX/LINUX way' we should use that method, I believe.
You can make your code easier:
Code: Select all
{$IFNDEF UNIX}
FLoader.AddLocation(WINDOWS_DLL3_LOCATION);
{$ELSE}
FLoader.AddLocation('./' + LINUX_DLL3_LOCATION)
FLoader.AddLocation(LINUX_DLL3_LOCATION);
{$ENDIF}
BTW : I'm looking for someone who can help me making 'Adding locations' possible from outside the zeoslib code. If you can find a way to implement this I hope you can share this with us.
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Markus,
I'm not trying to make it more difficult for you, but I'm not adding this code without some more background information on how LINUX loads a library when no full or relative path is passed to the call dlopen(Modulename, RTLD_GLOBAL) with RTLD_GLOBAL=$101
In windows the search order is clear : current dir of application exe and then the system path is checked.
How does this work in LINUX?
If the answer turns out the only way to have Windows-like behaviour is adding the './' location, I'll do so. But some more reading has to be done now...
Mark
I'm not trying to make it more difficult for you, but I'm not adding this code without some more background information on how LINUX loads a library when no full or relative path is passed to the call dlopen(Modulename, RTLD_GLOBAL) with RTLD_GLOBAL=$101
In windows the search order is clear : current dir of application exe and then the system path is checked.
How does this work in LINUX?
If the answer turns out the only way to have Windows-like behaviour is adding the './' location, I'll do so. But some more reading has to be done now...
Mark