Windows: KFW_AFS_get_cred userrealm
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 26 Jul 2011 21:34:52 +0000 (17:34 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Sun, 31 Jul 2011 17:17:55 +0000 (10:17 -0700)
The userrealm string in KFW_AFS_get_cred() should not include
the '@' symbol from the user principal.  Including the '@' produces
an invalid realm name.

Change-Id: I5887ffabce93666bdbe231eaac0821573162a6ba
Reviewed-on: http://gerrit.openafs.org/5110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/afskfw.c

index d5a8866..781da61 100644 (file)
@@ -1399,8 +1399,9 @@ KFW_AFS_get_cred( char * username,
             while ( dot = strchr(pname,'.') ) {
                 *dot = '/';
             }
-            *userrealm++ = '@';
+            *userrealm = '@';
         }
+        userrealm++;
     } else {
         size_t len = strlen(username) + strlen(realm) + 2;
         pname = malloc(len);
@@ -1424,7 +1425,7 @@ KFW_AFS_get_cred( char * username,
         OutputDebugString(realm);
         OutputDebugString("\n");
         OutputDebugString("Realm of User: ");
-        OutputDebugString(userrealm);
+        OutputDebugString(userrealm?userrealm:"<NULL>");
         OutputDebugString("\n");
     }