summaryrefslogtreecommitdiff
path: root/nslcd/common.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-12-31 16:43:21 +0000
committerArthur de Jong <arthur@arthurdejong.org>2007-12-31 16:43:21 +0000
commit671f49527656bf840c401e6c95dfeba00765584f (patch)
treecb07e51734e3300d9db4bb8caa36730bfb557a24 /nslcd/common.c
parent3a32926decd24ad4c803304979d30b5a5ecc5592 (diff)
fix bug that would return a password of one character short
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@543 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/common.c')
-rw-r--r--nslcd/common.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/nslcd/common.c b/nslcd/common.c
index 14600d7..a181dca 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -49,11 +49,6 @@ int mysnprintf(char *buffer,size_t buflen,const char *format, ...)
return ((res<0)||(((size_t)res)>=buflen));
}
-/* This tries to get the user password attribute from the entry.
- It will try to return an encrypted password as it is used in /etc/passwd,
- /etc/group or /etc/shadow depending upon what is in the directory.
- This function will return NULL if no passwd and will return the literal
- value in the directory if conversion is not possible. */
const char *get_userpassword(MYLDAP_ENTRY *entry,const char *attr)
{
const char **values;
@@ -69,7 +64,7 @@ const char *get_userpassword(MYLDAP_ENTRY *entry,const char *attr)
if (strncasecmp(values[i],"{crypt}",7)==0)
return values[i]+7;
if (strncasecmp(values[i],"crypt$",6)==0)
- return values[i]+7;
+ return values[i]+6;
}
/* just return the first value completely */
return values[0];