All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
@ 2014-08-28 20:47 Paul Moore
  2014-08-29 12:09 ` Stephen Smalley
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Moore @ 2014-08-28 20:47 UTC (permalink / raw)
  To: Serge Hallyn, selinux

I'm not sure the exact date of the change, but 'ls -Z' on Rawhide is
a bit different than in the past; the output now looks like this:

  # /bin/ls -Z test
  system_u:object_r:test_file_t:s0 test

This patch converts the testsuite to use 'ls -lZ' which appears to be
consistent.

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 tests/file/test |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/file/test b/tests/file/test
index e6ed44d..1c8485a 100755
--- a/tests/file/test
+++ b/tests/file/test
@@ -45,9 +45,9 @@ system "chcon -t fileop_exec_t $basedir/wait_io 2>&1 > /dev/null";
 #
 # Get the SID of the good file.
 #
-$output = `ls -Z $basedir/temp_file`;
+$output = `ls -lZ $basedir/temp_file`;
 @arr = split(' ', $output);
-$good_file_sid = $arr[3];
+$good_file_sid = $arr[4];
 
 #
 # Attempt to access a restricted file as the 'good' domain.  The first test

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
  2014-08-28 20:47 [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results Paul Moore
@ 2014-08-29 12:09 ` Stephen Smalley
  2014-08-29 14:37   ` Paul Moore
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Smalley @ 2014-08-29 12:09 UTC (permalink / raw)
  To: Paul Moore, Serge Hallyn, selinux, Daniel J Walsh

On 08/28/2014 04:47 PM, Paul Moore wrote:
> I'm not sure the exact date of the change, but 'ls -Z' on Rawhide is
> a bit different than in the past; the output now looks like this:
> 
>   # /bin/ls -Z test
>   system_u:object_r:test_file_t:s0 test

That seems very wrong - who knows how many userspace scripts may rely on
the output of ls -Z having a given format?   Is this a change in
upstream coreutils or Fedora-specific?

> 
> This patch converts the testsuite to use 'ls -lZ' which appears to be
> consistent.
> 
> Signed-off-by: Paul Moore <pmoore@redhat.com>
> ---
>  tests/file/test |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/file/test b/tests/file/test
> index e6ed44d..1c8485a 100755
> --- a/tests/file/test
> +++ b/tests/file/test
> @@ -45,9 +45,9 @@ system "chcon -t fileop_exec_t $basedir/wait_io 2>&1 > /dev/null";
>  #
>  # Get the SID of the good file.
>  #
> -$output = `ls -Z $basedir/temp_file`;
> +$output = `ls -lZ $basedir/temp_file`;
>  @arr = split(' ', $output);
> -$good_file_sid = $arr[3];
> +$good_file_sid = $arr[4];
>  
>  #
>  # Attempt to access a restricted file as the 'good' domain.  The first test
> 
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
  2014-08-29 12:09 ` Stephen Smalley
@ 2014-08-29 14:37   ` Paul Moore
  2014-08-29 15:12     ` Stephen Smalley
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Moore @ 2014-08-29 14:37 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: Serge Hallyn, selinux

On Friday, August 29, 2014 08:09:29 AM Stephen Smalley wrote:
> On 08/28/2014 04:47 PM, Paul Moore wrote:
> > I'm not sure the exact date of the change, but 'ls -Z' on Rawhide is
> > 
> > a bit different than in the past; the output now looks like this:
> >   # /bin/ls -Z test
> >   system_u:object_r:test_file_t:s0 test
> 
> That seems very wrong - who knows how many userspace scripts may rely on
> the output of ls -Z having a given format?   Is this a change in
> upstream coreutils or Fedora-specific?

It does seems a bit odd to me too, but I'm in need of a quick solution and 
changing to using the '-l' flag served that purpose.  I can try to track down 
the source of the change, but it probably isn't going to happen today.

In the meantime, using '-l' doesn't hurt anything, and it works.

-- 
paul moore
security and virtualization @ redhat

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
  2014-08-29 14:37   ` Paul Moore
@ 2014-08-29 15:12     ` Stephen Smalley
  2014-08-29 15:23       ` Paul Moore
  2014-08-29 18:06       ` Paul Moore
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Smalley @ 2014-08-29 15:12 UTC (permalink / raw)
  To: Paul Moore; +Cc: Serge Hallyn, selinux

