[Openvpn-devel,Openvpn-Devel,v4] Insert client connection data into PAM environment

Message ID 20200330124427.764219-1-wardragon78@gmail.com
State Changes Requested
Headers show
Series [Openvpn-devel,Openvpn-Devel,v4] Insert client connection data into PAM environment | expand

Commit Message

Paolo Cerrito March 30, 2020, 1:44 a.m. UTC
From: Paolo Cerrito <paolo.cerrito@uniroma2.it>

1) changed again remote lenght, we have to consider only the lenght op
   ipv6 address into form nnnn:nnnn:nnnn:nnnn:nnnn:ddd.ddd.ddd.ddd not
   the mask, so we have max lenght of 45 plus terminator.

2) refactored calls to get_env, now we make one call to take ipv6
address, the if it's NULL, we try to get ipv4 address.

 src/plugins/auth-pam/auth-pam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c
index b55a2ecd..ae0d495a 100644
--- a/src/plugins/auth-pam/auth-pam.c
+++ b/src/plugins/auth-pam/auth-pam.c
@@ -115,7 +115,7 @@  struct user_pass {
     char password[128];
     char common_name[128];
     char response[128];
-    char remote[51]; //51 as ipv6 form n:n:n:n:n:n:d.d.d.d/mask and terminator+1
+    char remote[46]; //46 as ipv6 form n:n:n:n:n:n:d.d.d.d and + terminator \0
     const struct name_value_list *name_value_list;