From: Kurt Zeilenga Date: Mon, 17 Jul 2000 21:54:20 +0000 (+0000) Subject: Clean up usage() X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2427 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0f5c87a41ca6c793df06adef223186bf605e0f6f;p=openldap Clean up usage() --- diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 1f7ec530ec..9894aa428e 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -55,32 +55,31 @@ usage( const char *s ) " dn: list of DNs to delete. If not given, it will be readed from stdin\n" " or from the file specified with \"-f file\".\n" "Delete Options:\n" -" -r\t\tdelete recursively\n" +" -r delete recursively\n" + "Common options:\n" -" -c\t\tcontinuous operation mode (do not stop on errors)\n" -" -C\t\tchase referrals\n" -" -d level\tset LDAP debugging level to `level'\n" -" -D binddn\tbind DN\n" -" -f file\t\tread operations from `file'\n" -" -h host\t\tLDAP server\n" -" -I\t\tuse SASL Interactive mode\n" -" -k\t\tuse Kerberos authentication\n" -" -K\t\tlike -k, but do only step 1 of the Kerberos bind\n" -" -M\t\tenable Manage DSA IT control (-MM to make it critical)\n" -" -n\t\tshow what would be done but don't actually delete\n" -" -O secprops\tSASL security properties\n" -" -p port\t\tport on LDAP server\n" -" -P version\tprocotol version (default: 3)\n" -" -Q\t\tuse SASL Quiet mode\n" -" -R realm\tSASL realm\n" -" -U user\t\tSASL authentication identity (username)\n" -" -v\t\trun in verbose mode (diagnostics to standard output)\n" -" -w passwd\tbind passwd (for simple authentication)\n" -" -W\t\tprompt for bind passwd\n" -" -x\t\tSimple authentication\n" -" -X id\t\tSASL authorization identity (\"dn:\" or \"u:\")\n" -" -Y mech\t\tSASL mechanism\n" -" -Z\t\tissue Start TLS request (-ZZ to require successful response)\n" +" -d level set LDAP debugging level to `level'\n" +" -D binddn bind DN\n" +" -f file read operations from `file'\n" +" -h host LDAP server\n" +" -I use SASL Interactive mode\n" +" -k use Kerberos authentication\n" +" -K like -k, but do only step 1 of the Kerberos bind\n" +" -M enable Manage DSA IT control (-MM to make critical)\n" +" -n show what would be done but don't actually search\n" +" -O props SASL security properties\n" +" -p port port on LDAP server\n" +" -P version procotol version (default: 3)\n" +" -Q use SASL Quiet mode\n" +" -R realm SASL realm\n" +" -U user SASL authentication identity (username)\n" +" -v run in verbose mode (diagnostics to standard output)\n" +" -w passwd bind passwd (for simple authentication)\n" +" -W prompt for bind passwd\n" +" -x Simple authentication\n" +" -X id SASL authorization identity (\"dn:\" or \"u:\")\n" +" -Y mech SASL mechanism\n" +" -Z Start TLS request (-ZZ to require successful response)\n" , s ); exit( EXIT_FAILURE ); @@ -290,7 +289,7 @@ main( int argc, char **argv ) sasl_flags = LDAP_SASL_QUIET; break; #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -315,7 +314,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_realm = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -341,7 +340,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_authc_id = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -382,7 +381,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_mech = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -423,7 +422,7 @@ main( int argc, char **argv ) case 'Z': #ifdef HAVE_TLS if( version == LDAP_VERSION2 ) { - fprintf( stderr, "%s -Z incompatible with version %d\n", + fprintf( stderr, "%s: -Z incompatible with version %d\n", prog, version ); return EXIT_FAILURE; } @@ -546,7 +545,7 @@ main( int argc, char **argv ) return( EXIT_FAILURE ); } #else - fprintf( stderr, "%s was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", argv[0] ); return( EXIT_FAILURE ); #endif @@ -627,8 +626,8 @@ static int dodelete( rc = ldap_delete_ext( ld, dn, NULL, NULL, &id ); if ( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapdelete: ldap_delete_ext: %s (%d)\n", - ldap_err2string( rc ), rc ); + fprintf( stderr, "%s: ldap_delete_ext: %s (%d)\n", + prog, ldap_err2string( rc ), rc ); return rc; } @@ -641,8 +640,8 @@ static int dodelete( rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 ); if( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapdelete: ldap_parse_result: %s (%d)\n", - ldap_err2string( rc ), rc ); + fprintf( stderr, "%s: ldap_parse_result: %s (%d)\n", + prog, ldap_err2string( rc ), rc ); return rc; } diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index a57c5852e5..910e0466eb 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -100,32 +100,33 @@ usage( const char *prog ) " The list of desired operations are read from stdin or from the file\n" " specified by \"-f file\".\n" "Add or modify options:\n" -" -a\t\tadd values (default%s)\n" -" -r\t\treplace values\n" -" -F\t\tforce all changes records to be used\n" - -"common options:\n" -" -c\t\tcontinuous operation (ignore errors)\n" -" -C\t\tchase referrals\n" -" -d level\tset LDAP debugging level to `level'\n" -" -D dn\t\tbind DN\n" -" -f file\t\tread operations from `file'\n" -" -h host\t\tLDAP server\n" -" -I\t\tuse SASL Interactive mode\n" -" -k\t\tuse Kerberos authentication\n" -" -K\t\tlike -k, but do only step 1 of the Kerberos bind\n" -" -M\t\tenable Manage DSA IT control (-MM to make it critical)\n" -" -n\t\tprint changes, don't actually do them\n" -" -O secprops\tSASL security properties\n" -" -p port\t\tport on LDAP server\n" -" -Q\t\tuse SASL Quiet mode\n" -" -R realm\tSASL realm\n" -" -U user\t\tSASL authentication identity (username)\n" -" -v\t\tverbose mode\n" -" -w passwd\tbind password (for Simple authentication)\n" -" -X id\t\tSASL authorization identity (\"dn:\" or \"u:\")\n" -" -Y mech\t\tSASL mechanism\n" -" -Z\t\tissue Start TLS request (-ZZ to require successful response)\n" +" -a add values (default%s)\n" +" -r replace values\n" +" -F force all changes records to be used\n" + +"Common options:\n" +" -d level set LDAP debugging level to `level'\n" +" -D binddn bind DN\n" +" -f file read operations from `file'\n" +" -h host LDAP server\n" +" -I use SASL Interactive mode\n" +" -k use Kerberos authentication\n" +" -K like -k, but do only step 1 of the Kerberos bind\n" +" -M enable Manage DSA IT control (-MM to make critical)\n" +" -n show what would be done but don't actually search\n" +" -O props SASL security properties\n" +" -p port port on LDAP server\n" +" -P version procotol version (default: 3)\n" +" -Q use SASL Quiet mode\n" +" -R realm SASL realm\n" +" -U user SASL authentication identity (username)\n" +" -v run in verbose mode (diagnostics to standard output)\n" +" -w passwd bind passwd (for simple authentication)\n" +" -W prompt for bind passwd\n" +" -x Simple authentication\n" +" -X id SASL authorization identity (\"dn:\" or \"u:\")\n" +" -Y mech SASL mechanism\n" +" -Z Start TLS request (-ZZ to require successful response)\n" , prog, (strcmp( prog, "ldapadd" ) ? " is to replace" : "") ); exit( EXIT_FAILURE ); @@ -348,7 +349,7 @@ main( int argc, char **argv ) sasl_flags = LDAP_SASL_QUIET; break; #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -373,7 +374,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_realm = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -399,7 +400,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_authc_id = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -440,7 +441,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_mech = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -481,7 +482,7 @@ main( int argc, char **argv ) case 'Z': #ifdef HAVE_TLS if( version == LDAP_VERSION2 ) { - fprintf( stderr, "%s -Z incompatible with version %d\n", + fprintf( stderr, "%s: -Z incompatible with version %d\n", prog, version ); return EXIT_FAILURE; } @@ -610,7 +611,7 @@ main( int argc, char **argv ) return( EXIT_FAILURE ); } #else - fprintf( stderr, "%s was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", argv[0] ); return( EXIT_FAILURE ); #endif diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index d30815bafc..b934909120 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -32,6 +32,7 @@ #include "lutil_ldap.h" #include "ldap_defaults.h" +static char *prog = NULL; static char *binddn = NULL; static struct berval passwd = { 0, NULL }; static char *ldaphost = NULL; @@ -65,33 +66,34 @@ usage( const char *s ) " If not given, the list of modifications is read from stdin or\n" " from the file specified by \"-f file\" (see man page).\n" "Rename options:\n" -" -c\t\tcontinuous operation mode (do not stop on errors)\n" -" -f file\t\tread operations from `file'\n" -" -r\t\tremove old RDN\n" -" -s newsuperior\tnew superior entry\n" - -"common options:\n" -" -C\t\tchase referrals\n" -" -d level\tset LDAP debugging level to `level'\n" -" -D binddn\tbind DN\n" -" -h host\t\tLDAP server\n" -" -I\t\tuse SASL Interactive mode\n" -" -k\t\tuse Kerberos authentication\n" -" -K\t\tlike -k, but do only step 1 of the Kerberos bind\n" -" -M\t\tenable Manage DSA IT control (-MM to make it critical)\n" -" -n\t\tshow what would be done but don't actually do it\n" -" -O secprops\tSASL security properties\n" -" -p port\t\tport on LDAP server\n" -" -P version\tprocotol version (default: 3)\n" -" -Q\t\tuse SASL Quiet mode\n" -" -R realm\tSASL realm\n" -" -U user\t\tSASL authentication identity (username)\n" -" -v\t\trun in verbose mode (diagnostics to standard output)\n" -" -w passwd\tbind passwd (for simple authentication)\n" -" -W\t\tprompt for bind passwd\n" -" -X id\t\tSASL authorization identity (\"dn:\" or \"u:\")\n" -" -Y mech\t\tSASL mechanism\n" -" -Z\t\tissue Start TLS request (-ZZ to require successful response)\n" +" -c continuous operation mode (do not stop on errors)\n" +" -f file read operations from `file'\n" +" -r remove old RDN\n" +" -s newsup new superior entry\n" + +"Common options:\n" +" -d level set LDAP debugging level to `level'\n" +" -D binddn bind DN\n" +" -f file read operations from `file'\n" +" -h host LDAP server\n" +" -I use SASL Interactive mode\n" +" -k use Kerberos authentication\n" +" -K like -k, but do only step 1 of the Kerberos bind\n" +" -M enable Manage DSA IT control (-MM to make critical)\n" +" -n show what would be done but don't actually search\n" +" -O props SASL security properties\n" +" -p port port on LDAP server\n" +" -P version procotol version (default: 3)\n" +" -Q use SASL Quiet mode\n" +" -R realm SASL realm\n" +" -U user SASL authentication identity (username)\n" +" -v run in verbose mode (diagnostics to standard output)\n" +" -w passwd bind passwd (for simple authentication)\n" +" -W prompt for bind passwd\n" +" -x Simple authentication\n" +" -X id SASL authorization identity (\"dn:\" or \"u:\")\n" +" -Y mech SASL mechanism\n" +" -Z Start TLS request (-ZZ to require successful response)\n" , s ); exit( EXIT_FAILURE ); @@ -100,7 +102,7 @@ usage( const char *s ) int main(int argc, char **argv) { - char *prog,*infile, *entrydn = NULL, *rdn = NULL, buf[ 4096 ]; + char *infile, *entrydn = NULL, *rdn = NULL, buf[ 4096 ]; FILE *fp; int rc, i, remove, havedn, authmethod, version, want_bindpw, debug, manageDSAit; int referrals; @@ -309,7 +311,7 @@ main(int argc, char **argv) sasl_flags = LDAP_SASL_QUIET; break; #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -334,7 +336,7 @@ main(int argc, char **argv) version = LDAP_VERSION3; sasl_realm = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -360,7 +362,7 @@ main(int argc, char **argv) version = LDAP_VERSION3; sasl_authc_id = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -401,7 +403,7 @@ main(int argc, char **argv) version = LDAP_VERSION3; sasl_mech = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -442,7 +444,7 @@ main(int argc, char **argv) case 'Z': #ifdef HAVE_TLS if( version == LDAP_VERSION2 ) { - fprintf( stderr, "%s -Z incompatible with version %d\n", + fprintf( stderr, "%s: -Z incompatible with version %d\n", prog, version ); return EXIT_FAILURE; } @@ -580,7 +582,7 @@ main(int argc, char **argv) return( EXIT_FAILURE ); } #else - fprintf( stderr, "%s was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", argv[0] ); return( EXIT_FAILURE ); #endif @@ -672,8 +674,8 @@ static int domodrdn( NULL, NULL, &id ); if ( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapmodrdn: ldap_rename: %s (%d)\n", - ldap_err2string( rc ), rc ); + fprintf( stderr, "%s: ldap_rename: %s (%d)\n", + prog, ldap_err2string( rc ), rc ); return rc; } @@ -686,8 +688,8 @@ static int domodrdn( rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 ); if( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapmodrdn: ldap_parse_result: %s (%d)\n", - ldap_err2string( rc ), rc ); + fprintf( stderr, "%s: ldap_parse_result: %s (%d)\n", + prog, ldap_err2string( rc ), rc ); return rc; } diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index f3dc98047c..32c8650cd3 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -30,32 +30,32 @@ usage(const char *s) fprintf(stderr, "Change password of an LDAP user\n\n" "usage: %s [options] user\n" -" user: the identity of the user, normally a DN\n" +" user: the identity of the user, normally a DN\n" "Password change options:\n" -" -a secret\told password\n" -" -A\t\tprompt for old password\n" -" -s secret\tnew password\n" -" -S\t\tprompt for new password\n" +" -a secret old password\n" +" -A prompt for old password\n" +" -s secret new password\n" +" -S prompt for new password\n" "Common options:\n" -" -d level\tdebugging level\n" -" -C\t\tchase referrals\n" -" -D binddn\tbind DN\n" -" -h host\t\tLDAP server (default: localhost)\n" -" -I\t\tuse SASL Interactive mode\n" -" -n\t\tmake no modifications\n" -" -O secprops\tSASL security properties\n" -" -p port\t\tport on LDAP server\n" -" -Q\t\tuse SASL Quiet mode\n" -" -R realm\tSASL realm\n" -" -U user\t\tSASL authentication identity (username)\n" -" -v\t\tverbose mode\n" -" -w passwd\tbind password (for simple authentication)\n" -" -W\t\tprompt for bind password\n" -" -x\t\tSimple authentication\n" -" -X id\t\tSASL authorization identity (\"dn:\" or \"u:\")\n" -" -Y mech\t\tSASL mechanism\n" -" -Z\t\tissue Start TLS request (-ZZ to require successful response)\n" +" -d level set LDAP debugging level to `level'\n" +" -D binddn bind DN\n" +" -f file read operations from `file'\n" +" -h host LDAP server\n" +" -I use SASL Interactive mode\n" +" -n show what would be done but don't actually search\n" +" -O props SASL security properties\n" +" -p port port on LDAP server\n" +" -Q use SASL Quiet mode\n" +" -R realm SASL realm\n" +" -U user SASL authentication identity (username)\n" +" -v run in verbose mode (diagnostics to standard output)\n" +" -w passwd bind passwd (for simple authentication)\n" +" -W prompt for bind passwd\n" +" -x Simple authentication\n" +" -X id SASL authorization identity (\"dn:\" or \"u:\")\n" +" -Y mech SASL mechanism\n" +" -Z Start TLS request (-ZZ to require successful response)\n" , s ); exit( EXIT_FAILURE ); @@ -315,7 +315,7 @@ main( int argc, char *argv[] ) sasl_flags = LDAP_SASL_QUIET; break; #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -340,7 +340,7 @@ main( int argc, char *argv[] ) version = LDAP_VERSION3; sasl_realm = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -366,7 +366,7 @@ main( int argc, char *argv[] ) version = LDAP_VERSION3; sasl_authc_id = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -407,7 +407,7 @@ main( int argc, char *argv[] ) version = LDAP_VERSION3; sasl_mech = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -448,7 +448,7 @@ main( int argc, char *argv[] ) case 'Z': #ifdef HAVE_TLS if( version == LDAP_VERSION2 ) { - fprintf( stderr, "%s -Z incompatible with version %d\n", + fprintf( stderr, "%s: -Z incompatible with version %d\n", prog, version ); return EXIT_FAILURE; } @@ -605,7 +605,7 @@ main( int argc, char *argv[] ) return( EXIT_FAILURE ); } #else - fprintf( stderr, "%s was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", argv[0] ); return( EXIT_FAILURE ); #endif diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index fb894fd258..2365cdd8df 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -39,55 +39,55 @@ usage( const char *s ) { fprintf( stderr, "usage: %s [options] [filter [attributes...]]\nwhere:\n" -"\tfilter\tRFC-2254 compliant LDAP search filter\n" -"\tattributes\twhitespace-separated list of attribute descriptions\n" -"\t which may include:\n" -"\t\t1.1 -- no attributes\n" -"\t\t* -- all user attributes\n" -"\t\t+ -- all operational attributes\n" +" filter\tRFC-2254 compliant LDAP search filter\n" +" attributes\twhitespace-separated list of attribute descriptions\n" +" which may include:\n" +" 1.1 no attributes\n" +" * all user attributes\n" +" + all operational attributes\n" "Search options:\n" -"\t-a deref\tone of never (default), always, search, or find\n" -"\t-A\t\tretrieve attribute names only (no values)\n" -"\t-b basedn\tbase dn for search\n" -"\t-l limit\ttime limit (in seconds) for search\n" -"\t-L\t\tprint responses in LDIFv1 format\n" -"\t-LL\t\tprint responses in LDIF format without comments\n" -"\t-LLL\t\tprint responses in LDIF format without comments\n" -"\t\t\tand version\n" -"\t-s scope\tone of base, one, or sub (search scope)\n" -"\t-S attr\t\tsort the results by attribute `attr'\n" -"\t-t\t\twrite binary values to files in temporary directory\n" -"\t-tt\t\twrite all values to files in temporary directory\n" -"\t-T path\t\twrite files to directory specified by path (default:\n" -"\t\t\t\"" LDAP_TMPDIR "\")\n" -"\t-u\t\tinclude User Friendly entry names in the output\n" +" -a deref one of never (default), always, search, or find\n" +" -A retrieve attribute names only (no values)\n" +" -b basedn base dn for search\n" +" -l limit time limit (in seconds) for search\n" +" -L print responses in LDIFv1 format\n" +" -LL print responses in LDIF format without comments\n" +" -LLL print responses in LDIF format without comments\n" +" and version\n" +" -s scope one of base, one, or sub (search scope)\n" +" -S attr sort the results by attribute `attr'\n" +" -t write binary values to files in temporary directory\n" +" -tt write all values to files in temporary directory\n" +" -T path write files to directory specified by path (default:\n" +" " LDAP_TMPDIR ")\n" +" -u include User Friendly entry names in the output\n" +" -V prefix URL prefix for files (default: \"" LDAP_FILE_URI_PREFIX ")\n" +" -z limit size limit (in entries) for search\n" "Common options:\n" -"\t-d level\tset LDAP debugging level to `level'\n" -"\t-D binddn\tbind DN\n" -"\t-f file\t\tread operations from `file'\n" -"\t-h host\t\tLDAP server\n" -"\t-I\t\tuse SASL Interactive mode\n" -"\t-k\t\tuse Kerberos authentication\n" -"\t-K\t\tlike -k, but do only step 1 of the Kerberos bind\n" -"\t-M\t\tenable Manage DSA IT control (-MM to make critical)\n" -"\t-n\t\tshow what would be done but don't actually search\n" -"\t-O secprops\tSASL security properties\n" -"\t-p port\t\tport on LDAP server\n" -"\t-P version\tprocotol version (default: 3)\n" -"\t-Q\t\tuse SASL Quiet mode\n" -"\t-R realm\tSASL realm\n" -"\t-U user\t\tSASL authentication identity (username)\n" -"\t-v\t\trun in verbose mode (diagnostics to standard output)\n" -"\t-V prefix\tURL prefix for files (default: \"" LDAP_FILE_URI_PREFIX ")\n" -"\t-w passwd\tbind passwd (for simple authentication)\n" -"\t-W\t\tprompt for bind passwd\n" -"\t-x\t\tSimple authentication\n" -"\t-X id\t\tSASL authorization identity (\"dn:\" or \"u:\")\n" -"\t-Y mech\t\tSASL mechanism\n" -"\t-z limit\tsize limit (in entries) for search\n" -"\t-Z\t\tissue Start TLS request (-ZZ to require successful response)\n" +" -d level set LDAP debugging level to `level'\n" +" -D binddn bind DN\n" +" -f file read operations from `file'\n" +" -h host LDAP server\n" +" -I use SASL Interactive mode\n" +" -k use Kerberos authentication\n" +" -K like -k, but do only step 1 of the Kerberos bind\n" +" -M enable Manage DSA IT control (-MM to make critical)\n" +" -n show what would be done but don't actually search\n" +" -O props SASL security properties\n" +" -p port port on LDAP server\n" +" -P version procotol version (default: 3)\n" +" -Q use SASL Quiet mode\n" +" -R realm SASL realm\n" +" -U user SASL authentication identity (username)\n" +" -v run in verbose mode (diagnostics to standard output)\n" +" -w passwd bind passwd (for simple authentication)\n" +" -W prompt for bind passwd\n" +" -x Simple authentication\n" +" -X id SASL authorization identity (\"dn:\" or \"u:\")\n" +" -Y mech SASL mechanism\n" +" -Z Start TLS request (-ZZ to require successful response)\n" , s ); exit( EXIT_FAILURE ); @@ -140,6 +140,7 @@ static int dosearch LDAP_P(( static char *tmpdir = NULL; static char *urlpre = NULL; +static char *prog = NULL; static char *binddn = NULL; static struct berval passwd = { 0, NULL }; static char *base = NULL; @@ -160,7 +161,7 @@ static int verbose, not, includeufn, vals2tmp, ldif; int main( int argc, char **argv ) { - char *prog, *infile, *filtpattern, **attrs, line[BUFSIZ]; + char *infile, *filtpattern, **attrs, line[BUFSIZ]; FILE *fp = NULL; int rc, i, first, scope, deref, attrsonly, manageDSAit; int referrals, timelimit, sizelimit, debug; @@ -418,7 +419,7 @@ main( int argc, char **argv ) sasl_flags = LDAP_SASL_QUIET; break; #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -443,7 +444,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_realm = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -469,7 +470,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_authc_id = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -510,7 +511,7 @@ main( int argc, char **argv ) version = LDAP_VERSION3; sasl_mech = strdup( optarg ); #else - fprintf( stderr, "%s: was not compiled with SASL support\n", + fprintf( stderr, "%s: not compiled with SASL support\n", prog ); return( EXIT_FAILURE ); #endif @@ -551,7 +552,7 @@ main( int argc, char **argv ) case 'Z': #ifdef HAVE_TLS if( version == LDAP_VERSION2 ) { - fprintf( stderr, "%s -Z incompatible with version %d\n", + fprintf( stderr, "%s: -Z incompatible with version %d\n", prog, version ); return EXIT_FAILURE; } @@ -737,8 +738,8 @@ main( int argc, char **argv ) return( EXIT_FAILURE ); } #else - fprintf( stderr, "%s was not compiled with SASL support\n", - argv[0] ); + fprintf( stderr, "%s: not compiled with SASL support\n", + prog, argv[0] ); return( EXIT_FAILURE ); #endif } else { @@ -885,8 +886,8 @@ static int dosearch( sctrls, cctrls, timelimit, sizelimit, &msgid ); if( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapsearch: ldap_search_ext: %s (%d)\n", - ldap_err2string( rc ), rc ); + fprintf( stderr, "%s: ldap_search_ext: %s (%d)\n", + prog, ldap_err2string( rc ), rc ); return( rc ); } diff --git a/doc/man/man1/ldappasswd.1 b/doc/man/man1/ldappasswd.1 index e5c3aba0a5..933747214a 100644 --- a/doc/man/man1/ldappasswd.1 +++ b/doc/man/man1/ldappasswd.1 @@ -51,15 +51,17 @@ ldappasswd \- change the password of an LDAP entry .SH DESCRIPTION .B ldappasswd is a tool to set the password of an LDAP user. -It is neither designed nor intended to be a replacement for -.BR passwd (1) -and should not be installed as such. .LP .B ldappasswd sets the password of associated with the user. If the new password is not specified on the command line or the user doesn't enable prompting, the server will be asked to generate a password for the user. +.LP +.B ldappasswd +is neither designed nor intended to be a replacement for +.BR passwd (1) +and should not be installed as such. .SH OPTIONS .TP .BI \-A @@ -132,11 +134,9 @@ actual SASL mechanism used. Specify the requested authorization ID for SASL bind. .I authzid must be one of the following formats: -.B dn:\c -.I +.BI dn: or -.B u:\c -.I +.BI u: \fP. .TP .BI \-Y \ mech Specify the SASL mechanism to be used for authentication. If it's not @@ -144,8 +144,8 @@ specified, the program will choose the best mechanism the server knows. .TP .B \-Z[Z] Issue StartTLS (Transport Layer Security) extended operation. If you use -.B \-ZZ\c -, the command will require the operation to be successful. +.BR \-ZZ , +the command will require the operation to be successful .SH SEE ALSO .BR ldap_bind (3) .SH AUTHOR