[PATCH] doc: Update connmanctl's exit status

2015-10-28 Thread Jaakko Hannikainen
Connmanctl returns the status of the last executed command. Update documentation to reflect this. --- doc/connmanctl.1.in | 6 ++ 1 file changed, 6 insertions(+) diff --git a/doc/connmanctl.1.in b/doc/connmanctl.1.in index 0f891bd..07320bd 100644 --- a/doc/connmanctl.1.in +++ b/doc/connmanctl

[PATCH 3/8] doc: Rewrite connmanctl.1

2015-10-26 Thread Jaakko Hannikainen
The 2.5 year old version has tons of outdated info and is badly formatted. Rewrite the man page for up to date information, better formatting and examples. --- doc/connmanctl.1 | 307 --- 1 file changed, 199 insertions(+), 108 deletions(-) diff

[PATCH 2/8] doc: Reformat connman.conf.5

2015-10-26 Thread Jaakko Hannikainen
Reformat the man page for main.conf according to common man page conventions. In addition, add an example section with a simple configuration example. Update copyright and last modification dates. --- doc/connman.conf.5 | 51 ++- 1 file changed, 30 i

[PATCH 1/8] doc: Use preferred formatting in connman.8

2015-10-26 Thread Jaakko Hannikainen
Presenting arguments in the format -W driver[,...] is preferred over -W driver1,driver2,... so use it instead. Change the modification date to -MM-DD. Update the copyright date. Show examples on their own line. Add additional See Also -manpage. --- doc/connman.8 | 41 +-

[PATCH 8/8] doc: Move man pages under automake

2015-10-26 Thread Jaakko Hannikainen
This change prettifies man pages with and /var/lib so that it will show the actual value connman was compiled with, rather than just hinting at some magical compile time variable. --- .gitignore | 8 ++-- Makefile.am

[PATCH 7/8] doc: Add connman-vpn-provider.config.5

2015-10-26 Thread Jaakko Hannikainen
--- doc/connman-vpn-provider.config.5 | 424 ++ doc/connman-vpn.8 | 3 +- doc/connmanctl.1 | 4 +- 3 files changed, 428 insertions(+), 3 deletions(-) create mode 100644 doc/connman-vpn-provider.config.5 diff --git a/doc/con

[PATCH 4/8] doc: Add connman-vpnd.8

2015-10-26 Thread Jaakko Hannikainen
--- doc/connman-vpn.8 | 62 +++ doc/connman.8 | 2 +- doc/connmanctl.1 | 2 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 doc/connman-vpn.8 diff --git a/doc/connman-vpn.8 b/doc/connman-vpn.8 new file mode 100644

[PATCH 6/8] doc: Add connman-service.config.5

2015-10-26 Thread Jaakko Hannikainen
--- doc/connman-service.config.5 | 197 +++ doc/connman.8| 3 +- doc/connmanctl.1 | 3 +- 3 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 doc/connman-service.config.5 diff --git a/doc/connman-service.co

[PATCH 5/8] doc: Add connman-vpn.conf.5

2015-10-26 Thread Jaakko Hannikainen
--- doc/connman-vpn.8 | 2 +- doc/connman-vpn.conf.5 | 48 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 doc/connman-vpn.conf.5 diff --git a/doc/connman-vpn.8 b/doc/connman-vpn.8 index 889faff..e595890 100644 --- a/doc/

[PATCH 0/8] Man page overhaul

2015-10-26 Thread Jaakko Hannikainen
This patchset rewrites half of the existing man pages and adds 4 new ones, since the old ones were either badly formatted, incomplete or simply wrong. It also moves them under automake so that end users will see proper paths to connman's files instead of suggesting that they are probably under /var

[RFC 8/8] doc: Move man pages under automake

2015-10-19 Thread Jaakko Hannikainen
This change prettifies man pages with and /var/lib so that it will show the actual value connman was compiled with, rather than just hinting at some magical compile time variable. --- .gitignore | 8 ++-- Makefile.am

