diff options
author | Jim Meyering <meyering@redhat.com> | 2009-09-11 16:30:27 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-09-11 19:58:18 +0200 |
commit | ebbf0a1f0f75490dd7e8b7d717adc46888075e1e (patch) | |
tree | 3b185b3c1770a50ba7de5b169ed3bed7abe3fa0b /src | |
parent | 398749b0cc49773320e6bc56eafabe7e85437412 (diff) | |
download | coreutils-ebbf0a1f0f75490dd7e8b7d717adc46888075e1e.tar.xz |
id: don't print context=... when POSIXLY_CORRECT is set
* src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context.
Reported by Ulrich Drepper.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi (id invocation): Document that id also prints the
security context, when possible, and when POSIXLY_CORRECT is not set.
* tests/id/no-context: New file. Test for this.
* tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'src')
-rw-r--r-- | src/id.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -328,6 +328,9 @@ print_full_info (const char *username) free (groups); } #endif /* HAVE_GETGROUPS */ - if (context != NULL) + + /* POSIX mandates the precise output format, and that it not include + any context=... part, so skip that if POSIXLY_CORRECT is set. */ + if (context != NULL && ! getenv ("POSIXLY_CORRECT")) printf (_(" context=%s"), context); } |