[packages/nss_ldapd] - up to 0.9.4
alucard
alucard at pld-linux.org
Fri Jul 11 13:54:25 CEST 2014
commit d55aa115381cf238db7f634b85eb9765d234b1e6
Author: Tomasz Rutkowski <alucard at pld-linux.org>
Date: Fri Jul 11 13:52:28 2014 +0200
- up to 0.9.4
nss_ldapd.spec | 12 ++++++-----
optimize-queries.patch | 57 ++++++++++++++++++++++++--------------------------
2 files changed, 34 insertions(+), 35 deletions(-)
---
diff --git a/nss_ldapd.spec b/nss_ldapd.spec
index 3d9874f..3e40f1d 100644
--- a/nss_ldapd.spec
+++ b/nss_ldapd.spec
@@ -6,12 +6,12 @@ Summary(es.UTF-8): Biblioteca NSS para LDAP
Summary(pl.UTF-8): Moduł NSS LDAP
Summary(pt_BR.UTF-8): Biblioteca NSS para LDAP
Name: nss_ldapd
-Version: 0.9.2
-Release: 5
+Version: 0.9.4
+Release: 0.1
License: LGPL v2.1+
Group: Base
Source0: http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz
-# Source0-md5: 0c60d4c300dd9a4fb40b6ba7abeed8a2
+# Source0-md5: 0d74202700efdde3b6e551bfff49c132
Source1: nslcd.init
Source2: nslcd.service
Source3: nslcd.tmpfiles
@@ -101,8 +101,10 @@ zmianę haseł i obsługę sesji.
%setup -q -n nss-pam-ldapd-%{version}
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+# made upstream
+#patch2 -p1
+# patched upstream
+#patch3 -p1
%patch4 -p1
%{__sed} -i -e '1s|#!.*|#!%{__python}|' utils/*.py
diff --git a/optimize-queries.patch b/optimize-queries.patch
index 4a38d15..e898fbc 100644
--- a/optimize-queries.patch
+++ b/optimize-queries.patch
@@ -37,26 +37,22 @@ diff -ur nss-pam-ldapd-0.9.2/nslcd/ether.c nss-pam-ldapd-0.9.2-opt/nslcd/ether.c
}
void ether_init(void)
-diff -ur nss-pam-ldapd-0.9.2/nslcd/group.c nss-pam-ldapd-0.9.2-opt/nslcd/group.c
---- nss-pam-ldapd-0.9.2/nslcd/group.c 2013-10-29 23:20:01.000000000 +0100
-+++ nss-pam-ldapd-0.9.2-opt/nslcd/group.c 2013-12-11 18:47:22.407609074 +0100
-@@ -88,8 +88,8 @@
- if (myldap_escape(name, safename, sizeof(safename)))
- return -1;
- /* build filter */
-- return mysnprintf(buffer, buflen, "(&%s(%s=%s))",
-- group_filter, attmap_group_cn, safename);
-+ return mysnprintf(buffer, buflen, "(&(%s=%s)%s)",
-+ attmap_group_cn, safename, group_filter);
- }
-
- /* create a search filter for searching a group entry
-@@ -98,15 +98,16 @@
- {
- if (gidSid != NULL)
+--- nss-pam-ldapd-0.9.4/nslcd/group.c.orig 2014-06-06 17:28:40.000000000 +0200
++++ nss-pam-ldapd-0.9.4/nslcd/group.c 2014-07-11 13:30:43.245939236 +0200
+@@ -112,19 +112,21 @@ static int mkfilter_group_bygid(gid_t gi
{
+ /* the given gid is a BUILTIN gid, the SID prefix is not the domain SID */
+ if ((gid >= min_builtin_rid) && (gid <= max_builtin_rid))
+- return mysnprintf(buffer, buflen, "(&%s(%s=%s\\%02x\\%02x\\%02x\\%02x))",
+- group_filter, attmap_group_gidNumber, builtinSid,
++ return mysnprintf(buffer, buflen, "(&(%s=%s\\%02x\\%02x\\%02x\\%02x)%s)",
++ attmap_group_gidNumber, builtinSid,
+ (int)(gid & 0xff), (int)((gid >> 8) & 0xff),
+- (int)((gid >> 16) & 0xff), (int)((gid >> 24) & 0xff));
- return mysnprintf(buffer, buflen, "(&%s(%s=%s\\%02x\\%02x\\%02x\\%02x))",
- group_filter, attmap_group_gidNumber, gidSid,
++ (int)((gid >> 16) & 0xff), (int)((gid >> 24) & 0xff),
++ group_filter);
+ return mysnprintf(buffer, buflen, "(&(%s=%s\\%02x\\%02x\\%02x\\%02x)%s)",
+ attmap_group_gidNumber, gidSid,
(int)(gid & 0xff), (int)((gid >> 8) & 0xff),
@@ -73,38 +69,39 @@ diff -ur nss-pam-ldapd-0.9.2/nslcd/group.c nss-pam-ldapd-0.9.2-opt/nslcd/group.c
}
}
-@@ -124,16 +125,16 @@
- return -1;
+@@ -146,8 +148,8 @@ static int mkfilter_group_bymember(MYLDA
/* try to translate uid to DN */
- if (uid2dn(session, uid, dn, sizeof(dn)) == NULL)
+ if ((strcasecmp(attmap_group_member, "\"\"") == 0) ||
+ (uid2dn(session, uid, dn, sizeof(dn)) == NULL))
- return mysnprintf(buffer, buflen, "(&%s(%s=%s))",
- group_filter, attmap_group_memberUid, safeuid);
+ return mysnprintf(buffer, buflen, "(&(%s=%s)%s)",
+ attmap_group_memberUid, safeuid, group_filter);
/* escape DN */
if (myldap_escape(dn, safedn, sizeof(safedn)))
+ {
+@@ -155,10 +157,9 @@ static int mkfilter_group_bymember(MYLDA
return -1;
+ }
/* also lookup using user DN */
- return mysnprintf(buffer, buflen, "(&%s(|(%s=%s)(%s=%s)))",
- group_filter,
+ return mysnprintf(buffer, buflen, "(&(|(%s=%s)(%s=%s))%s)",
attmap_group_memberUid, safeuid,
- attmap_group_member, safedn);
-+ attmap_group_member, safedn,
-+ group_filter);
++ attmap_group_member, safedn, group_filter);
}
static int mkfilter_group_bymemberdn(const char *dn,
-@@ -144,9 +145,9 @@
- if (myldap_escape(dn, safedn, sizeof(safedn)))
+@@ -172,9 +173,8 @@ static int mkfilter_group_bymemberdn(con
return -1;
+ }
return mysnprintf(buffer, buflen,
- "(&%s(%s=%s))",
- group_filter,
- attmap_group_member, safedn);
+ "(&(%s=%s)%s)",
-+ attmap_group_member, safedn,
-+ group_filter);
++ attmap_group_member, safedn, group_filter);
}
void group_init(void)
@@ -259,9 +256,9 @@ diff -ur nss-pam-ldapd-0.9.2/nslcd/service.c nss-pam-ldapd-0.9.2-opt/nslcd/servi
--- nss-pam-ldapd-0.9.2/nslcd/service.c 2013-10-30 00:01:54.000000000 +0100
+++ nss-pam-ldapd-0.9.2-opt/nslcd/service.c 2013-12-11 18:50:43.116232199 +0100
@@ -77,13 +77,14 @@
- {
- if (myldap_escape(protocol, safeprotocol, sizeof(safeprotocol)))
+ log_log(LOG_ERR, "mkfilter_service_byname(): safeprotocol buffer too small");
return -1;
+ }
- return mysnprintf(buffer, buflen, "(&%s(%s=%s)(%s=%s))",
- service_filter, attmap_service_cn, safename,
- attmap_service_ipServiceProtocol, safeprotocol);
@@ -279,9 +276,9 @@ diff -ur nss-pam-ldapd-0.9.2/nslcd/service.c nss-pam-ldapd-0.9.2-opt/nslcd/servi
static int mkfilter_service_bynumber(int number, const char *protocol,
@@ -94,13 +95,14 @@
- {
- if (myldap_escape(protocol, safeprotocol, sizeof(safeprotocol)))
+ log_log(LOG_ERR, "mkfilter_service_bynumber(): safeprotocol buffer too small");
return -1;
+ }
- return mysnprintf(buffer, buflen, "(&%s(%s=%d)(%s=%s))",
- service_filter, attmap_service_ipServicePort, number,
- attmap_service_ipServiceProtocol, safeprotocol);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nss_ldapd.git/commitdiff/1c7d34a351572252beddfd99c813167823088421
More information about the pld-cvs-commit
mailing list