Make it all work.

This commit is contained in:
Kurt Zeilenga 2000-07-16 00:14:08 +00:00
parent 4d45c61600
commit 1e562b0d1f
7 changed files with 34 additions and 14 deletions

View File

@ -333,6 +333,8 @@ main( int argc, char **argv )
#endif
break;
default:
fprintf( stderr, "%s: unrecongized option -%c\n",
prog, optopt );
usage( prog );
return( EXIT_FAILURE );
}

View File

@ -391,6 +391,8 @@ main( int argc, char **argv )
#endif
break;
default:
fprintf( stderr, "%s: unrecongized option -%c\n",
prog, optopt );
usage( prog );
}
}

View File

@ -63,15 +63,15 @@ 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\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"
" -k\t\tuse Kerberos authentication\n"
" -K\t\tlike -k, but do only step 1 of the Kerberos bind\n"
@ -109,9 +109,12 @@ main(int argc, char **argv)
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : ++prog;
while (( i = getopt( argc, argv, "rs:" "cCd:D:f:h:kKMnO:p:P:U:vw:WxX:Y:Z" )) != EOF ) {
while (( i = getopt( argc, argv, "cf:rs:" "Cd:D:h:kKMnO:p:P:U:vw:WxX:Y:Z" )) != EOF ) {
switch( i ) {
/* Modrdn Options */
case 'c':
contoper++;
break;
case 's': /* newSuperior */
if( version == LDAP_VERSION2 ) {
fprintf( stderr, "%s: -X incompatible with LDAPv%d\n",
@ -346,6 +349,8 @@ main(int argc, char **argv)
#endif
break;
default:
fprintf( stderr, "%s: unrecongized option -%c\n",
prog, optopt );
usage( argv[0] );
return( EXIT_FAILURE );
}
@ -374,7 +379,8 @@ main(int argc, char **argv)
}
++havedn;
} else if ( argc - optind != 0 ) {
fprintf( stderr, "%s: invalid number of arguments, only two allowed\n", prog);
fprintf( stderr, "%s: invalid number of arguments (%d), "
"only two allowed\n", prog, argc-optind );
usage( argv[0] );
return( EXIT_FAILURE );
}

View File

@ -61,6 +61,7 @@ int
main( int argc, char *argv[] )
{
int rc;
char *prog = NULL;
char *ldaphost = NULL;
char *dn = NULL;
@ -97,6 +98,8 @@ main( int argc, char *argv[] )
char *retoid = NULL;
struct berval *retdata = NULL;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : ++prog;
if (argc == 1)
usage (argv[0]);
@ -235,6 +238,8 @@ main( int argc, char *argv[] )
break;
default:
fprintf( stderr, "%s: unrecongized option -%c\n",
prog, optopt );
usage (argv[0]);
}
}

View File

@ -171,6 +171,8 @@ main( int argc, char **argv )
scope = LDAP_SCOPE_SUBTREE;
authmethod = -1;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : ++prog;
while (( i = getopt( argc, argv,
"Aa:b:f:Ll:S:s:T:tuV:z:" "Cd:D:h:kKMnO:p:P:U:vw:WxX:Y:Z")) != EOF )
{
@ -193,6 +195,9 @@ main( int argc, char **argv )
case 'A': /* retrieve attribute names only -- no values */
++attrsonly;
break;
case 'b': /* search base */
base = strdup( optarg );
break;
case 'f': /* input file */
infile = strdup( optarg );
break;
@ -456,6 +461,8 @@ main( int argc, char **argv )
#endif
break;
default:
fprintf( stderr, "%s: unrecongized option -%c\n",
prog, optopt );
usage( argv[0] );
}
}

View File

@ -21,9 +21,8 @@ else
REFSLAVECONF=$DATADIR/slapd-ref-slave.conf
fi
if test "$LDAP_PROTO" ; then
PROTO="-P $LDAP_PROTO"
fi
TOOLARGS="-x $LDAP_TOOLARGS"
TOOLPROTO="-P 3"
PASSWDCONF=$DATADIR/slapd-passwd.conf
@ -36,11 +35,11 @@ LDIF2LDBM="../servers/slapd/tools/slapadd $LDAP_VERBOSE"
CMP="diff -i -q"
SLAPD=../servers/slapd/slapd
SLURPD=../servers/slurpd/slurpd
LDAPPASSWD="$CLIENTDIR/ldappasswd"
LDAPSEARCH="$CLIENTDIR/ldapsearch $PROTO -LLL"
LDAPMODIFY="$CLIENTDIR/ldapmodify $PROTO"
LDAPADD="$CLIENTDIR/ldapadd $PROTO"
LDAPMODRDN="$CLIENTDIR/ldapmodrdn $PROTO"
LDAPPASSWD="$CLIENTDIR/ldappasswd $TOOLARGS"
LDAPSEARCH="$CLIENTDIR/ldapsearch $TOOLPROTO $TOOLARGS -LLL"
LDAPMODIFY="$CLIENTDIR/ldapmodify $TOOLPROTO $TOOLARGS"
LDAPADD="$CLIENTDIR/ldapadd $TOOLPROTO $TOOLARGS"
LDAPMODRDN="$CLIENTDIR/ldapmodrdn $TOOLPROTO $TOOLARGS"
SLAPDTESTER=$PROGDIR/slapd-tester
LVL=${SLAPD_DEBUG-5}
ADDR=127.0.0.1

View File

@ -34,8 +34,7 @@ PID=$!
echo "Using ldapsearch to retrieve all the entries..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
'objectClass=*' > $SEARCHOUT 2>&1
$LDAPSEARCH -S "" -b "$BASEDN" -h localhost:$PORT > $SEARCHOUT 2>&1
RC=$?
if test $RC = 1 ; then
echo "Waiting 5 seconds for slapd to start..."