[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kadmin bug (missing mod_name)


kadmin will crash when you `get' a principal, and that principal entry
does not have a modifier associated with it (i.e. mod_name == NULL).
This is the case when using the Heimdal KDC with an LDAP backend.
The following patch should be used to save sanity:

--- kadmin/get.c.orig	Wed Nov  8 12:28:57 2000
+++ kadmin/get.c	Wed Nov  8 12:44:44 2000
@@ -150,7 +150,10 @@
     printf("%24s: %d\n", "Failed login count", princ->fail_auth_count);
     time_t2str(princ->mod_date, buf, sizeof(buf), 1);
     printf("%24s: %s\n", "Last modified", buf);
-    krb5_unparse_name_fixed(context, princ->mod_name, buf, sizeof(buf));
+    if (princ->mod_name)
+	    krb5_unparse_name_fixed(context, princ->mod_name, buf, sizeof(buf));
+    else
+	    strcpy(buf, "<none>");
     printf("%24s: %s\n", "Modifier", buf);
     attributes2str (princ->attributes, buf, sizeof(buf));
     printf("%24s: %s\n", "Attributes", buf);

Why the LDAP hdb has problems finding a modifier is another story I
haven't determined yet.
Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org