Bug 1099508
Summary: | ls -Z trumps other arguments | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Nenad Peric <nperic> |
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, pbrady |
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: |
Cause:
Red Hat specific patch handles --scontext, --context and --lcontext ls options differently from upstream. Option --context behaves like a SELinux format option.
Consequence:
In ls, only the last format option is used. Previous format options are overridden.
Fix:
Documentation was adjusted, explicitly mentioning this behaviour and reasons why ls -Zl differs from ls -lZ.
Result:
Users should no longer be confused by this expected behaviour.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 12:44:19 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: |
Description
Nenad Peric
2014-05-20 13:29:15 UTC
Simply - no - it is just another format option. It is documented in 'info' documentation of coreutils, so your last sentence is wrong - as you can see on the following citation: "Note: When multiple format options are used in `ls', the last one is used. Therefore `ls -lZ' (security format is last - same as `ls --context') differs from `ls -Zl' (long format with selinux context is shown, same as `ls --lcontext')" Just to clarify the incomplete statement in the summary/description. -Z is not different from other formatting options of ls ... so ANY format options overrides the previous ones. This means from -Z, -1 , -l , -x , -m , -C options, only last one is used for the formatting. Can you write in WHICH version of coreutils info is the citation you mention in Comment 2 found? What I can see in info ls (/usr/share/info/coreutils.info.gz) is this: '-Z' '--context' Display the SELinux security context or '?' if none is found. When used with the '-l' option, print the security context to the left of the size column. And that is it! There is no Note you mention. So, please stop just screaming over bugzilla how everyone is daft and all that, and take a look at the package in RHEL7 and you will see that the "Note" you are mentioning does not exist (at least not in coreutils-8.22-11.el7.x86_64) Is there another version of RHEL7 coreutils packages we should be using somehow? Sorry for not checking the latest build, the statement was likely removed with the "closer to upstream" changes in coreutils-8.22. I checked my local RHEL-7 build before closing this, but not the right one. Statement -Z is no different from other format options is still valid and this will not change. Statement I'm not going to add the note to the man page is still valid. But you are right, that even info documentation doesn't mention it - and it doesn't even mention the format option. I'll add something more generic about the formats into info documentation for RHEL 7.1 after clarification upstream (as this part was always downstream part). Let's keep it opened. Note this behavior is downstream only. Can we drop it for RHEL7/Feodra? We've made lots of changes wrt -Z in other tools, so this would be a good time. The current downstream behavior is very confusing to me anyway. For the record the upstream format is consistent no matter what the option order and is: $ ls -ldZ / dr-xr-xr-x. 26 root root system_u:object_r:root_t:s0 4096 May 2 21:41 / $ ls -Zld / dr-xr-xr-x. 26 root root system_u:object_r:root_t:s0 4096 May 2 21:41 / For Rawhide, I'm going to drop the downstream changes. For RHEL 7 it is too late to change the behaviour (actually, it was kept as the downstream syntax was used by several training materials). I will improve the documentation of the downstream changes for RHEL 7. Upstream, there is no issue with the -Z - as it behaves as a flag, downstream, -Z is a format option. However - one thing probably worth of improvement upstream is better documenting of --format options in info docs or even man page, stating that only last format option is used. I improved information about --scontext/--context and --lcontext option in info documentation, and mentioned deprecation of these options. Info about "only last format option counts" was added as well. These options were already removed in Fedora, following upstream behaviour. 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 |