windows-aklog-naming-20050624
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 24 Jun 2005 04:01:48 +0000 (04:01 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 24 Jun 2005 04:01:48 +0000 (04:01 +0000)
Correct for the behavior of pr_SNameToId() lowercasing the username

src/WINNT/afsd/afskfw.c
src/WINNT/aklog/aklog.c

index a7b78ab..7c376ce 100644 (file)
@@ -2544,8 +2544,12 @@ ViceIDToUsername(char *username,
 
     strcpy(lastcell, aserver->cell);
 
-    if (!pr_Initialize (0, confname, aserver->cell))
-        status = pr_SNameToId (username, &viceId);
+    if (!pr_Initialize (0, confname, aserver->cell)) {
+        char sname[PR_MAXNAMELEN];
+        strncpy(sname, username, PR_MAXNAMELEN);
+        sname[PR_MAXNAMELEN-1] = '\0';    
+        status = pr_SNameToId (sname, &viceId);
+    }
 
     /*
      * This is a crock, but it is Transarc's crock, so
@@ -2948,7 +2952,8 @@ KFW_AFS_klog(
         strcpy(aclient.cell, realm_of_cell);
 
         len = min(k5creds->client->realm.length,strlen(realm_of_cell));
-        if ( strncmp(realm_of_cell, k5creds->client->realm.data, len) ) {
+        /* For Khimaira, always append the realm name */
+        if ( 1 /* strncmp(realm_of_cell, k5creds->client->realm.data, len) */ ) {
             char * p;
             strcat(aclient.name, "@");
             p = aclient.name + strlen(aclient.name);
index efce84c..5bb3b02 100644 (file)
@@ -220,8 +220,12 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
 
     strcpy(lastcell, aserver->cell);
 
-    if (!pr_Initialize (0, confname, aserver->cell))
-        *status = pr_SNameToId (username, &viceId);
+       if (!pr_Initialize (0, confname, aserver->cell)) {
+               char sname[PR_MAXNAMELEN];
+               strncpy(sname, username, PR_MAXNAMELEN);
+               sname[PR_MAXNAMELEN-1] = '\0';
+        *status = pr_SNameToId (sname, &viceId);
+       }
 
     if (dflag)
     {
@@ -763,7 +767,8 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
             }
         }
 
-        if (strcmp(realm_of_user, realm_of_cell))
+        /* For Khimaira we want to always append the realm to the name */
+        if (1 /* strcmp(realm_of_user, realm_of_cell) */)
         {
             strcat(username, "@");
             strcat(username, realm_of_user);