#endif
break;
default:
+ fprintf( stderr, "%s: unrecongized option -%c\n",
+ prog, optopt );
usage( prog );
return( EXIT_FAILURE );
}
#endif
break;
default:
+ fprintf( stderr, "%s: unrecongized option -%c\n",
+ prog, optopt );
usage( prog );
}
}
" 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"
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",
#endif
break;
default:
+ fprintf( stderr, "%s: unrecongized option -%c\n",
+ prog, optopt );
usage( argv[0] );
return( EXIT_FAILURE );
}
}
++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 );
}
main( int argc, char *argv[] )
{
int rc;
+ char *prog = NULL;
char *ldaphost = NULL;
char *dn = NULL;
char *retoid = NULL;
struct berval *retdata = NULL;
+ prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : ++prog;
+
if (argc == 1)
usage (argv[0]);
break;
default:
+ fprintf( stderr, "%s: unrecongized option -%c\n",
+ prog, optopt );
usage (argv[0]);
}
}
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 )
{
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;
#endif
break;
default:
+ fprintf( stderr, "%s: unrecongized option -%c\n",
+ prog, optopt );
usage( argv[0] );
}
}
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
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
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..."