adds detection of wrong names for apis
[src/app-framework-binder.git] / src / afb-api-so.c
index 693385d..bcd8dbe 100644 (file)
@@ -48,7 +48,7 @@ struct api_so_desc {
 
 static int api_timeout = 15;
 
-static const char plugin_register_function[] = "pluginAfbV1Entry";
+static const char plugin_register_function[] = "pluginAfbV1Register";
 
 static void afb_api_so_event_sender_push(struct api_so_desc *desc, const char *name, struct json_object *object)
 {
@@ -187,6 +187,10 @@ int afb_api_so_add_plugin(const char *path)
                ERROR("plugin [%s] bad prefix...", path);
                goto error3;
        }
+       if (!afb_apis_is_valid_api_name(desc->plugin->v1.prefix)) {
+               ERROR("plugin [%s] invalid prefix...", path);
+               goto error3;
+       }
        if (desc->plugin->v1.info == NULL || *desc->plugin->v1.info == 0) {
                ERROR("plugin [%s] bad description...", path);
                goto error3;