summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-07-17 10:03:37 +0000
committerVolker Lendecke <vlendec@samba.org>2003-07-17 10:03:37 +0000
commit0fe05982cd571d0172d59e0559348d79eea81239 (patch)
tree1198014d689dcd1dd8221cff3ddef57cee2d102d
parent7f7b754483863f94f32c6150c62710c5affcd390 (diff)
downloadsamba-0fe05982cd571d0172d59e0559348d79eea81239.tar.gz
samba-0fe05982cd571d0172d59e0559348d79eea81239.tar.bz2
samba-0fe05982cd571d0172d59e0559348d79eea81239.zip
Ban getgrouplist on linux glibc systems with glibc <= 2.3.
This segfaults when you have to many group membership entries in /etc/group. Fixed in glibc CVS end of April 2003. Volker (This used to be commit 61bfdf0b12457689b08c19a6269259abf3d15410)
-rw-r--r--source3/configure.in34
1 files changed, 33 insertions, 1 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 3469de2b59..af56395007 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -843,7 +843,7 @@ AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate
AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
-AC_CHECK_FUNCS(syslog vsyslog getgrouplist timegm)
+AC_CHECK_FUNCS(syslog vsyslog timegm)
AC_CHECK_FUNCS(setlocale nl_langinfo)
# setbuffer, shmget, shm_open are needed for smbtorture
AC_CHECK_FUNCS(setbuffer shmget shm_open backtrace_symbols)
@@ -867,6 +867,38 @@ AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
#
+#
+#
+case "$host_os" in
+ *linux*)
+ # glibc <= 2.3.2 has a broken getgrouplist
+ AC_TRY_RUN([
+#include <unistd.h>
+#include <sys/utsname.h>
+main() {
+ /* glibc up to 2.3 has a broken getgrouplist */
+#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+ int libc_major = __GLIBC__;
+ int libc_minor = __GLIBC_MINOR__;
+
+ if (libc_major < 2)
+ exit(1);
+ if ((libc_major == 2) && (libc_minor <= 3))
+ exit(1);
+#endif
+ exit(0);
+}
+], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no])
+ if test x"$linux_getgrouplist_ok" = x"yes"; then
+ AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
+ fi
+ ;;
+ *)
+ AC_CHECK_FUNCS(getgrouplist)
+ ;;
+esac
+
+#
# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
#