X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-passwd%2Fsearch.c;h=cf95ea1d4475b9a73118979cb7ca7fd70c59e1da;hb=59e9ff6243465640956b58ad1756a3ede53eca7c;hp=60ffd1b5b823ba3aa4ff4b910da29dd14b1422c1;hpb=bfd8b3a42aa44d317acd686e786ed4be681b2337;p=openldap diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 60ffd1b5b8..cf95ea1d44 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2014 The OpenLDAP Foundation. + * Copyright 1998-2018 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -113,7 +113,7 @@ passwd_back_search( * DN that was configured for this backend, but it's * better than nothing. * - * should be a configuratable item + * should be a configurable item */ BER_BVSTR( &val, "organizationalUnit" ); attr_merge_one( &e, ad_objectClass, &val, NULL ); @@ -291,7 +291,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) val.bv_len = STRLENOF("uid=,") + ( pwlen + be->be_suffix[0].bv_len ); val.bv_val = ch_malloc( val.bv_len + 1 ); - /* rdn attribute type should be a configuratable item */ + /* rdn attribute type should be a configurable item */ sprintf( val.bv_val, "uid=%s,%s", pw->pw_name, be->be_suffix[0].bv_val ); @@ -327,6 +327,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) */ if (pw->pw_gecos[0]) { char *s; + char buf[1024]; ber_str2bv( pw->pw_gecos, 0, 0, &val ); attr_merge_normalize_one( e, ad_desc, &val, NULL ); @@ -336,8 +337,6 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) s = ber_bvchr( &val, '&' ); if ( s ) { - char buf[1024]; - if( val.bv_len + pwlen < sizeof(buf) ) { int i = s - val.bv_val; strncpy( buf, val.bv_val, i );