r22151: remove netgr functions from libreplace they're not used
authorStefan Metzmacher <metze@samba.org>
Tue, 10 Apr 2007 15:59:39 +0000 (15:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:17 +0000 (12:19 -0500)
in samba4 currently and samba3 has explicit configure checks for them.

should fix bug #4496

metze
(This used to be commit 7f61b3f0095efed81adc9022ba44e5c7df84d2f2)

source3/lib/replace/README
source3/lib/replace/libreplace.m4
source3/lib/replace/replace.c
source3/lib/replace/test/testsuite.c

index 21cd0051c70dda05cf9890e03e3500380f8bf2fb..68d2c8ba2c0e720a493ad28919b5392dceabbb3f 100644 (file)
@@ -12,7 +12,6 @@ strlcpy
 strlcat
 mktime
 rename
-innetgr
 initgroups
 memmove
 strdup
@@ -88,5 +87,4 @@ stdbool.h
 Prerequisites:
 memset (for bzero)
 syslog (for vsyslog)
-setnetgrent, getnetgrent, endnetgrent (for innetgr)
 mktemp (for mkstemp and mkdtemp)
index 805cdc6cb59534a0e4ded4320b50693768edf6fa..6bd616f9b79b0ceae22076b6df263797efbf88ad 100644 (file)
@@ -150,7 +150,7 @@ AC_TRY_COMPILE([
 
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
-AC_CHECK_FUNCS(waitpid strlcpy strlcat innetgr initgroups memmove strdup)
+AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp socketpair)
 AC_HAVE_DECL(setresuid, [#include <unistd.h>])
 AC_HAVE_DECL(setresgid, [#include <unistd.h>])
@@ -330,8 +330,7 @@ m4_include(win32.m4)
 m4_include(timegm.m4)
 m4_include(repdir.m4)
 
-AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
-                          [AC_MSG_ERROR([Required function not found])])
+AC_CHECK_FUNCS([syslog memset memcpy],,[AC_MSG_ERROR([Required function not found])])
 
 echo "LIBREPLACE_BROKEN_CHECKS: END"
 ]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
index 9e6c75bd3587a8bb1f3c7731701992d1c9561c0c..8310d66d9e59b7ad8d340877b3976bce83cb8efe 100644 (file)
@@ -154,33 +154,6 @@ time_t rep_mktime(struct tm *t)
 #endif /* !HAVE_MKTIME */
 
 
-#ifndef HAVE_INNETGR
-#if defined(HAVE_SETNETGRENT) && defined(HAVE_GETNETGRENT) && defined(HAVE_ENDNETGRENT)
-/*
- * Search for a match in a netgroup. This replaces it on broken systems.
- */
-int rep_innetgr(const char *group, const char *host, const char *user, 
-                               const char *dom)
-{
-       char *hst, *usr, *dm;
-  
-       setnetgrent(group);
-       while (getnetgrent(&hst, &usr, &dm)) {
-               if (((host == 0) || (hst == 0) || !strcmp(host, hst)) &&
-                   ((user == 0) || (usr == 0) || !strcmp(user, usr)) &&
-                   ((dom == 0) || (dm == 0) || !strcmp(dom, dm))) {
-                       endnetgrent();
-                       return (1);
-               }
-       }
-       endnetgrent();
-       return (0);
-}
-#endif /* HAVE_SETNETGRENT HAVE_GETNETGRENT HAVE_ENDNETGRENT */
-#endif /* HAVE_INNETGR */
-
-
-
 #ifndef HAVE_INITGROUPS
 /****************************************************************************
  some systems don't have an initgroups call 
index effbdb13ef0f0214600ce3b1ef5160e05c03541b..293ea84946a089d0f46c858943362d10b4b33401 100644 (file)
@@ -125,12 +125,6 @@ static int test_mktime(void)
        return true;
 }
 
-static int test_innetgr(void)
-{
-       /* FIXME */
-       return true;
-}
-
 static int test_initgroups(void)
 {
        /* FIXME */
@@ -426,7 +420,6 @@ bool torture_local_replace(struct torture_context *ctx)
        ret &= test_strlcpy();
        ret &= test_strlcat();
        ret &= test_mktime();
-       ret &= test_innetgr();
        ret &= test_initgroups();
        ret &= test_memmove();
        ret &= test_strdup();