]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
crypto: Use our strcasecmp in kernel
authorAndrew Deason <adeason@sinenomine.net>
Wed, 25 Jul 2012 20:48:34 +0000 (15:48 -0500)
committerDerrick Brashear <shadow@dementix.org>
Thu, 26 Jul 2012 17:49:27 +0000 (10:49 -0700)
A few pieces of heimdal we use in the kernel call strcasecmp
(hcrypto/evp.c, krb5/crypto.c). The strcasecmp function does not exist
in all kernels (specifically, it does not exist in at least Linux 2.4,
2.6.9, and probably not on Solaris pre-10). Since we have our own copy
of strcasecmp (called afs_strcasecmp), just use that for now.

Ideally we would have some kind of configure test for detecting the
presence of the function in the kernel, and use the roken
implementation when we don't. We currently have the framework for
neither of those in place at the moment, though, so just get by with
this for now.

Change-Id: Ia96b17596da6cb168c80c92486fa049c05205da4
Reviewed-on: http://gerrit.openafs.org/7881
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/crypto/hcrypto/kernel/config.h

index 724ba18b5c7c47c72f525a01b74e8ec8898b611e..3475c64ecd1910e7addaca675628f0c3144088b8 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"
+#include "afs/afsincludes.h"
+#include "afs/afs_prototypes.h"
 
 /* Asserting is a mess - we need the RX headers in order to get a definition
  * for osi_Assert */
@@ -58,6 +60,9 @@ char * _afscrypto_strdup(const char *);
 #define realloc _afscrypto_realloc
 void * _afscrypto_realloc(void *, size_t);
 
+/* we may not have strcasecmp in the kernel */
+#define strcasecmp afs_strcasecmp
+
 /* osi_readRandom is also prototyped in afs_prototypes.h, but pulling that in
  * here creates loads of additional dependencies */
 extern int osi_readRandom(void *, afs_size_t);