libnm,vpn-editor-plugin: don't assert the plugin name is the same as service name
It's not. It's meant to be human readable (e.g. "IPSec network that sometimes works").
This commit is contained in:
@@ -83,8 +83,6 @@ nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
|||||||
* If the path is not an absolute path or no matching module
|
* If the path is not an absolute path or no matching module
|
||||||
* can be found, lookup inside a directory defined at compile time.
|
* can be found, lookup inside a directory defined at compile time.
|
||||||
* Due to this, @check_file might be called for two different paths.
|
* Due to this, @check_file might be called for two different paths.
|
||||||
* @check_name: if not-null, check that the loaded plugin has
|
|
||||||
* the given name.
|
|
||||||
* @check_service: if not-null, check that the loaded plugin advertises
|
* @check_service: if not-null, check that the loaded plugin advertises
|
||||||
* the given service.
|
* the given service.
|
||||||
* @check_owner: if non-negative, check whether the file is owned
|
* @check_owner: if non-negative, check whether the file is owned
|
||||||
@@ -105,7 +103,6 @@ nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
|||||||
*/
|
*/
|
||||||
NMVpnEditorPlugin *
|
NMVpnEditorPlugin *
|
||||||
nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
|
nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
|
||||||
const char *check_name,
|
|
||||||
const char *check_service,
|
const char *check_service,
|
||||||
int check_owner,
|
int check_owner,
|
||||||
NMUtilsCheckFilePredicate check_file,
|
NMUtilsCheckFilePredicate check_file,
|
||||||
@@ -160,11 +157,11 @@ nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
|
|||||||
NM_VPN_EDITOR_PLUGIN_SERVICE, &plug_service,
|
NM_VPN_EDITOR_PLUGIN_SERVICE, &plug_service,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (check_name && g_strcmp0 (plug_name, check_name) != 0) {
|
if (!plug_name || !*plug_name) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
NM_VPN_PLUGIN_ERROR,
|
NM_VPN_PLUGIN_ERROR,
|
||||||
NM_VPN_PLUGIN_ERROR_FAILED,
|
NM_VPN_PLUGIN_ERROR_FAILED,
|
||||||
_("cannot load VPN plugin in '%s': invalid plugin name"),
|
_("cannot load VPN plugin in '%s': missing plugin name"),
|
||||||
g_module_name (module));
|
g_module_name (module));
|
||||||
} else if ( check_service
|
} else if ( check_service
|
||||||
&& g_strcmp0 (plug_service, check_service) != 0) {
|
&& g_strcmp0 (plug_service, check_service) != 0) {
|
||||||
|
@@ -141,7 +141,6 @@ char *nm_vpn_editor_plugin_get_suggested_filename (NMVpnEditorPlugin *pl
|
|||||||
|
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
NMVpnEditorPlugin *nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
|
NMVpnEditorPlugin *nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
|
||||||
const char *check_name,
|
|
||||||
const char *check_service,
|
const char *check_service,
|
||||||
int check_owner,
|
int check_owner,
|
||||||
NMUtilsCheckFilePredicate check_file,
|
NMUtilsCheckFilePredicate check_file,
|
||||||
|
@@ -743,7 +743,6 @@ nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self, GError **error)
|
|||||||
|
|
||||||
priv->editor_plugin_loaded = TRUE;
|
priv->editor_plugin_loaded = TRUE;
|
||||||
priv->editor_plugin = nm_vpn_editor_plugin_load_from_file (plugin_filename,
|
priv->editor_plugin = nm_vpn_editor_plugin_load_from_file (plugin_filename,
|
||||||
priv->name,
|
|
||||||
nm_vpn_plugin_info_get_service (self),
|
nm_vpn_plugin_info_get_service (self),
|
||||||
getuid (),
|
getuid (),
|
||||||
NULL,
|
NULL,
|
||||||
|
Reference in New Issue
Block a user