Skip to content

Commit dae1402

Browse files
committed
fix(mkdir): add feat_selinux cfg alias
1 parent 0b40e51 commit dae1402

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/mkdir/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ workspace = true
1818
[lib]
1919
path = "src/mkdir.rs"
2020

21+
[build-dependencies]
22+
cfg_aliases.workspace = true
23+
2124
[dependencies]
2225
clap = { workspace = true }
2326
uucore = { workspace = true, features = ["fs", "mode", "fsxattr"] }

src/uu/mkdir/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is part of the uutils coreutils package.
2+
//
3+
// For the full copyright and license information, please view the LICENSE
4+
// file that was distributed with this source code.
5+
6+
use cfg_aliases::cfg_aliases;
7+
8+
pub fn main() {
9+
cfg_aliases! {
10+
selinux: { all(feature = "feat_selinux", any(target_os = "android", target_os = "linux")) },
11+
}
12+
}

src/uu/mkdir/src/mkdir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ fn create_single_dir(path: &Path, is_parent: bool, config: &Config) -> UResult<(
333333
}
334334

335335
// Apply SELinux context if requested
336-
#[cfg(feature = "selinux")]
336+
#[cfg(selinux)]
337337
if config.set_security_context && uucore::selinux::is_selinux_enabled() {
338338
if let Err(e) = uucore::selinux::set_selinux_security_context(path, config.context)
339339
{

0 commit comments

Comments
 (0)