Commits
Click on a commit to change the comparison rangerefactor(mknod): replace unsafe libc calls with nix crate for safety
- Switch from direct libc::mknod and libc::umask to nix::sys::stat::mknod and nix refactor(mknod): make Config struct private
Remove the 'pub' visibility modifier from the Config struct to encapsulate it within the module, preventing external access and improving code organization. This change aligns with best practices for internal data structures that should not be part of the public API. refactor: conditionally compile SELinux/SMACK security context features
Add #[cfg(any(feature = "selinux", feature = "smack"))] attributes to Config struct fields
and related code in uumain() to make SELinux/SMACK support optional, preventing compilation
errors when these features are disabled. This improves build flexibility without affecting
core mknod functionality. refactor(mknod): format SMACK context setting for code consistency
Reformatted the SMACK label setting block in mknod.rs to remove unnecessary line breaks and indentation, improving readability and aligning with the project's coding style guidelines. No functional changes were made. refactor(mknod): make Config struct fields private for better encapsulation
Changed the visibility of all fields in the Config struct from public to private to improve encapsulation and prevent direct external access, promoting better code organization and maintainability. Update src/uu/mknod/src/mknod.rs
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org> Merge branch 'knod_refactoring' of https://github.com/mattsu2020/coreutils into knod_refactoring fix(mknod): add explicit u32 cast to MODE_RW_UGO constant
Wrap the bitwise OR expression in parentheses and cast to u32 to ensure type consistency and resolve potential compilation issues. style(mknod): condense MODE_RW_UGO constant to single line
Reformat the MODE_RW_UGO constant declaration for consistency and to adhere to Rust formatting guidelines. refactor(mknod): remove redundant cast in MODE_RW_UGO constant
The bitwise OR operation on the file permission flags already yields a u32 value, making the explicit cast unnecessary and improving code clarity. fix(mknod): cast mode constants to u32 on android, macos, freebsd, redox
Ensure MODE_RW_UGO is explicitly typed as u32 on specified platforms to resolve compilation errors where the bitwise OR expression doesn't implicitly cast. This maintains consistent behavior across all supported operating systems.