load_from_file


Description:

[ Version ( since = "1.2" ) ]
public static VpnEditorPlugin load_from_file (string plugin_name, string check_service, int check_owner, UtilsCheckFilePredicate check_file) throws Error

Load the shared library plugin_name and create a new VpnEditorPlugin instance via the NMVpnEditorPluginFactory function.

If plugin_name is not an absolute path name, it assumes the file is in the plugin directory of NetworkManager. In any case, the call will do certain checks on the file before passing it to dlopen. A consequence for that is, that you cannot omit the ".so" suffix as you could for load.

Parameters:

plugin_name

The path or name of the shared library to load. The path must either be an absolute filename to an existing file. Alternatively, it can be the name (without path) of a library in the plugin directory of NetworkManager.

check_service

if not-null, check that the loaded plugin advertises the given service.

check_owner

if non-negative, check whether the file is owned by UID check_owner or by root. In this case also check that the file is not writable by anybody else.

check_file

optional callback to validate the file prior to loading the shared library.

user_data

user data for check_file

Returns:

a new plugin instance or null on error.