diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2009-06-06 22:46:33 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2009-06-06 22:46:33 +0200 |
commit | 285930cbcc3e2074ed7fe78a47aec55e49749953 (patch) | |
tree | 923db25377f59fcd0369eb1251fbd391140898a2 /nslcd/netgroup.c | |
parent | 6a0fbfe59622f76a2546e089d896a4c5ff3eea9b (diff) |
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
Diffstat (limited to 'nslcd/netgroup.c')
-rw-r--r-- | nslcd/netgroup.c | 11 |
1 files changed, 9 insertions, 2 deletions
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) ) |