Coda File System

Re: Manipulating directory entry of newly created file ...

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Thu, 3 Aug 2000 11:29:33 -0400
On Thu, Aug 03, 2000 at 06:46:00PM +0900, Stephen J. Turnbull wrote:
> ... doesn't seem to work.
> 
> Several of Debian's dpkg utilities have code like the following:
> 
> #! /usr/bin/perl
> open(Y,"> file.new") ||
>     die("open new substvars file \`file.new' failed");
> chown(0, 0, "file.new") ||
>     die("chown of \`file.new' failed");
> close(Y)
> 
> which when executed by root in a coda file system dies as follows:
> 
> chown of `file.new' failed at ./oops.pl line 4.
> 
> unless file.new previously existed.
> 
> I seem to recall this is expected behavior (but can't find the
> citation).  If so, is this a restriction of Coda, a bug in Coda, or a
> bug in the Perl code?

Well, chown's could potentially fail anyways, I believe they will
whenever the user doesn't have administrative right on the directory.

But in this case the newly created file is in a special `virgin' state
until some data has been stored into it, which only happens when it is
closed. There are already several special cases for virgin files in the
code, and I rather get rid of such special cases instead of adding more.

On the other hand, we need to have the virgin state to correctly handle
some ACL cases. For instance when someone has i(nsert) rights, but no
w(rite) rights, he should be able to create a new file and store data
into it once.

As far as I can tell it is probably a bug in Coda.

Jan
Received on 2000-08-03 11:44:34