don't write to log without log_file config
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 21 Feb 2010 01:02:47 +0000 (01:02 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 21 Feb 2010 01:02:47 +0000 (01:02 +0000)
bin/ldap-rewrite.pl

index cdc9534..8c35ebb 100755 (executable)
@@ -32,13 +32,15 @@ my $config = {
        upstream_ldap => 'ldap.ffzg.hr',
        upstream_ssl => 1,
        overlay_prefix => 'ffzg-',
-       log_file => 'log',
+#      log_file => 'log/ldap-rewrite.log',
 
 };
 
 my $log_fh;
 
 sub log {
+       return unless $config->{log_file};
+
        if ( ! $log_fh ) {
                open($log_fh, '>>', $config->{log_file}) || die "can't open ", $config->{log_file},": $!";
                print $log_fh "# " . time;