docs/79261: exttatr_list_file() wrongly documented in exattr(2) man page

Craig Rodrigues rodrigc at crodrigues.org
Sat Mar 26 19:30:05 UTC 2005


>Number:         79261
>Category:       docs
>Synopsis:       exttatr_list_file() wrongly documented in exattr(2) man page
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 26 19:30:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Craig Rodrigues
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dibbler.crodrigues.org 6.0-CURRENT FreeBSD 6.0-CURRENT #28: Sat Mar 26 13:25:05 EST 2005 rodrigc at dibbler.crodrigues.org:/opt/home/rodrigc/xfs/xfs_kernel/sys/i386/compile/XFS_KERNEL i386


	
>Description:
	While implementing extended attribute for the FreeBSD port of the
	XFS file system, I ran across the following in the extattr(2) man
	page:
	The extattr_list_file() returns a list of attributes present in the 
	requested namespace, separated by ASCII 0 (nul) characters.

	However, when I implemented this system call for XFS,
	the /usr/sbin/lsextattr utility did not work.  After looking at
	the source code for lsexttatr, I found the following code:

    234                         for (i = 0; i < error; i += buf[i] + 1)
    235                             printf("%s%*.*s", i ? "\t" : "",
    236                                 buf[i], buf[i], buf + i + 1);

	lsextattr expects to receive a buffer of extended attribute
	names.  Each name is preceded by one byte which contains
	the length of the attribute name.  Each attribute name
	is *NOT* NULL terminated in the buffer.

	I suggest that the man page for extattr(2) be changed
	to reflect the reality of what lsextattr expects.
	
>How-To-Repeat:
	
>Fix:

--- extattr_get_file.2.orig	Sat Mar 26 14:16:50 2005
+++ extattr_get_file.2	Sat Mar 26 14:19:11 2005
@@ -97,8 +97,10 @@
 system call deletes the extended attribute specified.
 The
 .Fn extattr_list_file
-returns a list of attributes present in the requested namespace, separated
-by ASCII 0 (nul) characters.
+returns a list of attributes present in the requested namespace.
+Each list entry consists of a single byte containing the length
+of the attribute name, followed by the attribute name.  The
+attribute name is not terminated by ASCII 0 (nul).
 The
 .Fn extattr_get_file ,
 and
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list