[Openvpn-devel] [PATCH 4/9] client-connect: Move multi_client_connect_setenv into early_setup

2014-10-10 Thread Fabian Knittel
This patch moves multi_client_connect_setenv into multi_client_connect_early_setup and makes sure that every client-connect handling function updates the virtual address selection. Background: This unifies how the client-connect handling functions work. Signed-off-by: Fabian Knittel --- src/ope

[Openvpn-devel] [PATCH 5/9] client-connect: Refactor to use return values instead of modifying a passed-in flag

2014-10-10 Thread Fabian Knittel
This patch changes the way the client-connect helper functions communicate with the main function. Instead of updating cc_succeeded and cc_succeeded_count, they now return either CC_RET_SUCCEEDED, CC_RET_FAILED or CC_RET_SKIPPED. In addition, the client-connect helpers are now called in completel

[Openvpn-devel] [PATCH 2/9] client-connect: Properly indent all functions

2014-10-10 Thread Fabian Knittel
This patch adds proper indentation to all new helper functions. No functional changes are performed. Nothing is moved around. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 408 ++-- 1 file changed, 204 insertions(+), 204 deletions(-) d

[Openvpn-devel] [PATCH 8/9] client-connect: Add deferred support to the client-connect script handler

2014-10-10 Thread Fabian Knittel
This patch introduces the concept of a return value file for the client-connect handlers. (This is very similar to the auth value file used during deferred authentication.) The file name is stored in the client_connect_state struct. In addition, the patch also allows the storage of the client con

[Openvpn-devel] [PATCH 9/9] client-connect: Add deferred support to the client-connect plugin v1 handler

2014-10-10 Thread Fabian Knittel
Uses the infrastructure provided and used in the previous patch to provide deferral support to the v1 client-connect plugin handler as well. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/

[Openvpn-devel] [PATCH 6/9] client-connect: Refactor client-connect handling to calling a bunch of hooks in a loop

2014-10-10 Thread Fabian Knittel
This patch changes the calling of the client-connect functions into an array of hooks and a block of code that calls them in a loop. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 57 +++-- 1 file changed, 16 insertions(+), 41 deletions(-)

[Openvpn-devel] [PATCH 0/9] Refactor client-connect / add support for deferred handling

2014-10-10 Thread Fabian Knittel
Hi, a few years ago I wrote a patch-set concerning OpenVPN's client-connect code. The first part of the patch-set (patches 1 to 6) refactors and unifies the client-connect code. (This might be of interest in the current "Fix temporary file leak"-thread.) The second part of the patch-set allows

[Openvpn-devel] [PATCH 3/9] client-connect: Refactor multi_client_connect_source_ccd

2014-10-10 Thread Fabian Knittel
Refactor multi_client_connect_source_ccd(), so that options_server_import() (or the success path in general) is only entered in one place within the function. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 29 + 1 file changed, 13 insertions(+), 16 deletions(

[Openvpn-devel] [PATCH 1/9] client-connect: Split multi_connection_established into separate functions

2014-10-10 Thread Fabian Knittel
This patch splits up the multi_connection_established() function. Each new helper function does a specific job. Functions that do a similar job receive a similar calling interface. The patch tries not to reindent code, so that the real changes are as clearly visible as possible. (A follow-up pa

[Openvpn-devel] [PATCH 7/9] client-connect: Add CC_RET_DEFERRED and cope with deferred client-connect

2014-10-10 Thread Fabian Knittel
This patch moves the state, that was previously tracked within the multi_connection_established() function, into struct client_connect_state. The multi_connection_established() function can now be exited and re-entered as many times as necessary - without losing the client-connect handling state.

Re: [Openvpn-devel] Async OPENVPN_PLUGIN_CLIENT_CONNECT plugin support

2014-10-10 Thread Fabian Knittel
Hi Lev, 2014-10-07 20:50 GMT+02:00 Lev Stipakov : > Patch works great, thanks! I have rebased it a bit and added support > for client-connect plugin call. > Great to hear that my patch works for you! I've finally rebased the patches too, due to my current users complaining about the old OpenVPN

Re: [Openvpn-devel] [PATCH] Fix temporary file leak

2014-10-10 Thread David Sommerseth
On 09/10/14 23:40, Samuel Thibault wrote: > Hello, > > Our openvpn server got out of free inodes in /tmp, making it quite > completely nonworking. This is due to some codepath in multi.c which > does not remove its temporary file (when a plugin callback returns an > error, or a client-connect scr