From 347dc63c65a3f0f3830b28652882228e0aee6088 Mon Sep 17 00:00:00 2001 From: Ted Brandston Date: Thu, 10 Apr 2025 14:12:20 -0400 Subject: [PATCH] Add MS_NOSYMFOLLOW flag MS_NOSYMFOLLOW (since Linux 5.10) disallows automatic following of symlinks. Added to rust-lang/libc in 0.2.176 See: https://github.com/torvalds/linux/commit/dab741e0e02bd3c4f5e2e97be74b39df2523fc6e https://github.com/rust-lang/libc/releases/tag/0.2.176 --- Cargo.toml | 2 +- changelog/2685.added.md | 1 + src/mount/linux.rs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/2685.added.md diff --git a/Cargo.toml b/Cargo.toml index bcca102820..5c5fdd6af6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ targets = [ ] [dependencies] -libc = { version = "=0.2.175", features = ["extra_traits"] } +libc = { version = "=0.2.176", features = ["extra_traits"] } bitflags = "2.3.3" cfg-if = "1.0" pin-utils = { version = "0.1.0", optional = true } diff --git a/changelog/2685.added.md b/changelog/2685.added.md new file mode 100644 index 0000000000..f34630f8fd --- /dev/null +++ b/changelog/2685.added.md @@ -0,0 +1 @@ +Added MS_NOSYMFOLLOW flag, a mount option on linux which disallows automatic following of symlinks. diff --git a/src/mount/linux.rs b/src/mount/linux.rs index 3c27150761..5fb38a7438 100644 --- a/src/mount/linux.rs +++ b/src/mount/linux.rs @@ -21,6 +21,8 @@ libc_bitflags!( MS_MANDLOCK; /// Directory modifications are synchronous MS_DIRSYNC; + /// Do not follow symlinks + MS_NOSYMFOLLOW; /// Do not update access times MS_NOATIME; /// Do not update directory access times