[RFC 7/8] doc: Add connman-vpn-provider.config.5

2015-10-19 Thread Jaakko Hannikainen
--- Makefile.am | 3 +- doc/connman-vpn-provider.config.5 | 424 ++ doc/connman-vpn.8 | 3 +- doc/connmanctl.1 | 4 +- 4 files changed, 430 insertions(+), 4 deletions(-) create mode 100644 doc/connman

[RFC 0/8] Man page overhaul

2015-10-19 Thread Jaakko Hannikainen
This patchset rewrites half of the existing man pages and adds 4 new ones, since the old ones were either badly formatted, incomplete or simply wrong. It also moves them under automake so that end users will see proper paths to connman's files instead of suggesting that they are probably under /var

[RFC 3/8] doc: Rewrite connmanctl.1

2015-10-19 Thread Jaakko Hannikainen
The 2.5 year old version has tons of outdated info and is badly formatted. Rewrite the man page for up to date information, better formatting and examples. --- doc/connmanctl.1 | 301 +++ 1 file changed, 193 insertions(+), 108 deletions(-) diff

[RFC 1/8] doc: Use preferred formatting in connman.8

2015-10-19 Thread Jaakko Hannikainen
Presenting arguments in the format -W driver[,...] is preferred over -W driver1,driver2,... so use it instead. Change the modification date to -MM-DD. Update the copyright date. Show examples on their own line. Add an additional See Also -manpage. --- doc/connman.8 | 41 +--

[RFC 5/8] doc: Add connman-vpn.conf.5

2015-10-19 Thread Jaakko Hannikainen
--- Makefile.am| 2 +- doc/connman-vpn.8 | 2 +- doc/connman-vpn.conf.5 | 50 ++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 doc/connman-vpn.conf.5 diff --git a/Makefile.am b/Makefile.am index 9193231..31

[RFC 6/8] doc: Add connman-service.config.5

2015-10-19 Thread Jaakko Hannikainen
--- Makefile.am | 2 +- doc/connman-service.config.5 | 197 +++ doc/connman.8| 3 +- doc/connmanctl.1 | 3 +- 4 files changed, 202 insertions(+), 3 deletions(-) create mode 100644 doc/connman-service.config

[RFC 2/8] doc: Reformat connman.conf.5

2015-10-19 Thread Jaakko Hannikainen
Reformat the man page for main.conf according to common man page conventions. In addition, add an example section with a simple configuration example. Update copyright and last modification dates. --- doc/connman.conf.5 | 51 ++- 1 file changed, 30 i

[RFC 4/8] doc: Add connman-vpn.8

2015-10-19 Thread Jaakko Hannikainen
--- Makefile.am | 6 -- doc/connman-vpn.8 | 62 +++ doc/connman.8 | 2 +- doc/connmanctl.1 | 2 +- 4 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 doc/connman-vpn.8 diff --git a/Makefile.am b/Makefile.am i

[PATCH] vpn: Fix wrong VPN parameters

