{
afs_int32 code;
struct rx_connection *serverconns[MAXSERVERS];
- struct rx_securityClass *sc[3];
+ struct rx_securityClass *sc;
struct afsconf_dir *tdir;
- struct ktc_token ttoken;
afs_int32 scIndex;
struct afsconf_cell info;
afs_int32 i;
code = afsconf_GetCellInfo(tdir, cellstr, "afsprot", &info);
if (code) {
- ViceLog(0, ("hpr_Initialize: Could not locate cell %s in %s/%s", cellstr, confDir, AFSDIR_CELLSERVDB_FILE));
+ ViceLog(0, ("hpr_Initialize: Could not locate cell %s in %s/%s",
+ cellstr, confDir->name, AFSDIR_CELLSERVDB_FILE));
afsconf_Close(tdir);
return code;
}
return code;
}
- scIndex = 2;
- sc[0] = 0;
- sc[1] = 0;
- sc[2] = 0;
/* Most callers use secLevel==1, however, the fileserver uses secLevel==2
* to force use of the KeyFile. secLevel == 0 implies -noauth was
* specified. */
if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
- code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
+ code = afsconf_ClientAuthSecure(tdir, &sc, &scIndex);
if (code)
ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code)));
if (code)
- scIndex = 0; /* use noauth */
- if (scIndex != 2)
- /* if there was a problem, an unauthenticated conn is returned */
- sc[scIndex] = sc[2];
+ scIndex = RX_SECIDX_NULL;
} else {
- struct ktc_principal sname;
- strcpy(sname.cell, info.name);
- sname.instance[0] = 0;
- strcpy(sname.name, "afs");
- code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
- if (code)
- scIndex = 0;
- else {
- if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
- /* this is a kerberos ticket, set scIndex accordingly */
- scIndex = 2;
- else {
- ViceLog(0, ("hpr_Initialize: funny kvno (%d) in ticket, proceeding", ttoken.kvno));
- scIndex = 2;
- }
- sc[2] =
- rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
- ttoken.kvno, ttoken.ticketLen,
- ttoken.ticket);
- }
+ afsconf_ClientAuthToken(&info, 0, &sc, &scIndex, NULL);
}
- if ((scIndex == 0) && (sc[0] == 0))
- sc[0] = rxnull_NewClientSecurityObject();
- if ((scIndex == 0))
+ if ((scIndex == RX_SECIDX_NULL) && (sc == NULL))
+ sc = rxnull_NewClientSecurityObject();
+ if (scIndex == RX_SECIDX_NULL)
ViceLog(0, ("hpr_Initialize: Could not get afs tokens, running unauthenticated. [%d]", code));
memset(serverconns, 0, sizeof(serverconns)); /* terminate list!!! */
for (i = 0; i < info.numServers; i++) {
serverconns[i] =
rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
- info.hostAddr[i].sin_port, PRSRV, sc[scIndex],
- scIndex);
+ info.hostAddr[i].sin_port, PRSRV,
+ sc, scIndex);
}
code = ubik_ClientInit(serverconns, uclient);
ViceLog(0, ("hpr_Initialize: ubik client init failed. [%d]", code));
}
afsconf_Close(tdir);
- code = rxs_Release(sc[scIndex]);
+ code = rxs_Release(sc);
return code;
}
*/
host->hcpsfailed = 1;
ViceLog(0,
- ("Warning: GetHostCPS failed (%d) for %x (%s:%d); will retry\n",
+ ("Warning: GetHostCPS failed (%d) for %p (%s:%d); will retry\n",
code, host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
} else {
host->hcpsfailed = 0;
ViceLog(1,
- ("gethost: GetHostCPS failed (%d) for %x (%s:%d); ignored\n",
+ ("gethost: GetHostCPS failed (%d) for %p (%s:%d); ignored\n",
code, host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
}
if (host->hcps.prlist_val)
if (code < 0) {
char hoststr[16];
ViceLog(0,
- ("Warning: h_TossStuff_r failed: Host %" AFS_PTR_FMT " (%s:%d) client %x was locked.\n",
+ ("Warning: h_TossStuff_r failed: Host %p (%s:%d) "
+ "client %p was locked.\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), client));
return;
if (client->refCount) {
char hoststr[16];
ViceLog(0,
- ("Warning: h_TossStuff_r failed: Host %" AFS_PTR_FMT " (%s:%d) client %x refcount %d.\n",
+ ("Warning: h_TossStuff_r failed: Host %p (%s:%d) "
+ "client %p refcount %d.\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), client, client->refCount));
/* This is the same thing we do if the host is locked */
return;
afsUUID_to_string(uuid, uuid2, 127);
ViceLog(125,
- ("h_AddHostToUuidHashTable_r: host %" AFS_PTR_FMT " (%s:%d) added as uuid %s\n",
+ ("h_AddHostToUuidHashTable_r: host %p (%s:%d) added as uuid %s\n",
host, afs_inet_ntoa_r(chain->hostPtr->host, hoststr),
- ntohs(chain->hostPtr->port), uuid));
+ ntohs(chain->hostPtr->port), uuid2));
}
/* deletes a HashChain structure corresponding to this host */
if (host->interface)
afsUUID_to_string(&host->interface->uuid, uuid2, 127);
ViceLog(0,
- ("CB: new identity for host %" AFS_PTR_FMT " (%s:%d), deleting(%x %x %s %s)\n",
+ ("CB: new identity for host %p (%s:%d), "
+ "deleting(%x %p %s %s)\n",
host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port),
identP->valid, host->interface,
identP->valid ? uuid1 : "no_uuid",
if (*aval == AnonymousID) {
ViceLog(2,
("MapName: NameToId on %s returns anonymousID\n",
- lnames.namelist_val));
+ lnames.namelist_val[0]));
}
free(lids.idlist_val); /* return parms are not malloced in stub if server proc aborts */
} else {
ViceLog(0,
("MapName: NameToId on '%s' is unknown\n",
- lnames.namelist_val));
+ lnames.namelist_val[0]));
code = -1;
}
}
if (!oldClient->deleted) {
/* if we didn't create it, it's not ours to put back */
if (created) {
- ViceLog(0, ("FindClient: stillborn client %x(%x); conn %x (host %s:%d) had client %x(%x)\n",
+ ViceLog(0, ("FindClient: stillborn client %p(%x); "
+ "conn %p (host %s:%d) had client %p(%x)\n",
client, client->sid, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)),
H_LOCK;
client = oldClient;
} else {
- ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n",
+ ViceLog(0, ("FindClient: deleted client %p(%x) already had "
+ "conn %p (host %s:%d), stolen by client %p(%x)\n",
oldClient, oldClient->sid, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)),
client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
if (client == NULL) {
ViceLog(0,
- ("GetClient: no client in conn %x (host %s:%d), VBUSYING\n",
+ ("GetClient: no client in conn %p (host %s:%d), VBUSYING\n",
tcon, afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon))));
H_UNLOCK;
}
if (rxr_CidOf(tcon) != client->sid || rxr_GetEpoch(tcon) != client->VenusEpoch) {
ViceLog(0,
- ("GetClient: tcon %x tcon sid %d client sid %d\n",
+ ("GetClient: tcon %p tcon sid %d client sid %d\n",
tcon, rxr_CidOf(tcon), client->sid));
H_UNLOCK;
return VBUSY;