Hello community,
here is the log from the commit of package nss_ldap for openSUSE:Factory
checked in at Wed May 20 02:35:44 CEST 2009.
--------
--- nss_ldap/nss_ldap.changes 2009-01-07 11:21:39.000000000 +0100
+++ nss_ldap/nss_ldap.changes 2009-05-19 09:28:41.000000000 +0200
@@ -1,0 +2,16 @@
+Tue May 19 09:16:41 CEST 2009 - rhafer@novell.com
+
+- updated to nss_ldap-264. From the changelog:
+ * fix for PADL-Bug#378: MAP_H_ERRNO() should map NSS_TRYAGAIN
+ to NETDB_INTERNAL not TRY_AGAIN
+ * fix for PADL-Bug#379: ldaps:// URIs only work if "ssl on"
+ is set
+ * fix for PADL-Bug#248: nss_ldap exposes malformed entries to the
+ system
+ * fix for PADL-Bug#374: nss_ldap returns success from setnetgrent()
+ when the requested netgroup doesn't exist
+ * fix for PADL-Bug#376: getXXent() only returns NULL once before
+ implicitly calling setXXent(), whereas other backends continue
+ to return NULL
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
nss_ldap-262.tar.bz2
nss_ldap-defport-ssl-uri.dif
New:
----
nss_ldap-264.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nss_ldap.spec ++++++
--- /var/tmp/diff_new_pack.b13017/_old 2009-05-20 02:20:37.000000000 +0200
+++ /var/tmp/diff_new_pack.b13017/_new 2009-05-20 02:20:37.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package nss_ldap (Version 262)
+# spec file for package nss_ldap (Version 264)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -29,15 +29,14 @@
Obsoletes: nss_ldap-64bit
%endif
#
-Version: 262
-Release: 11
+Version: 264
+Release: 1
Summary: NSS LDAP Module
Url: http://www.padl.com/OSS/nss_ldap.html
Source: nss_ldap-%{version}.tar.bz2
Source1: README.SuSE
Patch: nss_ldap.dif
Patch1: group-utf8.dif
-Patch2: nss_ldap-defport-ssl-uri.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -56,7 +55,6 @@
%setup -q
%patch -p1
%patch1 -p1
-%patch2 -p1
cp -v %{S:1} .
%build
@@ -112,6 +110,19 @@
%doc %{_mandir}/man5/nss_ldap.5*
%changelog
+* Tue May 19 2009 rhafer@novell.com
+- updated to nss_ldap-264. From the changelog:
+ * fix for PADL-Bug#378: MAP_H_ERRNO() should map NSS_TRYAGAIN
+ to NETDB_INTERNAL not TRY_AGAIN
+ * fix for PADL-Bug#379: ldaps:// URIs only work if "ssl on"
+ is set
+ * fix for PADL-Bug#248: nss_ldap exposes malformed entries to the
+ system
+ * fix for PADL-Bug#374: nss_ldap returns success from setnetgrent()
+ when the requested netgroup doesn't exist
+ * fix for PADL-Bug#376: getXXent() only returns NULL once before
+ implicitly calling setXXent(), whereas other backends continue
+ to return NULL
* Wed Jan 07 2009 olh@suse.de
- obsolete old -XXbit packages (bnc#437293)
* Tue Oct 28 2008 rhafer@suse.de
++++++ nss_ldap-262.tar.bz2 -> nss_ldap-264.tar.bz2 ++++++
++++ 2549 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/aix_authmeth.c new/nss_ldap-264/aix_authmeth.c
--- old/nss_ldap-262/aix_authmeth.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/aix_authmeth.c 2008-10-30 21:50:15.000000000 +0100
@@ -25,7 +25,7 @@
#include "config.h"
static char rcsId[] =
- "$Id: aix_authmeth.c,v 2.31 2006/02/24 01:28:59 lukeh Exp $";
+ "$Id: aix_authmeth.c,v 2.32 2008/10/30 20:49:46 lukeh Exp $";
#ifdef HAVE_USERSEC_H
@@ -381,7 +381,12 @@
LA_INIT (a);
LA_TYPE (a) = LA_TYPE_NUMBER;
- LA_NUMBER (a) = atol(vals[0]);
+ stat = _nss_ldap_parse_long (vals[0], 0, &(LA_NUMBER(a)));
+ if (stat != NSS_SUCCESS)
+ {
+ ldap_value_free (vals);
+ return stat;
+ }
attrs[0] = ATM (LM_GROUP, cn);
attrs[1] = NULL;
@@ -543,9 +548,11 @@
return NSS_NOTFOUND;
}
- av->attr_un.au_int = atoi (vals[0]);
+ stat = _nss_ldap_parse_int(vals[0], 0, &av->attr_un.au_int);
+
ldap_value_free (vals);
- return NSS_SUCCESS;
+
+ return stat;
}
/*
@@ -869,12 +876,12 @@
return NSS_NOTFOUND;
}
- *uid = atoi(vals[0]);
+ stat = _nss_ldap_parse_uid_t (vals[0], 0, uid);
ldap_value_free (vals);
ldap_msgfree (res);
- return NSS_SUCCESS;
+ return stat;
}
/*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ChangeLog new/nss_ldap-264/ChangeLog
--- old/nss_ldap-262/ChangeLog 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ChangeLog 2008-10-30 21:50:15.000000000 +0100
@@ -1,6 +1,24 @@
-$Id: ChangeLog,v 2.402 2008/08/23 00:51:26 lukeh Exp $
+$Id: ChangeLog,v 2.407 2008/10/30 20:49:46 lukeh Exp $
===============================================================
+264 Luke Howard
+
+ * fix for BUG#378: MAP_H_ERRNO() should map NSS_TRYAGAIN
+ to NETDB_INTERNAL not TRY_AGAIN
+ * fix for BUG#379: ldaps:// URIs only work if "ssl on"
+ is set
+ * fix for BUG#248: nss_ldap exposes malformed entries
+ to the system
+
+263 Luke Howard
+
+ * fix for BUG#374: nss_ldap returns success from
+ setnetgrent() when the requested netgroup doesn't
+ exist
+ * fix for BUG#376: getXXent() only returns NULL once
+ before implicitly calling setXXent(), whereas other
+ backends continue to return NULL (Red Hat BUG#466794)
+
262 Luke Howard
* fix for BUG#370: nss_ldap fails to work on Solaris
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/config.h.in new/nss_ldap-264/config.h.in
--- old/nss_ldap-262/config.h.in 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/config.h.in 2008-10-30 21:50:15.000000000 +0100
@@ -328,6 +328,18 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* The size of a `gid_t', as computed by sizeof. */
+#undef SIZEOF_GID_T
+
+/* The size of a `uid_t', as computed by sizeof. */
+#undef SIZEOF_UID_T
+
+/* The size of a `unsigned int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_INT
+
+/* The size of a `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/configure.in new/nss_ldap-264/configure.in
--- old/nss_ldap-262/configure.in 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/configure.in 2008-10-30 21:50:15.000000000 +0100
@@ -2,7 +2,7 @@
AC_CANONICAL_SYSTEM
AC_PREFIX_DEFAULT()
-AM_INIT_AUTOMAKE(nss_ldap, 260)
+AM_INIT_AUTOMAKE(nss_ldap, 264)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
@@ -278,6 +278,11 @@
with_ldap_lib=auto
fi
+AC_CHECK_SIZEOF([unsigned int])
+AC_CHECK_SIZEOF([unsigned long])
+AC_CHECK_SIZEOF([uid_t],,[#include ])
+AC_CHECK_SIZEOF([gid_t],,[#include ])
+
AC_CHECK_LIB(dl, dlopen,[LIBS="-ldl $LIBS"],,$LIBS)
dnl AC_CHECK_LIB(db, main,[LIBS="-ldb $LIBS"],,$LIBS)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/CVSVersionInfo.txt new/nss_ldap-264/CVSVersionInfo.txt
--- old/nss_ldap-262/CVSVersionInfo.txt 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/CVSVersionInfo.txt 2008-10-30 21:50:15.000000000 +0100
@@ -1,8 +1,8 @@
# Created and modified by checkpoint; do not edit
-# $Id: CVSVersionInfo.txt,v 2.306 2008/08/23 00:51:30 lukeh Exp $
-# $Name: nss_ldap-262 $
+# $Id: CVSVersionInfo.txt,v 2.308 2008/10/30 20:50:13 lukeh Exp $
+# $Name: nss_ldap-264 $
ProjectName: nss_ldap
-ProjectVersion: 262
+ProjectVersion: 264
ProjectMaintainer: lukeh
#
# run this before building in RC. @@@PLATFORM@@@ is
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-netgrp.c new/nss_ldap-264/ldap-netgrp.c
--- old/nss_ldap-262/ldap-netgrp.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-netgrp.c 2008-10-30 21:50:15.000000000 +0100
@@ -18,11 +18,11 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- $Id: ldap-netgrp.c,v 2.45 2006/09/13 06:35:48 lukeh Exp $
+ $Id: ldap-netgrp.c,v 2.46 2008/10/15 01:25:56 lukeh Exp $
*/
static char rcsId[] =
- "$Id: ldap-netgrp.c,v 2.45 2006/09/13 06:35:48 lukeh Exp $";
+ "$Id: ldap-netgrp.c,v 2.46 2008/10/15 01:25:56 lukeh Exp $";
#include "config.h"
@@ -372,6 +372,9 @@
_nss_ldap_filt_getnetgrent, LM_NETGROUP,
_nss_ldap_load_netgr);
+ if (stat == NSS_NOTFOUND)
+ return stat;
+
LOOKUP_SETENT (_ngbe);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-nss.c new/nss_ldap-264/ldap-nss.c
--- old/nss_ldap-262/ldap-nss.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-nss.c 2008-10-30 21:50:15.000000000 +0100
@@ -19,7 +19,7 @@
*/
static char rcsId[] =
- "$Id: ldap-nss.c,v 2.296 2008/03/04 09:59:25 lukeh Exp $";
+ "$Id: ldap-nss.c,v 2.300 2008/10/30 20:49:47 lukeh Exp $";
#include "config.h"
@@ -1042,7 +1042,7 @@
(void)do_init_krb5_cache(__config);
# endif /* CONFIGURE_KRB5_KEYTAB */
#ifdef HAVE_LDAP_INITIALIZE
- if (p == NULL &&
+ if (p == NULL && defport != 0 &&
((ldaps && defport != LDAPS_PORT) || (!ldaps && defport != LDAP_PORT)))
{
/* No port specified in URI and non-default port specified */
@@ -1586,9 +1586,13 @@
#endif /* HAVE_LDAP_START_TLS_S || HAVE_LDAP_START_TLS */
/*
- * If SSL is desired, then enable it.
+ * If SSL is desired, either by the "ssl" option or if this
+ * is a "ldaps" URI, then enable it.
*/
- if (cfg->ldc_ssl_on == SSL_LDAPS)
+ if (cfg->ldc_ssl_on == SSL_LDAPS ||
+ strncasecmp(cfg->ldc_uris[__session.ls_current_uri],
+ "ldaps://", sizeof ("ldaps://") - 1) == 0
+ )
{
#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
int tls = LDAP_OPT_X_TLS_HARD;
@@ -2023,6 +2027,7 @@
ctx->ec_res = NULL;
ctx->ec_msgid = -1;
ctx->ec_sd = NULL;
+ ctx->ec_eof = 0;
LS_INIT (ctx->ec_state);
@@ -2068,6 +2073,7 @@
}
ctx->ec_sd = NULL;
+ ctx->ec_eof = 0;
LS_INIT (ctx->ec_state);
@@ -3118,12 +3124,18 @@
dynamicFilterBuf = NULL;
}
+ if (stat == NSS_SUCCESS &&
+ ldap_count_entries (__session.ls_conn, *res) == 0) /* No results */
+ {
+ stat = NSS_NOTFOUND;
+ ldap_msgfree (*res);
+ *res = NULL;
+ }
+
/* If no entry was returned, try the next search descriptor. */
if (sd != NULL && sd->lsd_next != NULL)
{
- if (stat == NSS_NOTFOUND ||
- (stat == NSS_SUCCESS &&
- ldap_first_entry (__session.ls_conn, *res) == NULL))
+ if (stat == NSS_NOTFOUND)
{
sd = sd->lsd_next;
goto next;
@@ -3368,7 +3380,12 @@
debug ("==> _nss_ldap_getent_ex");
- if (*ctx == NULL || (*ctx)->ec_msgid < 0)
+ if (*ctx != NULL && (*ctx)->ec_eof != 0)
+ {
+ debug ("<== _nss_ldap_getent_ex (EOF)");
+ return NSS_NOTFOUND;
+ }
+ else if (*ctx == NULL || (*ctx)->ec_msgid < 0)
{
/*
* implicitly call setent() if this is the first time
@@ -3424,10 +3441,18 @@
}
#endif /* HAVE_LDAP_SEARCH_EXT */
- if (stat == NSS_NOTFOUND && (*ctx)->ec_sd != NULL)
+ if (stat == NSS_NOTFOUND)
{
- (*ctx)->ec_msgid = -1;
- goto next;
+ if ((*ctx)->ec_sd != NULL)
+ {
+ (*ctx)->ec_msgid = -1;
+ goto next;
+ }
+ else
+ {
+ /* Mark notional end of file */
+ (*ctx)->ec_eof = 1;
+ }
}
debug ("<== _nss_ldap_getent_ex");
@@ -3454,6 +3479,7 @@
ctx.ec_msgid = -1;
ctx.ec_cookie = NULL;
+ ctx.ec_eof = 0;
stat = _nss_ldap_search_s (args, filterprot, sel, NULL, 1, &ctx.ec_res);
if (stat != NSS_SUCCESS)
@@ -3801,22 +3827,36 @@
}
#ifdef HAVE_SHADOW_H
-int
-_nss_ldap_shadow_date (const char *val)
+NSS_STATUS
+_nss_ldap_shadow_date (const char *val, long default_date, long *value)
{
int date;
+ char *p;
+ long long ll;
+ if (val == NULL || strlen(val) == 0)
+ {
+ *value = default_date;
+ return NSS_NOTFOUND;
+ }
+ ll = strtoll(val, &p, 10);
+ if (p == NULL || p == val || *p != '\0')
+ {
+ *value = default_date;
+ return NSS_NOTFOUND;
+ }
if (__config->ldc_shadow_type == LS_AD_SHADOW)
{
- date = atoll (val) / 864000000000LL - 134774LL;
+ date = ll / 864000000000LL - 134774LL;
date = (date > 99999) ? 99999 : date;
}
else
{
- date = atol (val);
+ date = ll;
}
- return date;
+ *value = date;
+ return NSS_SUCCESS;
}
void
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-nss.h new/nss_ldap-264/ldap-nss.h
--- old/nss_ldap-262/ldap-nss.h 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-nss.h 2008-10-30 21:50:15.000000000 +0100
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- $Id: ldap-nss.h,v 2.137 2007/10/01 00:12:06 lukeh Exp $
+ $Id: ldap-nss.h,v 2.139 2008/10/30 20:49:47 lukeh Exp $
*/
#ifndef _LDAP_NSS_LDAP_LDAP_NSS_H
@@ -543,6 +543,7 @@
{
int ls_type;
int ls_retry;
+ int ls_eof;
#define LS_TYPE_KEY (0)
#define LS_TYPE_INDEX (1)
union
@@ -572,6 +573,7 @@
LDAPMessage *ec_res; /* result chain */
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 */
};
typedef struct ent_context ent_context_t;
@@ -863,11 +865,11 @@
NSS_STATUS _nss_ldap_oc_check (LDAPMessage * e, const char *oc);
+NSS_STATUS _nss_ldap_shadow_date(const char *val, long default_date,
+ long *value);
#if defined(HAVE_SHADOW_H)
-int _nss_ldap_shadow_date(const char *val);
void _nss_ldap_shadow_handle_flag(struct spwd *sp);
#else
-#define _nss_ldap_shadow_date(_v) atol((_v))
#define _nss_ldap_shadow_handle_flag(_sp) do { /* nothing */ } while (0)
#endif /* HAVE_SHADOW_H */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-pwd.c new/nss_ldap-264/ldap-pwd.c
--- old/nss_ldap-262/ldap-pwd.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-pwd.c 2008-10-30 21:50:15.000000000 +0100
@@ -19,7 +19,7 @@
*/
static char rcsId[] =
- "$Id: ldap-pwd.c,v 2.47 2007/10/01 00:34:46 lukeh Exp $";
+ "$Id: ldap-pwd.c,v 2.48 2008/10/30 20:49:47 lukeh Exp $";
#include "config.h"
@@ -122,7 +122,15 @@
_nss_ldap_assign_attrval (e, AT (uidNumber), &uid, &tmp, &tmplen);
if (stat != NSS_SUCCESS)
return stat;
- pw->pw_uid = (*uid == '\0') ? UID_NOBODY : (uid_t) atol (uid);
+ if (*uid == '\0')
+ pw->pw_uid = UID_NOBODY;
+ else
+ {
+ stat =
+ _nss_ldap_parse_uid_t (uid, UID_NOBODY, &pw->pw_uid);
+ if (stat != NSS_SUCCESS)
+ return stat;
+ }
tmp = tmpbuf;
tmplen = sizeof (tmpbuf);
@@ -131,7 +139,15 @@
&tmplen);
if (stat != NSS_SUCCESS)
return stat;
- pw->pw_gid = (*gid == '\0') ? GID_NOBODY : (gid_t) atol (gid);
+ if (*gid == '\0')
+ pw->pw_gid = GID_NOBODY;
+ else
+ {
+ stat =
+ _nss_ldap_parse_gid_t (gid, GID_NOBODY, &pw->pw_gid);
+ if (stat != NSS_SUCCESS)
+ return stat;
+ }
stat =
_nss_ldap_assign_attrval (e, AT (gecos), &pw->pw_gecos, &buffer,
@@ -176,16 +192,29 @@
tmp = NULL;
stat =
_nss_ldap_assign_attrval (e, AT (shadowMax), &tmp, &buffer, &buflen);
- pw->pw_change = (stat == NSS_SUCCESS) ? atol(tmp) * (24*60*60) : 0;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_long (tmp, 0, &pw->pw_change);
+ else
+ pw->pw_change = 0;
if (pw->pw_change > 0)
{
+ long sp_change;
tmp = NULL;
stat =
_nss_ldap_assign_attrval (e, AT (shadowLastChange), &tmp, &buffer,
&buflen);
if (stat == NSS_SUCCESS)
- pw->pw_change += atol(tmp) * (24*60*60);
+ {
+ stat = _nss_ldap_parse_long(tmp, 0, &sp_change);
+ if (stat == NSS_SUCCESS)
+ {
+ pw->pw_change += sp_change;
+ pw->pw_change *= (24 * 60 * 60);
+ }
+ else
+ pw->pw_change = 0;
+ }
else
pw->pw_change = 0;
}
@@ -195,7 +224,13 @@
tmp = NULL;
stat =
_nss_ldap_assign_attrval (e, AT (shadowExpire), &tmp, &buffer, &buflen);
- pw->pw_expire = (stat == NSS_SUCCESS) ? atol(tmp) * (24*60*60) : 0;
+ if (stat == NSS_SUCCESS)
+ {
+ _nss_ldap_parse_long (tmp, 0, &pw->pw_expire);
+ pw->pw_expire *= (24 * 60 * 60);
+ }
+ else
+ pw->pw_expire = 0;
#endif /* HAVE_PASSWD_PW_EXPIRE */
return NSS_SUCCESS;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-rpc.c new/nss_ldap-264/ldap-rpc.c
--- old/nss_ldap-262/ldap-rpc.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-rpc.c 2008-10-30 21:50:15.000000000 +0100
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- $Id: ldap-rpc.c,v 2.29 2006/01/11 18:03:49 lukeh Exp $
+ $Id: ldap-rpc.c,v 2.30 2008/10/30 20:49:47 lukeh Exp $
*/
/*
@@ -28,7 +28,7 @@
static char rcsId[] =
- "$Id: ldap-rpc.c,v 2.29 2006/01/11 18:03:49 lukeh Exp $";
+ "$Id: ldap-rpc.c,v 2.30 2008/10/30 20:49:47 lukeh Exp $";
#include "config.h"
@@ -95,7 +95,10 @@
if (stat != NSS_SUCCESS)
return stat;
- rpc->r_number = atol (number);
+ stat =
+ _nss_ldap_parse_int (number, 0, &rpc->r_number);
+ if (stat != NSS_SUCCESS)
+ return stat;
stat =
_nss_ldap_assign_attrvals (e, ATM (LM_RPC, cn), rpc->r_name,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-service.c new/nss_ldap-264/ldap-service.c
--- old/nss_ldap-262/ldap-service.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-service.c 2008-10-30 21:50:15.000000000 +0100
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
- $Id: ldap-service.c,v 2.32 2006/01/11 18:03:49 lukeh Exp $
+ $Id: ldap-service.c,v 2.33 2008/10/30 20:49:47 lukeh Exp $
*/
/*
@@ -28,7 +28,7 @@
static char rcsId[] =
- "$Id: ldap-service.c,v 2.32 2006/01/11 18:03:49 lukeh Exp $";
+ "$Id: ldap-service.c,v 2.33 2008/10/30 20:49:47 lukeh Exp $";
#include "config.h"
@@ -77,7 +77,8 @@
void *result, char *buffer, size_t buflen)
{
struct servent *service = (struct servent *) result;
- char *port;
+ char *portstr;
+ int port;
NSS_STATUS stat = NSS_SUCCESS;
/* this is complicated and ugly, because some git (me) specified that service
@@ -175,14 +176,20 @@
}
stat =
- _nss_ldap_assign_attrval (e, AT (ipServicePort), &port, &buffer,
+ _nss_ldap_assign_attrval (e, AT (ipServicePort), &portstr, &buffer,
&buflen);
if (stat != NSS_SUCCESS)
{
return stat;
}
- service->s_port = htons (atoi (port));
+ stat = _nss_ldap_parse_int (portstr, 0, &port);
+ if (stat != NSS_SUCCESS)
+ {
+ return stat;
+ }
+
+ service->s_port = htons(port);
return NSS_SUCCESS;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/ldap-spwd.c new/nss_ldap-264/ldap-spwd.c
--- old/nss_ldap-262/ldap-spwd.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/ldap-spwd.c 2008-10-30 21:50:15.000000000 +0100
@@ -19,7 +19,7 @@
*/
static char rcsId[] =
- "$Id: ldap-spwd.c,v 2.34 2006/01/11 18:03:49 lukeh Exp $";
+ "$Id: ldap-spwd.c,v 2.35 2008/10/30 20:49:47 lukeh Exp $";
#include "config.h"
@@ -51,6 +51,7 @@
#include "ldap-nss.h"
#include "ldap-spwd.h"
+#include "util.h"
#ifdef HAVE_PORT_AFTER_H
#include
@@ -86,34 +87,55 @@
stat =
_nss_ldap_assign_attrval (e, AT (shadowLastChange), &tmp, &buffer,
&buflen);
- sp->sp_lstchg = (stat == NSS_SUCCESS) ? _nss_ldap_shadow_date (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_shadow_date (tmp, -1, &sp->sp_lstchg);
+ else
+ sp->sp_lstchg = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowMax), &tmp, &buffer, &buflen);
- sp->sp_max = (stat == NSS_SUCCESS) ? atol (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_long (tmp, -1, &sp->sp_max);
+ else
+ sp->sp_max = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowMin), &tmp, &buffer, &buflen);
- sp->sp_min = (stat == NSS_SUCCESS) ? atol (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_long (tmp, -1, &sp->sp_min);
+ else
+ sp->sp_min = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowWarning), &tmp, &buffer,
&buflen);
- sp->sp_warn = (stat == NSS_SUCCESS) ? atol (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_long (tmp, -1, &sp->sp_warn);
+ else
+ sp->sp_warn = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowInactive), &tmp, &buffer,
&buflen);
- sp->sp_inact = (stat == NSS_SUCCESS) ? atol (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_long (tmp, -1, &sp->sp_inact);
+ else
+ sp->sp_inact = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowExpire), &tmp, &buffer,
&buflen);
- sp->sp_expire = (stat == NSS_SUCCESS) ? _nss_ldap_shadow_date (tmp) : -1;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_shadow_date (tmp, -1, &sp->sp_expire);
+ else
+ sp->sp_expire = -1;
stat =
_nss_ldap_assign_attrval (e, AT (shadowFlag), &tmp, &buffer, &buflen);
- sp->sp_flag = (stat == NSS_SUCCESS) ? atol (tmp) : 0;
+ if (stat == NSS_SUCCESS)
+ _nss_ldap_parse_ulong (tmp, -1, &sp->sp_flag);
+ else
+ sp->sp_flag = -1;
_nss_ldap_shadow_handle_flag(sp);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/nss_ldap.spec new/nss_ldap-264/nss_ldap.spec
--- old/nss_ldap-262/nss_ldap.spec 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/nss_ldap.spec 2008-10-30 21:50:15.000000000 +0100
@@ -1,6 +1,6 @@
Summary: NSS library for LDAP.
Name: nss_ldap
-Version: 260
+Version: 264
Release: 1
Source0: ftp://ftp.padl.com/pub/%{name}-%{version}.tar.gz
Source1: ldap.conf
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/util.c new/nss_ldap-264/util.c
--- old/nss_ldap-262/util.c 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/util.c 2008-10-30 21:50:15.000000000 +0100
@@ -58,7 +58,7 @@
#include "ldap-nss.h"
#include "util.h"
-static char rcsId[] = "$Id: util.c,v 2.135 2007/10/01 00:25:33 lukeh Exp $";
+static char rcsId[] = "$Id: util.c,v 2.137 2008/10/30 20:49:47 lukeh Exp $";
static NSS_STATUS do_getrdnvalue (const char *dn,
const char *rdntype,
@@ -1270,16 +1270,10 @@
}
}
- if (result->ldc_port == 0)
+ if (result->ldc_port == 0 &&
+ result->ldc_ssl_on == SSL_LDAPS)
{
- if (result->ldc_ssl_on == SSL_LDAPS)
- {
- result->ldc_port = LDAPS_PORT;
- }
- else
- {
- result->ldc_port = LDAP_PORT;
- }
+ result->ldc_port = LDAPS_PORT;
}
if (result->ldc_uris[0] == NULL)
@@ -1634,3 +1628,148 @@
return NSS_SUCCESS;
}
+/*
+ * Parse a text string into a long integer. If we fail for
+ * any reason, store the passed-in default value and return
+ * an error.
+ */
+NSS_STATUS
+_nss_ldap_parse_long (const char *text, long default_value, long *value)
+{
+ char *p;
+ long l;
+
+ if (text == NULL || strlen(text) == 0)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ l = strtol(text, &p, 10);
+ if (p == NULL || p == text || *p != '\0')
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ *value = l;
+
+ return NSS_SUCCESS;
+}
+
+NSS_STATUS
+_nss_ldap_parse_ulong (const char *text, unsigned long default_value,
+ unsigned long *value)
+{
+ char *p;
+ unsigned long l;
+
+ if (text == NULL || strlen(text) == 0)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ l = strtoul(text, &p, 10);
+ if (p == NULL || p == text || *p != '\0')
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ *value = l;
+
+ return NSS_SUCCESS;
+}
+
+NSS_STATUS
+_nss_ldap_parse_int (const char *text, int default_value, int *value)
+{
+ char *p;
+ long l;
+
+ if (text == NULL || strlen(text) == 0)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ l = strtol(text, &p, 10);
+ if (p == NULL || p == text || *p != '\0')
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ if (l < INT_MIN || l > INT_MAX)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ *value = l;
+
+ return NSS_SUCCESS;
+}
+
+NSS_STATUS
+_nss_ldap_parse_uid_t (const char *text, uid_t default_value, uid_t *value)
+{
+ char *p;
+ unsigned long l;
+
+ if (text == NULL || strlen(text) == 0)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ l = strtoul(text, &p, 10);
+ if (p == NULL || p == text || *p != '\0')
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+#if SIZEOF_UID_T == SIZEOF_UNSIGNED_INT
+ if (l > UINT_MAX)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+#endif
+
+ *value = l;
+
+ return NSS_SUCCESS;
+}
+
+NSS_STATUS
+_nss_ldap_parse_gid_t (const char *text, gid_t default_value, gid_t *value)
+{
+ char *p;
+ unsigned long l;
+
+ if (text == NULL || strlen(text) == 0)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+
+ l = strtoul(text, &p, 10);
+ if (p == NULL || p == text || *p != '\0')
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+#if SIZEOF_GID_T == SIZEOF_UNSIGNED_INT
+ if (l > UINT_MAX)
+ {
+ *value = default_value;
+ return NSS_NOTFOUND;
+ }
+#endif
+
+ *value = l;
+
+ return NSS_SUCCESS;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nss_ldap-262/util.h new/nss_ldap-264/util.h
--- old/nss_ldap-262/util.h 2008-08-23 02:51:32.000000000 +0200
+++ new/nss_ldap-264/util.h 2008-10-30 21:50:15.000000000 +0100
@@ -152,7 +152,7 @@
(herr) = 0; \
break; \
case NSS_TRYAGAIN: \
- (herr) = TRY_AGAIN; \
+ (herr) = NETDB_INTERNAL;\
break; \
case NSS_NOTFOUND: \
(herr) = HOST_NOT_FOUND;\
@@ -224,4 +224,16 @@
ldap_map_selector_t
_nss_ldap_str2selector (const char *key);
+NSS_STATUS
+_nss_ldap_parse_long (const char *text, long default_value, long *value);
+NSS_STATUS
+_nss_ldap_parse_ulong (const char *text, unsigned long default_value,
+ unsigned long *value);
+NSS_STATUS
+_nss_ldap_parse_int (const char *text, int default_value, int *value);
+NSS_STATUS
+_nss_ldap_parse_uid_t (const char *text, uid_t default_value, uid_t *value);
+NSS_STATUS
+_nss_ldap_parse_gid_t (const char *text, gid_t default_value, gid_t *value);
+
#endif /* _LDAP_NSS_LDAP_UTIL_H */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org