From: Theodore Tso Date: Mon, 24 Oct 1994 18:32:22 +0000 (+0000) Subject: kdb5_verify.c: Check principals with correct realm name X-Git-Tag: krb5-1.0-beta5~1084 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=301ae23659483830114d670793bbfe52df7434cf;p=krb5.git kdb5_verify.c: Check principals with correct realm name configure.in: Look for ndbm or dbm libraries git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4556 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/verify/ChangeLog b/src/tests/verify/ChangeLog index 7da8d0654..e809cc837 100644 --- a/src/tests/verify/ChangeLog +++ b/src/tests/verify/ChangeLog @@ -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 diff --git a/src/tests/verify/configure.in b/src/tests/verify/configure.in index 591e3d663..c067f1f3d 100644 --- a/src/tests/verify/configure.in +++ b/src/tests/verify/configure.in @@ -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 diff --git a/src/tests/verify/kdb5_verify.c b/src/tests/verify/kdb5_verify.c index d5671e0ba..6c5d37a7c 100644 --- a/src/tests/verify/kdb5_verify.c +++ b/src/tests/verify/kdb5_verify.c @@ -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; }