From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Fri, 30 Jan 2015 12:21:05 +0100 Message-ID: From: Giacomo Tesio To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e013d1674ee56e7050ddccccf Subject: [9fans] wstat and atomic directory change Topicbox-Message-UUID: 3e630a90-ead9-11e9-9d60-3106f5b1d025 --089e013d1674ee56e7050ddccccf Content-Type: text/plain; charset=UTF-8 Hi, I'm wondering about the validity of an interpretation of intro(5) and stat(5) that could allow a server to atomically change the directory of a file. >>From intro(5) The notation string[s] (using a literal s character) is shorthand for s[2] followed by s bytes of UTF-8 text. (Systems may choose to reduce the set of legal characters to reduce syntactic problems, for example to remove slashes from name compo- nents, *but the protocol has no such restriction*. Plan 9 names may contain any printable character (that is, any character outside hexadecimal 00-1F and 80-9F) except slash.). wstat(5) on the other hand does not say much about the name field of Fcall: The name can be changed by anyone with write permission in the parent directory; it is an error to change the name to that of an existing file. Now, since the protocol does not restrict names (even if Plan 9 does it), I'm wondering if setting the name to a full path starting from root could be used to change atomically the directory of a file (given the write permission on both original and target directory). Obviously I'm not referring to Plan 9 file servers (I guess this would be a non retrocompatbile change), but I'm considering if such interpretation would be wrong (according to the official specifications). A server supporting such behaviour could be considered a 9p2000 conformant server? Giacomo --089e013d1674ee56e7050ddccccf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, I'm wondering about the validity of an interpretat= ion of intro(5) and stat(5) that could allow a server to atomically change = the directory of a file.

From=C2=A0intro(5)
The notation
string[s] (using a literal s character) is shorthand for
s[2] followed by s bytes of UTF-8 text.  (Systems may choose
to reduce the set of legal characters to reduce syntactic
problems, for example to remove slashes from name compo-
nents, but the protocol has no such restriction.  Plan 9
names may contain any printable character (that is, any
character outside hexadecimal 00-1F and 80-9F) except
slash.).

=C2=A0wstat(5)=C2=A0on the other hand does not say mu= ch about the name field of Fcall:

The name can be changed by anyone with write
permission in the parent directory; it is an error to change
the name to that of an existing file.
Now, since the protoc= ol does not restrict names (even if Plan 9 does it), I'm wondering if s= etting the name to a full path starting from root could be used to change a= tomically the directory of a file (given the write permission on both origi= nal and target directory).

Obviously I'm not r= eferring to Plan 9 file servers (I guess this would be a non retrocompatbil= e change), but I'm considering if such interpretation would be wrong (a= ccording to the official specifications).

A server= supporting such behaviour could be considered a 9p2000 conformant server?<= /div>


Giacomo

--089e013d1674ee56e7050ddccccf--