- char *usage = "usage: %s [-nvkWc] [-M[M]] [-d debug-level] [-h ldaphost] [-P version] [-p ldapport] [-D binddn] [-w passwd] [ -f file | < entryfile | dn newrdn ] [-s newSuperior]\n";
- char *myname,*infile, *entrydn, *rdn, buf[ 4096 ];
- FILE *fp;
- int rc, i, remove, havedn, authmethod, version, want_bindpw, debug, manageDSAit;
- char *newSuperior=NULL;
-
- infile = NULL;
- not = contoper = verbose = remove = want_bindpw = debug = manageDSAit = 0;
- authmethod = LDAP_AUTH_SIMPLE;
- version = -1;
-
- myname = (myname = strrchr(argv[0], '/')) == NULL ? argv[0] : ++myname;
-
- while (( i = getopt( argc, argv, "WkKMcnvrh:P:p:D:w:d:f:s:" )) != EOF ) {
- switch( i ) {
- case 'k': /* kerberos bind */
-#ifdef HAVE_KERBEROS
- authmethod = LDAP_AUTH_KRBV4;
-#else
- fprintf (stderr, "%s was not compiled with Kerberos support\n", argv[0]);
- return( EXIT_FAILURE );
-#endif
- break;
- case 'K': /* kerberos bind, part one only */
-#ifdef HAVE_KERBEROS
- authmethod = LDAP_AUTH_KRBV41;
-#else
- fprintf (stderr, "%s was not compiled with Kerberos support\n", argv[0]);
- return( EXIT_FAILURE );
+ switch ( i ) {
+#if 0
+ int crit;
+ char *control, *cvalue;
+ case 'E': /* modrdn extensions */
+ if( protocol == LDAP_VERSION2 ) {
+ fprintf( stderr, _("%s: -E incompatible with LDAPv%d\n"),
+ prog, version );
+ exit( EXIT_FAILURE );
+ }
+
+ /* should be extended to support comma separated list of
+ * [!]key[=value] parameters, e.g. -E !foo,bar=567
+ */
+
+ crit = 0;
+ cvalue = NULL;
+ if( optarg[0] == '!' ) {
+ crit = 1;
+ optarg++;
+ }
+
+ control = strdup( optarg );
+ if ( (cvalue = strchr( control, '=' )) != NULL ) {
+ *cvalue++ = '\0';
+ }
+ fprintf( stderr, _("Invalid modrdn extension name: %s\n"), control );
+ usage();