]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-passwd/search.c
Add missing progname argument to fprintf
[openldap] / servers / slapd / back-passwd / search.c
index 231d6648692ed6f2abc99cacc1306265f084ef30..c9668907577d2ec7907405e75bd971b4721ff6e0 100644 (file)
@@ -107,7 +107,7 @@ passwd_back_search(
        
                        if ( test_filter( be, conn, op, e, filter ) == 0 ) {
                                send_search_entry( be, conn, op,
-                                       e, attrs, attrsonly, 0, NULL );
+                                       e, attrs, attrsonly, NULL );
                                sent++;
                        }
                }
@@ -145,7 +145,7 @@ passwd_back_search(
                                        }
 
                                        send_search_entry( be, conn, op,
-                                               e, attrs, attrsonly, 0, NULL );
+                                               e, attrs, attrsonly, NULL );
                                        sent++;
                                }
 
@@ -183,9 +183,7 @@ passwd_back_search(
                        goto done;
                }
 
-               for( s = user; *s ; s++ ) {
-                       *s = TOLOWER( *s );
-               }
+               user = str2lower( user );
 
                if ( (pw = getpwnam( user )) == NULL ) {
                        matched = parent;
@@ -198,7 +196,7 @@ passwd_back_search(
 
                if ( test_filter( be, conn, op, e, filter ) == 0 ) {
                        send_search_entry( be, conn, op,
-                               e, attrs, attrsonly, 0, NULL );
+                               e, attrs, attrsonly, NULL );
                        sent++;
                }
 
@@ -240,7 +238,8 @@ pw2entry( Backend *be, struct passwd *pw, char *rdn )
        /* rdn attribute type should be a configuratable item */
        sprintf( buf, "uid=%s,%s", pw->pw_name, be->be_suffix[0] );
        e->e_dn = ch_strdup( buf );
-       e->e_ndn = dn_normalize_case( ch_strdup( buf ) );
+       e->e_ndn = ch_strdup( buf );
+       (void) dn_normalize_case( e->e_ndn );
 
        val.bv_val = pw->pw_name;
        val.bv_len = strlen( pw->pw_name );
@@ -270,8 +269,7 @@ pw2entry( Backend *be, struct passwd *pw, char *rdn )
                        strncpy(buf, val.bv_val, i);
                        s = buf+i;
                        strcpy(s, pw->pw_name);
-                       if (islower(*s))
-                               *s = toupper(*s);
+                       *s = TOUPPER(*s);
                        strcat(s, val.bv_val+i+1);
                        val.bv_val = buf;
                }