On 08/29/2014 10:37 AM, Paul Moore wrote:
> On Friday, August 29, 2014 08:09:29 AM Stephen Smalley wrote:
>> On 08/28/2014 04:47 PM, Paul Moore wrote:
>>> I'm not sure the exact date of the change, but 'ls -Z' on Rawhide is
>>>
>>> a bit different than in the past; the output now looks like this:
>>>   # /bin/ls -Z test
>>>   system_u:object_r:test_file_t:s0 test
>>
>> That seems very wrong - who knows how many userspace scripts may rely on
>> the output of ls -Z having a given format?   Is this a change in
>> upstream coreutils or Fedora-specific?
> 
> It does seems a bit odd to me too, but I'm in need of a quick solution and 
> changing to using the '-l' flag served that purpose.  I can try to track down 
> the source of the change, but it probably isn't going to happen today.
> 
> In the meantime, using '-l' doesn't hurt anything, and it works.

...on rawhide, maybe.  It breaks the test on Fedora 20, and presumably
on every older Fedora and RHEL release.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
  2014-08-29 15:12     ` Stephen Smalley
@ 2014-08-29 15:23       ` Paul Moore
  2014-08-29 18:06       ` Paul Moore
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Moore @ 2014-08-29 15:23 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: Serge Hallyn, selinux

On Friday, August 29, 2014 11:12:58 AM Stephen Smalley wrote:
> On 08/29/2014 10:37 AM, Paul Moore wrote:
> > On Friday, August 29, 2014 08:09:29 AM Stephen Smalley wrote:
> >> On 08/28/2014 04:47 PM, Paul Moore wrote:
> >>> I'm not sure the exact date of the change, but 'ls -Z' on Rawhide is
> >>> 
> >>> a bit different than in the past; the output now looks like this:
> >>>   # /bin/ls -Z test
> >>>   system_u:object_r:test_file_t:s0 test
> >> 
> >> That seems very wrong - who knows how many userspace scripts may rely on
> >> the output of ls -Z having a given format?   Is this a change in
> >> upstream coreutils or Fedora-specific?
> > 
> > It does seems a bit odd to me too, but I'm in need of a quick solution and
> > changing to using the '-l' flag served that purpose.  I can try to track
> > down the source of the change, but it probably isn't going to happen
> > today.
> > 
> > In the meantime, using '-l' doesn't hurt anything, and it works.
> 
> ...on rawhide, maybe.  It breaks the test on Fedora 20, and presumably
> on every older Fedora and RHEL release.

I didn't realize the '-lZ' format changed as well ... sigh.

-- 
paul moore
security and virtualization @ redhat

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results
  2014-08-29 15:12     ` Stephen Smalley
  2014-08-29 15:23       ` Paul Moore
@ 2014-08-29 18:06       ` Paul Moore
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Moore @ 2014-08-29 18:06 UTC (permalink / raw)
  To: selinux; +Cc: Serge Hallyn, Stephen Smalley

On Friday, August 29, 2014 11:12:58 AM Stephen Smalley wrote:
> On 08/29/2014 10:37 AM, Paul Moore wrote:
> > In the meantime, using '-l' doesn't hurt anything, and it works.
> 
> ...on rawhide, maybe.  It breaks the test on Fedora 20, and presumably
> on every older Fedora and RHEL release.

Just to add a follow-up to the list ... we dug into this a bit more off-list 
and it appears that when Fedora Rawhide moved to coreutils-8.23 from 8.22 they 
adopted the upstream coreutils output formatting.

-- 
paul moore
security and virtualization @ redhat

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-29 18:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28 20:47 [PATCH] file: replace 'ls -Z' with 'ls -lZ' for consistent results Paul Moore
2014-08-29 12:09 ` Stephen Smalley
2014-08-29 14:37   ` Paul Moore
2014-08-29 15:12     ` Stephen Smalley
2014-08-29 15:23       ` Paul Moore
2014-08-29 18:06       ` Paul Moore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.