Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- C:/Users/Bob/Desktop/radiusplugin_v2.1a_beta1/radiusplugin.cpp Thu Sep 2 11:54:34 2010
- +++ C:/Users/Bob/Desktop/radiusplugin_v2.1a_beta1/radiusplugin.patched.cpp Sun Aug 28 19:23:39 2011
- @@ -1092,13 +1092,17 @@
- */
- string getTime()
- {
- - time_t rawtime;
- - struct tm * timeinfo;
- - time ( &rawtime );
- - timeinfo = localtime ( &rawtime );
- - string t(ctime(&rawtime));
- - t.replace(t.find("\n"),1," ");
- - return t;
- + time_t rawtime;
- + struct tm * timeinfo;
- + time ( &rawtime );
- + timeinfo = localtime ( &rawtime );
- + string t(ctime(&rawtime));
- + size_t str_pos=t.find("\n");
- + if (pos!=string::npos)
- + {
- + t.replace(str_pos,1," ");
- + }
- + return t;
- }
- void get_user_env(PluginContext * context,const int type,const char * envp[], UserPlugin * user)
- @@ -1150,16 +1154,16 @@
- user->setUsername ( get_env ( "common_name", envp ) );
- if ( get_env ( "password", envp ) !=NULL )
- user->setPassword ( get_env ( "password", envp ) );
- + if ( get_env ( "common_name", envp ) !=NULL )
- + {
- + user->setCommonname ( get_env ( "common_name", envp ) );
- + }
- //rewrite the username if OpenVPN use the option username-as-comon-name
- if ( context->conf.getUsernameAsCommonname() == true )
- {
- if ( DEBUG ( context->getVerbosity() ) ) cerr << getTime() << "RADIUS-PLUGIN: FOREGROUND: Commonname set to Username\n";
- user->setCommonname ( get_env ( "username", envp ) );
- }
- - if ( get_env ( "common_name", envp ) !=NULL )
- - {
- - user->setCommonname ( get_env ( "common_name", envp ) );
- - }
- string untrusted_ip;
- // it's ipv4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement