diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2009-06-06 21:10:46 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2009-06-06 21:10:46 +0000 |
commit | 67bb9bb9ed2659faa50b2aac22c147b10bef85ba (patch) | |
tree | 2ff98c5bde76aaa0160de57f5686576dd214c84a /nslcd/ether.c | |
parent | 3730b228be5961b975311713aa3fe84ea92cc6ae (diff) |
merge r934 from trunk
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@935 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/ether.c')
-rw-r--r-- | nslcd/ether.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/nslcd/ether.c b/nslcd/ether.c index 1bfa200..4a1d6a0 100644 --- a/nslcd/ether.c +++ b/nslcd/ether.c @@ -124,21 +124,12 @@ static int write_ether(TFILE *fp,MYLDAP_ENTRY *entry, const char **names,**ethers; int i,j; /* get the name of the ether entry */ - if (reqname!=NULL) + names=myldap_get_values(entry,attmap_ether_cn); + if ((names==NULL)||(names[0]==NULL)) { - names=tmparr; - names[0]=reqname; - names[1]=NULL; - } - else - { - names=myldap_get_values(entry,attmap_ether_cn); - if ((names==NULL)||(names[0]==NULL)) - { - log_log(LOG_WARNING,"ether entry %s does not contain %s value", - myldap_get_dn(entry),attmap_ether_cn); - return 0; - } + log_log(LOG_WARNING,"ether entry %s does not contain %s value", + myldap_get_dn(entry),attmap_ether_cn); + return 0; } /* get the addresses */ if (reqether!=NULL) @@ -160,12 +151,13 @@ static int write_ether(TFILE *fp,MYLDAP_ENTRY *entry, } /* write entries for all names and addresses */ for (i=0;names[i]!=NULL;i++) - for (j=0;ethers[j]!=NULL;j++) - { - WRITE_INT32(fp,NSLCD_RESULT_BEGIN); - WRITE_STRING(fp,names[i]); - WRITE_ETHER(fp,ethers[j]); - } + if ((reqname==NULL)||(strcasecmp(reqname,names[i])==0)) + for (j=0;ethers[j]!=NULL;j++) + { + WRITE_INT32(fp,NSLCD_RESULT_BEGIN); + WRITE_STRING(fp,names[i]); + WRITE_ETHER(fp,ethers[j]); + } return 0; } |