Skip to content

Commit f3ecfba

Browse files
committed
fix: revert PR #189 due to issues while running inside a Docker container.
Calling the `unshare` syscall is returning `EPERM` error under some circumstances, apparently related to being called inside a Docker container. For instance, the generation of Python wheels is broken: https://github.com/VirusTotal/yara-x/actions/runs/10775030489/job/29878522401#step:9:1147
1 parent eb8611e commit f3ecfba

File tree

3 files changed

+0
-35
lines changed

3 files changed

+0
-35
lines changed

Cargo.lock

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,6 @@ yara-x-parser = { workspace = true, features = ["serde"] }
246246

247247
lingua = { version = "1.6.2", optional = true, default-features = false, features = ["english", "german", "french", "spanish"] }
248248

249-
# syscalls crate is only available for Linux
250-
[target.'cfg(target_os = "linux")'.dependencies]
251-
syscalls = "0.6.18"
252-
253249
[build-dependencies]
254250
anyhow = { workspace = true }
255251
globwalk = { workspace = true }

lib/src/scanner/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,15 +591,6 @@ impl<'r> Scanner<'r> {
591591
if self.timeout.is_some() {
592592
INIT_HEARTBEAT.call_once(|| {
593593
thread::spawn(|| loop {
594-
#[cfg(target_os = "linux")]
595-
unsafe {
596-
// unshare(CLONE_FS) preventing setns syscall to fail
597-
// if a timeout is set for the scanner.
598-
// see issue: https://github.com/VirusTotal/yara-x/issues/182
599-
syscalls::syscall!(syscalls::Sysno::unshare, 512)
600-
.unwrap();
601-
}
602-
603594
thread::sleep(Duration::from_secs(1));
604595
ENGINE.increment_epoch();
605596
HEARTBEAT_COUNTER

0 commit comments

Comments
 (0)