touched up some perl scripts
This commit is contained in:
parent
13f5c2dc61
commit
01655b1dd9
@ -22,8 +22,6 @@ rm -rf /var/lib/codepot/* && \
|
||||
sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|database_hostname = "/var/lib/codepot/codepot.db"|g' \
|
||||
-e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|g' \
|
||||
-e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' /etc/codepot/codepot.ini && \
|
||||
sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /usr/sbin/codepot-user && \
|
||||
sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \
|
||||
mkdir -p /run/php-fpm && \
|
||||
cp -pf /etc/codepot/codepot.httpd /etc/httpd/conf.d/codepot.conf && \
|
||||
echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/httpd/conf.d/perl.conf && \
|
||||
|
@ -25,8 +25,6 @@ rm -rf /var/lib/codepot/* && \
|
||||
sed -ri -e 's|^database_hostname[[:space:]]*=[[:space:]]*"localhost"$|database_hostname = "/var/lib/codepot/codepot.db"|g' \
|
||||
-e 's|^database_driver[[:space:]]*=[[:space:]]*""$|database_driver = "sqlite"|g' \
|
||||
-e 's|^database_use_pdo[[:space:]]*=[[:space:]]*"no"$|database_use_pdo = "yes"|g' /etc/codepot/codepot.ini && \
|
||||
sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /usr/sbin/codepot-user && \
|
||||
sed -ri -e 's|Digest::SHA1|Digest::SHA|g' /etc/codepot/perl/Codepot/AccessHandler.pm && \
|
||||
cp -pf /etc/codepot/codepot.httpd /etc/apache2/conf-enabled/codepot.conf && \
|
||||
echo "PerlSwitches -Mlib=/etc/codepot/perl" >> /etc/apache2/conf-enabled/perl.conf && \
|
||||
sed -ri -e 's|^max_execution_time[[:space:]]*=.*$|max_execution_time = 120|g' /etc/php/*/apache2/php.ini
|
||||
|
@ -37,10 +37,9 @@ use APR::Base64;
|
||||
|
||||
use Config::Simple;
|
||||
use Net::LDAP;
|
||||
use Net::LDAP qw(LDAP_SUCCESS);
|
||||
use URI;
|
||||
use DBI;
|
||||
use Digest::SHA1 qw (sha1_hex);
|
||||
use Digest::SHA;
|
||||
|
||||
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_UNAUTHORIZED HTTP_INTERNAL_SERVER_ERROR PROXYREQ_PROXY AUTH_REQUIRED);
|
||||
|
||||
@ -122,7 +121,7 @@ sub authenticate_ldap
|
||||
my $f_filter = format_string($cfg->{ldap_userid_search_filter}, $userid, $password);
|
||||
|
||||
my $res = $ldap->bind($f_rootdn, password => $f_rootpw);
|
||||
if ($res->code != LDAP_SUCCESS)
|
||||
if ($res->code != Net::LDAP::LDAP_SUCCESS)
|
||||
{
|
||||
$r->log_error ("Cannot bind LDAP as $f_rootdn - " . $res->error());
|
||||
$ldap->unbind();
|
||||
@ -130,7 +129,7 @@ sub authenticate_ldap
|
||||
}
|
||||
|
||||
$res = $ldap->search(base => $f_basedn, scope => 'sub', filter => $f_filter);
|
||||
if ($res->code != LDAP_SUCCESS)
|
||||
if ($res->code != Net::LDAP::LDAP_SUCCESS)
|
||||
{
|
||||
$ldap->unbind();
|
||||
return 0;
|
||||
@ -152,7 +151,7 @@ sub authenticate_ldap
|
||||
|
||||
$passwd = format_string ($cfg->{ldap_password_format}, $userid, $password);
|
||||
my $res = $ldap->bind ($binddn, password => $passwd);
|
||||
if ($res->code != LDAP_SUCCESS)
|
||||
if ($res->code != Net::LDAP::LDAP_SUCCESS)
|
||||
{
|
||||
#$r->log_error ("Cannot bind LDAP as $binddn - " . $res->error());
|
||||
$ldap->unbind();
|
||||
@ -172,7 +171,7 @@ sub authenticate_ldap
|
||||
my $f_filter = '(objectClass=*)';
|
||||
|
||||
$res = $ldap->search(base => $binddn, scope => 'base', filter => $f_filter, @attrs);
|
||||
if ($res->code == LDAP_SUCCESS)
|
||||
if ($res->code == Net::LDAP::LDAP_SUCCESS)
|
||||
{
|
||||
search_loop:
|
||||
foreach my $entry ($res->entries)
|
||||
@ -220,7 +219,7 @@ sub authenticate_database
|
||||
my $hexsalt = substr($db_pw, -10);
|
||||
my $binsalt = pack('H*', $hexsalt);
|
||||
|
||||
my $fmt_pw = '{ssha1}' . sha1_hex ($password . $binsalt) . $hexsalt;
|
||||
my $fmt_pw = '{ssha1}' . Digest::SHA::sha1_hex($password . $binsalt) . $hexsalt;
|
||||
return (($fmt_pw eq $db_pw? 1: 0), undef);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,7 @@ use strict;
|
||||
use Switch;
|
||||
use Config::Simple;
|
||||
use DBI;
|
||||
use Digest::SHA1 qw (sha1_hex);
|
||||
|
||||
use Digest::SHA;
|
||||
|
||||
my $CFG_FILE = '@CFGDIR@/codepot.ini';
|
||||
my $QC = '';
|
||||
@ -112,7 +111,7 @@ sub rand_string
|
||||
sub format_passwd
|
||||
{
|
||||
my ($password, $binsalt, $hexsalt) = @_;
|
||||
my $fmt_pw = '{ssha1}' . sha1_hex ($password . $binsalt) . $hexsalt;
|
||||
my $fmt_pw = '{ssha1}' . Digest::SHA::sha1_hex($password . $binsalt) . $hexsalt;
|
||||
return $fmt_pw;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user