Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/dist/bind/lib/irs Pull up revision 1.2 (requested by it...



details:   https://anonhg.NetBSD.org/src/rev/ffb0cbf57737
branches:  netbsd-1-6
changeset: 528203:ffb0cbf57737
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 11:48:02 2002 +0000

description:
Pull up revision 1.2 (requested by itojun in ticket #387):
Update to BIND 8.3.3.  Fixes buffer overrun in resolver code.

diffstat:

 dist/bind/lib/irs/getgrent.c   |  16 +++++++++-------
 dist/bind/lib/irs/getgrent_r.c |  26 ++++++++++++++++++--------
 2 files changed, 27 insertions(+), 15 deletions(-)

diffs (149 lines):

diff -r 7da90d5198e4 -r ffb0cbf57737 dist/bind/lib/irs/getgrent.c
--- a/dist/bind/lib/irs/getgrent.c      Fri Jun 28 11:47:53 2002 +0000
+++ b/dist/bind/lib/irs/getgrent.c      Fri Jun 28 11:48:02 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getgrent.c,v 1.1.1.1 1999/11/20 18:54:08 veego Exp $   */
+/*     $NetBSD: getgrent.c,v 1.1.1.1.10.1 2002/06/28 11:48:02 lukem Exp $      */
 
 /*
  * Copyright (c) 1996-1999 by Internet Software Consortium.
@@ -18,7 +18,7 @@
  */
 
 #if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "Id: getgrent.c,v 1.19 1999/10/13 16:39:30 vixie Exp";
+static const char rcsid[] = "Id: getgrent.c,v 1.20 2001/05/29 05:48:41 marka Exp";
 #endif
 
 /* Imports */
@@ -38,6 +38,8 @@
 #include <grp.h>
 #include <resolv.h>
 #include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 
 #include <irs.h>
 
@@ -82,14 +84,14 @@
 
 #ifdef SETGRENT_VOID
 void
-setgrent() {
+setgrent(void) {
        struct net_data *net_data = init();
 
-       return (setgrent_p(net_data));
+       setgrent_p(net_data);
 }
 #else
 int
-setgrent() {
+setgrent(void) {
        struct net_data *net_data = init();
 
        return (setgrent_p(net_data));
@@ -104,7 +106,7 @@
 }
 
 int
-getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroups) {
+getgrouplist(GETGROUPLIST_ARGS) {
        struct net_data *net_data = init();
 
        return (getgrouplist_p(name, basegid, groups, ngroups, net_data));
@@ -144,7 +146,7 @@
        if (!net_data || !(gr = net_data->gr))
                return (NULL);
        if (net_data->gr_stayopen && net_data->gr_last &&
-           net_data->gr_last->gr_gid == gid)
+           (gid_t)net_data->gr_last->gr_gid == gid)
                return (net_data->gr_last);
        net_data->gr_last = (*gr->bygid)(gr, gid);
        if (!net_data->gr_stayopen)
diff -r 7da90d5198e4 -r ffb0cbf57737 dist/bind/lib/irs/getgrent_r.c
--- a/dist/bind/lib/irs/getgrent_r.c    Fri Jun 28 11:47:53 2002 +0000
+++ b/dist/bind/lib/irs/getgrent_r.c    Fri Jun 28 11:48:02 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getgrent_r.c,v 1.1.1.1 1999/11/20 18:54:08 veego Exp $ */
+/*     $NetBSD: getgrent_r.c,v 1.1.1.1.10.1 2002/06/28 11:48:10 lukem Exp $    */
 
 /*
  * Copyright (c) 1998-1999 by Internet Software Consortium.
@@ -18,7 +18,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "Id: getgrent_r.c,v 8.4 1999/01/18 07:46:51 vixie Exp";
+static const char rcsid[] = "Id: getgrent_r.c,v 8.7 2001/11/01 08:02:08 marka Exp";
 #endif /* LIBC_SCCS and not lint */
 
 #include <port_before.h>
@@ -28,7 +28,17 @@
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
+#include <sys/types.h>
+#if (defined(POSIX_GETGRNAM_R) || defined(POSIX_GETGRGID_R)) && \
+    defined(_POSIX_PTHREAD_SEMANTICS)
+       /* turn off solaris remapping in <grp.h> */
+#define _UNIX95
+#undef _POSIX_PTHREAD_SEMANTICS
 #include <grp.h>
+#define _POSIX_PTHREAD_SEMANTICS 1
+#else
+#include <grp.h>
+#endif
 #include <sys/param.h>
 #include <port_after.h>
 
@@ -52,7 +62,7 @@
 
        if (ge == NULL) {
                *result = NULL;
-               return (-1);
+               return (0);
        }
 
        res = copy_group(ge, gptr, buf, buflen);
@@ -77,11 +87,11 @@
 /* POSIX 1003.1c */
 #ifdef POSIX_GETGRGID_R
 int
-__posix_getgrgid_r(const gid_t gid, struct group *gptr,
+__posix_getgrgid_r(gid_t gid, struct group *gptr,
                char *buf, int buflen, struct group **result) {
 #else /* POSIX_GETGRGID_R */
 int
-getgrgid_r(const gid_t gid, struct group *gptr,
+getgrgid_r(gid_t gid, struct group *gptr,
                char *buf, size_t buflen, struct group **result) {
 #endif /* POSIX_GETGRGID_R */
        struct group *ge = getgrgid(gid);
@@ -89,7 +99,7 @@
 
        if (ge == NULL) {
                *result = NULL;
-               return (-1);
+               return (0);
        }
 
        res = copy_group(ge, gptr, buf, buflen);
@@ -99,7 +109,7 @@
 
 #ifdef POSIX_GETGRGID_R
 struct group *
-getgrgid_r(const gid_t gid, struct group *gptr,
+getgrgid_r(gid_t gid, struct group *gptr,
                char *buf, int buflen) {
        struct group *ge = getgrgid(gid);
        int res;
@@ -183,7 +193,7 @@
        
        if (len > buflen) {
                errno = ERANGE;
-               return (-1);
+               return (ERANGE);
        }
 
        /* copy group id */



Home | Main Index | Thread Index | Old Index