Windows: afslogon.dll vs windows 7
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 25 Mar 2010 05:23:23 +0000 (01:23 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 25 Mar 2010 05:28:45 +0000 (22:28 -0700)
In Windows 7 the GINA is no longer used.  As a result, when a
non-Heimdal realm is used for logon, the LogonDomain field
is no longer populated during the NPLogonNotify call.  Instead
we must obtain the Kerberos realm from the UPN specified in
the Username field.

Change-Id: I838e0a5b19d560dd2fed6ccccf1e136fe1c4e0c2
Reviewed-on: http://gerrit.openafs.org/1660
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/afslogon.c

index 0554eed..be5876e 100644 (file)
@@ -854,9 +854,14 @@ DWORD APIENTRY NPLogonNotify(
         !UnicodeStringToANSI(IL->LogonDomainName, logonDomain, MAX_DOMAIN_LENGTH))
        return 0;
 
-    /* Make sure AD-DOMANS sent from login that is sent to us is striped */
+    /* Make sure AD-DOMAINS sent from login that is sent to us is striped */
     ctemp = strchr(uname, '@');
-    if (ctemp) *ctemp = 0;
+    if (ctemp) {
+        *ctemp = 0;
+        ctemp++;
+        if ( logonDomain[0] == '\0' )
+            StringCchCopy(logonDomain, MAX_DOMAIN_LENGTH, ctemp);
+    }
 
     /* is the name all lowercase? */
     for ( ctemp = uname; *ctemp ; ctemp++) {