2015-10-19 Thread Jaakko Hannikainen
Some VPN parameters are mistyped in the source, fix them and update documentation. Add deprecated-label to OpenVPN.TLSRemote. --- I went through all of the VPN parameters, and I believe the parameters are correct now (I don't have means to properly test them). Turns out xl2tpd.conf's man page is ac

[PATCH 5/6] service: Refactor set_property's Proxy

2015-10-15 Thread Jaakko Hannikainen
Refactor set_property's Proxy.Configuration to a separate function. --- src/connman.h | 3 ++ src/service.c | 169 +- 2 files changed, 88 insertions(+), 84 deletions(-) diff --git a/src/connman.h b/src/connman.h index 914c623..eb83d8a 1006

[PATCH 6/6] service: Implement ClearProperty properly

2015-10-15 Thread Jaakko Hannikainen
The previous implementation only cleared Error, which as per documentation is wrong since Error is readonly. Add sane defaults to all readwrite fields. Reported by Francesco Bruno. --- src/service.c | 31 ++- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git

[PATCH 1/6] service: Refactor set_property's AutoConnect

2015-10-15 Thread Jaakko Hannikainen
Refactor set_property's AutoConnect to a separate function. --- src/connman.h | 2 ++ src/service.c | 29 +++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/connman.h b/src/connman.h index 35eb3f5..d1cb71b 100644 --- a/src/connman.h +++ b/src/connma

[PATCH 2/6] service: Refactor set_property's Nameservers

2015-10-15 Thread Jaakko Hannikainen
Refactor set_property's Nameservers.Configuration to a separate function. --- src/connman.h | 2 + src/service.c | 131 +++--- 2 files changed, 73 insertions(+), 60 deletions(-) diff --git a/src/connman.h b/src/connman.h index d1cb71b..8f64e65

[PATCH 3/6] service: Refactor set_property's Timeservers

2015-10-15 Thread Jaakko Hannikainen
Refactor set_property's Timeservers.Configuration to a separate function. --- src/connman.h | 2 ++ src/service.c | 46 +++--- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/connman.h b/src/connman.h index 8f64e65..9f9f665 100644 --- a

[PATCH 0/6] Implement ClearProperty

2015-10-15 Thread Jaakko Hannikainen
This patchset refactors the API SendProperty function to a bit better shape, and then implements ClearProperty so that it will 1) Prevent clearing the 'Error' field 2) Allow clearing readwrite fields to defaults. The defaults are as following: - AutoConnect True - Nameservers.Configuration

[PATCH 4/6] service: Refactor set_property's Domains

2015-10-15 Thread Jaakko Hannikainen
Refactor set_property's Domains.Configuration to a separate function. --- src/connman.h | 2 ++ src/service.c | 44 +++- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/connman.h b/src/connman.h index 9f9f665..914c623 100644 --- a/src/c

[PATCH] doc: Reformat connman.8

2015-09-17 Thread Jaakko Hannikainen
Reformat the man page so that it follows the convention of common man pages (see: manual page of man); bold text should be copied exactly as shown, italic text should be replaced with the appropriate argument and arguments inside [] are optional. --- doc/connman.8 | 55

[PATCH] config: Fix memory leak

2015-08-27 Thread Jaakko Hannikainen
--- src/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.c b/src/config.c index 88f8bd5..344b8ce 100644 --- a/src/config.c +++ b/src/config.c @@ -720,6 +720,8 @@ static bool load_service(GKeyFile *keyfile, const char *group, } else service-

[PATCH] wifi: Add support for AnonymousIdentity

2015-08-23 Thread Jaakko Hannikainen
As there are networks that mandate the use of an anonymous identity, we need to support it. Reported by alin. --- doc/config-format.txt | 1 + gsupplicant/gsupplicant.h | 1 + gsupplicant/supplicant.c | 4 plugins/wifi.c| 3 +++ src/config.c | 15 +++

[PATCH] service: Return OperationAborted on agent cancel

2015-08-10 Thread Jaakko Hannikainen
When connecting to a hidden wireless service for the first time, connmand asks the SSID through the agent api. If the agent returns Canceled, return OperationAborted to the caller of Connect() as other calls to Connect() behave this way. --- gsupplicant/supplicant.c | 2 +- src/service.c

[PATCH] client: Add completion for VPN connections

2015-08-04 Thread Jaakko Hannikainen
Listen for vpn.Manager signals and adjust services' existing tab completion to work with vpnconnections. --- client/commands.c | 133 +- 1 file changed, 122 insertions(+), 11 deletions(-) diff --git a/client/commands.c b/client/commands.c index

[PATCH v2 1/2] config: monitor inotify event IN_MOVED_FROM

2015-07-29 Thread Jaakko Hannikainen
If a config file is moved from a config directory, IN_DELETE is not fired but IN_MOVED_FROM is, so both have to be monitored. --- src/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index 5bf5cf1..d993fd3 100644 --- a/src/config.c +++ b/

