struct ktc_principal *aclient,
int *vicep)
{
- int scIndex;
+ rx_securityIndex scIndex;
int code;
int i;
struct ubik_client *ptconn = 0;
memset(lnames, 0, sizeof *lnames);
memset(lids, 0, sizeof *lids);
- scIndex = 2;
+ scIndex = RX_SECIDX_KAD;
sc = rxkad_NewClientSecurityObject(rxkad_auth,
&atoken->sessionKey, atoken->kvno,
atoken->ticketLen, atoken->ticket);
register struct rx_securityClass *tc;
tc = rxnull_NewClientSecurityObject();
*astr = tc;
- *aindex = 0;
+ *aindex = RX_SECIDX_NULL;
return 0;
}
rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, NULL);
if (tclass) {
*astr = tclass;
- *aindex = 2; /* kerberos security index */
+ *aindex = RX_SECIDX_KAD;
UNLOCK_GLOBAL_MUTEX;
return 0;
} else {
rxkad_NewClientSecurityObject(enclevel, &session, kvno, ticketLen,
tbuffer);
*astr = tclass;
- *aindex = 2; /* kerberos security index */
+ *aindex = RX_SECIDX_KAD;
return 0;
}
afs_int32 code;
*sc = NULL;
- *scIndex = 0;
+ *scIndex = RX_SECIDX_NULL;
strcpy(sname.cell, info->name);
sname.instance[0] = 0;
ttoken.kvno,
ttoken.ticketLen,
ttoken.ticket);
- *scIndex = 2;
+ *scIndex = RX_SECIDX_KAD;
if (expires)
*expires = ttoken.endTime;
}
afs_int32 code = 0;
*sc = NULL;
- *scIndex = 0;
+ *scIndex = RX_SECIDX_NULL;
if (expires)
expires = 0;
}
if (*sc == NULL) {
*sc = rxnull_NewClientSecurityObject();
- *scIndex = 0;
+ *scIndex = RX_SECIDX_NULL;
if (expires)
*expires = NEVERDATE;
}
struct afsconf_dir *tdir = NULL;
afsconf_secflags secFlags;
struct rx_securityClass *sc;
- int scIndex;
+ afs_int32 scIndex;
hostname = as->parms[0].items->data;
th = hostutil_GetHostByName(hostname);
exit(1);
}
- if (scIndex == 0)
+ if (scIndex == RX_SECIDX_NULL)
fprintf(stderr, "bos: running unauthenticated\n");
tconn =
afs_int32 code = 0;
struct afsconf_dir *acdir;
struct rx_securityClass *sc;
- afs_int32 i, scIndex = 0; /* Index of Rx security object - noauth */
+ afs_int32 i, scIndex = RX_SECIDX_NULL;
struct afsconf_cell info;
struct rx_connection *serverconns[VLDB_MAXSERVERS];
afsconf_secflags secFlags;
afs_com_err(whoami, code, "(configuring connection security)");
ERROR(BC_NOCELLCONFIG);
}
- if (scIndex == 0 && !noAuthFlag)
+ if (scIndex == RX_SECIDX_NULL && !noAuthFlag)
afs_com_err(whoami, 0, "Can't get tokens - running unauthenticated");
/* tell UV module about default authentication */
afs_com_err(whoami, code, "(configuring connection security)");
ERROR(BC_NOCELLCONFIG);
}
- if (&udbHandle.uh_scIndex == 0 && !noAuthFlag)
+ if (&udbHandle.uh_scIndex == RX_SECIDX_NULL && !noAuthFlag)
afs_com_err(whoami, 0, "Can't get tokens - running unauthenticated");
if (info.numServers > MAXSERVERS) {
return (-1);
}
- udbHandle.uh_scIndex = RX_SCINDEX_NULL;
+ udbHandle.uh_scIndex = RX_SECIDX_NULL;
udbHandle.uh_secobj = (struct rx_securityClass *)
rxnull_NewClientSecurityObject();
if (sc == NULL) {
sc = rxnull_NewClientSecurityObject();
- scIndex = 0;
+ scIndex = RX_SECIDX_NULL;
}
- if ((scIndex == 0) && (secLevel != 0))
+ if ((scIndex == RX_SECIDX_NULL) && (secLevel != 0))
fprintf(stderr,
"%s: Could not get afs tokens, running unauthenticated\n",
whoami);
/* this shud be equal to VRESTARTING ( util/errors.h ) for old clients to work */
#define RX_RESTARTING (-100)
+typedef enum {
+ RX_SECIDX_NULL = 0,
+ RX_SECIDX_KAD = 2,
+ RX_SECIDX_GK = 4,
+ RX_SECIDX_K5 = 5,
+} rx_securityIndex;
+
struct rx_securityObjectStats {
char type; /* 0:unk 1:null,2:vab 3:kad */
char level;
rxkad_NewClientSecurityObject(parms->authentication, &Ksession,
kvno, ticketLen, ticket);
assert(sc);
- scIndex = 2; /* kerberos security index */
+ scIndex = RX_SECIDX_KAD;
} else {
/* unauthenticated connection */
sc = rxnull_NewClientSecurityObject();
assert(sc);
- scIndex = 0; /* null security index */
+ scIndex = RX_SECIDX_NULL;
}
code = 0;
afs_int32 maxservers, char *serviceid, afs_int32 deadtime,
afs_uint32 server, afs_uint32 port, afs_int32 usrvid)
{
- afs_int32 code, scIndex, secFlags, i;
+ afs_int32 code, secFlags, i;
+ afs_int32 scIndex;
struct afsconf_cell info;
struct afsconf_dir *tdir;
struct rx_securityClass *sc;
fprintf(stderr, "%s: can't create client security object", funcName);
return -1;
}
- if (scIndex == 0) {
+ if (scIndex == RX_SECIDX_NULL) {
fprintf(stderr,
"%s: Could not get afs tokens, running unauthenticated.\n",
funcName);
printf("%s: Can't create client security object\n", uss_whoami);
exit(1);
}
- if (scIndex == 0 && !a_noAuthFlag) {
+ if (scIndex == RX_SECIDX_NULL && !a_noAuthFlag) {
fprintf(stderr,
"%s: Couldn't get AFS tokens, running unauthenticated.\n",
uss_whoami);
afs_int32 code;
*sc = NULL;
- *scIndex = 0;
+ *scIndex = RX_SECIDX_NULL;
tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
if (!tdir) {
#endif
code = afsconf_ClientAuthToken(&p->info, 0, &p->sc, &p->scIndex);
if (code) {
- p->scIndex = 0;
+ p->scIndex = RX_SECIDX_NULL;
p->sc = rxnull_NewClientSecurityObject();
}
}
pxclient_Initialize(int auth, afs_int32 serverAddr)
{
afs_int32 code;
- afs_int32 scIndex;
+ rx_securityIndex scIndex;
struct rx_securityClass *sc;
code = rx_Init(htons(2115) /*0 */ );
fprintf(stderr, "pxclient_Initialize: Could not initialize rx.\n");
return code;
}
- scIndex = 0;
+ scIndex = RX_SECIDX_NULL;
rx_SetRxDeadTime(50);
sc = rxnull_NewClientSecurityObject();
serverconns[0] =
if (code)
ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code)));
if (code)
- scIndex = 0; /* use noauth */
+ scIndex = RX_SECIDX_NULL;
} else {
afsconf_ClientAuthToken(&info, 0, &sc, &scIndex, NULL);
}
- if ((scIndex == 0) && (sc == NULL))
+ if ((scIndex == RX_SECIDX_NULL) && (sc == NULL))
sc = rxnull_NewClientSecurityObject();
- if (scIndex == 0)
+ 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!!! */
afs_int32
vl_Initialize(const char *confDir)
{
- afs_int32 code, scIndex = 0, i;
+ afs_int32 code, i;
+ afs_int32 scIndex = RX_SECIDX_NULL;
struct afsconf_dir *tdir;
struct rx_securityClass *sc;
struct afsconf_cell info;