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
fe52fe99
Commit
fe52fe99
authored
Jun 07, 2001
by
justdave%syndicomm.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 21253: removing all single-parameter system() calls from Bugzilla
Patch by Dave Miller <justdave@syndicomm.com> r= tara@tequilarista.org
parent
e1417d77
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
11 deletions
+33
-11
checksetup.pl
checksetup.pl
+3
-3
collectstats.pl
collectstats.pl
+2
-2
globals.pl
globals.pl
+21
-2
process_bug.cgi
process_bug.cgi
+2
-2
syncshadowdb
syncshadowdb
+5
-2
No files found.
checksetup.pl
View file @
fe52fe99
...
...
@@ -1233,7 +1233,7 @@ CheckEnumField('bugs', 'rep_platform', @my_platforms);
# that login, if it doesn't exist already, and make it a member of all groups.
sub
bailout
{
# this is just in case we get interrupted while getting passwd
system
(
"stty
echo"
);
# re-enable input echoing
system
(
"stty
"
,
"
echo"
);
# re-enable input echoing
exit
1
;
}
...
...
@@ -1313,7 +1313,7 @@ _End_Of_SQL_
$SIG
{
QUIT
}
=
\&
bailout
;
$SIG
{
TERM
}
=
\&
bailout
;
system
(
"stty
-echo"
);
# disable input echoing
system
(
"stty
"
,
"
-echo"
);
# disable input echoing
while
(
$pass1
ne
$pass2
)
{
while
(
$pass1
eq
""
)
{
...
...
@@ -1334,7 +1334,7 @@ _End_Of_SQL_
}
}
system
(
"stty
echo"
);
# re-enable input echoing
system
(
"stty
"
,
"
echo"
);
# re-enable input echoing
$SIG
{
HUP
}
=
'DEFAULT'
;
# and remove our interrupt hooks
$SIG
{
INT
}
=
'DEFAULT'
;
$SIG
{
QUIT
}
=
'DEFAULT'
;
...
...
collectstats.pl
View file @
fe52fe99
...
...
@@ -131,8 +131,8 @@ sub calculate_dupes {
# Save % count here in a date-named file
# so we can read it back in to do changed counters
# First, delete it if it exists, so we don't add to the contents of an old file
if
(
<
data
/duplicates/
dupes$today
*>
)
{
system
(
"rm -f data/duplicates/dupes$today*"
)
;
if
(
my
@files
=
<
data
/duplicates/
dupes$today
*>
)
{
unlink
@files
;
}
dbmopen
(
%
count
,
"data/duplicates/dupes$today"
,
0644
)
||
die
"Can't open DBM dupes file: $!"
;
...
...
globals.pl
View file @
fe52fe99
...
...
@@ -109,8 +109,27 @@ sub ReconnectToShadowDatabase {
my
$shadowchanges
=
0
;
sub
SyncAnyPendingShadowChanges
{
if
(
$shadowchanges
)
{
system
(
"./syncshadowdb &"
);
$shadowchanges
=
0
;
my
$pid
;
FORK:
{
if
(
$pid
=
fork
)
{
# create a fork
# parent code runs here
$shadowchanges
=
0
;
return
;
}
elsif
(
defined
$pid
)
{
# child process code runs here
exec
(
"./syncshadowdb"
,
[]
)
or
die
"Unable to exec syncshadowdb: $!"
;
# passing the empty list as a second parameter tricks it into
# using execvp instead of running a shell, but still doesn't
# pass any parameters to syncshadowdb
}
elsif
(
$!
=~
/No more process/
)
{
# recoverable fork error, try again in 5 seconds
sleep
5
;
redo
FORK
;
}
else
{
# something weird went wrong
die
"Can't create background process to run syncshadowdb: $!"
;
}
}
}
}
...
...
process_bug.cgi
View file @
fe52fe99
...
...
@@ -993,7 +993,7 @@ The changes made were:
print
"<TABLE BORDER=1><TD><H2>Changes to bug $id submitted</H2>\n"
;
SendSQL
(
"unlock tables"
);
my
@ARGLIST
=
(
"./processmail"
);
my
@ARGLIST
=
();
if
(
$removedCcString
ne
""
)
{
push
@ARGLIST
,
(
"-forcecc"
,
$removedCcString
);
}
...
...
@@ -1004,7 +1004,7 @@ The changes made were:
push
@ARGLIST
,
(
"-forceqacontact"
,
$origQaContact
);
}
push
@ARGLIST
,
(
$id
,
$::FORM
{
'who'
});
system
@ARGLIST
;
system
(
"./processmail"
,
@ARGLIST
)
;
print
"<TD><A HREF=\"show_bug.cgi?id=$id\">Back To BUG# $id</A></TABLE>\n"
;
...
...
syncshadowdb
View file @
fe52fe99
...
...
@@ -156,10 +156,13 @@ if ($syncall) {
}
Verbose
(
"Locking entire database"
);
SendSQL
(
$query
);
my
$tablelist
=
join
(
' '
,
@tables
);
my
$tempfile
=
"data/tmpsyncshadow.$$"
;
Verbose
(
"Dumping database to a temp file ($tempfile)."
);
system
(
"mysqldump -l -e $db_name $tablelist > $tempfile"
);
open
SAVEOUT
,
">&STDOUT"
;
# stash the original output stream
open
STDOUT
,
">$tempfile"
;
# redirect to file
select
STDOUT
;
$|
=
1
;
# disable buffering
system
(
"mysqldump"
,
"-l"
,
"-e"
,
$db_name
,
@tables
);
open
STDOUT
,
">&SAVEOUT"
;
# redirect back to original stream
Verbose
(
"Restoring from tempfile into shadowdb"
);
my
$extra
=
""
;
if
(
$verbose
)
{
...
...
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