[PATCH v2 2/2] vpn-config: monitor IN_MOVED_FROM and IN_MOVED_TO

2015-07-29 Thread Jaakko Hannikainen
If a file is moved to or from a config directory, IN_DELETE and IN_MODIFY events are not fired, so IN_MOVED_FROM and IN_MOVED_TO events have to be monitored. --- vpn/vpn-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c index 293c6

[PATCH v2 1/2] technology: Fix connect button text with VPNs

2015-07-29 Thread Jaakko Hannikainen
Technology's update function wasn't called with VPN services, so now always call it from service's update function. --- src/main.c | 2 +- src/service.c| 2 ++ src/technology.c | 8 +++- src/technology.h | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main

[PATCH v2 2/2] agent: Show entry text on fields like Username

2015-07-29 Thread Jaakko Hannikainen
--- src/agent.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/agent.c b/src/agent.c index eafa02f..09c2dd2 100644 --- a/src/agent.c +++ b/src/agent.c @@ -125,7 +125,12 @@ static void add_field(GPtrArray *array, const char *label, gboolean secret) entry->ent

[PATCH 2/2] vpn-config: monitor IN_MOVED_FROM and IN_MOVED_TO

2015-07-28 Thread Jaakko Hannikainen
If a file is moved to or from a config directory, IN_DELETE and IN_MODIFY events are not fired, so IN_MOVED_FROM and IN_MOVED_TO events have to be monitored. --- vpn/vpn-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c index 293c6

[PATCH 1/2] config: monitor inotify event IN_MOVED_FROM

2015-07-28 Thread Jaakko Hannikainen
If a config file is moved from a config directory, IN_DELETE is not fired but IN_MOVED_FROM is, so both have to be monitored. --- src/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 5bf5cf1..41d3e3d 100644 --- a/src/config.c +++ b/src/

[PATCH] vpn: Fix NULL dereferencing in vpn_set_state

2015-07-27 Thread Jaakko Hannikainen
Data might be NULL if called from vpn_died, so check it and do nothing if it is NULL. --- vpn/plugins/vpn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c index 60954be..1b5af6e 100644 --- a/vpn/plugins/vpn.c +++ b/vpn/plugins/vpn.c @@ -199,6 +199,8 @@

[PATCH] doc: Update service documentation about Immutable

2015-07-24 Thread Jaakko Hannikainen
If a service is set as Immutable, the AutoConnect property can still be changed. --- doc/service-api.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/service-api.txt b/doc/service-api.txt index b4f1dca..88816d8 100644 --- a/doc/service-api.txt +++ b/doc/service-api

[PATCH] service: Send hidden wifi SSID request to sender

2015-07-21 Thread Jaakko Hannikainen
Previously when querying the SSID from client through the agent api, the request was sent to default agent rather than sender, as get_dbus_sender returns NULL if service->pending is NULL, causing a request to the default agent. --- src/service.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deleti

[PATCH v2 6/6] service: Remove empty strings from Nameservers

2015-07-15 Thread Jaakko Hannikainen
When parsing DBus messages to Nameservers.Configuration, check all space-separated strings, replace non-IPs with empty strings and remove all empty strings from input. Sending "123.123.123.123 invalid-ip 8.8.8.8 " will result in Nameservers.Configuration containing [ 123.123.123.123, 8.8.8.8 ], r

[PATCH v2 0/6] Strip whitespace and empty strings from DBus input

2015-07-15 Thread Jaakko Hannikainen
1, 8.8.8.8]. The v2 implements remove_empty_strings much more sensibly, fixes some style issues and adds a patch for Nameservers.Configuration. Managed to fudge the cover letter first time around, sorry. Jaakko Hann

[PATCH v2 3/6] service: Remove empty strings from Proxy

2015-07-15 Thread Jaakko Hannikainen
When parsing DBus messages to Proxy.Configuration, remove all empty strings from input. For example, sending " example.com foo.example.com " will result in Proxy.Configuration containing [ example.com, foo.example.com ], rather than [ , example.com, , , foo.example.com, ]. --- src/service.c | 16

