Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- freeradius_original.inc 2013-01-17 19:53:08.431356176 +0100
- +++ freeradius.inc 2013-01-17 19:38:11.151353016 +0100
- @@ -2747,9 +2747,34 @@
- conf_mount_ro();
- }
- +#Function checks if Samba package is installed
- +function samba_isinstalled($conf){
- + if(is_array($conf)){
- + $instpkgs = array();
- + foreach($conf as $instpkg) {
- + if (strtolower($instpkg['name']) === 'samba'){
- + return 'true';
- + }
- + }
- + }
- + return 'false';
- +}
- function freeradius_modulesmschap_resync() {
- global $config;
- + #$varFREERADIUS_BASE = FREERADIUS_BASE;
- + #We need add ntlm_auth path to mschap config if samba is installed
- + $ntlm_auth = "# ntlm_auth = /path/to/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}";
- + if (samba_isinstalled($config['installedpackages']['package']) === 'true'){
- + $ntlm_auth = "ntlm_auth = /usr/local/bin/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}";
- + #we will see if samba will be installed only in /usr/local/bin or in /usr/pbi...
- + #if ($varFREERADIUS_BASE === '/usr/local'){
- + # $ntlm_auth = "ntlm_auth = /usr/local/bin/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}";
- + #}
- + #else {
- + #$ntlm_auth = "ntlm_auth = /usr/local/bin/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}";
- +
- + }
- $conf = '';
- $conf .= <<<EOD
- @@ -2817,8 +2842,7 @@
- # attribute, and do prefix/suffix checks in order to obtain
- # the "best" user name for the request.
- #
- -# ntlm_auth = "/path/to/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --
- -nt-response=%{%{mschap:NT-Response}:-00}"
- + $ntlm_auth
- # For Apple Server, when running on the same machine as
- # Open Directory. It has no effect on other systems.
Add Comment
Please, Sign In to add comment