From: Kenneth C. Schalk <ken@xo...> - 2002-12-10 16:44:48
Two of the classic Vesta blunders are doing mkdir when you meant to do
vcreate and doing vcreate when you meant to do mkdir. The former we
can make vcreate handle by allowing the package directory to already
exist, as long as it is an empty appendable directory.
I started working on this over the weekend. In order to make this
safe, vcreate needs to check whether the directory is empty in the
VestaSourceAtomic action. Since atomic actions are straight-line only
(no if-then-else capability), it must check whether the package exists
*before* the atomic action and alter what we put into the atomic
sequence based on that. If the package doesn't exist at the initial
check, vcreate just proceeds with creating it as it does now. If it
does exist, then instead of creating it the atomic sequence will check
that it is an empty appendable directory.
Performing the emptiness test atomically required extending the
VestaSourceAtomic interface to include the lookupIndex method. This
was fairly easy, but while working on it I discovered that, unlike the
other actions that can be performed through VestaSourceAtomic,
lookupIndex doesn't include an identity parameter. This actually
means that lookupIndex is un-authenticated. I didn't feel like doing
a full audit of the SRPC interface looking for operations that are
missing authentication, so I didn't fix this.
I checked in the repository with this change to the atomic interface
on the branch I've been working in:
While I had it checked out, I also fixed the bug in Replication.C that
caused /vesta-work to get #mode 000.
I checked in the repos_ui changes as:
Get latest updates about Open Source Projects, Conferences and News.