File dante-glibc-2.17.patch of Package dante
Index: dante-1.3.2/libscompat/issetugid.c
===================================================================
--- dante-1.3.2.orig/libscompat/issetugid.c
+++ dante-1.3.2/libscompat/issetugid.c
@@ -4,6 +4,8 @@
#include "autoconf.h"
#endif /* HAVE_CONFIG_H */
+#include <sys/auxv.h>
+
/*
* Copyright (c) 1999, 2005, 2008, 2009
* Inferno Nettverk A/S, Norway. All rights reserved.
@@ -47,22 +49,14 @@
*
*/
-#if HAVE_LIBC_ENABLE_SECURE
-extern int __libc_enable_secure;
-#endif /* HAVE_LIBC_ENABLE_SECURE */
-
#include "issetugid.h"
int
issetugid(void)
{
-#if HAVE_LIBC_ENABLE_SECURE
- if (!__libc_enable_secure)
- return 0;
-#elif HAVE_LIBC_ENABLE_SECURE_DISABLED
- if (getuid() == geteuid() && getgid() == getegid())
- return 0;
-#endif /* HAVE_LIBC_ENABLE_SECURE_DISABLED */
+ unsigned long secure = getauxval(AT_SECURE);
+ if (secure != 0)
+ return 1;
- return 1; /* don't know, better safe than sorry. */
+ return 0;
}
Index: dante-1.3.2/libscompat.m4
===================================================================
--- dante-1.3.2.orig/libscompat.m4
+++ dante-1.3.2/libscompat.m4
@@ -157,30 +157,3 @@ AC_SUBST([LIBSCSRC])
if test x${ac_cv_func_bzero} = xno; then
AC_DEFINE(bzero(b, len), memset((b), 0, (len)), [bzero replacement])
fi
-
-m4_ifdef([dantebuild], [
-#causes problems with packaging, allow test to be turned off
-AC_ARG_WITH(glibc-secure,
-[ --without-glibc-secure disable libc_enable_secure check @<:@default=detect@:>@],
-[GLIBCSEC=$withval])
-
-if test "${GLIBCSEC}" != no; then
- AC_MSG_CHECKING([for __libc_enable_secure])
- AC_TRY_RUN([
-extern int __libc_enable_secure;
-
-int main()
-{
- if (__libc_enable_secure == 0)
- return 0;
-
- return 1;
-}],[AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1, [linux version of issetugid()])],
- AC_MSG_RESULT([no]))
-fi
-],
-[AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 0, [not used])])
-if test x"$GLIBCSEC" = xno; then
- AC_DEFINE(HAVE_LIBC_ENABLE_SECURE_DISABLED, 1, [glibc variable disable])
-fi
Index: dante-1.3.2/include/autoconf.h.in
===================================================================
--- dante-1.3.2.orig/include/autoconf.h.in
+++ dante-1.3.2/include/autoconf.h.in
@@ -262,12 +262,6 @@
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_LIBCRYPTO
-/* linux version of issetugid() */
-#undef HAVE_LIBC_ENABLE_SECURE
-
-/* glibc variable disable */
-#undef HAVE_LIBC_ENABLE_SECURE_DISABLED
-
/* Define to 1 if you have the `des' library (-ldes). */
#undef HAVE_LIBDES