[PATCH v2 5/6] service: Remove empty strings from Timeservers

2015-07-15 Thread Jaakko Hannikainen
As both Domains and Nameserves' parsing uses GString to hold the temporary server list, change Timeservers' parsing to use it too. While parsing, remove empty strings. --- src/service.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/s

[PATCH v2 4/6] service: Strip whitespace from Proxy URL

2015-07-15 Thread Jaakko Hannikainen
Call g_strstrip on the URL before setting Proxy.Configuration.URL. --- src/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index 7b9f8f3..7adcd4f 100644 --- a/src/service.c +++ b/src/service.c @@ -3085,7 +3085,7 @@ static int update_proxy

[PATCH v2 2/6] service: Remove empty strings from Domains

2015-07-15 Thread Jaakko Hannikainen
When parsing DBus messages to Domains.Configuration, remove all empty strings from input. For example, sending " example.com foo.example.com " will result in Domains.Configuration containing [ example.com, foo.example.com ], rather than [ , example.com, , , foo.example.com, ]. --- src/service.c

[PATCH v2 1/6] service: Add function to remove empty strings

2015-07-15 Thread Jaakko Hannikainen
This helper function takes in a heap-allocated buffer of heap-allocated strings. It frees empty strings and moves other strings on top of them. --- src/service.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/service.c b/src/service.c index 2d8245e..3cf49a8 100644 --- a

[PATCH 3/5] service: Remove empty strings from Proxy

2015-07-15 Thread Jaakko Hannikainen
Same as previous commit, but for Proxy.Configuration. --- src/service.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/service.c b/src/service.c index 37f8fb9..2bf64e8 100644 --- a/src/service.c +++ b/src/service.c @@ -3071,9 +3071,12 @@ static int update_p

[PATCH 5/5] service: Remove empty strings from Timeservers

2015-07-15 Thread Jaakko Hannikainen
As both Domains and Nameserves' parsing uses GString to hold the temporary server list, change Timeservers' parsing to use it too. While parsing, remove empty strings. --- src/service.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/ser

[PATCH 4/5] service: Strip whitespace from Proxy URL

2015-07-15 Thread Jaakko Hannikainen
Call g_strstrip on the URL before setting Proxy.Configuration.URL. --- src/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service.c b/src/service.c index 2bf64e8..be5f2f5 100644 --- a/src/service.c +++ b/src/service.c @@ -3102,7 +3102,7 @@ static int update_proxy

[PATCH 2/5] service: Remove empty strings from Domains

2015-07-15 Thread Jaakko Hannikainen
When parsing DBus messages to Domains.Configuration, remove all empty strings from input. For example, sending " example.com foo.example.com " will result in Domains.Configuration containing [ example.com, foo.example.com ], rather than [ , example.com, , , foo.example.com, ]. --- src/service.c

[PATCH 1/5] service: Add function to remove empty strings

2015-07-15 Thread Jaakko Hannikainen
This helper function takes in a heap-allocated buffer of heap-allocated strings. If no strings should be removed, return the buffer. Else, free all empty strings, place nonempty strings to a new container and return it, freeing the old container. --- src/service.c | 32

[PATCH 1/2] client: Memory leak on dbus reply

2015-07-03 Thread Jaakko Hannikainen
Unref DBusPendingCall after stealing the message. Reported by Abhijit Lamsoge. --- client/dbus_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/dbus_helpers.c b/client/dbus_helpers.c index d905746..9c4cfee 100644 --- a/client/dbus_helpers.c +++ b/client/dbus_helpers.c @@ -145,6

[PATCH 2/2] client: Memory leak at readline callback

2015-07-03 Thread Jaakko Hannikainen
Free input string after handling it. Reported by Abhijit Lamsoge. --- client/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/input.c b/client/input.c index 9705871..e59df8a 100644 --- a/client/input.c +++ b/client/input.c @@ -114,6 +114,7 @@ static void rl_handler(char *input)