[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coreutils] [PATCHv2] stat: print SELinux context when available
From: |
Jim Meyering |
Subject: |
Re: [coreutils] [PATCHv2] stat: print SELinux context when available |
Date: |
Tue, 05 Oct 2010 11:03:23 +0200 |
Pádraig Brady wrote:
> The attached fixes a logic inversion issue,
> and doesn't print context in file system mode
> which is confusing to me at least.
>
> There is also the argument not to print context
> in terse mode at all, as we'll have issues
> with outputting other extended attributes
> like capabilities and ACLs etc?
...
> Subject: [PATCH] stat: adjust the printing of SELinux context
>
> * src/stat.c (default_format): Don't print SELinux context
> when in file system (-f) mode, as the context is associated
> with the file, not the file system.
> Fix logic inversion, so that in terse mode, %C is included
> only when is_selinux_enabled and not vice versa.
Good catches. Thanks!
The above fixes sound fine.
...
> - if (0 < is_selinux_enabled ())
> + if (is_selinux_enabled ())
...
> - if (0 < is_selinux_enabled ())
> + if (is_selinux_enabled ())
However, the changes to the use of is_selinux_enabled look wrong,
since that function returns -1 upon failure.
That's why we test 0 < is_selinux_enabled ().
>From the man page:
DESCRIPTION
is_selinux_enabled returns 1 if SELinux is running or 0 if it is
not. On error, -1 is returned.
- [coreutils] stat and SELinux context, Eric Blake, 2010/10/01
- Re: [coreutils] stat and SELinux context, Pádraig Brady, 2010/10/01
- [coreutils] [PATCH] stat: print SELinux context when available, Eric Blake, 2010/10/01
- Re: [coreutils] [PATCHv2] stat: print SELinux context when available, Pádraig Brady, 2010/10/05
- Re: [coreutils] [PATCHv2] stat: print SELinux context when available,
Jim Meyering <=
- Re: [coreutils] [PATCHv2] stat: print SELinux context when available, Pádraig Brady, 2010/10/05
- Re: [coreutils] [PATCHv2] stat: print SELinux context when available, Eric Blake, 2010/10/05
- Re: [coreutils] [PATCHv2] stat: print SELinux context when available, Jim Meyering, 2010/10/05
- [coreutils] [PATCH] stat: drop %C support when printing file system details, Eric Blake, 2010/10/05
- Re: [coreutils] [PATCH] stat: drop %C support when printing file system details, Eric Blake, 2010/10/05
- Re: [coreutils] [PATCH] stat: drop %C support when printing file system details, Jim Meyering, 2010/10/05
- Re: [coreutils] [PATCH] stat: optimize and translate default format strings, Jim Meyering, 2010/10/01
- Re: [coreutils] [PATCH] stat: optimize and translate default format strings, Eric Blake, 2010/10/01
- Re: [coreutils] [PATCH] stat: optimize and translate default format strings, Jim Meyering, 2010/10/01