- 12 Feb, 2019 2 commits
-
-
Thomas Haller authored
-
Thomas Haller authored
"nm-macros-interal.h" already includes <errno.h> and <string.h>. No need to include it everywhere else too.
-
- 25 Oct, 2018 1 commit
-
-
Thomas Haller authored
Previously, a "DONE\n" was required to break the loop.
-
- 22 Oct, 2018 2 commits
-
-
Lubomir Rintel authored
We're basically rather careless when parsing the auth-dialog protocol. Let's add some warning so we get an early alert when something's wrong.
-
Lubomir Rintel authored
Equals sign was picked as a continuation character arbitratily. It would simplify parsing, if we cared. DATA_KEY=some-key DATA_VAL=string =continued after a line break SECRET_KEY=key names =can have =continuations too SECRET_VAL=value DONE
-
- 17 Sep, 2018 1 commit
-
-
luz.paz authored
Remainder of typos found using `codespell -q 3 --skip="./shared,./src/systemd,*.po" -I ../NetworkManager-word-whitelist.txt` whereby whitelist consists of: ``` ans busses cace cna conexant crasher iff liftime creat nd sav technik uint ``` https://github.com/NetworkManager/NetworkManager/pull/205
-
- 04 Sep, 2018 1 commit
-
-
Thomas Haller authored
We already had nm_free_secret() to clear the secret out of a NUL terminated string. That works well for secrets which are strings, it can be used with a cleanup attribute (nm_auto_free_secret) and as a cleanup function for a GBytes. However, it does not work for secrets which are binary. For those, we must also track the length of the allocated data and clear it. Add two new structs NMSecretPtr and NMSecretBuf to help with that.
-
- 23 Aug, 2018 1 commit
-
-
Lubomir Rintel authored
NetworkManager considers a connection w/o L3 configuration fine and connected. Don't make VPN plugins commit suicide in such case.
-
- 11 Jul, 2018 1 commit
-
-
Thomas Haller authored
We commonly don't use the glib typedefs for char/short/int/long, but their C types directly. $ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l 587 $ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l 21114 One could argue that using the glib typedefs is preferable in public API (of our glib based libnm library) or where it clearly is related to glib, like during g_object_set (obj, PROPERTY, (gint) value, NULL); However, that argument does not seem strong, because in practice we don't follow that argument today, and seldomly use the glib typedefs. Also, the style guide for this would be hard to formalize, because "using them where clearly related to a glib" is a very loose suggestion. Also note that glib typedefs will always just be typedefs of the underlying C types. There is no danger of glib changing the meaning of these typedefs (because that would be a major API break of glib). A simple style guide is instead: don't use these typedefs. No manual actions, I only ran the bash script: FILES=($(git ls-files '*.[hc]')) sed -i \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\> /\1 /g' \ -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \ "${FILES[@]}"
-
- 30 Apr, 2018 1 commit
-
-
Beniamino Galvani authored
Normalize coding style by removing consecutive empty lines from C sources and headers. https://github.com/NetworkManager/NetworkManager/pull/108
-
- 08 Feb, 2018 1 commit
-
-
Lubomir Rintel authored
This makes GCC 8.0 unhappy and it is probably right about that -- it's more difficult to get things wrong when the function prototypes actually match.
-
- 16 Jan, 2018 2 commits
-
-
Thomas Haller authored
Otherwise, the only way to disconnect the NMVpnServicePlugin instance is by completely unrefing it. However, often it is not so easy to ensure that nobody else is still keeping the instance alive, after the point where we no longer want to handle D-Bus requests. nm_vpn_service_plugin_shutdown() to the rescue.
-
Thomas Haller authored
-
- 15 Jan, 2018 1 commit
-
-
Thomas Haller authored
Otherwise, we might still be called back with D-Bus requests, after the NMVpnServicePlugin instance is already destroyed.
-
- 18 Dec, 2017 1 commit
-
-
Lubomir Rintel authored
-
- 23 Nov, 2017 3 commits
-
-
Thomas Haller authored
-
Thomas Haller authored
-
Thomas Haller authored
-
- 16 Nov, 2017 1 commit
-
-
Thomas Haller authored
We also do this for libnm and libnm-core, where it causes visible changes in behavior. But if somebody would rely on the hashing implementation for hash tables, it would be seriously flawed.
-
- 08 Mar, 2017 1 commit
-
-
Thomas Haller authored
Unify marking GObject properties that are G_PARAM_CONSTRUCT_ONLY with a comment /* construct-only */
-
- 06 Feb, 2017 1 commit
-
-
Thomas Haller authored
The -Wimplicit-fallthrough=3 warning is quite flexible of accepting a fall-through warning. Some comments were missing or not detected correctly. Thereby, also change all other comments to follow the exact same pattern.
-
- 24 Nov, 2016 1 commit
-
-
Lubomir Rintel authored
We may want to stop the plugin before we started connecting e.g. when the plugin NeedsSecrets but we can't supply them.
-
- 23 Nov, 2016 1 commit
-
-
Lubomir Rintel authored
This makes it easier to install the files with proper names. Also, it makes the makefile rules slightly simpler. Lastly, the documentation is now generated into docs/api, which makes it possible to get rid of the awkward relative file names in docbook.
-
- 03 Oct, 2016 1 commit
-
-
Thomas Haller authored
sed 's#^/\*\{5\}\*\+/$#/*****************************************************************************/#' $(git grep -l '\*\{5\}' | grep '\.[hc]$') -i
-
- 16 Jun, 2016 1 commit
-
-
Thomas Haller authored
The "shared" directory contains files that are possibly used by all components of NetworkManager repository. Some of these files are even copied as-is to other projects (VPN plugins, nm-applet) and used there without modification. Move those files to a separate directory. By moving them to a common directory, it is clearer that they belong together. Also, you can easier compare the copied versions to their original via $ diff -r ./shared/nm-utils/ /path/to/nm-vpn-plugin/shared/nm-utils/
-
- 15 Jun, 2016 1 commit
-
-
Thomas Haller authored
Let VPN plugins return a virtual function table to extend the API while bypassing libnm. This allows to add and use new functionality to VPN plugins without updating libnm. The actual definitions are in a header-only file "nm-vpn-editor-plugin-call.h", which can be copied to the caller/plugin.
-
- 20 Apr, 2016 1 commit
-
-
Lubomir Rintel authored
Otherwise NetworkManager can be too fast calling a method: <error> [1461073999.2362] vpn-connection[0x7fe39ec491e0,be049803-a705-438f-b8f5-49db87640c93,"libreswan",0]: plugin NeedSecrets request #1 failed: No such interface 'org.freedesktop.NetworkManager.VPN.Plugin' on object at path /org/freedesktop/NetworkManager/VPN/Plugin
-
- 26 Mar, 2016 1 commit
-
-
Thomas Haller authored
When we receive a connection from NetworkManager it is not guaranteed that the connection verifies. For example, if the current libnm version is older then the NetworkManager version. Be more accepting and don't do any verification of the connection. For NMVpnPluginOld this change is uncritical, because there are probably no users of this API anyway. NMVpnServicePlugin is new API since nm-1-1. However, this API is already strongly used by all the plugins we ported over. So this change is affecting them. This should only matter if libnm's and NetworkManager's version differ, because NetworkManager just doesn't send out an invalid connection. It actually only matters if NetworkManager is a newer version and sends an invalid connection to the client. That is anyway badly tested and probably this changes rather improves compatibility than breaking existing users.
-
- 03 Mar, 2016 1 commit
-
-
Thomas Haller authored
GError codes are only unique per domain, so logging the code without also indicating the domain is not helpful. And anyway, if the error messages are not distinctive enough to tell the whole story then we should fix the error messages. Based-on-patch-by:
Dan Winship <danw@gnome.org>
-
- 02 Mar, 2016 1 commit
-
-
Dan Williams authored
If the plugin supports interactive mode, but the VPN binary (like vpnc or openvpn) doesn't support it, then the plugin should return NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED from its connect_interactive() hook. This lets NetworkManager know to fall back to plain Connect(). Since this notification is done through an error return, the VPN service plugin code sees the failure and moves the plugin state back to STOPPED. NetworkManager sees that state change, and terminates the connection attempt while waiting for a reply to the Connect() method. (VPN service plugins that don't support interactive mode at all don't have this problem because that error is returned before the plugin's state is moved to STARTING.) To fix this, do two things: 1) if the connect_interactive() hook fails and returns the error NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED, postpone the STOPPED state change for a few seconds to allow NM time to fall back to plain Connect(). We still want to move the plugin state back to STOPPED eventually, because otherwise it could stay in STARTING forever. 2) change state to STARTING only if the connect/connect_interactive plugin hooks were successful. Otherwise the plugin would still be in STARTING state, and it's not valid to call Connect()/ConnectInteractive() during the STARTING state. https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00091.html https://bugzilla.redhat.com/show_bug.cgi?id=1298732
-
- 19 Feb, 2016 1 commit
-
-
Thomas Haller authored
- All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. ...
-
- 12 Feb, 2016 1 commit
-
-
Thomas Haller authored
- "gsystem-local-alloc.h" and <gio/gio.h> are already included via "nm-default.h". No need to include them separately. - include "nm-macros-internal.h" via "nm-default.h" and drop all explict includes. - in the modified files, ensure that we always include "config.h" and "nm-default.h" first. As second, include the header file for the current source file (if applicable). Then follow external includes and finally internal nm includes. - include nm headers inside source code files with quotes - internal header files don't need to include default headers. They can savely assume that "nm-default.h" is already included and with it glib, nm-glib.h, nm-macros-internal.h, etc.
-
- 28 Jan, 2016 1 commit
-
-
Lubomir Rintel authored
Perfectly fine for ethernet-bridged networks (openvpn with tap devices).
-
- 13 Nov, 2015 1 commit
-
-
Lubomir Rintel authored
-
- 23 Oct, 2015 1 commit
-
-
Lubomir Rintel authored
If the plugin didn't succeed connecting once, don't let the old timer fire during a subsequent connection. https://bugzilla.redhat.com/show_bug.cgi?id=1271973
-
- 16 Oct, 2015 1 commit
-
-
Beniamino Galvani authored
-
- 14 Oct, 2015 1 commit
-
-
Lubomir Rintel authored
It's part of the DBus API; the skeleton has it and we can't remove it. This partially reverts commit fd61b217.
-
- 13 Oct, 2015 3 commits
-
-
Lubomir Rintel authored
The plugins set state only on failures and often forget to do that. Do the correct status transition to STOPPED in nm_vpn_service_plugin_failure() instead. The get_state() is only used to find out whether to fail or orderly disconnect depending on whether we're STARTING or already STARTED. Handle that in nm_vpn_service_plugin_disconnect() in a generic manner instead.
-
Lubomir Rintel authored
We're of no use anymore as another user would start an instance with a different bus name.
-
Lubomir Rintel authored
Make it possible to construct the plugin instance in a way that disconnects the connection if the DBus client that activated it drops off the bus. This makes the plugins conveniently clean up when NetworkManager crashes. We need this, as with multiple VPN support we can loose track of the client bus names when the daemon crashes leaving to nice way to clean up on respawn. However, this behavior is not desired for debugging or hypotetical VPN plugin users other than NetworkManager (say; "gdbus call -m o.fd.NM.VPN.Plugin.Connect"). Let the plugin decide when to use it.
-