Bug 1084471
Summary: | Clarify documentation for -Z/--context options | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Manish Saxena <msaxena> |
Component: | coreutils | Assignee: | Ondrej Vasik <ovasik> |
Status: | CLOSED ERRATA | QA Contact: | qe-baseos-daemons |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | jscotka, mfabian, mmalik, pbrady, rpiddapa |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | coreutils-8.22-13.el7 | Doc Type: | Bug Fix |
Doc Text: |
The "-Z" option accepted by the cp, install, mkdir, mkfifo, and mknod utilities no longer requires an argument and instead restores the default SELinux context in Red Hat Enterprise Linux 7. However, the "--context" option, which is the long format version of "-Z", optionally accepts an argument. The differences in behavior of the two options sometimes confused users. The man pages documenting "-Z" and "--context" have been modified to describe the options separately and clarify their behavior.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 12:44:18 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Comment 4
Ondrej Vasik
2014-04-05 20:13:14 UTC
cp, install, mkdir, mknod and mkfifo no longer accept an argument to the short -Z option. The --context equivalent still takes an optional argument. is the most important NEWS entry I forgot to add in the previous comment. Squares are likely quotes in the encoding your terminal is not able to display. I expect you were connected via ssh to different machine and locales there were not supported by your machine (this is just to comment on the squares) - still not a bug in coreutils. Hi Ondrej, Thanks for your analysis so far. Can you please share the exact command i should run to overcome such error? as i am still not sure how to execute the correct syntax. if i execute in below format then it will execute successfully but it will take default context and i would like to set it to "system_u:object_r:random_device_t:s0" context. #mknod -m 666 --context /dev/random2 c 1 9 Regarding comments on squares, i installed the RHEL7 snapshot 11 and logged in as a root on VM console (not from remote server ssh) and executed that command. Regards, manish Hi Manish, command mknod -m 666 --context=system_u:object_r:random_device_t:s0 /dev/random2 c 1 9 should work... As to squares, try to run `locale` command in the console. Using LC_ALL=C as the envvar in the script should help to get rid off the squares. Squares can show up when the utf-8 character is not supported in the terminal encoding, but with C locales you basically force ASCII to be used instead of UTF-8 chars. Hi Ondrej, Yes, it works !! As per man page below is the command to update the context but it is not clear from below command security context is not require in case when execute it with -Z so i think it needs to be update. Should we file a documentation bug to modify this for change in behaviour on RHEL7 snapshot 11? please confirm. "man mknod" -Z, --context=CTX set the SELinux security context of NAME to CTX As if i execute this command with -Z and with --context then still it works- #mknod -m 666 -Z --context=system_u:object_r:random_device_t:s0 /dev/random2 c 1 9 Regards, Manish Saxena GSS, Red Hat Inc. Using both -Z (restore default one) and --context (set different one) doesn't make much sense. Yes, I agree this is a bit confusing - as in the case of -m, --mode=MODE , -m requires the MODE parameter, but in the case of -Z, --context[=CTX] , -Z requires no argument... actually, I would suggest to split this to two lines in all utilities using this behaviour. Documentation bug will not help, I'll ask upstream about their opinion (if the split to two lines is acceptable or not) and if accepted, we can reopen this bugzilla and use it for tracking the manpage and help output change. Upstream seems to agree with this docs change - although it is quite common practice to have optional arguments only for long options. Upstream report - http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17220 ... reopening and changing summary. Hi Manish. Can you confirm that on the latest RHEL 7 that the `man mknod` output in comment 9 is accurate. You say it is: -Z, --context=CTX set the SELinux security context of NAME to CTX While I would expect it to be: -Z, --context[=CTX] set the SELinux security context of NAME to default type, or set the SELinux or SMACK security context to CTX if specified In any case we'll clarify this further upstream. On RHEL 7.0 Beta (Maipo) & uname -r ( 3.10.0-54.0.1.el7.x86_64 ) it is below - ------------------------------------------------------------------ -Z, --context=CTX set the SELinux security context of NAME to CTX Whereas on RHEL 7 Snapshot 11 & uname -r ( 3.10.0-113.el7.x86_64 ) it is below - ------------------------------------------------------------------- -Z, --context[=CTX] set the SELinux security context of NAME to default type, or to CTX if specified I believe it would be better if split it in two lines as below - ----------------------------------------------- -Z set the SELinux security context of NAME to default type --context[=CTX] set the SELinux or SMACK security context to CTX if specified Thanks. manish Thanks Manish. Improved text is now merged upstream: http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=30acfcab Thanks Padraig. *** Bug 1100375 has been marked as a duplicate of this bug. *** Making public, as it contain any sensitive information and there was public duplicate. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2160.html |