]> git.sur5r.net Git - openldap/commitdiff
Add -W option to ldapsearch.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 6 Aug 1999 00:19:54 +0000 (00:19 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 6 Aug 1999 00:19:54 +0000 (00:19 +0000)
(note: log for rev 1.4.2.5.2.1 indicated such was added.  However,
this change appears to be Kerberos related.  in fact, it appears to
back out previous Kerberos change... should be examined by Kerberos
maintainer (if we had such).

CHANGES
clients/tools/ldapsearch.c

diff --git a/CHANGES b/CHANGES
index 44217f7e04b13bd009e55b031d6ebdb665f35671..3ed697877a68ac29dea41e681c9d311d4a0625b5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,7 +2,7 @@ OpenLDAP Change Log
 
 Changes included in OpenLDAP 1.2 Release Engineering
        CVS Tag: OPENLDAP_REL_ENG_1_2
-       <insert changes here>
+       Added ldapsearch -W password prompting
 
 Changes included in OpenLDAP 1.2.6
        CVS Tag: OPENLDAP_REL_ENG_1_2_6
index 377d72dfe498fc18b25e09637511b36076321fea..c96c58aad57051f0471d3c3207b5992338c53269 100644 (file)
@@ -47,6 +47,7 @@ char  *s;
     fprintf( stderr, "    -z size lim\tsize limit (in entries) for search\n" );
     fprintf( stderr, "    -D binddn\tbind dn\n" );
     fprintf( stderr, "    -w passwd\tbind passwd (for simple authentication)\n" );
+    fprintf( stderr, "    -W\t\tprompt for bind passwd\n" );
 #ifdef HAVE_KERBEROS
     fprintf( stderr, "    -k\t\tuse Kerberos instead of Simple Password authentication\n" );
 #endif
@@ -92,12 +93,12 @@ char        **argv;
     char               *infile, *filtpattern, **attrs, line[ BUFSIZ ];
     FILE               *fp;
     int                        rc, i, first, scope, kerberos, deref, attrsonly, debug;
-    int                        ldap_options, timelimit, sizelimit, authmethod;
+    int                        ldap_options, timelimit, sizelimit, authmethod, want_bindpw;
     LDAP               *ld;
 
     infile = NULL;
     deref = verbose = allow_binary = not = kerberos = vals2tmp =
-           attrsonly = ldif = debug = 0;
+           attrsonly = ldif = want_bindpw = debug = 0;
 
 #ifdef LDAP_REFERRALS
     ldap_options = LDAP_OPT_REFERRALS;
@@ -112,9 +113,9 @@ char        **argv;
 
     while (( i = getopt( argc, argv,
 #ifdef HAVE_KERBEROS
-           "KknuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:"
+           "KknuvtRABLD:s:f:h:b:d:p:F:a:Ww:l:z:S:"
 #else
-           "nuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:"
+           "nuvtRABLD:s:f:h:b:d:p:F:a:Ww:l:z:S:"
 #endif
            )) != EOF ) {
        switch( i ) {
@@ -211,6 +212,9 @@ char        **argv;
        case 'w':       /* bind password */
            passwd = strdup( optarg );
            break;
+       case 'W':       /* prompt for password */
+           want_bindpw++;
+           break;
        case 'l':       /* time limit */
            timelimit = atoi( optarg );
            break;
@@ -294,6 +298,11 @@ char       **argv;
     } else {
        authmethod =  LDAP_AUTH_KRBV4;
     }
+
+       if (want_bindpw) {
+               passwd = getpass("Enter LDAP Password: ");
+       }
+
     if ( ldap_bind_s( ld, binddn, passwd, authmethod ) != LDAP_SUCCESS ) {
        ldap_perror( ld, "ldap_bind" );
        exit( 1 );