summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-12-09 10:32:23 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-12-09 10:32:23 +0100
commitb6df9ba1ca4850e03f8ecb6c2a571838e1912fba (patch)
treef8b676b8b16bd5836cbd933a749bb8e8c02701e1 /database
parent02e01e3cf3d83e286be10c97dd23b9c6dce8f182 (diff)
downloadeurephia-b6df9ba1ca4850e03f8ecb6c2a571838e1912fba.tar.gz
eurephia-b6df9ba1ca4850e03f8ecb6c2a571838e1912fba.tar.xz
eurephia-b6df9ba1ca4850e03f8ecb6c2a571838e1912fba.zip
eurephiadb init: Only setup the requiered function pointers in driver
This is ment as a security enhancement. Do not setup the function pointers to functions which is not needed for the requested minimum driver API version. Calling any of these functions which is not set up would then cause a SEGV. In real life, this means that the eurephia-auth.so which only needs API version 1 now will not setup any pointers to the API version 2, which the eurephiadm utility needs. In the future it should be a 4th argument to the eDBlink_init(...), defining features to enable when loading the drivers. This should be a bitwise mask. So that API version can change whenever the driver includes more functions. But for now, this change is enough.
Diffstat (limited to 'database')
-rw-r--r--database/eurephiadb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/database/eurephiadb.c b/database/eurephiadb.c
index 5588ef8..4d75020 100644
--- a/database/eurephiadb.c
+++ b/database/eurephiadb.c
@@ -86,7 +86,7 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl, const int minver)
}
// Configure functions contained in the driver, defined by API version
- switch( eDB_DriverAPIVersion() ) {
+ switch( (eDB_DriverAPIVersion() > minver ? minver : eDB_DriverAPIVersion()) ) {
default:
eurephia_log(ctx, LOG_WARNING, 0,
"eurephiaDB driver API is newer than the running eurephia version. Consider "