...
 
Commits (27)
......@@ -19,6 +19,7 @@
auth_request_set $headername10 $upstream_http_headername10;
auth_request_set $headervalue10 $upstream_http_headervalue10;
auth_request_set $lmcookie $upstream_http_cookie;
add_header Set-Cookie $lmcookie;
access_by_lua '
i = 1
ngx.req.set_header("Cookie",ngx.var.lmcookie)
......
......@@ -14,6 +14,7 @@ Build-Depends-Indep: libapache-session-perl,
libconvert-pem-perl,
libcrypt-openssl-rsa-perl,
libcrypt-openssl-x509-perl,
libcrypt-urandom-perl,
libcrypt-rijndael-perl,
libdbd-sqlite3-perl,
libdbi-perl,
......@@ -25,6 +26,7 @@ Build-Depends-Indep: libapache-session-perl,
libhtml-template-perl,
libimage-magick-perl,
libio-string-perl,
libipc-run-perl,
libjson-perl,
liblasso-perl,
libmime-tools-perl,
......@@ -195,6 +197,7 @@ Depends: ${misc:Depends},
libconfig-inifiles-perl,
libcrypt-openssl-rsa-perl,
libcrypt-openssl-x509-perl,
libcrypt-urandom-perl,
libcrypt-rijndael-perl,
libhtml-template-perl,
libjson-perl,
......@@ -267,6 +270,7 @@ Depends: ${misc:Depends},
Recommends: libcrypt-openssl-bignum-perl,
libconvert-base32-perl,
libemail-sender-perl (>=1.300027) | libemail-sender-transport-smtps-perl,
libipc-run-perl,
libgd-securityimage-perl,
libmime-tools-perl,
libnet-ldap-perl,
......
......@@ -33,6 +33,7 @@ WriteMakefile(
'Apache::Session::Browseable' => 0,
'Convert::Base32' => 0,
'Cookie::Baker::XS' => 0,
'Crypt::URandom' => 0,
'DBI' => 0,
'Net::LDAP' => 0,
'SOAP::Lite' => 0,
......
......@@ -9,9 +9,10 @@
package Lemonldap::NG::Common::Apache::Session::Generate::SHA256;
use strict;
use Crypt::URandom;
use Digest::SHA qw(sha256 sha256_hex sha256_base64);
our $VERSION = '2.0.0';
our $VERSION = '2.0.2';
sub generate {
my $session = shift;
......@@ -23,7 +24,9 @@ sub generate {
$session->{data}->{_session_id} = substr(
Digest::SHA::sha256_hex(
Digest::SHA::sha256_hex( time() . {} . rand() . $$ )
Digest::SHA::sha256_hex(
time() . {} . Crypt::URandom::urandom($length) . $$
)
),
0, $length
);
......
......@@ -5,10 +5,11 @@ package Lemonldap::NG::Common::TOTP;
use strict;
use Mouse;
use Convert::Base32 'decode_base32';
use Convert::Base32 qw(decode_base32 encode_base32);
use Crypt::URandom;
use Digest::HMAC_SHA1 'hmac_sha1_hex';
our $VERSION = '2.0.0';
our $VERSION = '2.0.2';
# Verify that TOTP $code matches with $secret
sub verifyCode {
......@@ -47,8 +48,7 @@ sub _code {
# Simply generate new base32 secret
sub newSecret {
my ($self) = @_;
my @chars = ( 'a' .. 'z', 2 .. 7 );
return join( '', @chars[ map { int( rand(32) ) } 1 .. 32 ] );
return encode_base32( Crypt::URandom::urandom(20) );
}
1;
package Lemonldap::NG::Handler;
print STDERR
"Use the appropriate handler. For Apache, use Lemonldap::NG::Handler::ApacheMP2";
# Use the appropriate handler
# For Apache, use Lemonldap::NG::Handler::ApacheMP2
our $VERSION = '2.0.2';
......
......@@ -27,10 +27,11 @@ sub set_header_in {
sub unset_header_in {
my ( $class, $req, $header ) = @_;
$req->{respHeaders} = [ grep { $_ ne $header } @{ $req->{respHeaders} } ];
$req->{respHeaders} = [ grep { $_ ne $header and $_ ne cgiName($header) }
@{ $req->{respHeaders} } ];
delete $req->{env}->{ cgiName($header) };
$header =~ s/-/_/g;
delete $req->{env}->{$header};
delete $req->{env}->{"HTTP_$header"};
}
# Inheritence is broken in this case with Debian >= jessie
......
......@@ -67,11 +67,8 @@ sub handler {
my ( $self, $req ) = @_;
my $hdrs = $req->{respHeaders};
$req->{respHeaders} = [];
my $cookie = $req->env->{HTTP_COOKIE};
my $cn = $self->Lemonldap::NG::Handler::Main::tsv->{cookieName};
$cookie =~ s/\b$cn(http)?=[^,;]*[,;\s]*//og;
my @convertedHdrs =
( 'Content-Length' => 0, Cookie => ( $cookie // '' ) );
( 'Content-Length' => 0, Cookie => ( $req->env->{HTTP_COOKIE} // '' ) );
my $i = 0;
while ( my $k = shift @$hdrs ) {
my $v = shift @$hdrs;
......
package Lemonldap::NG::Manager::Cli;
use strict;
use Crypt::URandom;
use Mouse;
use Data::Dumper;
use Lemonldap::NG::Common::Conf::ReConstants;
......@@ -254,8 +255,9 @@ sub _save {
$new->{cfgDate} = time;
$new->{cfgVersion} = $VERSION;
$new->{cfgLog} = '';
$new->{key} ||=
join( '', map { chr( int( rand(94) ) + 33 ) } ( 1 .. 16 ) );
$new->{key} ||= join( '',
map { chr( int( ord( Crypt::URandom::urandom(1) ) * 94 / 256 ) + 33 ) }
( 1 .. 16 ) );
my $s = $self->mgr->confAcc->saveConf( $new, %$saveParams );
if ( $s > 0 ) {
......
......@@ -20,6 +20,7 @@ package Lemonldap::NG::Manager::Conf::Parser;
use strict;
use utf8;
use Crypt::URandom;
use Mouse;
use JSON 'to_json';
use Lemonldap::NG::Common::Conf::ReConstants;
......@@ -130,8 +131,9 @@ sub scanTree {
$self->newConf->{cfgAuthorIP} = $self->req->address;
$self->newConf->{cfgDate} = time;
$self->newConf->{cfgVersion} = $VERSION;
$self->newConf->{key} ||=
join( '', map { chr( int( rand(94) ) + 33 ) } ( 1 .. 16 ) );
$self->newConf->{key} ||= join( '',
map { chr( int( ord( Crypt::URandom::urandom(1) ) * 94 / 256 ) + 33 ) }
( 1 .. 16 ) );
return 1;
}
......
......@@ -342,7 +342,7 @@ llapp.controller 'TreeCtrl', [
id: "#{node.id}/n#{id++}"
title: 'new'
type: 'samlAttribute'
data: [0, 'New', '', '']
data: ['0', 'New', '', '']
# Nodes with template
$scope.addVhost = ->
......@@ -678,9 +678,9 @@ llapp.controller 'TreeCtrl', [
else
node.data = data.value
# Cast int as int (remember that booleans are int for Perl)
if node.type and node.type.match /^(bool|trool|boolOrExpr)$/
node.data = node.data.toString()
else if node.type and node.type.match /^int$/
#if node.type and node.type.match /^(bool|trool|boolOrExpr)$/
#node.data = node.data.toString()
if node.type and node.type.match /^int$/
node.data = parseInt(node.data, 10)
# Split SAML types
else if node.type and node.type.match(/^(saml(Service|Assertion)|blackWhiteList)$/) and not (typeof node.data == 'object')
......
......@@ -5,11 +5,11 @@
<div class="panel-body">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="bopeOn" type="radio" value="1" name="bope" ng-model="currentNode.data" aria-labelledby="onl" role="radio"/>
<input id="bopeOn" type="radio" ng-value="1" name="bope" ng-model="currentNode.data" ng-checked="currentNode.data==1 || currentNode.data=='1'" aria-labelledby="onl" role="radio"/>
<label id="onl" for="bopeOn" trspan="on"></label>
</label>
<label class="radio-inline">
<input id="bopeOff" type="radio" value="0" name="bope" ng-model="currentNode.data" ng-checked="currentNode.data!==1&&currentNode.data!=='1'" aria-labelledby="offl" role="radio"/>
<input id="bopeOff" type="radio" ng-value="0" name="bope" ng-model="currentNode.data" ng-checked="currentNode.data!==1&&currentNode.data!=='1'" aria-labelledby="offl" role="radio"/>
<label id="offl" for="bopeOff" trspan="off"></label>
</label>
</div>
......
......@@ -5,15 +5,15 @@
<div class="panel-body">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="bopeOn" type="radio" value="1" name="bope" ng-model="currentNode.data" aria-labelledby="onl" role="radio"/>
<input id="bopeOn" type="radio" ng-value="1" name="bope" ng-model="currentNode.data" aria-labelledby="onl" role="radio"/>
<label id="onl" for="bopeOn" trspan="on"></label>
</label>
<label class="radio-inline">
<input id="bopeOff" type="radio" value="0" name="bope" ng-model="currentNode.data" aria-labelledby="offl" role="radio"/>
<input id="bopeOff" type="radio" ng-value="0" name="bope" ng-model="currentNode.data" aria-labelledby="offl" role="radio"/>
<label id="offl" for="bopeOff" trspan="off"></label>
</label>
<label class="radio-inline">
<input id="bopeExpr" type="radio" value="-1" name="bope" ng-click="currentNode.data=''" ng-checked="currentNode.data!==0&&currentNode.data!=='0'&&currentNode.data!==1&&currentNode.data!=='1'" aria-labelledby="rulel" role="radio"/>
<input id="bopeExpr" type="radio" ng-value="-1" name="bope" ng-click="currentNode.data=''" ng-checked="currentNode.data!==0&&currentNode.data!=='0'&&currentNode.data!=1&&currentNode.data!=='1'" aria-labelledby="rulel" role="radio"/>
<label id="rulel" for="bopeExpr" trspan="specialRule"></label>
</label>
</div>
......
......@@ -28,11 +28,11 @@
<td ng-if="n.type=='bool'">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="bopeOn/{{n.title}}" type="radio" value="1" ng-model="n.data" role="radio" aria-labelledby="lbopeOn{{n.title}}"/>
<input id="bopeOn/{{n.title}}" type="radio" ng-value="1" ng-model="n.data" role="radio" aria-labelledby="lbopeOn{{n.title}}"/>
<span id="lbopeOn{{n.title}}" for="bopeOn/{{n.title}}" trspan="on"></span>
</label>
<label class="radio-inline">
<input id="bopeOff/{{n.title}}" type="radio" value="0" ng-model="n.data" ng-checked="n.data!==1&&n.data!=='1'" role="radio" aria-labelledby="lbopeOff{{n.title}}"/>
<input id="bopeOff/{{n.title}}" type="radio" ng-value="0" ng-model="n.data" ng-checked="n.data!==1&&n.data!=='1'" role="radio" aria-labelledby="lbopeOff{{n.title}}"/>
<span id="lbopeOff{{n.title}}" for="bopeOff/{{n.title}}" trspan="off"></span>
</label>
</div>
......@@ -41,15 +41,15 @@
<td ng-if="n.type=='trool'">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="trOn/{{n.title}}" type="radio" value="1" ng-model="n.data" role="radio" aria-labelledby="ltrOn{{n.title}}">
<input id="trOn/{{n.title}}" type="radio" ng-value="1" ng-model="n.data" role="radio" aria-labelledby="ltrOn{{n.title}}">
<span id="ltrOn{{n.title}}" for="trOn/{{n.title}}" trspan="on"></span>
</label>
<label class="radio-inline">
<input id="trOff/{{n.title}}" type="radio" value="0" ng-model="n.data" role="radio" aria-labelledby="ltrOff{{n.title}}">
<input id="trOff/{{n.title}}" type="radio" ng-value="0" ng-model="n.data" role="radio" aria-labelledby="ltrOff{{n.title}}">
<span id="ltrOff{{n.title}}" for="trOff/{{n.title}}" trspan="off"></span>
</label>
<label class="radio-inline">
<input id="trDefault/{{n.title}}" type="radio" value="-1" ng-model="n.data" ng-checked="n.data!==1&&n.data!=='1'&&n.data!==0&&n.data!=='0'" role="radio" aria-labelledby="ltrDefault{{n.title}}">
<input id="trDefault/{{n.title}}" type="radio" ng-value="-1" ng-model="n.data" ng-checked="n.data!==1&&n.data!=='1'&&n.data!==0&&n.data!=='0'" role="radio" aria-labelledby="ltrDefault{{n.title}}">
<span id="ltrDefault{{n.title}}" for="trDefault/{{n.title}}" trspan="default"></span>
</label>
</div>
......@@ -58,15 +58,15 @@
<td ng-if="n.type=='boolOrExpr'">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="boeOn/{{n.title}}" type="radio" value="1" ng-model="n.data" role="radio" aria-labelledby="lboeOn{{n.title}}">
<input id="boeOn/{{n.title}}" type="radio" ng-value="1" ng-model="n.data" role="radio" aria-labelledby="lboeOn{{n.title}}">
<span id="lboeOn{{n.title}}" for="boeOn/{{n.title}}" trspan="on"></span>
</label>
<label class="radio-inline">
<input id="boeOff/{{n.title}}" type="radio" value="0" ng-model="n.data" role="radio" aria-labelledby="lboeOff{{n.title}}">
<input id="boeOff/{{n.title}}" type="radio" ng-value="0" ng-model="n.data" role="radio" aria-labelledby="lboeOff{{n.title}}">
<span id="lboeOff{{n.title}}" for="boeOff/{{n.title}}" trspan="off"></span>
</label>
<label class="radio-inline">
<input id="boeExpr/{{n.title}}" type="radio" value="-1" ng-click="n.data=''" ng-checked="n.data!==0&&n.data!=='0'&&n.data!==1&&n.data!=='1'" role="radio" aria-labelledby="lboeExpr{{n.title}}">
<input id="boeExpr/{{n.title}}" type="radio" ng-value="-1" ng-click="n.data=''" ng-checked="n.data!==0&&n.data!=='0'&&n.data!==1&&n.data!=='1'" role="radio" aria-labelledby="lboeExpr{{n.title}}">
<span id="lboeExpr{{n.title}}" for="boeExpr/{{n.title}}" trspan="specialRule"></span>
</label>
</div>
......
......@@ -5,15 +5,15 @@
<div class="panel-body">
<div class="input-group-solid" role="radiogroup">
<label class="radio-inline">
<input id="trOn" type="radio" value="1" ng-model="currentNode.data" role="radio" aria-labelledby="ltrOn">
<input id="trOn" type="radio" ng-value="1" ng-model="currentNode.data" role="radio" aria-labelledby="ltrOn">
<span id="ltrOn" for="trOn" trspan="on"></span>
</label>
<label class="radio-inline">
<input id="trOff" type="radio" value="0" ng-model="currentNode.data" role="radio" aria-labelledby="ltrOff">
<input id="trOff" type="radio" ng-value="0" ng-model="currentNode.data" role="radio" aria-labelledby="ltrOff">
<span id="ltrOff" for="trOff" trspan="off"></span>
</label>
<label class="radio-inline">
<input id="trDefault" type="radio" value="-1" ng-model="currentNode.data" ng-checked="currentNode.data!==1&&currentNode.data!=='1'&&currentNode.data!==0&&currentNode.data!=='0'" role="radio" aria-labelledby="ltrDefault">
<input id="trDefault" type="radio" ng-value="-1" ng-model="currentNode.data" ng-checked="currentNode.data!==1&&currentNode.data!=='1'&&currentNode.data!==0&&currentNode.data!=='0'" role="radio" aria-labelledby="ltrDefault">
<span id="ltrDefault" for="trDefault" trspan="default"></span>
</label>
</div>
......
......@@ -410,7 +410,7 @@ This file contains:
id: node.id + "/n" + (id++),
title: 'new',
type: 'samlAttribute',
data: [0, 'New', '', '']
data: ['0', 'New', '', '']
});
};
$scope.addVhost = function() {
......@@ -823,9 +823,7 @@ This file contains:
} else {
node.data = data.value;
}
if (node.type && node.type.match(/^(bool|trool|boolOrExpr)$/)) {
node.data = node.data.toString();
} else if (node.type && node.type.match(/^int$/)) {
if (node.type && node.type.match(/^int$/)) {
node.data = parseInt(node.data, 10);
} else if (node.type && node.type.match(/^(saml(Service|Assertion)|blackWhiteList)$/) && !(typeof node.data === 'object')) {
node.data = node.data.split(';');
......
......@@ -3,8 +3,9 @@ package Lemonldap::NG::Portal::Lib::OneTimeToken;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Crypt::URandom;
our $VERSION = '2.0.0';
our $VERSION = '2.0.2';
extends 'Lemonldap::NG::Common::Module';
......@@ -63,7 +64,8 @@ sub createToken {
$infos->{_type} ||= "token";
if ( $self->cache ) {
my $id = $infos->{_utime} . '_' . int( rand(10000) );
my $id =
$infos->{_utime} . '_' . unpack( 's', Crypt::URandom::urandom(2) );
# Dereference $infos
my %h = %$infos;
......
......@@ -9,7 +9,7 @@
#
package Lemonldap::NG::Portal::Main::Run;
our $VERSION = '2.0.1';
our $VERSION = '2.0.2';
package Lemonldap::NG::Portal::Main;
......
From 5752254af89729562f6459e45a6060a1ca4a6a9d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 19:48:46 +0100
Subject: [PATCH 1/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 1 +
1 file changed, 1 insertion(+)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index afa281ec7..dba925df0 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,6 +7,7 @@
use strict;
use Test::More;
+use v5.26.1;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From baa2868d3f7444120460f0949c4e20d0429f4b4d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 20:09:42 +0100
Subject: [PATCH 2/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index dba925df0..8c052c42c 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,7 @@
use strict;
use Test::More;
-use v5.26.1;
+use v5.20;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From adbe2adb3e2a8a7aada8cfffcea3a5f1fa20fea3 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:16:55 +0100
Subject: [PATCH 3/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8c052c42c..8dcdf048f 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,8 +49,8 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8)/si, "File is $1 encoded" )
- or print STDERR "Result: $_\n";
+ ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+ print STDERR "Result: $_\n";
$count++;
};
}
--
2.20.1
From e1565191bf66f8bcd3dedc307a2972482e1fd402 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:38:24 +0100
Subject: [PATCH 4/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8dcdf048f..2a09730cc 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,7 +49,7 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+ ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
print STDERR "Result: $_\n";
$count++;
};
--
2.20.1
From 559b410849613731fff08fd58dae2f7aa40bbbe4 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:46:23 +0100
Subject: [PATCH 5/7] Fix unit test for Debian Buster
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 2a09730cc..85d384198 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -17,10 +17,8 @@ BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
my $h;
-ok(
- $h = new Lemonldap::NG::Common::Conf(
- {
- type => 'File',
+ok( $h = new Lemonldap::NG::Common::Conf(
+ { type => 'File',
dirName => "t/",
}
),
@@ -40,25 +38,27 @@ my @test = (
{ cfgNum => 1, test => 'éà' }
);
-for ( my $i = 0 ; $i < @test ; $i++ ) {
+for ( my $i = 0; $i < @test; $i++ ) {
ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
- or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
+ or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
$count++;
if ( -x '/usr/bin/file' ) {
eval {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
- print STDERR "Result: $_\n";
+
+ ## Debian Buster 'file' command returns JSON DATA
+ ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
+ or print STDERR "Result: $_\n";
$count++;
};
}
my $cfg;
ok( $cfg = $h->load(1), "Test $i can be read" )
- or print STDERR $Lemonldap::NG::Common::Conf::msg;
+ or print STDERR $Lemonldap::NG::Common::Conf::msg;
ok( $cfg->{test} eq $test[$i]->{test}, "Test $i is restored" )
- or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
+ or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
$count += 2;
}
--
2.20.1
From 6dee2f2dba53e3261ceed76bc0bd7999096e3e76 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:47:40 +0100
Subject: [PATCH 6/7] Fix unit test for Debian Buster
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 1 -
1 file changed, 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 85d384198..63cadffcf 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,6 @@
use strict;
use Test::More;
-use v5.20;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From 774137e5fd85d3c1cdeca842e28e4687f14dc670 Mon Sep 17 00:00:00 2001
From: Xavier Guimard <yadd@debian.org>
Date: Sat, 19 Jan 2019 09:46:55 +0100
Subject: [PATCH 7/7] Remove useless test (fixes test failure on Debian
unstable)
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 63cadffcf..ebd5f5b38 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -41,18 +41,6 @@ for ( my $i = 0; $i < @test; $i++ ) {
ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
$count++;
- if ( -x '/usr/bin/file' ) {
- eval {
- open F, 'file t/lmConf-1.json |';
- $_ = join( '', <F> );
- close F;
-
- ## Debian Buster 'file' command returns JSON DATA
- ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
- or print STDERR "Result: $_\n";
- $count++;
- };
- }
my $cfg;
ok( $cfg = $h->load(1), "Test $i can be read" )
or print STDERR $Lemonldap::NG::Common::Conf::msg;
--
2.20.1
......@@ -49,7 +49,7 @@
# Main package
#==============================================================================
Name: lemonldap-ng
Version: 2.0.2
Version: 2.0.1
Release: %{?pre_release:0.}1%{?pre_release:.%{pre_release}}%{?dist}
Summary: LemonLDAP-NG WebSSO
License: GPLv2+
......@@ -57,6 +57,8 @@ URL: http://lemonldap-ng.org
Source0: https://release.ow2.org/lemonldap/%{name}-%{version}%{?pre_release:~%{pre_release}}.tar.gz
BuildArch: noarch
Patch0: lemonldap-ng-2.0.1-Remove_useless_test.patch
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Apache2::Connection)
......@@ -98,12 +100,9 @@ BuildRequires: perl(Digest::HMAC_SHA1)
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(Digest::SHA)
BuildRequires: perl(Email::Date::Format)
# Not available for EL6
%if ! 0%{?el6}
BuildRequires: perl(Email::Sender)
BuildRequires: perl(Email::Sender::Simple)
BuildRequires: perl(Email::Sender::Transport::SMTP)
%endif
BuildRequires: perl(Encode)
BuildRequires: perl(English)
BuildRequires: perl(Env)
......@@ -125,6 +124,10 @@ BuildRequires: perl(IO::Select)
BuildRequires: perl(IO::Socket::INET)
BuildRequires: perl(IO::String)
BuildRequires: perl(JSON)
%if 0%{?fedora} >= 29
BuildRequires: perl(Lasso)
BuildRequires: perl(Glib)
%endif
BuildRequires: perl(Log::Log4perl)
BuildRequires: perl(LWP::Protocol::https)
BuildRequires: perl(LWP::UserAgent)
......@@ -135,6 +138,7 @@ BuildRequires: perl(Mouse)
BuildRequires: perl(Net::LDAP)
BuildRequires: perl(Net::LDAP::Extension::SetPassword)
BuildRequires: perl(Net::LDAP::Util)
BuildRequires: perl(Net::OpenID::Server)
BuildRequires: perl(Plack)
BuildRequires: perl(Plack::Handler::CGI)
BuildRequires: perl(Plack::Handler::FCGI)
......@@ -148,8 +152,9 @@ BuildRequires: perl(Regexp::Assemble)
BuildRequires: perl(Regexp::Common)
BuildRequires: perl(Safe)
BuildRequires: perl(Scalar::Util)
# https://bugzilla.redhat.com/show_bug.cgi?id=1644266
#BuildRequires: perl(Sentry::Raven)
%if 0%{?fedora}
BuildRequires: perl(Sentry::Raven)
%endif
BuildRequires: perl(SOAP::Lite)
BuildRequires: perl(SOAP::Transport::HTTP)
BuildRequires: perl(strict)
......@@ -164,12 +169,14 @@ BuildRequires: perl(URI::Escape)
BuildRequires: perl(URI::URL)
BuildRequires: perl(utf8)
BuildRequires: perl(warnings)
%if 0%{?fedora}
BuildRequires: perl(Web::ID)
%endif
BuildRequires: perl(XML::LibXML)
BuildRequires: perl(XML::LibXSLT)
BuildRequires: perl(XML::Simple)
BuildRequires: perl(YAML)
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd
%endif
Requires: lemonldap-ng-conf = %{version}-%{release}
Requires: lemonldap-ng-doc = %{version}-%{release}
......@@ -179,14 +186,16 @@ Requires: lemonldap-ng-portal = %{version}-%{release}
Requires: lemonldap-ng-test = %{version}-%{release}
# Setup requires filtering
%if 0%{?rhel} == 6
%filter_from_requires /perl(lasso/d; /perl(Net::OpenID/d; /perl(Web::ID/d; /perl(XML::LibXML/d; /perl(XML::LibXSLT/d; /perl(Sentry::Raven/d;
%filter_setup
%if 0%{?rhel} >= 7
%{?perl_default_filter}
%global __requires_exclude perl\\(Lasso|perl\\(Web::ID|perl\\(Sentry::Raven
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%if 0%{?fedora}
%{?perl_default_filter}
%global __requires_exclude perl\\(lasso|perl\\(Net::OpenID|perl\\(Web::ID|perl\\(XML::LibXML|perl\\(XML::LibXSLT|perl\\(Sentry::Raven
%if 0%{?fedora} < 29
%global __requires_exclude perl\\(Lasso
%endif
%endif
%description
......@@ -353,6 +362,7 @@ This package installs the authentication portal.
#==============================================================================
%prep
%setup -q -n %{name}-%{version}%{?pre_release:~%{pre_release}}
%patch0 -p1 -b fix_test_falure
#==============================================================================
......@@ -387,7 +397,7 @@ This package installs the authentication portal.
ETCDEFAULTDIR=%{_sysconfdir}/default \
DNSDOMAIN=%{lm_dnsdomain} \
APACHEVERSION=%{apache_version} \
APACHELOGDIR=/var/log/httpd \
APACHELOGDIR=%{_localstatedir}/log/httpd \
UWSGIYAMLDIR=%{_sysconfdir}/uwsgi/apps-available \
LLNGAPPDIR=%{lm_sharedir}/llng-server \
PROD=yes
......