Bug 665050

Summary: getfattr does not return failure when designated attribute does not exist
Product: Red Hat Enterprise Linux 6 Reporter: Kamil Dudka <kdudka>
Component: attrAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: azelinka, jean-pierre.andre, jscotka, kdudka, ovasik, pkovar
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Prior to this update, the getfattr utility did not return a non-zero exit code if an attribute specified in the "getfattr" command did not exist. This unintended behavior has been fixed in this update so that getfattr now returns a non-zero exit code.
Story Points: ---
Clone Of: 660619
: 759077 (view as bug list) Environment:
Last Closed: 2011-09-07 13:07:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 660619    
Bug Blocks: 759077    

Description Kamil Dudka 2010-12-22 14:54:30 UTC
+++ This bug was initially created as a clone of Bug #660619 +++

Description of problem:

When using getfattr in a shell script, a failure is expected when the designated attribute was not set.

Version-Release number of selected component (if applicable):

Fedora 14, attr-2.4.44-5, libattr-2.4.44-5

How reproducible:

Always

Steps to Reproduce:
1. Assume file has no user extended attribute set
2. type "if getfattr -h -e hex -n user.color file; then echo success; else echo failure; fi"
3. 
  
Actual results:

We get :
file: user.color: No such attribute
success

Expected results:

We should get :
file: user.color: No such attribute
failure

Additional info:

The manual is silent about the return codes

--- Additional comment from kdudka on 2010-12-07 18:39:58 CET ---

Created attachment 465275 [details]
proposed fix

--- Additional comment from jean-pierre.andre on 2010-12-07 21:42:45 CET ---

Behaves as expected with fix applied. Thanks.

--- Additional comment from kdudka on 2010-12-22 15:49:03 CET ---

fixed in attr-2.4.44-6.fc15

Comment 1 Kamil Dudka 2010-12-22 16:51:19 UTC
proposed upstream:

http://lists.gnu.org/archive/html/acl-devel/2010-12/msg00004.html

Comment 2 RHEL Program Management 2011-01-07 15:32:34 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 5 Kamil Dudka 2011-06-27 14:12:55 UTC
upstream commit:

http://git.savannah.gnu.org/cgit/attr.git/commit/?id=93c92ed

Comment 7 Petr Kovar 2011-06-29 11:12:47 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the getfattr utility did not return a non-zero exit code if an attribute specified in the "getfattr" command did not exist. This unintended behavior has been fixed in this update so that getfattr now returns a non-zero exit code.

Comment 14 errata-xmlrpc 2011-09-07 13:07:33 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1272.html