Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/socket-patch-core/src/patch/copy_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ mod tests {
#[cfg(unix)]
#[tokio::test]
async fn relax_loop_must_not_traverse_symlinked_root() {
if unsafe { libc::geteuid() } == 0 {
return; // root bypasses permission bits; nothing to test
}
let base = tempfile::tempdir().unwrap();
// External target tree with restrictive perms.
let target = base.path().join("target");
Expand Down
3 changes: 3 additions & 0 deletions crates/socket-patch-core/src/patch/redirect/vlt_heal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ mod tests {
#[tokio::test]
async fn an_unremovable_hidden_lock_keeps_every_store_entry() {
use std::os::unix::fs::PermissionsExt as _;
if unsafe { libc::geteuid() } == 0 {
return; // root bypasses permission bits; nothing to test
}
let tmp = tempfile::tempdir().unwrap();
store(tmp.path(), ID, PRISTINE);
hidden(tmp.path(), Some("sha512-UPSTREAM"));
Expand Down
3 changes: 3 additions & 0 deletions crates/socket-patch-core/src/vendor/pypi_poetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,9 @@ content-hash = "4b42a89b7ff7b26511b06acdc458dbd85312e5083db8f212b017482bc68cdd01
#[tokio::test]
async fn wire_write_failure_maps_error_and_leaves_lock_untouched() {
use std::os::unix::fs::PermissionsExt;
if unsafe { libc::geteuid() } == 0 {
return; // root bypasses permission bits; nothing to test
}
let tmp = write_project(LOCK21_DIRECT_REGISTRY, PYPROJECT_DIRECT).await;
let p = load_poetry_project(tmp.path()).await.unwrap();

Expand Down
3 changes: 3 additions & 0 deletions crates/socket-patch-core/src/vendor/pypi_requirements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3153,6 +3153,9 @@ mod tests {
#[tokio::test]
async fn wire_failure_rolls_back_already_written_files() {
use std::os::unix::fs::PermissionsExt as _;
if unsafe { libc::geteuid() } == 0 {
return; // root bypasses permission bits; nothing to test
}
let original_root = "six==1.16.0\n-r deps/pinned.txt\n";
let tmp = write_root(original_root).await;
tokio::fs::create_dir_all(tmp.path().join("deps"))
Expand Down
Loading