Bug 660619 - getfattr does not return failure when designated attribute does not exist
Summary: getfattr does not return failure when designated attribute does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: attr
Version: 14
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 665050 759077
TreeView+ depends on / blocked
 
Reported: 2010-12-07 11:10 UTC by Jean-Pierre André
Modified: 2013-05-19 22:01 UTC (History)
2 users (show)

Fixed In Version: attr-2.4.44-4.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 665050 (view as bug list)
Environment:
Last Closed: 2011-01-17 20:49:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
proposed fix (814 bytes, patch)
2010-12-07 17:39 UTC, Kamil Dudka
no flags Details | Diff

Description Jean-Pierre André 2010-12-07 11:10:28 UTC
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

Comment 1 Kamil Dudka 2010-12-07 17:39:58 UTC
Created attachment 465275 [details]
proposed fix

Comment 2 Jean-Pierre André 2010-12-07 20:42:45 UTC
Behaves as expected with fix applied. Thanks.

Comment 3 Kamil Dudka 2010-12-22 14:49:03 UTC
fixed in attr-2.4.44-6.fc15

Comment 4 Kamil Dudka 2010-12-22 16:51:18 UTC
proposed upstream:

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

Comment 5 Fedora Update System 2011-01-05 18:58:21 UTC
attr-2.4.44-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/attr-2.4.44-6.fc14

Comment 6 Fedora Update System 2011-01-05 18:58:43 UTC
attr-2.4.44-4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/attr-2.4.44-4.fc13

Comment 7 Fedora Update System 2011-01-06 19:26:45 UTC
attr-2.4.44-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update attr'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/attr-2.4.44-4.fc13

Comment 8 Fedora Update System 2011-01-17 20:49:28 UTC
attr-2.4.44-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-01-23 20:25:14 UTC
attr-2.4.44-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Kamil Dudka 2011-06-27 14:12:53 UTC
upstream commit:

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

Comment 11 Christian Kujau 2013-05-19 22:01:44 UTC
FWIW, upstream just released attr 2.4.47, also containing this fix:

  https://lists.nongnu.org/archive/html/acl-devel/2013-05/msg00012.html


Note You need to log in before you can comment on or make changes to this bug.