From owner-freebsd-doc@FreeBSD.ORG Sat Mar 26 19:30:04 2005 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFE5216A4CE for ; Sat, 26 Mar 2005 19:30:04 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94A8743D2D for ; Sat, 26 Mar 2005 19:30:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2QJU4Ve017194 for ; Sat, 26 Mar 2005 19:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2QJU4Pf017193; Sat, 26 Mar 2005 19:30:04 GMT (envelope-from gnats) Resent-Date: Sat, 26 Mar 2005 19:30:04 GMT Resent-Message-Id: <200503261930.j2QJU4Pf017193@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Craig Rodrigues Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB5AA16A4CE; Sat, 26 Mar 2005 19:20:47 +0000 (GMT) Received: from rwcrmhc14.comcast.net (rwcrmhc14.comcast.net [216.148.227.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id 748E043D53; Sat, 26 Mar 2005 19:20:47 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.30.114.143]) by comcast.net (rwcrmhc14) with ESMTP id <2005032619204601400au6oee>; Sat, 26 Mar 2005 19:20:46 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.127.in-addr.arpa [127.0.0.1])j2QJKUvP001127; Sat, 26 Mar 2005 14:20:34 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)j2QJKJZT001126; Sat, 26 Mar 2005 14:20:19 -0500 (EST) (envelope-from rodrigc) Message-Id: <200503261920.j2QJKJZT001126@h00609772adf0.ne.client2.attbi.com> Date: Sat, 26 Mar 2005 14:20:19 -0500 (EST) From: Craig Rodrigues To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: kan@FreeBSD.org cc: rodrigc@crodrigues.org cc: rwatson@FreeBSD.org Subject: docs/79261: exttatr_list_file() wrongly documented in exattr(2) man page X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Craig Rodrigues List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2005 19:30:05 -0000 >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@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: