vp = (struct vnode *)dp->d_inode;
#else
code = gop_lookupname_user(path, AFS_UIOUSER, follow, &vp);
+#if defined(AFS_FBSD80_ENV) /* XXX check on 7x */
+ VN_HOLD(vp);
+#endif /* AFS_FBSD80_ENV */
#endif /* AFS_LINUX22_ENV */
#endif /* AFS_AIX41_ENV */
AFS_GLOCK();
#ifdef AFS_LINUX22_ENV
dput(dp);
#else
+#if defined(AFS_FBSD80_ENV)
+ if (VOP_ISLOCKED(vp))
+ VOP_UNLOCK(vp, 0);
+#endif /* AFS_FBSD80_ENV */
AFS_RELE(vp); /* put vnode back */
#endif
}
tvp = afs_GetVolume(&avc->f.fid, areq, READ_LOCK);
if (tvp) {
cp = aout;
- for (i = 0; i < MAXHOSTS; i++) {
+ for (i = 0; i < AFS_MAXHOSTS; i++) {
ts = tvp->serverHost[i];
if (!ts)
break;
memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32));
cp += sizeof(afs_int32);
}
- if (i < MAXHOSTS) {
+ if (i < AFS_MAXHOSTS) {
/* still room for terminating NULL, add it on */
ainSize = 0; /* reuse vbl */
memcpy(cp, (char *)&ainSize, sizeof(afs_int32));
* \param[in] ain not in use
* \param[out] aout PAG value or NOPAG
*
- * \retval E2BIG Error not enough space to copy out value
- *
* \post get PAG value for the caller's cred
*/
DECL_PIOCTL(PGetPAG)
{
afs_int32 pag;
- if (*aoutSize < sizeof(afs_int32)) {
- return E2BIG;
- }
-
pag = PagInCred(*acred);
memcpy(aout, (char *)&pag, sizeof(afs_int32));
DECL_PIOCTL(PNewCell)
{
/* create a new cell */
- afs_int32 cellHosts[MAXCELLHOSTS], *lp, magic = 0;
+ afs_int32 cellHosts[AFS_MAXCELLHOSTS], *lp, magic = 0;
char *newcell = 0, *linkedcell = 0, *tp = ain;
register afs_int32 code, linkedstate = 0, ls;
u_short fsport = 0, vlport = 0;
if (magic != 0x12345678)
return EINVAL;
- /* A 3.4 fs newcell command will pass an array of MAXCELLHOSTS
+ /* A 3.4 fs newcell command will pass an array of AFS_MAXCELLHOSTS
* server addresses while the 3.5 fs newcell command passes
- * MAXHOSTS. To figure out which is which, check if the cellname
+ * AFS_MAXHOSTS. To figure out which is which, check if the cellname
* is good.
*/
- newcell = tp + (MAXCELLHOSTS + 3) * sizeof(afs_int32);
- scount = ((newcell[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
+ newcell = tp + (AFS_MAXCELLHOSTS + 3) * sizeof(afs_int32);
+ scount = ((newcell[0] != '\0') ? AFS_MAXCELLHOSTS : AFS_MAXHOSTS);
- /* MAXCELLHOSTS (=8) is less than MAXHOSTS (=13) */
- memcpy((char *)cellHosts, tp, MAXCELLHOSTS * sizeof(afs_int32));
+ /* AFS_MAXCELLHOSTS (=8) is less than AFS_MAXHOSTS (=13) */
+ memcpy((char *)cellHosts, tp, AFS_MAXCELLHOSTS * sizeof(afs_int32));
tp += (scount * sizeof(afs_int32));
lp = (afs_int32 *) tp;
tcell = afs_GetCellByIndex(whichCell, READ_LOCK);
if (tcell) {
cp = aout;
- memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
- for (i = 0; i < MAXCELLHOSTS; i++) {
+ memset(cp, 0, AFS_MAXCELLHOSTS * sizeof(afs_int32));
+ for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
if (tcell->cellHosts[i] == 0)
break;
memcpy(cp, (char *)&tcell->cellHosts[i]->addr->sa_ip,
sizeof(afs_int32));
cp += sizeof(afs_int32);
}
- cp = aout + MAXCELLHOSTS * sizeof(afs_int32);
+ cp = aout + AFS_MAXCELLHOSTS * sizeof(afs_int32);
strcpy(cp, tcell->cellName);
cp += strlen(tcell->cellName) + 1;
*aoutSize = cp - aout;
ReleaseReadLock(&afs_xvcache);
- MObtainWriteLock(&afs_xdcache, 328); /* needed if you're going to flush any stuff */
+ ObtainWriteLock(&afs_xdcache, 328); /* needed if you're going to flush any stuff */
for (i = 0; i < afs_cacheFiles; i++) {
if (!(afs_indexFlags[i] & IFEverUsed))
continue; /* never had any data */
}
afs_PutDCache(tdc); /* bumped by getdslot */
}
- MReleaseWriteLock(&afs_xdcache);
+ ReleaseWriteLock(&afs_xdcache);
ObtainReadLock(&afs_xvolume);
for (i = 0; i < NVOLS; i++) {
ain += t + 1;
num = count;
}
- if (cr_gid(*acred) == RMTUSER_REQ ||
- cr_gid(*acred) == RMTUSER_REQ_PRIV) { /* Handles all exporters */
- if (allpags && cr_gid(*acred) != RMTUSER_REQ_PRIV) {
+ if (afs_cr_gid(*acred) == RMTUSER_REQ ||
+ afs_cr_gid(*acred) == RMTUSER_REQ_PRIV) { /* Handles all exporters */
+ if (allpags && afs_cr_gid(*acred) != RMTUSER_REQ_PRIV) {
return EPERM;
}
pag = PagInCred(*acred);
for (i = 0; i < s; i++) {
if (l[i] == cell->cellNum) {
ObtainWriteLock(&cell->lock, 690);
- afs_SortServers(cell->cellHosts, MAXCELLHOSTS);
+ afs_SortServers(cell->cellHosts, AFS_MAXCELLHOSTS);
ReleaseWriteLock(&cell->lock);
}
}
for (k = 0; k < s; k++)
if (j->cell == l[k]) {
ObtainWriteLock(&j->lock, 233);
- afs_SortServers(j->serverHost, MAXHOSTS);
+ afs_SortServers(j->serverHost, AFS_MAXHOSTS);
ReleaseWriteLock(&j->lock);
break;
}
#define PIOCTL_HEADER 6
static int
HandleClientContext(struct afs_ioctl *ablob, int *com,
- afs_ucred_t **acred, AFS_UCRED *credp)
+ afs_ucred_t **acred, afs_ucred_t *credp)
{
char *ain, *inData;
afs_uint32 hostaddr;
struct unixuser *au;
afs_uint32 comp = *com & 0xff00;
afs_uint32 h, l;
+#if defined(AFS_SUN510_ENV)
+ gid_t gids[2];
+#endif
#if defined(AFS_SGIMP_ENV)
osi_Assert(ISAFS_GLOCK());
#ifdef AFS_AIX41_ENV
setuerror(0);
#endif
- set_cr_gid(newcred, isroot ? RMTUSER_REQ_PRIV : RMTUSER_REQ);
+ afs_set_cr_gid(newcred, isroot ? RMTUSER_REQ_PRIV : RMTUSER_REQ);
#ifdef AFS_AIX51_ENV
newcred->cr_groupset.gs_union.un_groups[0] = g0;
newcred->cr_groupset.gs_union.un_groups[1] = g1;
#elif defined(AFS_LINUX26_ENV)
-#ifdef AFS_LINUX26_ONEGROUP_ENV
+# ifdef AFS_LINUX26_ONEGROUP_ENV
set_cr_group_info(newcred, groups_alloc(1)); /* not that anything sets this */
l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
h = ((g0-0x3f00) >> 14);
h = ((g1-0x3f00) >> 14) + h + h + h;
GROUP_AT(cr_group_info(newcred), 0) = ((h << 28) | l);
-#else
+# else
set_cr_group_info(newcred, groups_alloc(2));
GROUP_AT(cr_group_info(newcred), 0) = g0;
GROUP_AT(cr_group_info(newcred), 1) = g1;
-#endif
+# endif
+#elif defined(AFS_SUN510_ENV)
+ gids[0] = g0;
+ gids[1] = g1;
+ crsetgroups(newcred, 2, gids);
#else
newcred->cr_groups[0] = g0;
newcred->cr_groups[1] = g1;
#endif
#ifdef AFS_AIX_ENV
newcred->cr_ngrps = 2;
-#elif !defined(AFS_LINUX26_ENV)
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX22_ENV)
+#elif !defined(AFS_LINUX26_ENV) && !defined(AFS_SUN510_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX22_ENV)
newcred->cr_ngroups = 2;
-#else
+# else
for (i = 2; i < NGROUPS; i++)
newcred->cr_groups[i] = NOGROUP;
-#endif
+# endif
#endif
if (!(exporter = exporter_find(exporter_type))) {
/* Exporter wasn't initialized or an invalid exporter type */
return EINVAL;
}
if (exporter->exp_states & EXP_PWSYNC) {
- if (uid != cr_uid(credp)) {
+ if (uid != afs_cr_uid(credp)) {
crfree(newcred);
return ENOEXEC; /* XXX Find a better errno XXX */
}
}
- set_cr_uid(newcred, uid); /* Only temporary */
+ afs_set_cr_uid(newcred, uid); /* Only temporary */
code = EXP_REQHANDLER(exporter, &newcred, hostaddr, &pag, &outexporter);
/* The client's pag is the only unique identifier for it */
- set_cr_uid(newcred, pag);
+ afs_set_cr_uid(newcred, pag);
*acred = newcred;
if (!code && *com == PSETPAG) {
/* Special case for 'setpag' */
return EINVAL;
memcpy(&addr, ain, sizeof(afs_int32));
- if (cr_gid(*acred) == RMTUSER_REQ_PRIV && !addr) {
+ if (afs_cr_gid(*acred) == RMTUSER_REQ_PRIV && !addr) {
tu = afs_GetUser(areq->uid, -1, SHARED_LOCK);
if (!tu->exporter || !(addr = EXP_GETHOST(tu->exporter))) {
afs_PutUser(tu, SHARED_LOCK);