queries with relative filenames might return multiple results
This commit is contained in:
@@ -127,7 +127,7 @@ METHOD(pts_database_t, check_file_measurement, status_t,
|
|||||||
{
|
{
|
||||||
enumerator_t *e;
|
enumerator_t *e;
|
||||||
chunk_t hash;
|
chunk_t hash;
|
||||||
status_t status;
|
status_t status = NOT_FOUND;
|
||||||
|
|
||||||
e = this->db->query(this->db,
|
e = this->db->query(this->db,
|
||||||
"SELECT fh.hash FROM file_hashes AS fh "
|
"SELECT fh.hash FROM file_hashes AS fh "
|
||||||
@@ -139,14 +139,18 @@ METHOD(pts_database_t, check_file_measurement, status_t,
|
|||||||
{
|
{
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
if (e->enumerate(e, &hash))
|
while (e->enumerate(e, &hash))
|
||||||
{
|
{
|
||||||
status = chunk_equals(measurement, hash) ?
|
/* with relative filenames there might be multiple entries */
|
||||||
SUCCESS : VERIFY_ERROR;
|
if (chunk_equals(measurement, hash))
|
||||||
}
|
{
|
||||||
else
|
status = SUCCESS;
|
||||||
{
|
break;
|
||||||
status = NOT_FOUND;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status = VERIFY_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e->destroy(e);
|
e->destroy(e);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user