From f99226a2ec12997060202e8badd3a67e66cd871b Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 4 Jun 2014 09:42:46 -0500 Subject: [PATCH] bozo: Ignore ListKeys ka_KeyCheckSum return value With commit c04de52da4e89e15b211b4a19a3d9bc4d612b209, an error in ka_KeyCheckSum here makes the entire BOZO_ListKeys RPC to fail. This caused two changes: - That commit makes the RPC fail in situations where it did not before. But even if we cannot calculate the checksum, we can still return other information about the key, so this is undesirable. - It masks the previous 'code' value, returned from stat(). The return code of stat() is now effectively ignored, except for the purposes of setting st_mtime, whereas previously a failure caused the RPC to fail. This is a behavior change. So, effectively revert c04de52da4e89e15b211b4a19a3d9bc4d612b209. Explicitly cast the return value of ka_KeyCheckSum to void, to make it clear that we are intentionally ignoring the return value, so hopefully this will not be flagged as a warning by code analysis tools such as coverity. Reviewed-on: http://gerrit.openafs.org/11194 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Perry Ruiter Reviewed-by: D Brashear (cherry picked from commit 1673764ea091a3f02a64a3d853c3e14f758cdda7) Change-Id: Ibb05f0afc68db5fa66e1dc55f7dae190d8057232 Reviewed-on: http://gerrit.openafs.org/11206 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Perry Ruiter Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- src/bozo/bosoprocs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bozo/bosoprocs.c b/src/bozo/bosoprocs.c index c3e2cd992..4465c8935 100644 --- a/src/bozo/bosoprocs.c +++ b/src/bozo/bosoprocs.c @@ -629,9 +629,10 @@ SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno, akeyinfo->mod_sec = tstat.st_mtime; } - /* If the key is bad, this will produce an error. Should never happen, - * but ... */ - code = ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); + /* This will return an error if the key is 'bad' (bad checksum, weak DES + * key, etc). But we don't care, since we can still return the other + * information about the key, so ignore the result. */ + (void)ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); fail: if (noauth) -- 2.39.5