From nobody@FreeBSD.org Wed May 25 03:45:26 2011 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0679106564A for ; Wed, 25 May 2011 03:45:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id A6AE48FC12 for ; Wed, 25 May 2011 03:45:26 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4P3jQSP077651 for ; Wed, 25 May 2011 03:45:26 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p4P3jQcT077650; Wed, 25 May 2011 03:45:26 GMT (envelope-from nobody) Message-Id: <201105250345.p4P3jQcT077650@red.freebsd.org> Date: Wed, 25 May 2011 03:45:26 GMT From: Jason Hellenthal To: freebsd-gnats-submit@FreeBSD.org Subject: getextattr(8) incorrect listing of attibutes with glob on whole directory. X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 157308 >Category: bin >Synopsis: getextattr(8) incorrect listing of attibutes with glob on whole directory. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 25 03:50:06 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Jason Hellenthal >Release: 8.2-STABLE r222214 >Organization: >Environment: FreeBSD disbatch.dataix.local 8.2-STABLE FreeBSD 8.2-STABLE #0 r222214 Tue May 24 01:32:38 EDT 2011 jhell@DataIX.net:/usr/obj/usr/src/sys/DISBATCH i386 >Description: Invoking getextattr(8) on a glob pattern that matches the whole contents of a directory or possibly even a smaller part of the contents display incorrect attributes other than what was set. Invoking getextattr(8) on a single file results in correctly displaying the value. To rule out possible flukes of nature and scripting I copied the explained below 'bin' directory to a seperate filesystem and removed '[' all 'symlinks' and 'direct links' so all that was left were actual files that were only single copies of themself and the situation still repeated across multiple machines. This was tested with '/rescue' '/bin' '/sbin' with the same results. >How-To-Repeat: Set the attributes using short example script here via (root): -------------------------------------------------- #!/bin/sh for file in /bin/*; do setextattr system NAME `basename $file` $file done -------------------------------------------------- Then ensure the attributes are set (should show 'NAME' for every file) lsextattr system /bin/* Then display single correct name (should show 'realpath') getextattr system NAME /bin/realpath Then display list of incorrect names. (Starts displaying incorrectly for larger name than the previously displayed name)(Notice realpath displays as 'realpathmeme') getextattr system NAME /bin/* Bad output: ./[ ./test ./bash ./bash ./cat ./cath ./chflags ./chflags ./chio ./chioags ./chmod ./chmodgs ./cp ./cpmodgs ./csh ./tcshdgs ./date ./datedgs ./dd ./ddtedgs ./df ./dftedgs ./domainname ./domainname ./echo ./echoinname ./ed ./redoinname ./expr ./exprinname ./getfacl ./getfaclame ./hostname ./hostnameme ./kenv ./kenvnameme ./kill ./killnameme ./ksh ./ksh93ameme ./ksh93 ./ksh93ameme ./link ./lnh93ameme ./ln ./lnh93ameme ./ls ./lsh93ameme ./mkdir ./mkdirameme ./mv ./mvdirameme ./pax ./paxirameme ./pgrep ./pkillameme ./pkill ./pkillameme ./ps ./psillameme ./pwait ./pwaitameme ./pwd ./pwditameme ./rcp ./rcpitameme ./realpath realpathmeme ./red ./redathmeme ./rm ./unlinkmeme ./rmail ./rmailkmeme ./rmdir ./rmdirkmeme ./setfacl ./setfacleme ./sh ./shtfacleme ./sleep ./sleepcleme ./stty ./sttypcleme ./sync ./syncpcleme ./tcsh ./tcshpcleme ./test ./testpcleme ./unlink ./unlinkleme ./uuidgen ./uuidgeneme >Fix: Unknown at this time 'WIP' >Release-Note: >Audit-Trail: >Unformatted: