bugattr - Bugs: bug #40337, attr_get man page needs updating

 
 

bug #40337: attr_get man page needs updating

Submitted by:  None
Submitted on:  Mon 21 Oct 2013 07:48:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 18 Nov 2013 08:41:44 PM UTC, comment #3:

Fixed by making the Irix compatibility functions behave as documented; I don't like the idea of compatibility functions which are not compatible very much. Also, those functions are now marked as deprecated.

Andreas Gruenbacher <agruen>
Project Administrator
Wed 23 Oct 2013 03:35:49 PM UTC, comment #2:

[I'm the one who originally opened this bug. Sorry, didn't realize I wasn't logged in at the time.]

At this point I think changing the man page to match current linux behavior probably makes the most sense.

Since attr_get is just a wrapper around getxattr now, it might be easiest to just change the attr_get man page to say that on failure, the errno will be set as described in the getxattr man page?

Tony Ernst <tonyernst>
Tue 22 Oct 2013 04:57:16 PM UTC, comment #1:

Hmmm. In retrospect, adding the attr_get, attr_set, attr_list, and attr_multi functions to libattr was a mistake. They were originally there for Irix compatibility only, but they apparently don't even do that well enough.

I wonder how to best proceed from here: un-document the existence of those functions by removing the man pages? Fixing the implementation to more closely match the man pages? Fixing the man pages seems unreasonably given that the functions would then not match their Irix equivalent anymore, anyway.

Andreas Gruenbacher <agruen>
Project Administrator
Mon 21 Oct 2013 07:48:29 PM UTC, original submission:

According to the attr_get man page:
attr_get will fail ...:

[E2BIG] The value of the given attribute is too large
to fit into the buffer. The integer that the
valuelength argument points to has been modified
to show the actual number of bytes that would
be required to store the value of that attribute.

But that's not how it works. Instead, attr_get fails with errno ERANGE and valuelength is unmodified.

get_attr() is mostly just a wrapper around getxattr().

The getxattr man page says:
If the size of the value buffer is too small to
hold the result, errno is set to ERANGE.
...
An empty buffer of size zero can be passed into
these calls to return the current size of the
named extended attribute, which can be used to
estimate the size of a buffer which is
sufficiently large to hold the value associated
with the extended attribute.

The attr_get manpage needs updating (same goes for attr_set).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tonyernst (Posted a comment)
  • -unavailable- added by agruen (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 18 Nov 2013 08:41:44 PM UTCagruenStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 23 Oct 2013 03:36:20 PM UTCtonyernstCarbon-CopyRemoved -unavailable-=>-
    Wed 23 Oct 2013 03:35:49 PM UTCtonyernstCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1