Bug 1123447 - coreutils: ls -lZ is different from ls -Zl
Summary: coreutils: ls -lZ is different from ls -Zl
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-25 16:38 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2014-07-25 18:34 UTC (History)
7 users (show)

Fixed In Version: coreutils-8.23-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-25 18:34:42 UTC


Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2014-07-25 16:38:31 UTC
Description of problem:
Using -Z undoes -l setting, if used after it.
That's not how other ls options work.

Version-Release number of selected component (if applicable):
coreutils-8.22-17.fc21.x86_64

How reproducible:
100%

Steps to Reproduce:
$ ls -dlZ /
drwxr-xr-x. root root system_u:object_r:root_t:s0      /
$ ls -dZl /
drwxr-xr-x. 20 system_u:object_r:root_t:s0      root root 4096 Jul 25 12:07 /

Comment 1 Ondrej Vasik 2014-07-25 18:34:42 UTC
Not true. Try e.g. ls -lm vs. ls -ml . This is exactly how format options behave. Only last one is used.

Unfortunately, RH SELinux patch differs from the upstream a bit (which will change with F22) in the case of SELinux options. RH does have --scontext, --lcontext and --context options - with special security context format. I removed most of the differences, this one was kept, as these downstream ls options were/are part of the various rh documents/rh trainings.

ls -dlZ means use --context format (as -l is overridden by security format)
ls -dZl means use --lcontext format (as -Z enables security context and sets security format - which is overridden by long format).

Previously, it was documented in more details in info documentation, unfortunately this was by-accident removed during one of the rebases.

As this creates this kind of confusion, I removed the security format for Fedora 22/Rawhide with coreutils-8.23 . I will probably remove it for F21, but keep the current behaviour for F20/F19. Closing Rawhide - as this works as you expect with coreutils-8.23-1.fc22.


Note You need to log in before you can comment on or make changes to this bug.