From owner-freebsd-stable@FreeBSD.ORG Thu Sep 22 16:59:12 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A9E106564A for ; Thu, 22 Sep 2011 16:59:12 +0000 (UTC) (envelope-from dmagda@ee.ryerson.ca) Received: from eccles.ee.ryerson.ca (ee.ryerson.ca [141.117.1.2]) by mx1.freebsd.org (Postfix) with ESMTP id 13F7D8FC16 for ; Thu, 22 Sep 2011 16:59:09 +0000 (UTC) Received: from webmail.ee.ryerson.ca (eccles [172.16.1.2]) by eccles.ee.ryerson.ca (8.14.4/8.14.4) with ESMTP id p8MGx8VK056999; Thu, 22 Sep 2011 12:59:08 -0400 (EDT) (envelope-from dmagda@ee.ryerson.ca) Received: from 206.108.127.2 (SquirrelMail authenticated user dmagda) by webmail.ee.ryerson.ca with HTTP; Thu, 22 Sep 2011 12:59:08 -0400 Message-ID: In-Reply-To: References: Date: Thu, 22 Sep 2011 12:59:08 -0400 From: "David Magda" To: =?iso-8859-1?Q?=22Olivier_Cochard-Labb=E9=22?= User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-stable@freebsd.org Subject: Re: cpio and directory owner preservation behaviour X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2011 16:59:12 -0000 On Thu, September 22, 2011 10:54, Olivier Cochard-Labbé wrote: [...] > [root@R3]/#(cd /usr/local/etc; find . -name ripd.conf -type f | cpio > -dumpv /tmp/) > > The file owner and permission for ripd.conf is keept: > [root@R3]/#ls -alh /tmp/quagga/ripd.conf > -rw------- 1 quagga quagga 134B Sep 22 15:28 /tmp/quagga/ripd.conf > > But not the directory owner that is changed to root:wheel > [root@R3]/#ls -alh /tmp | grep quagga > drwxr-xr-x 2 root wheel 512B Sep 22 16:41 quagga > > Is a cpio bug ? No it is not a bug, because the find(1) command will only print "quagga/ripd.conf" to its output, and not "quagga/" as well. Since cpio(1) only receives "quagga/ripd.conf", it will only put the information for that item in the archive stream. Try the following command: # (cd /usr/local/etc; find quagga | cpio -dumpv /tmp/) instead. This should grab quagga/ itself, in addition to its contents in the archive stream. If you want to know which items (files, directories, other) that cpio(1) grab information on just run the find(1) without piping its output anywhere. If you don't see the item of interest on a line of its own, cpio(1) will not grab its metadata.