kdb5_verify.c: Check principals with correct realm name
authorTheodore Tso <tytso@mit.edu>
Mon, 24 Oct 1994 18:32:22 +0000 (18:32 +0000)
committerTheodore Tso <tytso@mit.edu>
Mon, 24 Oct 1994 18:32:22 +0000 (18:32 +0000)
configure.in: Look for ndbm or dbm libraries

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4556 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/verify/ChangeLog
src/tests/verify/configure.in
src/tests/verify/kdb5_verify.c

index 7da8d0654357da3f7c185c4c96bc20a529c2c9dd..e809cc837a485e9c8da947ea2ddc030142b67d58 100644 (file)
@@ -1,3 +1,10 @@
+Sun Oct 23 00:50:42 1994    (tytso@rsx-11)
+
+       * kdb5_verify.c (check_princ): Check principals with the correct
+               realm name.
+
+       * configure.in: Look for ndbm or dbm libraries
+
 Thu Oct  6 12:42:47 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * kdb5_verify.c (main, set_dbname_help): Allow master key password
index 591e3d66325abd2b1c049c72c2dec8f60d1643dd..c067f1f3d04f9bf8498c1361e8d9f3aa9882fe58 100644 (file)
@@ -5,6 +5,8 @@ AC_SET_BUILDTOP
 AC_PROG_INSTALL
 AC_HAVE_LIBRARY(socket)
 AC_HAVE_LIBRARY(nsl)
+AC_HAVE_LIBRARY(-lndbm)
+AC_HAVE_LIBRARY(-ldbm)
 KRB_INCLUDE
 ISODE_INCLUDE
 WITH_KRB5ROOT
index d5671e0ba8c3507de63bceab13ff265c1ca5e4d2..6c5d37a7c62fbe52a6d1f356be96864ff5e947a2 100644 (file)
@@ -254,19 +254,22 @@ OLDDECLARG(char *, str_princ)
     krb5_boolean more;
     int nprincs = 1;
     char *str_mod_name;
+    char princ_name[4096];
 
-    fprintf(stderr, "\t%s ...\n", str_princ);
+    sprintf(princ_name, "%s@%s", str_princ, cur_realm);
 
-    if (retval = krb5_parse_name(str_princ, &princ)) {
-      com_err(progname, retval, "while parsing '%s'", str_princ);
+    fprintf(stderr, "\t%s ...\n", princ_name);
+
+    if (retval = krb5_parse_name(princ_name, &princ)) {
+      com_err(progname, retval, "while parsing '%s'", princ_name);
       goto out;
     }
 
-    pwd.data = str_princ;  /* must be able to regenerate */
-    pwd.length = strlen(str_princ);
+    pwd.data = princ_name;  /* must be able to regenerate */
+    pwd.length = strlen(princ_name);
 
     if (retval = krb5_principal2salt(princ, &salt)) {
-       com_err(progname, retval, "while converting principal to salt for '%s'", str_princ);
+       com_err(progname, retval, "while converting principal to salt for '%s'", princ_name);
        goto out;
     }
 
@@ -275,7 +278,7 @@ OLDDECLARG(char *, str_princ)
                                &pwd,
                                &salt);
     if (retval) {
-       com_err(progname, retval, "while converting password to key for '%s'", str_princ);
+       com_err(progname, retval, "while converting password to key for '%s'", princ_name);
        goto out;
     }
 
@@ -286,7 +289,7 @@ OLDDECLARG(char *, str_princ)
 
     if (nprincs != 1) {
       com_err(progname, 0, "Found %d entries db entry for %s.\n", nprincs,
-             str_princ);
+             princ_name);
       goto errout;
     }
 
@@ -294,7 +297,7 @@ OLDDECLARG(char *, str_princ)
                                  &kdbe.key,
                                  &db_key);
     if (retval) {
-       com_err(progname, retval, "while decrypting key for '%s'", str_princ);
+       com_err(progname, retval, "while decrypting key for '%s'", princ_name);
        goto errout;
     }
 
@@ -309,7 +312,7 @@ errout:
     else {
       if (memcmp((char *)pwd_key.contents, (char *) db_key.contents, pwd_key.length)) {
        fprintf(stderr, "\t key did not match stored value for %s\n", 
-               str_princ);
+               princ_name);
        goto errout;
       }
     }
@@ -318,32 +321,32 @@ errout:
     free((char *)db_key.contents);
 
     if (kdbe.kvno != 1) {
-      fprintf(stderr, "\tkvno did not match stored value for %s.\n", str_princ);
+      fprintf(stderr, "\tkvno did not match stored value for %s.\n", princ_name);
       goto errout;
     }
 
     if (kdbe.max_life != mblock.max_life) {
       fprintf(stderr, "\tmax life did not match stored value for %s.\n", 
-             str_princ);
+             princ_name);
       goto errout;
     }
 
     if (kdbe.max_renewable_life != mblock.max_rlife) {
       fprintf(stderr, 
              "\tmax renewable life did not match stored value for %s.\n",
-             str_princ);
+             princ_name);
       goto errout;
     }
 
     if (kdbe.mkvno != mblock.mkvno) {
       fprintf(stderr, "\tmaster keyvno did not match stored value for %s.\n", 
-             str_princ);
+             princ_name);
       goto errout;
     }
 
     if (kdbe.expiration != mblock.expiration) {
       fprintf(stderr, "\texpiration time did not match stored value for %s.\n",
-             str_princ);
+             princ_name);
       goto errout;
     }
 
@@ -361,7 +364,7 @@ errout:
 
     if (kdbe.attributes != mblock.flags) {
       fprintf(stderr, "\tAttributes did not match stored value for %s.\n",
-             str_princ);
+             princ_name);
       goto errout;
     }