aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/multi.c
diff options
context:
space:
mode:
authorArne Schwabe2021-04-07 17:49:51 +0200
committerGert Doering2021-04-28 14:03:55 +0200
commit28e6103096ae8ba0a4498da1625a61150a50e6c1 (patch)
tree7ffc89f75330dff9a5c39d1a42d29b1ed9b01833 /src/openvpn/multi.c
parent925f0180318033f9ea7885b40b4b8200b35abbca (diff)
downloadopenvpn-28e6103096ae8ba0a4498da1625a61150a50e6c1.zip
openvpn-28e6103096ae8ba0a4498da1625a61150a50e6c1.tar.gz
Implement deferred auth for scripts
This patch also refactors the if condition that checks the result of the authentication since that has become quite unreadable. It renames s1/s2 and extracts some parts of the condition into individual variables to make the condition better understandle Patch v2: add refactoring of the if condition Patch v4: fix documentation not mentioning method as 2nd line Patch v5: fix deferred auth used by both plugin and script not working Patch v6: Add missing async inotify for script deferred auth Signed-off-by: Arne Schwabe <arne@rfc2549.org> Tested-by: Antonio Quartulli <antonio@openvpn.net> Acked-by: Antonio Quartulli <antonio@openvpn.net> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20210407154951.13330-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22072.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/multi.c')
-rw-r--r--src/openvpn/multi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index f45f6b0..cfa8f87 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -2993,6 +2993,12 @@ multi_process_post(struct multi_context *m, struct multi_instance *mi, const uns
add_inotify_file_watch(m, mi, m->top.c2.inotify_fd,
ks->plugin_auth.auth_control_file);
}
+ if (ks && ks->script_auth.auth_control_file && was_unauthenticated
+ && (ks->authenticated == KS_AUTH_DEFERRED))
+ {
+ add_inotify_file_watch(m, mi, m->top.c2.inotify_fd,
+ ks->script_auth.auth_control_file);
+ }
#endif
if (!IS_SIG(&mi->context))