Skip to content

Commit d60f3c6

Browse files
repository: don't leak repository fd
We're leaking fds into the sandbox in flatpak-rs. Let's fix this obvious one. Signed-off-by: Allison Karlitskaya <[email protected]>
1 parent 03f4eb2 commit d60f3c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/composefs/src/repository.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<ObjectID: FsVerityHashValue> Repository<ObjectID> {
7676
let path = path.as_ref();
7777

7878
// O_PATH isn't enough because flock()
79-
let repository = openat(dirfd, path, OFlags::RDONLY, Mode::empty())
79+
let repository = openat(dirfd, path, OFlags::RDONLY | OFlags::CLOEXEC , Mode::empty())
8080
.with_context(|| format!("Cannot open composefs repository at {}", path.display()))?;
8181

8282
flock(&repository, FlockOperation::LockShared)

0 commit comments

Comments
 (0)