From owner-freebsd-questions@FreeBSD.ORG Mon Aug 28 18:13:09 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A0A916A4DA for ; Mon, 28 Aug 2006 18:13:09 +0000 (UTC) (envelope-from obrieng@nm.cbc.ca) Received: from mail02.nm.cbc.ca (mail02.nm.cbc.ca [159.33.1.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9294B43D45 for ; Mon, 28 Aug 2006 18:12:33 +0000 (GMT) (envelope-from obrieng@nm.cbc.ca) Received: from hub.cbc.ca (hub.nm.cbc.ca [192.168.1.119]) by mail02.nm.cbc.ca (Postfix) with ESMTP id D9947272D2A for ; Mon, 28 Aug 2006 14:12:25 -0400 (EDT) Received: from localhost (localhost.cbc.ca [127.0.0.1]) by hub.cbc.ca (Postfix) with ESMTP id B711B6A47D for ; Mon, 28 Aug 2006 14:12:25 -0400 (EDT) Received: from hub.cbc.ca ([127.0.0.1]) by localhost (hub.cbc.ca [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 74994-01-18 for ; Mon, 28 Aug 2006 14:12:25 -0400 (EDT) Received: from [1.151.32.18] (intd.cbc.ca [159.33.1.75]) by hub.cbc.ca (Postfix) with ESMTP id D70D46A47A for ; Mon, 28 Aug 2006 14:12:24 -0400 (EDT) Message-ID: <44F33207.2070401@nm.cbc.ca> Date: Mon, 28 Aug 2006 14:12:23 -0400 From: Gabriel O'Brien User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.cbc.ca Subject: FreeBSD 5.4: 'cp -p' does not behave as documented X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 18:13:09 -0000 Hi folks, FreeBSD 5.4-RELEASE-p6 i386 We have a script in our environment that is used to back up our mail logs. In essence it does: cp -p /var/log/maillog.0.bz2 /stats/maillogs/maillog-testcopy.bz2 According to the cp man page: -p Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions. If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered. However, when I run this script or when I do a cp -p manually I am seeing: cp: chown: /stats/maillogs/maillog-copy-test.bz2: Permission denied For the record the user does not actually have permissions to do the chown, however we would still like to use 'cp -p' in order to preserve the remainder of the attributes and according to the docs this should be possible. Does anybody have any insight? I note this issue does not appear to exist on our FreeBSD 6.1 boxes. cheers, Gabriel O'Brien