diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-07-02 02:40:35 +0100 |
---|---|---|
committer | Michael Demeter <michael.demeter@intel.com> | 2013-08-12 15:54:58 -0700 |
commit | 0224b79c7cee7d7e6ca2b7d7fa2b81e644409f1f (patch) | |
tree | 9e7ab541c5384383d419d0866fc00036739b29cb | |
parent | 3b012e3ddf85e927b9cbebdd1303ded5aa02ff19 (diff) | |
download | coreutils-0224b79c7cee7d7e6ca2b7d7fa2b81e644409f1f.tar.gz coreutils-0224b79c7cee7d7e6ca2b7d7fa2b81e644409f1f.tar.bz2 coreutils-0224b79c7cee7d7e6ca2b7d7fa2b81e644409f1f.zip |
id: don't show SMACK errors unless -Z is specified
* src/id.c (main): Be consistent with the SELinux case,
and only show errors in getting the security context
when -Z is specified.
-rw-r--r-- | src/id.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -197,7 +197,7 @@ main (int argc, char **argv) error (EXIT_FAILURE, 0, _("cannot print only names or real IDs in default format")); - /* If we are on a selinux-enabled kernel, no user is specified, and + /* If we are on a SELinux/SMACK-enabled kernel, no user is specified, and either --context is specified or none of (-u,-g,-G) is specified, and we're not in POSIXLY_CORRECT mode, get our context. Otherwise, leave the context variable alone - it has been initialized to an @@ -211,7 +211,8 @@ main (int argc, char **argv) error (EXIT_FAILURE, 0, _("can't get process context")); #ifdef HAVE_SMACK else if (smack_enabled - && smack_new_label_from_self ((char **) &context) < 0) + && smack_new_label_from_self ((char **) &context) < 0 + && just_context) error (EXIT_FAILURE, 0, _("can't get process context")); #endif } |