Use default LDAP protocols, as seem on RHEL 6

https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3171578&group_id=17457
This commit is contained in:
Jamie Cameron
2011-02-07 10:57:58 -08:00
parent 00c74c1690
commit 6994618164
2 changed files with 10 additions and 1 deletions

View File

@@ -758,6 +758,11 @@ if ($gconfig{'os_type'} eq 'redhat-linux') {
local %ldap;
&read_env_file("/etc/init.d/ldap", \%ldap);
&read_env_file("/etc/sysconfig/ldap", \%ldap);
if (!$ldap{'SLAPD_LDAP'} &&
!$ldap{'SLAPD_LDAPI'} &&
!$ldap{'SLAPD
&read_env_file("/etc/sysconfig/ldap", \%ldap, 1);
}
return { 'ldap' => $ldap{'SLAPD_LDAP'} eq 'yes' ? 1 : 0,
'ldapi' => $ldap{'SLAPD_LDAPI'} eq 'yes' ? 1 : 0,
'ldaps' => $ldap{'SLAPD_LDAPS'} eq 'yes' ? 1 : 0,

View File

@@ -4798,7 +4798,7 @@ if (!@main::list_languages_cache) {
return @main::list_languages_cache;
}
=head2 read_env_file(file, &hash)
=head2 read_env_file(file, &hash, [include-commented])
Similar to Webmin's read_file function, but handles files containing shell
environment variables formatted like :
@@ -4815,6 +4815,10 @@ sub read_env_file
local $_;
&open_readfile(FILE, $_[0]) || return 0;
while(<FILE>) {
if ($_[2]) {
# Remove start of line comments
s/^\s*#+\s*//;
}
s/#.*$//g;
if (/^\s*(export\s*)?([A-Za-z0-9_\.]+)\s*=\s*"(.*)"/i ||
/^\s*(export\s*)?([A-Za-z0-9_\.]+)\s*=\s*'(.*)'/i ||