summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-02 19:20:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-02 19:20:04 +0900
commit9238f87e05ec891d87fb0080922df0f9e7e7e11f (patch)
tree38cbe1176dfcea28819a396fd9f80e86dc455822
parent7217133861bc380e63475f5756663cb462d1d94b (diff)
elm map - fix module load craziness loading all elm modules
so elm map loads every module it can find in a recursive dir walk of all elm modules. this si nuts. this can accidentallly load OLD modules and thats a recipe for disaster. so check module arch dir aagainst module arch string to load the right version and be quiet if module doesn thave the right symbols - it's the wrong module type. @fix
-rw-r--r--src/lib/elm_map.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index b799c7e93..8a3101894 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -3451,6 +3451,8 @@ _source_mod_cb(Eina_Module *m,
3451{ 3451{
3452 const char *file; 3452 const char *file;
3453 Elm_Map_Data *sd = data; 3453 Elm_Map_Data *sd = data;
3454 char *dir;
3455 const char *subfile;
3454 3456
3455 Elm_Map_Module_Source_Name_Func name_cb; 3457 Elm_Map_Module_Source_Name_Func name_cb;
3456 Elm_Map_Module_Tile_Url_Func tile_url_cb; 3458 Elm_Map_Module_Tile_Url_Func tile_url_cb;
@@ -3465,17 +3467,28 @@ _source_mod_cb(Eina_Module *m,
3465 EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE); 3467 EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
3466 3468
3467 file = eina_module_file_get(m); 3469 file = eina_module_file_get(m);
3468 if (!eina_module_load(m)) 3470 if (!file) return EINA_FALSE;
3471
3472 dir = ecore_file_dir_get(file);
3473 if (!dir) return EINA_FALSE;
3474 subfile = ecore_file_file_get(dir);
3475 if (!subfile)
3476 {
3477 free(dir);
3478 return EINA_FALSE;
3479 }
3480 if (strcmp(subfile, MODULE_ARCH))
3469 { 3481 {
3470 ERR("Could not load module \"%s\": %s", file, 3482 free(dir);
3471 eina_error_msg_get(eina_error_get()));
3472 return EINA_FALSE; 3483 return EINA_FALSE;
3473 } 3484 }
3485 free(dir);
3486
3487 if (!eina_module_load(m)) return EINA_FALSE;
3488
3474 name_cb = eina_module_symbol_get(m, "map_module_source_name_get"); 3489 name_cb = eina_module_symbol_get(m, "map_module_source_name_get");
3475 if ((!name_cb)) 3490 if ((!name_cb))
3476 { 3491 {
3477 WRN("Could not find map module name from module \"%s\": %s",
3478 file, eina_error_msg_get(eina_error_get()));
3479 eina_module_unload(m); 3492 eina_module_unload(m);
3480 return EINA_FALSE; 3493 return EINA_FALSE;
3481 } 3494 }