diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index f08a82b67e..d32aee0bfe 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -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, diff --git a/src/util/get_krbrlm.c b/src/util/get_krbrlm.c index c6f4980410..2f9e7d2c8e 100644 --- a/src/util/get_krbrlm.c +++ b/src/util/get_krbrlm.c @@ -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;