NetworkManager/src/settings/plugins
Thomas Haller 39e97c9339 ifcfg-rh: only accept ifcfg base paths in impl_ifcfgrh_get_ifcfg_details()
Previously, we directly passed the @in_ifcfg path to find_by_path().
That means, @in_ifcfg must be the path to the base "ifcfg-" file,
not an alias or route file.

Add an additional pre-check, that the provided file name is really a
ifcfg base file.

This results in a more detailed error message when calling
GetIfcfgDetails not on the ifcfg base file. It's not that previously
the lookup would have succeeded.
2016-01-06 12:06:44 +01:00
..
ibft build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
ifcfg-rh ifcfg-rh: only accept ifcfg base paths in impl_ifcfgrh_get_ifcfg_details() 2016-01-06 12:06:44 +01:00
ifnet build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
ifupdown build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
keyfile build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
Makefile.am settings/example: remove 'example' settings plugin 2015-06-12 15:59:40 +02:00
README core: fix interface type names 2015-09-10 13:43:47 -04:00

Plugins generally have three components:

1) plugin object: manages the individual "connections", which are
  just objects wrapped around on-disk config data.  The plugin handles requests
  to add new connections via the NM D-Bus API, and also watches config
  directories for changes to configuration data.  Plugins implement the
  NMSettingsPlugin interface.  See plugin.c.

2) "connections": subclasses of NMSettingsConnection.  They handle updates to
  configuration data, deletion, etc.  See NMKeyfileConnection.

3) reader/writer code: typically a separate static library that gets linked
  into the main plugin shared object, so they can be unit tested separately
  from the plugin.  This code should read config data from disk and create
  an NMConnection from it, and be capable of taking an NMConnection and writing
  out appropriate configuration data to disk.

NM will first call the "factory" function that every module must provide, which
is nm_settings_plugin_factory().  That function creates and returns a singleton
instance of the plugin's main object, which implements NMSettingsPlugin.
That interface is implemented via the object definition in G_DEFINE_TYPE_EXTENDED
in plugin.c, which registers the interface setup function
settings_plugin_interface_init(), which when called actually sets up the vtables
for the functions defined by NMSettingsPluginInterface.  Thus there are two
entry points into the plugin:  nm_settings_plugin_factory() and
the NMSettingsPluginInterface methods.

The plugin also emits various signals (defined by NMSettingsPluginInterface)
which NetworkManager listens for.  These include notifications of new
connections if they were created via changes to the on-disk files.  The
"connection" objects can also emit signals (defined by the NMSettingsConnection
and NMConnection superclasses) when the connections' backing storage gets
changed or deleted.