Skip to content

Commit b2f3477

Browse files
apd: set mount tmpfs as private
Merge pull request #864 from JingMatrix/mount
2 parents 9ef7a6f + 884b67f commit b2f3477

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apd/src/mount.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ pub fn mount_devpts(dest: impl AsRef<Path>) -> Result<()> {
188188
MountFlags::empty(),
189189
"newinstance",
190190
)?;
191+
mount_change(dest.as_ref(), MountPropagationFlags::PRIVATE).context("make devpts private")?;
191192
Ok(())
192193
}
193194
#[cfg(not(any(target_os = "linux", target_os = "android")))]
@@ -218,6 +219,7 @@ pub fn mount_tmpfs(dest: impl AsRef<Path>) -> Result<()> {
218219
"",
219220
)?;
220221
}
222+
mount_change(dest.as_ref(), MountPropagationFlags::PRIVATE).context("make tmpfs private")?;
221223
let pts_dir = format!("{}/{PTS_NAME}", dest.as_ref().display());
222224
if let Err(e) = mount_devpts(pts_dir) {
223225
warn!("do devpts mount failed: {}", e);

0 commit comments

Comments
 (0)