diff --git a/fastrpc.cgi b/fastrpc.cgi index 1c4ef6393..d2ac1437e 100755 --- a/fastrpc.cgi +++ b/fastrpc.cgi @@ -178,7 +178,7 @@ while(1) { # Transfer data from a file print STDERR "fastrpc: read $arg->{'file'}\n" if ($gconfig{'rpcdebug'}); local ($data, $got); - open(FILE, $arg->{'file'}); + open(FILE, "<$arg->{'file'}"); binmode(FILE); while(read(FILE, $got, 1024) > 0) { $data .= $got; @@ -194,7 +194,7 @@ while(1) { $rawrv = &serialise_variable( { 'status' => 1, 'rv' => [ undef, "$arg->{'file'} is a directory" ] } ); } - elsif (!open(FILE, $arg->{'file'})) { + elsif (!open(FILE, "<$arg->{'file'}")) { $rawrv = &serialise_variable( { 'status' => 1, 'rv' => [ undef, "Failed to open $arg->{'file'} : $!" ] } ); } diff --git a/feedback.cgi b/feedback.cgi index 054b3ed16..ba5565b21 100755 --- a/feedback.cgi +++ b/feedback.cgi @@ -125,7 +125,7 @@ if ($in{'config'} && !$gconfig{'nofeedbackconfig'}) { next if (!$f || -d $f); next if ($f =~ /\/var\/log\//); local $/ = undef; - open(FILE, $f) || next; + open(FILE, "<$f") || next; local $data = ; close(FILE); local $count = ($data =~ tr/[\000-\176]/[\000-\176]/); diff --git a/help.cgi b/help.cgi index 46103aca1..1102b6330 100755 --- a/help.cgi +++ b/help.cgi @@ -21,7 +21,7 @@ if ($file =~ /\.(gif|jpg|jpeg|png)$/i) { # read the help file $path = &help_file($module, $file); @st = stat($path); -open(HELP, $path) || &helperror(&text('help_efile', $path)); +open(HELP, "<$path") || &helperror(&text('help_efile', $path)); read(HELP, $help, $st[7]); close(HELP); @@ -64,7 +64,7 @@ else { # including from this module local $ipath = &help_file($module, $_[0]); @st = stat($ipath); - open(INC, $ipath) || + open(INC, "<$ipath") || return "".&text('help_einclude', $_[0])."
\n"; read(INC, $inc, $st[7]); close(INC); diff --git a/pam_login.cgi b/pam_login.cgi index 2dbe63e09..83346ac5d 100755 --- a/pam_login.cgi +++ b/pam_login.cgi @@ -14,7 +14,7 @@ if ($gconfig{'loginbanner'} && $ENV{'HTTP_COOKIE'} !~ /banner=1/ && print "Set-Cookie: banner=1; path=/\r\n"; &PrintHeader(); $url = $in{'page'}; - open(BANNER, $gconfig{'loginbanner'}); + open(BANNER, "<$gconfig{'loginbanner'}"); while() { s/LOGINURL/$url/g; print; diff --git a/password_change.cgi b/password_change.cgi index d91af80e3..0f94a16b9 100755 --- a/password_change.cgi +++ b/password_change.cgi @@ -137,7 +137,7 @@ elsif ($in{'pam'}) { exit(0); } waitpid($pid, 0); - open(TEMP, $temp); + open(TEMP, "<$temp"); chop($rv = ); chop($messages = ); close(TEMP); diff --git a/rpc.cgi b/rpc.cgi index e90abe196..ee7ee21ba 100755 --- a/rpc.cgi +++ b/rpc.cgi @@ -55,7 +55,7 @@ if ($arg->{'newsession'}) { while(1) { local ($rawcmd, $cmd, @rv); alarm($rcount ? 360 : 60); - open(FIFO, $fifo1) || last; + open(FIFO, "<$fifo1") || last; while() { $rawcmd .= $_; } @@ -145,7 +145,7 @@ elsif ($arg->{'action'} eq 'write') { elsif ($arg->{'action'} eq 'read') { # Transfer data from a file local ($data, $got); - open(FILE, $arg->{'file'}); + open(FILE, "<$arg->{'file'}"); while(read(FILE, $got, 1024) > 0) { $data .= $got; } @@ -158,7 +158,7 @@ else { open(FIFO, ">$session->[0]"); print FIFO $rawarg; close(FIFO); - open(FIFO, $session->[1]); + open(FIFO, "<$session->[1]"); while() { print; } diff --git a/session_login.cgi b/session_login.cgi index e4bf2a073..e02369fc6 100755 --- a/session_login.cgi +++ b/session_login.cgi @@ -15,7 +15,7 @@ if ($gconfig{'loginbanner'} && $ENV{'HTTP_COOKIE'} !~ /banner=1/ && print "Set-Cookie: banner=1; path=/\r\n"; &PrintHeader(); $url = $in{'page'}; - open(BANNER, $gconfig{'loginbanner'}); + open(BANNER, "<$gconfig{'loginbanner'}"); while() { s/LOGINURL/$url/g; print; diff --git a/uptracker.cgi b/uptracker.cgi index 9eca2cf8a..7bfaee99d 100755 --- a/uptracker.cgi +++ b/uptracker.cgi @@ -45,7 +45,7 @@ $start = time(); while(1) { sleep(1); $now = time(); - if (!open(UPFILE, $upfile)) { + if (!open(UPFILE, "<$upfile")) { # Doesn't exist yet if ($now - $start > 60) { # Give up after 60 seconds