rpms/nss_db/devel nss_db-2.2-initialize.patch, NONE, 1.1 nss_db-2.2-compat.patch, 1.1, 1.2 nss_db.spec, 1.21, 1.22

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 26 18:00:23 UTC 2005


Author: nalin

Update of /cvs/dist/rpms/nss_db/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29697

Modified Files:
	nss_db-2.2-compat.patch nss_db.spec 
Added Files:
	nss_db-2.2-initialize.patch 
Log Message:
- set errno to ENOENT by default so that we don't leave stale errno values
  around in error cases (#152467)
- clear the entire key DBT before handing it to a get() function
- set errno to ENOENT when returning NSS_STATUS_NOTFOUND (#152467, Dave Lehman)


nss_db-2.2-initialize.patch:
 db-XXX.c |    1 +
 1 files changed, 1 insertion(+)

--- NEW FILE nss_db-2.2-initialize.patch ---
Initialize all of the fields of the key to zeroes, so that we don't pass
garbage keys in to later versions of Berkeley DB.
--- nss_db-2.2/db-XXX.c	2005-03-29 16:13:57.103516704 -0500
+++ nss_db-2.2/db-XXX.c	2005-03-29 16:13:47.108821931 -0500
@@ -225,6 +225,7 @@
   DBT key;								      \
   enum nss_status status;						      \
   const size_t size = (keysize) + 1;					      \
+  memset(&key, 0, sizeof(key));						      \
   key.data = alloca (size);						      \
   key.size = KEYPRINTF keypattern;					      \
   key.flags = 0;							      \

nss_db-2.2-compat.patch:
 Makefile.am   |    2 +-
 Makefile.in   |    2 +-
 db-XXX.c      |   23 ++++++++++-------------
 db-alias.c    |   21 +++++++--------------
 db-netgrp.c   |    8 +++-----
 files-parse.c |   10 +++++-----
 netgroup.h    |    2 +-
 7 files changed, 28 insertions(+), 40 deletions(-)

Index: nss_db-2.2-compat.patch
===================================================================
RCS file: /cvs/dist/rpms/nss_db/devel/nss_db-2.2-compat.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nss_db-2.2-compat.patch	9 Sep 2004 09:19:51 -0000	1.1
+++ nss_db-2.2-compat.patch	26 Apr 2005 18:00:12 -0000	1.2
@@ -1,4 +1,4 @@
---- nss_db-compat/db-alias.c.compat	Tue Aug  8 18:47:33 2000
+--- nss_db-compat/db-alias.c	Tue Aug  8 18:47:33 2000
 +++ nss_db-compat/db-alias.c	Wed Aug 16 12:33:23 2000
 @@ -85,7 +85,7 @@ _nss_db_endaliasent (void)
     the result.  */
@@ -26,7 +26,7 @@
  	{
  	no_more_room:
 -	  *errnop = ERANGE;
-+	  __set_errno(ERANGE);
++	  errno = ERANGE;
  	  return NSS_STATUS_TRYAGAIN;
  	}
  
@@ -70,7 +70,7 @@
    pthread_mutex_unlock (&lock);
  
    return status;
---- nss_db-compat/db-netgrp.c.compat	Tue Aug  8 19:05:01 2000
+--- nss_db-compat/db-netgrp.c	Tue Aug  8 19:05:01 2000
 +++ nss_db-compat/db-netgrp.c	Wed Aug 16 12:33:23 2000
 @@ -82,18 +82,16 @@ _nss_db_endnetgrent (void)
  
@@ -94,7 +94,7 @@
  
    pthread_mutex_unlock (&lock);
  
---- nss_db-compat/db-XXX.c.compat	Wed Aug  9 15:46:39 2000
+--- nss_db-compat/db-XXX.c	Wed Aug  9 15:46:39 2000
 +++ nss_db-compat/db-XXX.c	Wed Aug 16 12:33:23 2000
 @@ -103,7 +103,7 @@ CONCAT(_nss_db_end,ENTNAME) (void)
  /* Do a database lookup for KEY.  */
@@ -105,7 +105,7 @@
  {
    char *p;
    enum nss_status status;
-@@ -116,7 +116,6 @@ lookup (DBT *key, struct STRUCTURE *resu
+@@ -115,21 +115,20 @@ lookup (DBT *key, struct STRUCTURE *resu
        status = internal_setent (DBFILE, &db);
        if (status != NSS_STATUS_SUCCESS)
  	{
@@ -113,19 +113,28 @@
  	  H_ERRNO_SET (NETDB_INTERNAL);
  	  return status;
  	}
-@@ -129,7 +128,6 @@ lookup (DBT *key, struct STRUCTURE *resu
+     }
+ 
+   /* Succeed iff it matches a value that parses correctly.  */
+-  *errnop = ENOENT;
++  errno = ENOENT;
+   value.flags = 0;
+   err = db->get (db, NULL, key, &value, 0);
+   if (err)
      {
        if (err > 0)
  	{
 -	  *errnop = err;
++	  errno = err;
  	  H_ERRNO_SET (NETDB_INTERNAL);
  	  status = NSS_STATUS_UNAVAIL;
  	}
-@@ -152,7 +150,6 @@ lookup (DBT *key, struct STRUCTURE *resu
+@@ -152,7 +152,7 @@ lookup (DBT *key, struct STRUCTURE *resu
    else if (buflen < value.size)
      {
        /* No room to copy the data to.  */
 -      *errnop = ERANGE;
++      errno = ERANGE;
        H_ERRNO_SET (NETDB_INTERNAL);
        status = NSS_STATUS_TRYAGAIN;
      }
@@ -182,7 +191,7 @@
  	/* Give the user a chance to get the same entry with a larger
  	   buffer.  */
  	--entidx;
---- nss_db-compat/Makefile.am.compat	Tue Aug 15 16:18:16 2000
+--- nss_db-compat/Makefile.am	Tue Aug 15 16:18:16 2000
 +++ nss_db-compat/Makefile.am	Wed Aug 16 12:33:23 2000
 @@ -6,7 +6,7 @@ AUTOMAKE_OPTIONS = gnu 1.4
  VERSION = @VERSION@
@@ -193,7 +202,7 @@
  
  slibdir = @slibdir@
  
---- nss_db-compat/Makefile.in.compat	Tue Aug 15 16:18:26 2000
+--- nss_db-compat/Makefile.in	Tue Aug 15 16:18:26 2000
 +++ nss_db-compat/Makefile.in	Wed Aug 16 12:33:23 2000
 @@ -78,7 +78,7 @@ AUTOMAKE_OPTIONS = gnu 1.4
  VERSION = @VERSION@
@@ -204,7 +213,7 @@
  
  slibdir = @slibdir@
  
---- nss_db-compat/netgroup.h.compat	Mon Dec  8 03:33:09 1997
+--- nss_db-compat/netgroup.h	Mon Dec  8 03:33:09 1997
 +++ nss_db-compat/netgroup.h	Wed Aug 16 12:39:54 2000
 @@ -65,6 +65,6 @@ extern int __internal_setnetgrent (const
  extern void __internal_endnetgrent (struct __netgrent *datap);
@@ -214,7 +223,7 @@
 +				     char *buffer, size_t buflen);
  
  #endif /* netgroup.h */
---- nss_db-compat/files-parse.c.compat	Sun Jul 23 22:44:22 2000
+--- nss_db-compat/files-parse.c	Sun Jul 23 22:44:22 2000
 +++ nss_db-compat/files-parse.c	Wed Aug 16 12:44:00 2000
 @@ -79,7 +79,7 @@ struct parser_data
  
@@ -257,7 +266,7 @@
  	{
  	  /* We cannot fit another pointer in the buffer.  */
 -	  *errnop = ERANGE;
-+	  __set_errno(ERANGE);
++	  errno = ERANGE;
  	  return NULL;
  	}
        if (*line == '\0')


Index: nss_db.spec
===================================================================
RCS file: /cvs/dist/rpms/nss_db/devel/nss_db.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- nss_db.spec	16 Mar 2005 20:49:21 -0000	1.21
+++ nss_db.spec	26 Apr 2005 18:00:12 -0000	1.22
@@ -5,7 +5,7 @@
 Summary: An NSS library for the Berkeley DB.
 Name: nss_db
 Version: 2.2
-Release: 31
+Release: 32
 Source: ftp://sources.redhat.com/pub/glibc/releases/nss_db-%{version}.tar.gz
 Source1: http://www.sleepycat.com/update/%{db_version}/db-%{db_version}.tar.gz
 Source2: db-getent-Makefile
@@ -16,6 +16,8 @@
 Patch3: nss_db-2.2-compat.patch
 Patch4: nss_db-2.2-selinux.patch
 Patch5: nss_db-2.2-db-4.3.patch
+Patch6: nss_db-2.2-enoent.patch
+Patch7: nss_db-2.2-initialize.patch
 License: GPL
 Group: System Environment/Libraries
 PreReq: /sbin/ldconfig
@@ -52,6 +54,8 @@
 %patch2 -p1 -b .uniqdb
 %patch4 -p1 -b .selinux
 %patch5 -p1 -b .db-4.3
+%patch6 -p1 -b .enoent
+%patch7 -p1 -b .initialize
 autoreconf -f -i
 
 mv %{name}-%{version} %{name}-compat-%{version}
@@ -61,6 +65,8 @@
 %patch2 -p1 -b .uniqdb
 %patch4 -p1 -b .selinux
 %patch5 -p1 -b .db-4.3
+%patch6 -p1 -b .enoent
+%patch7 -p1 -b .initialize
 %patch3 -p1 -b .compat
 autoreconf -f -i
 popd
@@ -146,6 +152,14 @@
 %endif
 
 %changelog
+* Tue Apr 26 2005 Nalin Dahyabhai <nalin at redhat.com>
+- set errno to ENOENT by default so that we don't leave stale errno values
+  around in error cases (#152467)
+- clear the entire key DBT before handing it to a get() function
+
+* Tue Mar 29 2005 Nalin Dahyabhai <nalin at redhat.com> 2.2-32
+- set errno to ENOENT when returning NSS_STATUS_NOTFOUND (#152467, Dave Lehman)
+
 * Wed Mar 16 2005 Nalin Dahyabhai <nalin at redhat.com> 2.2-31
 - rebuild with new gcc, missed it by that much
 




More information about the fedora-cvs-commits mailing list