diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-12-03 22:45:20 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-12-03 22:45:20 +0000 |
commit | c0f408747204aba0050d4545b7da90ea7961063d (patch) | |
tree | 3d1c703e1f82f1d08eb3f030cee48e868d7f826b /nslcd/common.c | |
parent | 62928b08bb311646c6b6ee5c244bf27bde6d32d1 (diff) |
allow backslashes in names execpt as first or last character
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@804 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/common.c')
-rw-r--r-- | nslcd/common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nslcd/common.c b/nslcd/common.c index 9855879..76a0ff8 100644 --- a/nslcd/common.c +++ b/nslcd/common.c @@ -84,7 +84,7 @@ const char *get_userpassword(MYLDAP_ENTRY *entry,const char *attr) The standard defines user names valid if they contain characters from the set [A-Za-z0-9._-] where the hyphen should not be used as first - character. As an extension this test allows the at '@' and dolar '$' signs. + character. As an extension this test allows some more characters. */ int isvalidname(const char *name) { @@ -95,10 +95,11 @@ int isvalidname(const char *name) for (i=0;name[i]!='\0';i++) { if ( ! ( ( (i!=0) && (name[i]=='-') ) || + ( (i!=0) && (name[i]=='\\') && name[i+1]!='\0' ) || (name[i]>='@' && name[i] <= 'Z') || (name[i]>='a' && name[i] <= 'z') || (name[i]>='0' && name[i] <= '9') || - name[i]=='.' || name[i]=='_' || name[i]=='$' || name[i] == ' ') ) + name[i]=='.' || name[i]=='_' || name[i]=='$' || name[i]==' ') ) return 0; } /* no test failed so it must be good */ |