Skip to content

Commit c3b9c57

Browse files
Fix clippy lint 'suspicious_open_options'
1 parent 0a4915b commit c3b9c57

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

mullvad-exclude/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fn run() -> Result<Infallible, Error> {
9595
let file = fs::OpenOptions::new()
9696
.write(true)
9797
.create(true)
98+
.truncate(false)
9899
.open(procs_path)
99100
.map_err(Error::AddProcToCGroup)?;
100101

talpid-core/src/split_tunnel/linux.rs

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ impl PidManager {
114114
let mut file = fs::OpenOptions::new()
115115
.write(true)
116116
.create(true)
117+
.truncate(false)
117118
.open(exclusions_path)
118119
.map_err(Error::AddCGroupPid)?;
119120

@@ -173,6 +174,7 @@ impl PidManager {
173174
fs::OpenOptions::new()
174175
.write(true)
175176
.create(true)
177+
.truncate(false)
176178
.open(self.net_cls_path.join("cgroup.procs"))
177179
}
178180
}

test/test-runner/src/sys.rs

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ ExecStart=/usr/bin/mullvad-daemon --disable-stdout-timestamps {verbosity}"#
178178

179179
let mut file = tokio::fs::OpenOptions::new()
180180
.create(true)
181+
.truncate(true)
181182
.write(true)
182183
.open(override_path)
183184
.await
@@ -409,6 +410,7 @@ pub async fn set_daemon_environment(env: HashMap<String, String>) -> Result<(),
409410

410411
let mut file = tokio::fs::OpenOptions::new()
411412
.create(true)
413+
.truncate(true)
412414
.write(true)
413415
.open(override_path)
414416
.await

0 commit comments

Comments
 (0)