From: Ben Kaduk Date: Fri, 12 Jul 2013 16:53:46 +0000 (-0400) Subject: Use the string form of key types in asetkey X-Git-Tag: upstream/1.8.0_pre1^2~1062^2~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fe73ac62fbda1d4e563ef03114813f148c7d321e;p=packages%2Fo%2Fopenafs.git Use the string form of key types in asetkey Check for rxkad-k5 keys in the six-argument form and warn they are unsupported. Do sanity-checking on the type. Change-Id: I571fcf88744dec271265e6a47f7d9831f867115b --- diff --git a/src/aklog/asetkey.c b/src/aklog/asetkey.c index 7fe95df17..7cbcba5bd 100644 --- a/src/aklog/asetkey.c +++ b/src/aklog/asetkey.c @@ -197,13 +197,24 @@ addKey(struct afsconf_dir *dir, int argc, char **argv) { kvno = atoi(argv[3]); if (type == afsconf_rxkad) { typedKey = keyFromCommandLine(afsconf_rxkad, kvno, 0, argv[5], 8); + } else if (type == afsconf_rxkad_krb5){ + fprintf(stderr, "Raw keys for afsconf_rxkad_krb5 are unsupported"); + exit(1); } else { fprintf(stderr, "Unknown key type %s\n", argv[2]); exit(1); } break; case 7: - typedKey = keyFromKeytab(atoi(argv[3]), atoi(argv[2]), atoi(argv[4]), argv[5], argv[6]); + type = stringToType(argv[2]); + kvno = atoi(argv[3]); + if (type == afsconf_rxkad || type == afsconf_rxkad_krb5) { + typedKey = keyFromKeytab(kvno, type, atoi(argv[4]), argv[5], + argv[6]); + } else { + fprintf(stderr, "Unknown key type %s\n", argv[2]); + exit(1); + } break; default: fprintf(stderr, "%s add: usage is '%s add "