From 36233e1e318c7864122cf16c85da012f936c03db Mon Sep 17 00:00:00 2001 From: Olivier Calle Date: Wed, 7 Feb 2007 04:52:18 +0000 Subject: [PATCH] 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 --- src/ptserver/ptprocs.c | 19 ++++++++++++++++++- src/util/get_krbrlm.c | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) 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;