Use default LDAP protocols, as seem on RHEL 6
authorJamie Cameron <jcameron@webmin.com>
Mon, 7 Feb 2011 18:57:58 +0000 (10:57 -0800)
committerJamie Cameron <jcameron@webmin.com>
Mon, 7 Feb 2011 18:57:58 +0000 (10:57 -0800)
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3171578&group_id=17457

ldap-server/ldap-server-lib.pl
web-lib-funcs.pl

index 153356b..705ce16 100755 (executable)
@@ -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,
index bc679ac..f530308 100755 (executable)
@@ -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 ||