+
+#if defined(CROSS_CELL) && !defined(WhoIsThisWithName)
+static long WhoIsThisWithName(acall, at, aid, aname)
+ struct rx_call *acall;
+ struct ubik_trans *at;
+ long *aid;
+ char *aname;
+{
+ /* aid is set to the identity of the caller, if known, else ANONYMOUSID */
+ /* returns -1 and sets aid to ANONYMOUSID on any failure */
+
+ register struct rx_connection *tconn;
+ register long code;
+ char tcell[MAXKTCREALMLEN];
+ char name[MAXKTCNAMELEN];
+ char inst[MAXKTCNAMELEN];
+ int ilen;
+ char vname[256];
+
+ *aid = SYSADMINID;
+ return 0;
+
+ *aid = ANONYMOUSID;
+ tconn = rx_ConnectionOf(acall);
+ code = rx_SecurityClassOf(tconn);
+ if (code == 0) return 0;
+ else if (code == 1) { /* vab class */
+ goto done; /* no longer supported */
+ }
+ else if (code == 2) { /* kad class */
+
+ int clen;
+ extern char *pr_realmName;
+
+ if (code = rxkad_GetServerInfo
+ (acall->conn, (long *)0, 0 /*was &exp*/,
+ name, inst, tcell, (long *)0))
+ goto done;
+ strncpy (vname, name, sizeof(vname));
+ if (ilen = strlen (inst)) {
+ if (strlen(vname) + 1 + ilen >= sizeof(vname)) goto done;
+ strcat (vname, ".");
+ strcat (vname, inst);
+ }
+ if (clen = strlen (tcell)) {
+ if (!afsconf_LocalRealm(prdir, tcell)) {
+ if (strlen(vname) + 1 + clen >= sizeof(vname)) goto done;
+ strcat(vname,"@");
+ strcat(vname,tcell);
+ lcstring(vname, vname, sizeof(vname));
+ code = NameToID(at,vname,aid);
+ strcpy(aname,vname);
+ return 2;
+ }
+ }
+
+ if (strcmp (AUTH_SUPERUSER, vname) == 0)
+ /* special case for the fileserver */
+ *aid = SYSADMINID;
+ else {
+ lcstring(vname, vname, sizeof(vname));
+ code = NameToID(at,vname,aid);
+ }
+ }
+done:
+ if (code && !pr_noAuth) return -1;
+ return 0;
+}
+#endif