Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4dabf1a9
Commit
4dabf1a9
authored
Jan 21, 2015
by
Gervase Markham
Committed by
David Lawrence
Jan 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1079065: [SECURITY] Always use the 3 arguments form for open() to prevent shell code injection
r=dylan,a=simon
parent
367d9c2f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
Attachment.pm
Bugzilla/Attachment.pm
+2
-2
Error.pm
Bugzilla/Error.pm
+1
-1
CPAN.pm
Bugzilla/Install/CPAN.pm
+2
-2
Filesystem.pm
Bugzilla/Install/Filesystem.pm
+1
-1
collectstats.pl
collectstats.pl
+1
-1
reports.cgi
reports.cgi
+1
-1
search_plugin.cgi
search_plugin.cgi
+1
-1
showdependencygraph.cgi
showdependencygraph.cgi
+3
-3
testserver.pl
testserver.pl
+3
-3
No files found.
Bugzilla/Attachment.pm
View file @
4dabf1a9
...
...
@@ -333,7 +333,7 @@ sub data {
# If there's no attachment data in the database, the attachment is stored
# in a local file, so retrieve it from there.
if
(
length
(
$self
->
{
data
})
==
0
)
{
if
(
open
(
AH
,
$self
->
_get_local_filename
()))
{
if
(
open
(
AH
,
'<'
,
$self
->
_get_local_filename
()))
{
# file is actually on disk.
$self
->
{
is_on_filesystem
}
=
1
;
local
$/
;
...
...
@@ -412,7 +412,7 @@ sub datasize {
# is stored in a local file, and so retrieve its size from the file,
# or the attachment has been deleted.
unless
(
$self
->
{
datasize
})
{
if
(
open
(
AH
,
$self
->
_get_local_filename
()))
{
if
(
open
(
AH
,
'<'
,
$self
->
_get_local_filename
()))
{
# file is actually on disk.
$self
->
{
is_on_filesystem
}
=
1
;
binmode
AH
;
...
...
Bugzilla/Error.pm
View file @
4dabf1a9
...
...
@@ -74,7 +74,7 @@ sub _throw_error {
$val
=
"*****"
if
$val
=~
/password|http_pass/i
;
$mesg
.=
"[$$] "
.
Data::
Dumper
->
Dump
([
$val
],[
"env($var)"
]);
}
open
(
ERRORLOGFID
,
">>$datadir/errorlog"
);
open
(
ERRORLOGFID
,
">>
"
,
"
$datadir/errorlog"
);
print
ERRORLOGFID
"$mesg\n"
;
close
ERRORLOGFID
;
}
...
...
Bugzilla/Install/CPAN.pm
View file @
4dabf1a9
...
...
@@ -196,8 +196,8 @@ sub set_cpan_config {
# Calling a senseless autoload that does nothing makes us
# automatically load any existing configuration.
# We want to avoid the "invalid command" message.
open
(
my
$saveout
,
">&STDOUT"
);
open
(
STDOUT
,
'>/dev/null'
);
open
(
my
$saveout
,
">&
"
,
"
STDOUT"
);
open
(
STDOUT
,
'>
'
,
'
/dev/null'
);
eval
{
CPAN
->
ignore_this_error_message_from_bugzilla
;
};
undef
$@
;
close
(
STDOUT
);
...
...
Bugzilla/Install/Filesystem.pm
View file @
4dabf1a9
...
...
@@ -634,7 +634,7 @@ sub _update_old_charts {
(
$in_file
=~
/\.orig$/i
));
rename
(
"$in_file"
,
"$in_file.orig"
)
or
next
;
open
(
IN
,
"$in_file.orig"
)
or
next
;
open
(
IN
,
"
<"
,
"
$in_file.orig"
)
or
next
;
open
(
OUT
,
'>'
,
$in_file
)
or
next
;
# Fields in the header
...
...
collectstats.pl
View file @
4dabf1a9
...
...
@@ -309,7 +309,7 @@ sub regenerate_stats {
return
;
}
if
(
open
DATA
,
">
$file"
)
{
if
(
open
DATA
,
">
"
,
$file
)
{
my
$fields
=
join
(
'|'
,
(
'DATE'
,
@statuses
,
@resolutions
));
my
$product_name
=
$product
->
name
;
print
DATA
<<FIN;
...
...
reports.cgi
View file @
4dabf1a9
...
...
@@ -138,7 +138,7 @@ sub generate_chart {
my
(
$dir
,
$image_file
,
$product
,
$datasets
)
=
@_
;
my
$data_file
=
$dir
.
'/'
.
$product
->
id
;
if
(
!
open
FILE
,
$data_file
)
{
if
(
!
open
(
FILE
,
'<'
,
$data_file
)
)
{
ThrowCodeError
(
'chart_data_not_generated'
,
{
'product'
=>
$product
});
}
...
...
search_plugin.cgi
View file @
4dabf1a9
...
...
@@ -27,7 +27,7 @@ print $cgi->header('application/xml');
# Get the contents of favicon.ico
my
$filename
=
bz_locations
()
->
{
'libpath'
}
.
"/images/favicon.ico"
;
if
(
open
(
IN
,
$filename
))
{
if
(
open
(
IN
,
'<'
,
$filename
))
{
local
$/
;
binmode
IN
;
$vars
->
{
'favicon'
}
=
<
IN
>
;
...
...
showdependencygraph.cgi
View file @
4dabf1a9
...
...
@@ -49,7 +49,7 @@ sub CreateImagemap {
my
$map
=
"<map name=\"imagemap\">\n"
;
my
$default
=
""
;
open
MAP
,
"<
$mapfilename"
;
open
MAP
,
"<
"
,
$mapfilename
;
while
(
my
$line
=
<
MAP
>
)
{
if
(
$line
=~
/^default ([^ ]*)(.*)$/
)
{
$default
=
qq{<area alt="" shape="default" href="$1">\n}
;
...
...
@@ -258,7 +258,7 @@ if ($webdotbase =~ /^https?:/) {
error
=>
$!
});
binmode
$pngfh
;
open
(
DOT
,
"\"$webdotbase\" -Tpng $filename|
"
);
open
(
DOT
,
'-|'
,
"\"$webdotbase\" -Tpng $filename
"
);
binmode
DOT
;
print
$pngfh
$_
while
<
DOT
>
;
close
DOT
;
...
...
@@ -287,7 +287,7 @@ if ($webdotbase =~ /^https?:/) {
error
=>
$!
});
binmode
$mapfh
;
open
(
DOT
,
"\"$webdotbase\" -Tismap $filename|
"
);
open
(
DOT
,
'-|'
,
"\"$webdotbase\" -Tismap $filename
"
);
binmode
DOT
;
print
$mapfh
$_
while
<
DOT
>
;
close
DOT
;
...
...
testserver.pl
View file @
4dabf1a9
...
...
@@ -40,7 +40,7 @@ my @pscmds = ('ps -eo comm,gid', 'ps -acxo command,gid', 'ps -acxo command,rgid'
my
$sgid
=
0
;
if
(
!
ON_WINDOWS
)
{
foreach
my
$pscmd
(
@pscmds
)
{
open
PH
,
"$pscmd 2>/dev/null |
"
;
open
PH
,
'-|'
,
"$pscmd 2>/dev/null
"
;
while
(
my
$line
=
<
PH
>
)
{
if
(
$line
=~
/^(?:\S*\/)?(?:httpd|apache?)2?\s+(\d+)$/
)
{
$sgid
=
$1
if
$1
>
$sgid
;
...
...
@@ -267,7 +267,7 @@ sub check_image {
sub
create_file
{
my
(
$filename
,
$content
)
=
@_
;
open
(
FH
,
">
$filename"
)
open
(
FH
,
">
"
,
$filename
)
or
die
"Failed to create $filename: $!\n"
;
binmode
FH
;
print
FH
$content
;
...
...
@@ -276,7 +276,7 @@ sub create_file {
sub
read_file
{
my
(
$filename
)
=
@_
;
open
(
FH
,
$filename
)
open
(
FH
,
'<'
,
$filename
)
or
die
"Failed to open $filename: $!\n"
;
binmode
FH
;
my
$content
=
<
FH
>
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment