Fixed problem with HAVE_NETGROUP being used on platforms
authorJeremy Allison <jra@samba.org>
Wed, 18 Nov 1998 01:19:32 +0000 (01:19 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 18 Nov 1998 01:19:32 +0000 (01:19 +0000)
that cannot support it.
Jeremy.

source/configure
source/configure.in
source/include/config.h.in
source/include/includes.h
source/lib/replace.c

index 1d5779bf34ec23c6d57e02fbf3a702bb72ad2685..ea8bbcc907e3f3a4bea11c71964164d705535b14 100755 (executable)
@@ -3659,7 +3659,7 @@ else
 fi
 done
 
-for ac_func in strftime sigprocmask sigblock sigaction innetgr
+for ac_func in strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 echo "configure:3666: checking for $ac_func" >&5
index f555087ddfd999dbb9e94d43bf7eaddd4f092441..5435d59f763f4c8e7b821b4d1b702c84fdc28cad 100644 (file)
@@ -166,7 +166,7 @@ fi
 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
-AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
+AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
 AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64 fopen64)
 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
index c5c761ede393f8d06aeb3ad5359c2d22212c8ca0..57ef45312bbd52b7e167643703c11d0137c60069 100644 (file)
 /* Define if you have the dup2 function.  */
 #undef HAVE_DUP2
 
+/* Define if you have the endnetgrent function.  */
+#undef HAVE_ENDNETGRENT
+
 /* Define if you have the execl function.  */
 #undef HAVE_EXECL
 
 /* Define if you have the getgrnam function.  */
 #undef HAVE_GETGRNAM
 
+/* Define if you have the getnetgrent function.  */
+#undef HAVE_GETNETGRENT
+
 /* Define if you have the getprpwnam function.  */
 #undef HAVE_GETPRPWNAM
 
 /* Define if you have the setluid function.  */
 #undef HAVE_SETLUID
 
+/* Define if you have the setnetgrent function.  */
+#undef HAVE_SETNETGRENT
+
 /* Define if you have the setsid function.  */
 #undef HAVE_SETSID
 
index 24fb84c803585b27a86274fe5293b0aad62ddfe7..92b415efa1f11bd5e30485412f22c166bdb7bb46 100644 (file)
@@ -585,7 +585,7 @@ union semun {
 #define HAVE_PAM 1
 #endif
 
-#if defined(HAVE_YP_GET_DEFAULT_DOMAIN)
+#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)
 #define HAVE_NETGROUP 1
 #endif
 
index b0adb72fd24ea4b564e00430bc34d18bd1b87660..2d4ed775a47996511d1886cdc7710b83046f439a 100644 (file)
@@ -41,7 +41,7 @@ ftruncate for operating systems that don't have it
       fl.l_type = F_WRLCK;
       return fcntl(f, F_FREESP, &fl);
 }
-#endif
+#endif /* HAVE_FTRUNCATE */
 
 
 #ifndef HAVE_MKTIME
@@ -119,10 +119,11 @@ Corrections by richard.kettlewell@kewill.com
     }
   return unlink (zfrom);
 }
-#endif
+#endif /* HAVE_RENAME */
 
 
 #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.
  */
@@ -142,7 +143,8 @@ Corrections by richard.kettlewell@kewill.com
        endnetgrent();
        return (0);
 }
-#endif
+#endif /* HAVE_SETNETGRENT HAVE_GETNETGRENT HAVE_ENDNETGRENT */
+#endif /* HAVE_INNETGR */
 
 
 
@@ -160,7 +162,7 @@ Corrections by richard.kettlewell@kewill.com
        }
        /* yikes! no SETGROUPS or INITGROUPS? how can this work? */
        return(0);
-#else
+#else /* HAVE_SETGROUPS */
        gid_t  grouplst[NGROUPS_MAX];
        int    i,j;
        struct group *g;
@@ -186,9 +188,9 @@ Corrections by richard.kettlewell@kewill.com
        }
        endgrent();
        return(setgroups(i,grouplst));
-#endif
+#endif /* HAVE_SETGROUPS */
 }
-#endif
+#endif /* HAVE_INITGROUPS */
 
 
 #if (defined(SecureWare) && defined(SCO))
@@ -260,7 +262,7 @@ needs.
        }
        return(dest);
 }
-#endif
+#endif /* HAVE_MEMMOVE */
 
 #ifndef HAVE_STRDUP
 /****************************************************************************
@@ -268,7 +270,7 @@ duplicate a string
 ****************************************************************************/
  char *strdup(const char *s)
 {
-       int len;
+       size_t len;
        char *ret;
 
        if (!s) return(NULL);
@@ -279,7 +281,7 @@ duplicate a string
        memcpy(ret,s,len);
        return(ret);
 }
-#endif
+#endif /* HAVE_STRDUP */
 
 #ifdef REPLACE_INET_NTOA
 char *rep_inet_ntoa(struct in_addr ip)
@@ -289,11 +291,11 @@ char *rep_inet_ntoa(struct in_addr ip)
 #if WORDS_BIGENDIAN
        slprintf(buf, 17, "%d.%d.%d.%d", 
                 (int)p[0], (int)p[1], (int)p[2], (int)p[3]);
-#else
+#else /* WORDS_BIGENDIAN */
        slprintf(buf, 17, "%d.%d.%d.%d", 
                 (int)p[3], (int)p[2], (int)p[1], (int)p[0]);
-#endif
+#endif /* WORDS_BIGENDIAN */
        return buf;
 }
-#endif
+#endif /* REPLACE_INET_NTOA */