From: Simon Wilkinson Date: Fri, 15 Feb 2013 16:13:20 +0000 (+0000) Subject: asetkey: Handle unknown key types X-Git-Tag: upstream/1.8.0_pre1^2~1522 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a208292dd5867f1bb964c7c38585105d249bd9f4;p=packages%2Fo%2Fopenafs.git asetkey: Handle unknown key types If the user tries to create a key which is not rxkad, error out rather than attempt to add a random blob of memory to the KeyFile. Caught by clang-analyzer Change-Id: Id2803fe29153f01ab352747caed31b0d0cb4f573 Reviewed-on: http://gerrit.openafs.org/9160 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Derrick Brashear --- diff --git a/src/aklog/asetkey.c b/src/aklog/asetkey.c index 2db399f69..e73fe57b3 100644 --- a/src/aklog/asetkey.c +++ b/src/aklog/asetkey.c @@ -183,6 +183,9 @@ 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 { + fprintf(stderr, "Unknown key type %s\n", argv[2]); + exit(1); } break; default: