MantisBT - CDash
View Issue Details
0007853CDashpublic2008-10-24 15:512008-10-29 18:32
Todd Harrington 
Julien Jomier 
normalminoralways
closedfixed 
1.2 
1.3 
0007853: Builds sent from differnt sites can clobber each other
The function get_build_id() does not take enough parameters to uniquely identify a build. Last night we had two sites, running on the same OS, start nightly builds at the same time. Thus there build name (OS-compiler) and build stamp (date-time-type) were identical (we are migrating to a new server, but both are running at the moment).

To fix this problem I added the site name to get_build_id() and changed the DB query to:

  $sql = "SELECT build.id FROM build, site WHERE build.name='$buildname' AND build.stamp='$stamp' AND build.projectid='$projectid' AND build.siteid=site.id AND site.name='$sitename' ORDER BY id DESC";
  $build = pdo_query($sql);

Of course I also had to update all the places that called get_build_id() to include the site name in the call.
No tags attached.
Issue History
2008-10-24 15:51Todd HarringtonNew Issue
2008-10-24 15:58Julien JomierStatusnew => assigned
2008-10-24 15:58Julien JomierAssigned To => Julien Jomier
2008-10-29 17:50Julien JomierNote Added: 0013980
2008-10-29 17:50Julien JomierStatusassigned => closed
2008-10-29 17:50Julien JomierResolutionopen => fixed
2008-10-29 17:50Julien JomierFixed in Version => 1.3
2008-10-29 18:24Todd HarringtonNote Added: 0013981
2008-10-29 18:24Todd HarringtonStatusclosed => feedback
2008-10-29 18:24Todd HarringtonResolutionfixed => reopened
2008-10-29 18:32Julien JomierNote Added: 0013982
2008-10-29 18:32Julien JomierStatusfeedback => closed
2008-10-29 18:32Julien JomierResolutionreopened => fixed

Notes
(0013980)
Julien Jomier   
2008-10-29 17:50   
Fixed in svn. Thanks for the report and providing a fix.
(0013981)
Todd Harrington   
2008-10-29 18:24   
I just looked at the changes you made, and the code is a bit wrong. Believe it or not, I made the exact same mistake on my first attempt to fix this issue.

  $site = $parser->index["SITE"];

Here $site is the XML site node. This is passed to the correctly update get_build_id() function. However, that function is expecting the site name which is:

  $sitename = $parser->vals[$site[0]]["attributes"]["NAME"];

For all but update submissions where it is:

  $sitename = getXMLValue($xmlarray,"SITE","UPDATE");

The site name is already computed near all the placed it is needed for calls to get_build_id(), so I just moved those to be before the call so I could use the value.
(0013982)
Julien Jomier   
2008-10-29 18:32   
Should be better now. Feel free to reopen if needed. Thanks again!