mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Switch all calls to open() to explicitly open for read
This commit is contained in:
@@ -43,7 +43,7 @@ return 1; # same!
|
||||
sub read_shorewall6_config
|
||||
{
|
||||
local @ret;
|
||||
open(SHOREWALL_CONF, "$config{'config_dir'}/shorewall6.conf");
|
||||
open(SHOREWALL_CONF, "<$config{'config_dir'}/shorewall6.conf");
|
||||
while (<SHOREWALL_CONF>) {
|
||||
chomp;
|
||||
s/\r//;
|
||||
@@ -85,7 +85,7 @@ sub read_table_file
|
||||
{
|
||||
local @rv;
|
||||
local $func = $_[1];
|
||||
open(FILE, "$config{'config_dir'}/$_[0]");
|
||||
open(FILE, "<$config{'config_dir'}/$_[0]");
|
||||
while(<FILE>) {
|
||||
s/\r|\n//g;
|
||||
local $l = &$func($_);
|
||||
@@ -101,7 +101,7 @@ sub read_table_struct
|
||||
if (!defined($read_table_cache{$_[0]})) {
|
||||
local @rv;
|
||||
local $func = $_[1];
|
||||
open(FILE, "$config{'config_dir'}/$_[0]");
|
||||
open(FILE, "<$config{'config_dir'}/$_[0]");
|
||||
local $lnum = 0;
|
||||
while(<FILE>) {
|
||||
s/\r|\n//g;
|
||||
@@ -1557,7 +1557,7 @@ sub list_standard_actions
|
||||
{
|
||||
local @rv;
|
||||
foreach my $a (split(/\t+/, $config{'actions'})) {
|
||||
open(ACTIONS, $a);
|
||||
open(ACTIONS, "<".$a);
|
||||
while(<ACTIONS>) {
|
||||
s/\r|\n//g;
|
||||
s/#.*$//;
|
||||
@@ -1600,7 +1600,7 @@ sub get_shorewall6_version
|
||||
{
|
||||
local ($nocache) = @_;
|
||||
local $version;
|
||||
if (!$nocache && open(VERSION, "$module_config_directory/version")) {
|
||||
if (!$nocache && open(VERSION, "<$module_config_directory/version")) {
|
||||
chop($version = <VERSION>);
|
||||
close(VERSION);
|
||||
}
|
||||
@@ -1626,7 +1626,7 @@ sub list_protocols
|
||||
{
|
||||
local @stdprotos = ( 'tcp', 'udp', 'ipv6-icmp' );
|
||||
local @otherprotos;
|
||||
open(PROTOS, "/etc/protocols");
|
||||
open(PROTOS, "</etc/protocols");
|
||||
while(<PROTOS>) {
|
||||
s/\r|\n//g;
|
||||
s/#.*$//;
|
||||
|
||||
Reference in New Issue
Block a user