Bug 217177

Summary: id <username> fails with "id: cannot print security context when user specified"
Product: [Fedora] Fedora Reporter: Mike Bonnet <mikeb>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: meyering, pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 5.97-16.fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-24 13:36:38 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
fix for the above none

Description Mike Bonnet 2006-11-24 12:35:37 EST
Description of problem:
When passing a username to id, it prints the message

id: cannot print security context when user specified

and exits with status 1.

Version-Release number of selected component (if applicable):
coreutils-5.97-15.fc7

How reproducible:
Always

Steps to Reproduce:
1. run: id root
2.
3.
  
Actual results:
id: cannot print security context when user specified

Expected results:
No error

Additional info:
Comment 2 Jim Meyering 2006-11-24 12:45:01 EST
Hi,
Running id with both a user name and -Z doesn't make sense.
And that's why id now fails -- this recent change addressed BZ#211089.
The problem is not with coreutils, but rather with the code that
invokes "id" that way.
Comment 3 Mike Bonnet 2006-11-24 13:05:33 EST
I am not passing -Z to id.  The problem occurs with a straight

$ id root

and with

$ id -g root

There is no -Z being passed on the command-line.
Comment 4 Jim Meyering 2006-11-24 13:13:27 EST
Oh!  That makes all the difference.  Obviously a bug.  I should have tried your
"How to reproduce" command.
Comment 5 Jim Meyering 2006-11-24 13:25:33 EST
Created attachment 142084 [details]
fix for the above

FYI, here's the obvious (albeit untested) patch.
Comment 6 Tim Waugh 2006-11-24 13:36:38 EST
Sorry!