From owner-freebsd-stable Thu Jun 1 12:38: 8 2000 Delivered-To: freebsd-stable@freebsd.org Received: from rr.com (rdu25-28-182.nc.rr.com [24.25.28.182]) by hub.freebsd.org (Postfix) with ESMTP id ACEA837B958 for ; Thu, 1 Jun 2000 12:38:02 -0700 (PDT) (envelope-from rhh@rr.com) Received: (from rhh@localhost) by rr.com (8.9.3/8.9.3) id PAA01274; Thu, 1 Jun 2000 15:38:59 -0400 (EDT) (envelope-from rhh) Date: Thu, 1 Jun 2000 15:38:59 -0400 From: Randall Hopper To: andrew@ugh.net.au Cc: stable@freebsd.org Subject: Re: cp fails to do utimes() (??) Message-ID: <20000601153859.A1062@nc.rr.com> References: <20000531160040.A1299@nc.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from andrew@ugh.net.au on Thu, Jun 01, 2000 at 03:59:52PM +1000 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG andrew@ugh.net.au: |> I can write the file as either user, but in the non-root case the resulting |> file modification time is wrong. | | You can only use utimes if you are root or you own or have write |permission on the file. You aren't root so do you own or have write |permisison to the new file? FAT doesn't support ownership so what does the |owner default to - it may not be you? What permisions are on the file when |utimes is called? ... |Oops...thats only if you are trying to set access and modification times |and I would guess cp isn't so ignore me. No, you're right on! cp -p says to transfer the modification time, ownership, and other attributes from the source file to the dest file. I didn't know about the ownership loophole you mentioned. Searching the mount_msdos page, I found the fstab magic I needed to force ownership for FAT. It's not pretty but it works. /dev/fd0 /a msdos rw,-m777,noauto,-u1234 0 0 /dev/fd1 /b msdos rw,-m777,noauto,-u1234 0 0 /dev/wd0s1 /c msdos rw,-m777,-u1234 0 0 /dev/wd1s1 /d msdos rw,-m777,-u1234 0 0 /dev/wd2s1 /e msdos rw,-m777,-u1234 0 0 /dev/wd0s5 /f msdos rw,-m777,-u1234 0 0 /dev/wd1s5 /g msdos ro,-m555,-u1234 0 0 /dev/wd1s6 /h msdos ro,-m555,-u1234 0 0 cp -p now doesn't complain about either chown or utimes. Thanks for the help, Randall -- Randall Hopper aa8vb@nc.rr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message