coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

mkdir: add "--context" option

Open Ecordonnier opened this issue 1 year ago • 3 comments

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

Ecordonnier avatar Dec 20 '23 12:12 Ecordonnier

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.

cre4ture avatar Dec 27 '23 10:12 cre4ture

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

sylvestre avatar Dec 27 '23 11:12 sylvestre

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).

Ecordonnier avatar Dec 27 '23 15:12 Ecordonnier