uutils / coreutils

Cross-platform Rust rewrite of the GNU coreutils
https://uutils.github.io/
MIT License
17.77k stars 1.28k forks source link

mkdir: add "--context" option #5682

Open Ecordonnier opened 11 months ago

Ecordonnier commented 11 months ago

I didn't find an issue tracking this, so I'm creating one for tracking purpose. As noted in https://github.com/uutils/coreutils/blob/6bcf4e2cece5815eb7352e74f64af14b13ad5a4f/src/uu/mkdir/src/mkdir.rs#L84 , the option "-Z" / "--context" of mkdir is not yet implemented.

man mkdir indicates:

   --context[=CTX]
          like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
cre4ture commented 10 months ago

I was testing my local mkdir (Ubuntu 22.04.3 LTS) for this option and I got this warning: mkdir: warning: ignoring --context; it requires an SELinux/SMACK-enabled kernel I think its worth to give some hints which distribution/system can be used for testing this feature.

sylvestre commented 10 months ago

you have to install selinux on your ubuntu: https://www.linode.com/docs/guides/how-to-install-selinux-on-ubuntu-22-04/

Ecordonnier commented 10 months ago

Yes, I'm able to test on Ubuntu after installing selinux. I started working on the implementation (but my progress is slow since I'm a beginner in rust).