DEVEL15-windows-kauth-cell-search-registry-20090616
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 19 Jun 2009 04:15:23 +0000 (04:15 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 19 Jun 2009 04:15:23 +0000 (04:15 +0000)
LICENSE MIT

add registry based cell search to ka_UserAuthenticateGeneral2()
which is used by klog() and afslogon.dll when no kerberos support
is available.

(cherry picked from commit 3af8eafae68b7260941b59346720730410f97944)

src/kauth/user_nt.c

index da99ac4..62327ec 100644 (file)
@@ -22,6 +22,7 @@ RCSID
 #include <stdio.h>             /* sprintf */
 #include <malloc.h>
 #include <afs/kautils.h>
+#include <afs/cm.h>
 #include <afs/cm_config.h>
 #include <afs/krb.h>
 #include <afs/krb_prot.h>
@@ -107,7 +108,9 @@ ka_UserAuthenticateGeneral2(afs_int32 flags, char *name, char *instance,
     if (lifetime == 0)
        lifetime = MAXKTCTICKETLIFETIME;
 
-    code = cm_SearchCellFile(realm, fullRealm, ka_AddHostProc, NULL);
+    code = cm_SearchCellRegistry(1, realm, fullRealm, NULL, ka_AddHostProc, NULL);
+    if (code && code != CM_ERROR_FORCE_DNS_LOOKUP)
+        code = cm_SearchCellFile(realm, fullRealm, ka_AddHostProc, NULL);
 
 #ifdef AFS_AFSDB_ENV
     if (code) {