From f3562ccb93a1b81360d90863d7fbbc922af79164 Mon Sep 17 00:00:00 2001 From: ralfluebben Date: Wed, 29 Aug 2012 10:22:23 +0000 Subject: [PATCH] *** empty log message *** --- AccountingProcess.cpp | 2 +- ChangeLog | 2 +- Config.h | 2 +- Makefile | 47 ++++++++++++++++++++++++++----------------- PluginContext.cpp | 8 ++++---- README | 2 +- User.h | 22 ++++++++++---------- UserAcct.cpp | 2 +- UserAcct.h | 2 +- UserAuth.cpp | 2 +- radiusplugin.cpp | 24 +++++++++++----------- 11 files changed, 63 insertions(+), 52 deletions(-) diff --git a/AccountingProcess.cpp b/AccountingProcess.cpp index e1eca12..132ffdb 100644 --- a/AccountingProcess.cpp +++ b/AccountingProcess.cpp @@ -38,7 +38,7 @@ void AccountingProcess::Accounting(PluginContext * context) string key; //The unique key. AcctScheduler scheduler; //The scheduler for the accounting. fd_set set; //A set for the select function. - struct timeval tv; //A timeinterval for the select funtion. + struct timeval tv; //A timeinterval for the select function. diff --git a/ChangeLog b/ChangeLog index cc4e0a7..483e512 100644 --- a/ChangeLog +++ b/ChangeLog @@ -88,7 +88,7 @@ radiusplugin_2.1: - Adapted to OPENVPN_PLUGIN_VERSION 2 - Internal key is now based on untrusted_ip and untrusted_before. - Separated key for status file is added. -- Update password and username if the user (key) is already known. Before if the ip and port would be the same and the timeout hasn't occured the login will success. The update prevents against this behaviour. +- Update password and username if the user (key) is already known. Before if the ip and port were the same and the timeout hasn't occurred the login will success. The update prevents against this behaviour. - Initialization of gcrypt library added. - Rewrite ACF file when the user is authenticated. - Include nested configfiles from main configfile. diff --git a/Config.h b/Config.h index 47e9cd3..d741f52 100644 --- a/Config.h +++ b/Config.h @@ -43,7 +43,7 @@ class Config string statusfile; /**< The path and filename of the status file, where openvpn writes the status information.*/ char subnet[16]; /** * serverlist; diff --git a/radiusplugin.cpp b/radiusplugin.cpp index 5011754..f4d112d 100755 --- a/radiusplugin.cpp +++ b/radiusplugin.cpp @@ -30,7 +30,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL; extern "C" { - /** The function is needed by the OpenVpn plugin model. The funtion is called + /** The function is needed by the OpenVpn plugin model. The function is called * when OpenVpn starts. In this case here two background process are * started. One for authentication and one for accounting. The communication * between the processes is made via sockets. @@ -43,7 +43,7 @@ extern "C" * and it is undependent from the openvpn process. * @param The type of plugin, maybe client_connect, client_disconnect, user_auth_pass_verify... * @param A list of arguments which are set in the configuration file of openvpn in plugin line. - * @param The list of enviromental variables, it is created by the OpenVpn-Process. + * @param The list of environmental variables, it is created by the OpenVpn-Process. */ @@ -320,7 +320,7 @@ extern "C" } - /** This funtion is called from the OpenVpn process everytime + /** This function is called from the OpenVpn process every time * a event happens. The function handle the events (plugins) * AUTH_USER_PASS_VERIFY, CLIENT_CONNECT, CLIENT_DISCONNECT. * The function reads the information from the envriomental @@ -336,8 +336,8 @@ extern "C" * @param The handle which was allocated in the open function. * @param The type of plugin, maybe client_conect, client_disconnect, auth_user_pass_verify * @param A list of arguments which are set in the openvpn configuration file. - * @param The list of enviromental variables, it is created by the OpenVpn-Process. - * @return A interger with the status of the funtion (OPENVPN_PLUGIN_FUNC_SUCCESS or OPENVPN_PLUGIN_FUNC_ERROR). + * @param The list of environmental variables, it is created by the OpenVpn-Process. + * @return An integer with the status of the function (OPENVPN_PLUGIN_FUNC_SUCCESS or OPENVPN_PLUGIN_FUNC_ERROR). */ //OPENVPN_EXPORT int @@ -377,7 +377,7 @@ extern "C" UserPlugin *newuser=NULL; /**< A context for an new user.*/ UserPlugin *tmpuser=NULL; /**< A context for an temporary user.*/ - string common_name; /**acctsocketbackgr.send ( DEL_USER ); context->acctsocketbackgr.send ( newuser->getKey() ); - //get the responce + //get the response const int status = context->acctsocketbackgr.recvInt(); if ( status == RESPONSE_SUCCEEDED ) { @@ -733,7 +733,7 @@ extern "C" * if found or NULL otherwise. * A field in the envp-array looks like: name=user1 * @param The name of the variable. - * @param The array with the enviromental variables. + * @param The array with the environmental variables. * @return A poniter to the variable value or NULL, if the varaible was not found. */ const char * get_env ( const char *name, const char *envp[] ) @@ -745,7 +745,7 @@ const char * get_env ( const char *name, const char *envp[] ) for ( i = 0; envp[i]; ++i ) { - //compare the enviromental names + //compare the environmental names if ( !strncmp ( envp[i], name, namelen ) ) { //if the varibale is found @@ -963,7 +963,7 @@ void * auth_user_pass_verify(void * c) //there must be a username if ( newuser->getUsername().size() > 0 ) //&& olduser==NULL) { - //send the informations to the backgorund process + //send the informations to the background process context->authsocketbackgr.send ( COMMAND_VERIFY ); context->authsocketbackgr.send ( newuser->getUsername() ); context->authsocketbackgr.send ( newuser->getPassword() ); @@ -1044,7 +1044,7 @@ void * auth_user_pass_verify(void * c) context->acctsocketbackgr.send ( DEL_USER ); context->acctsocketbackgr.send ( newuser->getKey() ); - //get the responce + //get the response const int status = context->acctsocketbackgr.recvInt(); if ( status == RESPONSE_SUCCEEDED ) { @@ -1202,7 +1202,7 @@ void get_user_env(PluginContext * context,const int type,const char * envp[], Us user->setCommonname ("UNDEF"); } - //rewrite the commonname if OpenVPN use the option username-as-comon-name + //rewrite the commonname if OpenVPN use the option username-as-common-name if ( context->conf.getUsernameAsCommonname() == true ) { if ( DEBUG ( context->getVerbosity() ) ) cerr << getTime() << "RADIUS-PLUGIN: FOREGROUND: Commonname set to Username\n";