From 285930cbcc3e2074ed7fe78a47aec55e49749953 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 6 Jun 2009 20:46:33 +0000 Subject: implement case-sensitive filtering for group, netgroup, passwd, protocols, rpc, services and shadow lookups git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@934 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/netgroup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nslcd/netgroup.c') diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c index 6c38216..58078f8 100644 --- a/nslcd/netgroup.c +++ b/nslcd/netgroup.c @@ -200,12 +200,19 @@ static int write_netgroup_triple(TFILE *fp,const char *triple) if (write_netgroup_triple(fp,triple)) \ return -1; -static int write_netgroup(TFILE *fp,MYLDAP_ENTRY *entry) +static int write_netgroup(TFILE *fp,MYLDAP_ENTRY *entry, const char *reqname) { int32_t tmpint32; int i; + const char **names; const char **triples; const char **members; + /* get the netgroup name */ + names=myldap_get_values(entry,attmap_netgroup_cn); + for (i=0;(names[i]!=NULL)&&(strcmp(reqname,names[i])!=0);i++) + /* nothing here */ ; + if (names[i]==NULL) + return 0; /* the name was not found */ /* get the netgroup triples and member */ triples=myldap_get_values(entry,attmap_netgroup_nisNetgroupTriple); members=myldap_get_values(entry,attmap_netgroup_memberNisNetgroup); @@ -238,5 +245,5 @@ NSLCD_HANDLE( log_log(LOG_DEBUG,"nslcd_netgroup_byname(%s)",name);, NSLCD_ACTION_NETGROUP_BYNAME, mkfilter_netgroup_byname(name,filter,sizeof(filter)), - write_netgroup(fp,entry) + write_netgroup(fp,entry,name) ) -- cgit v1.2.3