]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-aklog-afsid-lookup-20060519
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 20 May 2006 04:14:07 +0000 (04:14 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 20 May 2006 04:14:07 +0000 (04:14 +0000)
if the cell matches the realm, do not lookup with realm

src/WINNT/aklog/aklog.c

index d2eb3255cf9c5054dda40240d1d7f32939ce8f3a..ae4970db96c3b70501bfd7f41a7c14f6fdccf716 100644 (file)
@@ -199,10 +199,15 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
     strcpy(lastcell, aserver->cell);
 
     if (!pr_Initialize (0, confname, aserver->cell)) {
-        char sname[PR_MAXNAMELEN];
+        char sname[PR_MAXNAMELEN], *at;
+
         strncpy(sname, username, PR_MAXNAMELEN);
         sname[PR_MAXNAMELEN-1] = '\0';
-        *status = pr_SNameToId (sname, &viceId);
+
+       at = strchr(sname, '@');
+       if (at && !stricmp(at+1, realm_of_cell))
+           *at = '\0';
+       *status = pr_SNameToId (sname, &viceId);
     }
 
     if (dflag)