|
if openvpn: msg#00001network.openvpn.devel
i am use openvpn 2.0.7,and use auth-user-pass-verify to auth userlogin.
but i have a problems!
if openvpn server "use auth-user-pass-verify ",can't disable a user name duplicate login in same time.
my auth plugin src is below:
#include <stdio.h> #include "openvpn-plugin.h" #define MAX_USER_LEN 15 struct user /*
if ( user == NULL || pass == NULL ) for (i=0; i < ct->num_users; i++) return 0;
for (i = 0; envp[i]; ++i) if (*cp == '=') return NULL;
if (ct == NULL || ct->file_path == NULL) if ( stat(ct->file_path,&st) < 0 ) if ( st.st_mtime <= ct->mtime ) fp = fopen(ct->file_path,"r"); num = 0; if (p == NULL) *p++ = '\0'; strcpy(ct->users[num].name,buf); while ( (p = strrchr(ct->users[num].pass,'\n')) ) num++; ct->mtime = st.st_mtime; return num;
if ( argv[1] == NULL ) /* if ( read_users(context) < 0 ) context->file_path = strdup(argv[1]); /* return (openvpn_plugin_handle_t) context;
/* get username/password from envp string array */ read_users(context); /* check entered username/password against what we require */
free((void*)context->file_path);
h = openvpn_plugin_open_v1(&type,&argv[1],envp); if ( openvpn_plugin_func_v1(h,type,NULL,envp) == OPENVPN_PLUGIN_FUNC_SUCCESS ) openvpn_plugin_close_v1(h); Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________ Openvpn-devel mailing list Openvpn-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/openvpn-devel |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | MULTICAST: cannot join a group across the OpenVPN connection. Why?: 00001, Tony |
|---|---|
| Next by Date: | Re: MULTICAST: cannot join a group across the OpenVPN connection. Why?: 00001, Tony |
| Previous by Thread: | MULTICAST: cannot join a group across the OpenVPN connection. Why?i: 00001, Tony |
| Next by Thread: | TAP driver: 00001, Sammy Yu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |