#if !defined(AFS_DARWIN80_ENV)
VOP_UNLOCK(fvp, 0, p);
#endif
- FREE(fname, M_TEMP);
- FREE(tname, M_TEMP);
+#ifdef notdef
+ if (error == EXDEV) {
+ /* The idea would be to have a userspace handler like afsdb to
+ * run mv as the user, thus:
+ */
+ printf("su %d -c /bin/mv /afs/.:mount/%d:%d:%d:%d/%s /afs/.:mount/%d:%d:%d:%d/%s\n",
+ (cn_cred(tcnp))->cr_uid, fvc->fid.Cell, fvc->fid.Fid.Volume,
+ fvc->fid.Fid.Vnode, fvc->fid.Fid.Unique, fname,
+ tvc->fid.Cell, tvc->fid.Fid.Volume, tvc->fid.Fid.Vnode,
+ tvc->fid.Fid.Unique, tname);
+ }
+#endif
#ifdef AFS_DARWIN80_ENV
cache_purge(fdvp);
cache_purge(fvp);
vrele(fdvp);
vrele(fvp);
#endif
+ FREE(fname, M_TEMP);
+ FREE(tname, M_TEMP);
return error;
}
static int
EvalMountData(char type, char *data, afs_uint32 states, afs_uint32 cellnum,
struct volume **avolpp, register struct vrequest *areq,
- afs_uint32 *acellidxp, afs_uint32 *avolnump)
+ afs_uint32 *acellidxp, afs_uint32 *avolnump, afs_uint32 *avnoidp)
{
struct volume *tvp = 0;
struct VenusFid tfid;
afs_int32 prefetch; /* 1=>None 2=>RO 3=>BK */
afs_int32 mtptCell, assocCell = 0, hac = 0;
afs_int32 samecell, roname, len;
- afs_uint32 volid, cellidx;
+ afs_uint32 volid, cellidx, vnoid = 0;
cpos = afs_strchr(data, ':'); /* if cell name present */
if (cpos) {
+ cellnum = 0;
volnamep = cpos + 1;
*cpos = 0;
- tcell = afs_GetCellByName(data, READ_LOCK);
+ for (x = data; *x >= '0' && *x <= '9'; x++)
+ cellnum = (cellnum * 10) + (*x - '0');
+ if (cellnum && !*x)
+ tcell = afs_GetCell(cellnum, READ_LOCK);
+ else {
+ tcell = afs_GetCellByName(data, READ_LOCK);
+ cellnum = 0;
+ }
*cpos = ':';
} else if (cellnum) {
volnamep = data;
}
afs_PutCell(tcell, READ_LOCK);
+ cpos = afs_strrchr(volnamep, ':'); /* if vno present */
+ if (cpos)
+ *cpos = 0;
/* Look for an all-numeric volume ID */
volid = 0;
for (x = volnamep; *x >= '0' && *x <= '9'; x++)
volid = (volid * 10) + (*x - '0');
+ if (cpos) {
+ *cpos = ':';
+ vnoid = 0;
+ if (!*x) /* allow vno with numeric volid only */
+ for (x = (cpos + 1); *x >= '0' && *x <= '9'; x++)
+ vnoid = (vnoid * 10) + (*x - '0');
+ if (*x)
+ vnoid = 0;
+ }
/*
* If the volume ID was all-numeric, and they didn't ask for a
*acellidxp = cellidx;
if (avolnump)
*avolnump = volid;
+ if (avnoidp)
+ *avnoidp = vnoid;
return 0;
}
*acellidxp = cellidx;
if (avolnump)
*avolnump = tvp->volume;
+ if (avnoidp)
+ *avnoidp = vnoid;
if (avolpp)
*avolpp = tvp;
else
struct volume **avolpp, register struct vrequest *areq)
{
afs_int32 code;
+ afs_uint32 avnoid;
AFS_STATCNT(EvalMountPoint);
#ifdef notdef
/* Determine which cell and volume the mointpoint goes to */
code = EvalMountData(avc->linkData[0], avc->linkData + 1,
- avc->states, avc->fid.Cell, avolpp, areq, 0, 0);
+ avc->states, avc->fid.Cell, avolpp, areq, 0, 0,
+ &avnoid);
if (code) return code;
+ if (!avnoid)
+ avnoid = 1;
+
if (avc->mvid == 0)
avc->mvid =
(struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid));
avc->mvid->Cell = (*avolpp)->cell;
avc->mvid->Fid.Volume = (*avolpp)->volume;
- avc->mvid->Fid.Vnode = 1;
+ avc->mvid->Fid.Vnode = avnoid;
avc->mvid->Fid.Unique = 1;
avc->states |= CMValid;
*/
if (afs_IsDynrootMount(adp)) {
struct VenusFid tfid;
- afs_uint32 cellidx, volid;
+ afs_uint32 cellidx, volid, vnoid;
- code = EvalMountData('%', aname, 0, 0, NULL, &treq, &cellidx, &volid);
+ code = EvalMountData('%', aname, 0, 0, NULL, &treq, &cellidx, &volid, &vnoid);
if (code)
goto done;
afs_GetDynrootMountFid(&tfid);