From: Moritz Bunkus Date: Fri, 11 May 2007 12:02:24 +0000 (+0000) Subject: Filehandles lokal deklarieren. open() nur mit "sicherem" Argument aufrufen. X-Git-Tag: release-2.4.3^2~342 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=24a9ad0e3460a4daba0a0d5255d6146cc4653a70;p=kivitendo-erp.git Filehandles lokal deklarieren. open() nur mit "sicherem" Argument aufrufen. --- diff --git a/SL/USTVA.pm b/SL/USTVA.pm index f99021f9a..86bf8bdea 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -562,6 +562,8 @@ sub process_query { # return unless (-f $filename); + local *FH; + open(FH, "$filename") or $form->error("$filename : $!\n"); my $query = ""; my $sth; @@ -1014,14 +1016,18 @@ sub get_config { my ($self, $userpath, $filename) = @_; + local (*FACONF, *FANEW); + my $form = $main::form; - if (!open(FACONF, "$userpath/$form->{login}_$filename")) { - open(FANEW, ">$userpath/$form->{login}_$filename") || - $form->error("$userpath/$filename : $!"); + $filename = "$form->{login}_$filename"; + $filename =~ s|.*/||; + $filename = "$userspath/$filename"; + + if (!open(FACONF, "<", $filename)) { + open(FANEW, ">", $filename) || $form->error("$filename : $!"); close(FANEW); - open(FACONF, "$userpath/$form->{login}_$filename") || - $form->error("$userpath/$form->{username}_$filename : $!"); + open(FACONF, "<", $filename) || $form->error("$filename : $!"); } while () {