Skip to content

Commit

Permalink
Debug and try a hypothesis
Browse files Browse the repository at this point in the history
  • Loading branch information
marcua committed Jan 19, 2025
1 parent fdfd5ca commit 98d3872
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/build_nsjail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

git clone https://github.com/google/nsjail.git nsjail-checkout
cd nsjail-checkout
git checkout bc30a1a335bb4d5d2a24d1a7abeb420af9bb3388
make
mv nsjail ..
cd ..
Expand Down
9 changes: 8 additions & 1 deletion src/hosted_db/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,30 @@ pub async fn potentially_isolated_sqlite_query(
query_mode: QueryMode,
) -> Result<QueryResult, AybError> {
if let Some(isolation) = isolation {
println!("potentially1");
let result =
run_in_sandbox(Path::new(&isolation.nsjail_path), path, query, query_mode).await?;

println!("potentially2");
if !result.stderr.is_empty() {
println!("potentially3");
let error: AybError = serde_json::from_str(&result.stderr)?;
println!("potentially4");
return Err(error);
} else if result.status != 0 {
println!("potentially5");
return Err(AybError::Other {
message: format!(
"Error status from sandboxed query runner: {}",
result.status
),
});
} else if !result.stdout.is_empty() {
println!("potentially6");
let query_result: QueryResult = serde_json::from_str(&result.stdout)?;
println!("potentially7");
return Ok(query_result);
} else {
println!("potentially8");
return Err(AybError::Other {
message: "No results from sandboxed query runner".to_string(),
});
Expand Down

0 comments on commit 98d3872

Please sign in to comment.