rpms/nss_ldap/devel nss_ldap-264-ent_internal.patch, NONE, 1.1 nss_ldap.spec, 1.111, 1.112

Nalin Dahyabhai nalin at fedoraproject.org
Wed Jul 8 17:37:44 UTC 2009


Author: nalin

Update of /cvs/extras/rpms/nss_ldap/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5908

Modified Files:
	nss_ldap.spec 
Added Files:
	nss_ldap-264-ent_internal.patch 
Log Message:
- add proposed patch for upstream #322: crashing in oneshot mode

nss_ldap-264-ent_internal.patch:

--- NEW FILE nss_ldap-264-ent_internal.patch ---
Distinguish between contexts that are somewhat persistent and one-offs
which are used to fulfill part of a larger request.

diff -up nss_ldap/ldap-grp.c nss_ldap/ldap-grp.c
--- nss_ldap/ldap-grp.c
+++ nss_ldap/ldap-grp.c
@@ -857,7 +857,7 @@ ng_chase (const char *dn, ldap_initgroup
   LA_STRING (a) = dn;
   LA_TYPE (a) = LA_TYPE_STRING;
 
-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
+  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
     {
       return NSS_UNAVAIL;
     }
@@ -930,7 +930,7 @@ ng_chase_backlink (const char ** members
   LA_STRING_LIST (a) = filteredMembersOf;
   LA_TYPE (a) = LA_TYPE_STRING_LIST_OR;
 
-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
+  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
     {
       free (filteredMembersOf);
       return NSS_UNAVAIL;
diff -up nss_ldap/ldap-netgrp.c nss_ldap/ldap-netgrp.c
--- nss_ldap/ldap-netgrp.c
+++ nss_ldap/ldap-netgrp.c
@@ -691,7 +691,7 @@ do_innetgr_nested (ldap_innetgr_args_t *
   LA_TYPE (a) = LA_TYPE_STRING;
   LA_STRING (a) = nested;	/* memberNisNetgroup */
 
-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
+  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
     {
       debug ("<== do_innetgr_nested: failed to initialize context");
       return NSS_UNAVAIL;
diff -up nss_ldap/ldap-nss.c nss_ldap/ldap-nss.c
--- nss_ldap/ldap-nss.c
+++ nss_ldap/ldap-nss.c
@@ -1961,6 +1961,7 @@ _nss_ldap_ent_context_init_locked (ent_c
 	  debug ("<== _nss_ldap_ent_context_init_locked");
 	  return NULL;
 	}
+      ctx->ec_internal = 0;
       *pctx = ctx;
     }
   else
@@ -1990,6 +1991,15 @@ _nss_ldap_ent_context_init_locked (ent_c
 
   return ctx;
 }
+ent_context_t *
+_nss_ldap_ent_context_init_internal_locked (ent_context_t ** pctx)
+{
+  ent_context_t *ctx;
+  ctx = _nss_ldap_ent_context_init_locked (pctx);
+  if (ctx != NULL)
+    ctx->ec_internal = 1;
+  return ctx;
+}
 
 /*
  * Clears a given context; we require the caller
@@ -2031,7 +2041,8 @@ _nss_ldap_ent_context_release (ent_conte
 
   LS_INIT (ctx->ec_state);
 
-  if (_nss_ldap_test_config_flag (NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT))
+  if (!ctx->ec_internal &&
+      _nss_ldap_test_config_flag (NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT))
     {
       do_close ();
     }
diff -up nss_ldap/ldap-nss.h nss_ldap/ldap-nss.h
--- nss_ldap/ldap-nss.h
+++ nss_ldap/ldap-nss.h
@@ -560,6 +560,8 @@ struct ent_context
   ldap_state_t ec_state;	/* eg. for services */
   int ec_msgid;			/* message ID */
   LDAPMessage *ec_res;		/* result chain */
+  int ec_internal;		/* this context is just a part of a larger
+				 * query for information */
   ldap_service_search_descriptor_t *ec_sd;	/* current sd */
   struct berval *ec_cookie;     /* cookie for paged searches */
   int ec_eof;			/* reached notional end of file */
@@ -744,6 +746,15 @@ ent_context_t *_nss_ldap_ent_context_ini
 ent_context_t *_nss_ldap_ent_context_init_locked (ent_context_t **);
 
 /*
+ * _nss_ldap_ent_context_init_internal_locked() has the same
+ * behaviour, except it marks the context as one that's being
+ * used to fetch additional data used in answering a request, i.e.
+ * that this isn't the "main" context
+ */
+
+ent_context_t *_nss_ldap_ent_context_init_internal_locked (ent_context_t **);
+
+/*
  * _nss_ldap_ent_context_release() is used to manually free a context 
  */
 void _nss_ldap_ent_context_release (ent_context_t *);


Index: nss_ldap.spec
===================================================================
RCS file: /cvs/extras/rpms/nss_ldap/devel/nss_ldap.spec,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -p -r1.111 -r1.112
--- nss_ldap.spec	6 Jul 2009 23:24:49 -0000	1.111
+++ nss_ldap.spec	8 Jul 2009 17:37:14 -0000	1.112
@@ -2,7 +2,7 @@
 Summary: NSS library and PAM module for LDAP
 Name: nss_ldap
 Version: 264
-Release: 3%{?dist}
+Release: 4%{?dist}
 Source0: ftp://ftp.padl.com/pub/nss_ldap-%{version}.tar.gz
 Source1: ftp://ftp.padl.com/pub/pam_ldap-%{pam_ldap_version}.tar.gz
 Source3: nss_ldap.versions
@@ -25,6 +25,7 @@ Patch17: nss_ldap-259-res_init.patch
 Patch19: pam_ldap-184-broken-sasl-rebind.patch
 Patch20: pam_ldap-184-nsrole.patch
 Patch21: nss_ldap-264-checkcase.patch
+Patch22: nss_ldap-264-ent_internal.patch
 
 URL: http://www.padl.com/
 License: LGPLv2+
@@ -65,6 +66,7 @@ pushd nss_ldap-%{version}
 %patch8 -p1 -b .soname
 %patch17 -p1 -b .res_init
 #%patch21 -p1 -b .checkcase
+%patch22 -p1 -b .ent_internal
 autoreconf -f -i
 popd
 
@@ -192,8 +194,12 @@ fi
 %doc pam_ldap-%{pam_ldap_version}/ns-pwd-policy.schema
 
 %changelog
+* Tue Jul  7 2009 Nalin Dahyabhai <nalin at redhat.com> - 264-4
+- add proposed patch for upstream #322: crashing in oneshot mode
+
 * Mon Jul  6 2009 Nalin Dahyabhai <nalin at redhat.com>
-- add but don't apply proposed patch for upstream #399
+- add but don't apply proposed patch for upstream #399: depending on the
+  server to enforce the expected case-sensitivity opens up corner cases
 
 * Fri Jun 19 2009 Kedar Sovani <kedars at marvell.com>  - 264-3
 - BuildRequires: openssl-static




More information about the fedora-extras-commits mailing list