summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2011-06-05 08:54:12 +0000
committerArthur de Jong <arthur@arthurdejong.org>2011-06-05 08:54:12 +0000
commitba84a2d8de5f48aecc036acd145fa7cc92589643 (patch)
tree00e26ce838cb498cb322f7ccf1459f801f437101
parent443ee6e54e4aabc15420b488712ba0b8c9da77c4 (diff)
simplify and correct find_rdn_value() to handle splitting attribute and value correctly
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1468 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd/myldap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index f2f6770..233c595 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -1446,16 +1446,15 @@ static const char *find_rdn_value(char **exploded_rdn,const char *attr)
/* check that RDN starts with attr */
if (strncasecmp(exploded_rdn[i],attr,l)!=0)
continue;
+ j=l;
/* skip spaces */
- for (j=l;isspace(exploded_rdn[i][j]);j++)
- /* nothing here */;
+ while (isspace(exploded_rdn[i][j]) j++;
/* ensure that we found an equals sign now */
if (exploded_rdn[i][j]!='=')
continue;
j++;
/* skip more spaces */
- for (j++;isspace(exploded_rdn[i][j]);j++)
- /* nothing here */;
+ while (isspace(exploded_rdn[i][j]) j++;
/* ensure that we're not at the end of the string */
if (exploded_rdn[i][j]=='\0')
continue;