]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-passwd/search.c
Happy New Year
[openldap] / servers / slapd / back-passwd / search.c
index 60ffd1b5b823ba3aa4ff4b910da29dd14b1422c1..cf95ea1d4475b9a73118979cb7ca7fd70c59e1da 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * 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 );