From 6a7e2dc0a75127ccce841202d363f0f8fdf35aa7 Mon Sep 17 00:00:00 2001
From: Benoit Mortier <benoit.mortier@opensides.be>
Date: Fri, 13 Jan 2017 23:04:27 +0100
Subject: [PATCH] Sonar fixes: when $fh is useed in place of FH in print we
 must use print $fh $_;

Signed-off-by: Benoit Mortier <benoit.mortier@opensides.be>
---
 contrib/bin/fusiondirectory-insert-schema | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/contrib/bin/fusiondirectory-insert-schema b/contrib/bin/fusiondirectory-insert-schema
index c6a4e425c..cca75704d 100644
--- a/contrib/bin/fusiondirectory-insert-schema
+++ b/contrib/bin/fusiondirectory-insert-schema
@@ -184,6 +184,7 @@ sub insert_schema
   my($schema, $schema_name) = @_;
   my $schema_file;
   my $update_file;
+  my $empty_file;
 
   $full_cmd = $search_cmd.$schema_name." cn";
   print ("\n");
@@ -242,21 +243,21 @@ sub insert_schema
             print $update_file "replace: olcObjectClasses\n";
           }
 
-          print $update_file;
+          print $update_file $_;
           print $update_file "\n";
         }
         close $schema_file;
         close $update_file;
       } else { # Emptying schema
-        open($update_file,  q{>}, $path.$schema."_update.ldif") or die_with_error('Could not open '.">".$path.$schema."_update.ldif: $!");
+        open($empty_file,  q{>}, $path.$schema."_update.ldif") or die_with_error('Could not open '.">".$path.$schema."_update.ldif: $!");
         push @gen_files, $path.$schema."_update";
-        print $update_file "dn: $dn_part,cn=schema,cn=config\n";
-        print $update_file "changetype: modify\n";
-        print $update_file "delete: olcAttributeTypes\n";
-        print $update_file "-\n";
-        print $update_file "delete: olcObjectClasses\n";
-        print $update_file "-\n";
-        close $update_file;
+        print $empty_file "dn: $dn_part,cn=schema,cn=config\n";
+        print $empty_file "changetype: modify\n";
+        print $empty_file "delete: olcAttributeTypes\n";
+        print $empty_file "-\n";
+        print $empty_file "delete: olcObjectClasses\n";
+        print $empty_file "-\n";
+        close $empty_file;
       }
       $full_cmd = $mod_cmd.$path.$schema."_update.ldif";
       print "executing '$full_cmd'\n";
-- 
GitLab