memrchr compatibility stub taken from sudo. Workaround for: 21158555 - solaris should provide memrchr for bsd / linux compatibility --- gnome-keyring-42.1/configure.ac.orig +++ gnome-keyring-42.1/configure.ac @@ -144,6 +144,12 @@ AC_CHECK_FUNCS(flock, AC_DEFINE(HAVE_FLOCK,1,[Have flock])) # -------------------------------------------------------------------- +# Check for memrchr +# + +AC_CHECK_FUNCS(memrchr, AC_DEFINE(HAVE_MEMRCHR,1,[Have memrchr])) + +# -------------------------------------------------------------------- # Check for timegm # --- gnome-keyring-42.1/egg/egg-armor.c.orig +++ gnome-keyring-42.1/egg/egg-armor.c @@ -31,7 +31,7 @@ #include #include -#include +#include "egg-memrchr.h" /* * Armor looks like: --- /dev/null +++ gnome-keyring-42.1/egg/egg-memrchr.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2007, 2010-2011, 2013 + * Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +#ifndef HAVE_MEMRCHR + +#include + +/* + * Reverse memchr() + * Find the last occurrence of 'c' in the buffer 's' of size 'n'. + */ +void * +memrchr(const void *s, int c, size_t n) +{ + const unsigned char *cp; + + if (n != 0) { + cp = (unsigned char *)s + n; + do { + if (*(--cp) == (unsigned char)c) + return (void *)cp; + } while (--n != 0); + } + return (void *)0; +} +#endif /* HAVE_MEMRCHR */ --- /dev/null +++ gnome-keyring-42.1/egg/egg-memrchr.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2007, 2010-2011, 2013 + * Todd C. Miller + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef EGG_MEMRCHR_H_ +#define EGG_MEMRCHR_H_ + +#include + +#ifndef HAVE_MEMRCHR + +void * memrchr (const void *s, int c, size_t n); + +#endif + +#endif /* EGG_MEMRCHR_H_ */ --- gnome-keyring-42.1/egg/Makefile.am.orig +++ gnome-keyring-42.1/egg/Makefile.am @@ -28,6 +28,7 @@ egg/egg-hex.c egg/egg-hex.h \ egg/egg-hkdf.c egg/egg-hkdf.h \ egg/egg-libgcrypt.c egg/egg-libgcrypt.h \ + egg/egg-memrchr.c egg/egg-memrchr.h \ egg/egg-oid.c egg/egg-oid.h \ egg/egg-padding.c egg/egg-padding.h \ egg/egg-openssl.c egg/egg-openssl.h \