From: Simon Wilkinson Date: Tue, 26 Feb 2013 12:10:17 +0000 (+0000) Subject: bosserver: Return error if key is bad X-Git-Tag: upstream/1.6.10_pre1^2~105 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=955c4999b5ac73dcc0a38b315f1dea7667579fd6;p=packages%2Fo%2Fopenafs.git bosserver: Return error if key is bad If a key is bad, have SBOZO_ListKeys return an error, rather than silently ignoring the result from ka_KeyCheckSum. Caught by coverity (#988413) Reviewed-on: http://gerrit.openafs.org/9270 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit c04de52da4e89e15b211b4a19a3d9bc4d612b209) Change-Id: I7474da0967d759fc4359140c9057ac997935dc76 Reviewed-on: http://gerrit.openafs.org/11014 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/bozo/bosoprocs.c b/src/bozo/bosoprocs.c index 0ab80028b..c3e2cd992 100644 --- a/src/bozo/bosoprocs.c +++ b/src/bozo/bosoprocs.c @@ -628,8 +628,10 @@ SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno, if (code == 0) { akeyinfo->mod_sec = tstat.st_mtime; } - ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); - /* only errors is bad key parity */ + + /* If the key is bad, this will produce an error. Should never happen, + * but ... */ + code = ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); fail: if (noauth)