multiple-local-realms-20070201

FIXES 52459

when the name is foreign, execute the body of afs_is_foreign_ticket_name

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
FIXES 52459

The Name to ID RPC must distinguish between local and foreign names
This commit is contained in:
Olivier Calle 2007-02-07 04:52:18 +00:00 committed by Jeffrey Altman
parent 55653d5dd0
commit 36233e1e31
2 changed files with 19 additions and 2 deletions

View File

@ -628,7 +628,24 @@ nameToID(call, aname, aid)
ABORT_WITH(tt, code);
for (i = 0; i < aname->namelist_len; i++) {
code = NameToID(tt, aname->namelist_val[i], &aid->idlist_val[i]);
char vname[256];
char *nameinst, *cell;
strncpy(vname, aname->namelist_val[i], sizeof(vname));
vname[sizeof(vname)-1] ='\0';
nameinst = vname;
cell = strchr(vname, '@');
if (cell) {
*cell = '\0';
cell++;
}
if (cell && afs_is_foreign_ticket_name(nameinst,NULL,cell,pr_realmName))
code = NameToID(tt, aname->namelist_val[i], &aid->idlist_val[i]);
else
code = NameToID(tt, nameinst, &aid->idlist_val[i]);
if (code != PRSUCCESS)
aid->idlist_val[i] = ANONYMOUSID;
osi_audit(PTS_NmToIdEvent, code, AUD_STR,

View File

@ -122,7 +122,7 @@ afs_is_foreign_ticket_name(char *tname, char *tinst, char * tcell, char *localre
foreign = 1;
#if defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV)
if (!foreign) {
if (foreign) {
static char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ];
static int num_lrealms = -1;
int lrealm_match, i;