From 5d858e2e62ba4ca395e263fded2a963cd036b9ad Mon Sep 17 00:00:00 2001
From: Benoit Mortier <benoit.mortier@opensides.be>
Date: Fri, 13 Jan 2017 16:48:53 +0100
Subject: [PATCH] Sonar fixes: Two-argument "open" used

Signed-off-by: Benoit Mortier <benoit.mortier@opensides.be>
---
 contrib/bin/fusiondirectory-setup | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/bin/fusiondirectory-setup b/contrib/bin/fusiondirectory-setup
index 2b31fd9d5..547336320 100644
--- a/contrib/bin/fusiondirectory-setup
+++ b/contrib/bin/fusiondirectory-setup
@@ -794,7 +794,7 @@ sub get_ldap_connexion {
 
   # bind to the LDAP server
   if (-e $fd_secrets) {
-    open($secret_file, $fd_secrets) || die ("Could not open $fd_secrets");
+    open($secret_file, q{<}, $fd_secrets) || die ("Could not open $fd_secrets");
     my $key = "";
     while(<$secret_file>) {
       if ($_ =~ m/RequestHeader set FDKEY ([^ \n]+)\n/) {
@@ -808,7 +808,7 @@ sub get_ldap_connexion {
 
   if ($tls) {
     # Read LDAP config file
-    open ($ldap_conf,$vars{ldap_conf}) or die ("! Failed to open ldap config file '$vars{ldap_conf}': $!\n");
+    open ($ldap_conf, q{<}, $vars{ldap_conf}) or die ("! Failed to open ldap config file '$vars{ldap_conf}': $!\n");
 
     my %tls_options = (
       'REQCERT'   => 'require',
-- 
GitLab