Changeset 2985
- Timestamp:
- 11/07/08 04:18:29 (2 months ago)
- Files:
-
- openwsman/trunk/src/lib/wsman-plugins.c (modified) (1 diff)
- openwsman/trunk/src/lib/wsman-server.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openwsman/trunk/src/lib/wsman-plugins.c
r1842 r2985 109 109 self->p_name = u_strdup(p_name) ; 110 110 if (NULL != (self->p_handle = dlopen(p_name, RTLD_LAZY))) { 111 if ( ! dlsym(self->p_handle, "get_endpoints") 112 && dlsym(self->p_handle, "init")) 111 self->init = dlsym(self->p_handle, "init"); 112 self->get_endpoints = dlsym(self->p_handle, "get_endpoints"); 113 if ( ! self->get_endpoints 114 && ! self->init) 113 115 { 114 116 self->init = 0 ; 115 PluginError = PLUGIN_ERROR_SYMBOLSNOTFOUND ;117 PluginError = PLUGIN_ERROR_SYMBOLSNOTFOUND ; 116 118 } 117 119 } else { openwsman/trunk/src/lib/wsman-server.c
r2326 r2985 115 115 while (node) { 116 116 WsManPlugin *p = (WsManPlugin *) node->list_data; 117 p->ifc = 118 (WsDispatchInterfaceInfo *) 119 malloc(sizeof(WsDispatchInterfaceInfo)); 120 117 if (p->init == NULL 118 || p->init(p->p_handle, &(p->data)) == 0 ) { 119 error ("Plugin fails init()"); 120 error("invalid plugin"); 121 goto next_plugin; 122 } 123 124 p->ifc = (WsDispatchInterfaceInfo *) 125 malloc(sizeof(WsDispatchInterfaceInfo)); 126 ifcinfo = p->ifc; 127 ifcinfo->extraData = p->data; 121 128 p->set_config = dlsym(p->p_handle, "set_config"); 122 p->get_endpoints = dlsym(p->p_handle, "get_endpoints");123 124 129 125 130 if (listener->config && p->set_config) { … … 132 137 p->get_endpoints(p->p_handle, p->ifc); 133 138 134 ifcinfo = p->ifc;135 139 if (p->ifc && wsman_server_verify_plugin(ifcinfo)) { 136 140 lnode_t *i = lnode_create(p->ifc); … … 138 142 } else { 139 143 error ("Plugin is not compatible with version of the software or plugin is invalid"); 140 error("invalid plugins"); 141 } 144 error("invalid plugin"); 145 } 146 next_plugin: 142 147 node = list_next(listener->plugins, node); 143 148 }
