auto-import changelog data from ypserv-2.13-4.src.rpm

Tue Aug 31 2004 Steve Dickson <SteveD@RedHat.com>
- Zeroed out the ypxfr response buffer so allocated memory is not freed
    with the transfer fails
Sat Jun 19 2004 Steve Dickson <SteveD@RedHat.com>
- Closed a memory leak in GDBM database routines (bz 120980)
This commit is contained in:
cvsdist 2004-09-09 15:21:45 +00:00
parent 75a5587a44
commit 39e988d63d
3 changed files with 83 additions and 1 deletions

View File

@ -0,0 +1,61 @@
--- ypserv-2.13/lib/yp_db.c.org 2004-04-14 07:47:02.000000000 -0400
+++ ypserv-2.13/lib/yp_db.c 2004-06-19 08:48:33.000000000 -0400
@@ -200,6 +200,7 @@ ypdb_close_all (void)
fast_open_files[i].map, i);
free (fast_open_files[i].domain);
free (fast_open_files[i].map);
+ fast_open_files[i].domain = fast_open_files[i].map = NULL;
_db_close (fast_open_files[i].dbp);
fast_open_files[i].dbp = NULL;
fast_open_files[i].flag = 0;
@@ -232,8 +233,11 @@ ypdb_close (DB_FILE file)
log_msg ("ypdb_MUST_close (%s/%s|%d)",
fast_open_files[i].domain,
fast_open_files[i].map, i);
- free (fast_open_files[i].domain);
- free (fast_open_files[i].map);
+ if (fast_open_files[i].domain != NULL)
+ free (fast_open_files[i].domain);
+ if (fast_open_files[i].map != NULL)
+ free (fast_open_files[i].map);
+ fast_open_files[i].domain = fast_open_files[i].map = NULL;
_db_close (fast_open_files[i].dbp);
fast_open_files[i].dbp = NULL;
fast_open_files[i].flag = 0;
@@ -279,6 +283,10 @@ ypdb_open (const char *domain, const cha
fast_open_init = 0;
for (i = 0; i < cached_filehandles; i++)
{
+ if (fast_open_files[i].domain != NULL)
+ free (fast_open_files[i].domain);
+ if (fast_open_files[i].map != NULL)
+ free (fast_open_files[i].map);
fast_open_files[i].domain =
fast_open_files[i].map = NULL;
fast_open_files[i].dbp = (DB_FILE) NULL;
@@ -334,7 +342,11 @@ ypdb_open (const char *domain, const cha
Fopen tmp;
if ((fast_open_files[i].dbp = _db_open (domain, map)) == NULL)
- return NULL;
+ return NULL;
+ if (fast_open_files[i].domain != NULL)
+ free(fast_open_files[i].domain);
+ if (fast_open_files[i].map != NULL)
+ free(fast_open_files[i].map);
fast_open_files[i].domain = strdup (domain);
fast_open_files[i].map = strdup (map);
fast_open_files[i].flag |= F_OPEN_FLAG;
@@ -375,8 +387,10 @@ ypdb_open (const char *domain, const cha
fast_open_files[i].map, i);
log_msg ("Opening: %s/%s (%d)", domain, map, i);
}
- free (fast_open_files[i].domain);
- free (fast_open_files[i].map);
+ if (fast_open_files[i].domain != NULL)
+ free (fast_open_files[i].domain);
+ if (fast_open_files[i].map != NULL)
+ free (fast_open_files[i].map);
_db_close (fast_open_files[i].dbp);
fast_open_files[i].domain = strdup (domain);

View File

@ -0,0 +1,10 @@
--- ypserv-2.13/ypxfr/ypxfr.c.orig 2004-01-12 08:12:15.000000000 -0500
+++ ypserv-2.13/ypxfr/ypxfr.c 2004-08-31 13:17:30.000000000 -0400
@@ -361,6 +361,7 @@ ypxfr (char *map, char *source_host, cha
struct hostent *h;
int sock, result;
+ memset(&resp_val, '\0', sizeof(resp_val));
/* Name of the map file */
if (strlen (path_ypdb) + strlen (target_domain) + strlen (map) + 3 < MAXPATHLEN)
sprintf (dbName_orig, "%s/%s/%s", path_ypdb, target_domain, map);

View File

@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server.
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.13
Release: 2
Release: 4
License: GPL
Group: System Environment/Daemons
Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
@ -19,6 +19,8 @@ Patch2: ypserv-2.5-nfsnobody2.patch
Patch3: ypserv-2.11-nomap.patch
Patch4: ypserv-2.11-iface-binding3.patch
Patch5: ypserv-2.13-pie.patch
Patch6: ypserv-2.13-yplib-memleak.patch
Patch7: ypserv-2.13-ypxfr-zeroresp.patch
Obsoletes: yppasswd
BuildRequires: gdbm-devel
Buildroot: %{_tmppath}/%{name}-root
@ -47,6 +49,8 @@ machines.
%patch3 -p1 -b .nomap
%patch4 -p1 -b .iface
%patch5 -p1 -b .pie
%patch6 -p1 -b .memleak
%patch7 -p1 -b .respzero
%build
cp etc/README etc/README.etc
@ -132,6 +136,13 @@ exit 0
%{_includedir}/*/*
%changelog
* Tue Aug 31 2004 Steve Dickson <SteveD@RedHat.com>
- Zeroed out the ypxfr response buffer so allocated memory
is not freed with the transfer fails
* Sat Jun 19 2004 Steve Dickson <SteveD@RedHat.com>
- Closed a memory leak in GDBM database routines (bz 120980)
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt