Skip to content

Commit

Permalink
Auto merge of #102543 - daym:patch-1, r=joshtriplett
Browse files Browse the repository at this point in the history
Remove "execute" bit from lock file permissions

Previously, flock would set the "execute" bit on Rust lock files. That makes no sense.

This patch clears the "execute" bit on Rust lock files.

See issue #102531.
  • Loading branch information
bors committed Oct 18, 2022
2 parents 194140b + e07e510 commit 98a5ac2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions compiler/rustc_data_structures/src/flock/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ pub struct Lock {

impl Lock {
pub fn new(p: &Path, wait: bool, create: bool, exclusive: bool) -> io::Result<Lock> {
let file = OpenOptions::new()
.read(true)
.write(true)
.create(create)
.mode(libc::S_IRWXU as u32)
.open(p)?;
let file = OpenOptions::new().read(true).write(true).create(create).mode(0o600).open(p)?;

let mut operation = if exclusive { libc::LOCK_EX } else { libc::LOCK_SH };
if !wait {
Expand Down

0 comments on commit 98a5ac2

Please sign in to comment.