common controls across all tools.
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
" -I use SASL Interactive mode\n"
{
char *compdn = NULL, *attrs = NULL;
char *sep;
- int rc, i, manageDSAit, quiet;
+ int rc, i, crit, manageDSAit, noop, quiet;
int referrals, debug;
int authmethod, version, want_bindpw;
LDAP *ld = NULL;
struct berval bvalue = { 0, NULL };
char *pw_file = NULL;
+ char *control, *cvalue;
- debug = verbose = not = referrals =
+ debug = verbose = not = referrals = noop =
manageDSAit = want_bindpw = quiet = 0;
version = -1;
prog = lutil_progname( "ldapcompare", argc, argv );
while (( i = getopt( argc, argv,
- "Cd:D:h:H:IkKMnO:p:P:qQR:U:vw:WxX:y:Y:zZ")) != EOF )
+ "Cd:D:e:h:H:IkKMnO:p:P:qQR:U:vw:WxX:y:Y:zZ")) != EOF )
{
switch( i ) {
+ case 'E': /* compare controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
+ prog, version );
+ return 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 compare control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
/* Common Options */
case 'C':
}
binddn = strdup( optarg );
break;
+
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
{
char buf[ 4096 ];
FILE *fp;
- int i, rc, authmethod, referrals, want_bindpw, version, debug, manageDSAit;
+ int i, rc, authmethod, referrals, want_bindpw, version, debug, manageDSAit, noop, crit;
char *pw_file;
+ char *control, *cvalue;
- not = verbose = contoper = want_bindpw = debug = manageDSAit = referrals = 0;
+ not = verbose = contoper = want_bindpw = debug
+ = manageDSAit = noop = referrals = 0;
fp = NULL;
authmethod = -1;
version = -1;
prog = lutil_progname( "ldapdelete", argc, argv );
while (( i = getopt( argc, argv, "cf:r"
- "Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z" )) != EOF )
+ "Cd:D:e:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z" )) != EOF )
{
switch( i ) {
/* Delete Specific Options */
case 'c': /* continuous operation mode */
++contoper;
break;
+ case 'E': /* delete controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
+ prog, version );
+ return 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 delete control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
case 'f': /* read DNs from a file */
if( fp != NULL ) {
fprintf( stderr, "%s: -f previously specified\n", prog );
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
"Add or modify options:\n"
" -a add values (default%s)\n"
" -c continuous operation mode (do not stop on errors)\n"
-" -E <ctrl>[=<ctrlparam>] controls\n"
-" manageDSAit[={no|yes|critical}] (alternate form, see -M)\n"
-" noop[={no|yes|critical}] (no operation)\n"
" -F force all changes records to be used\n"
" -S file write skipped modifications to `file'\n"
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
int rc, i, authmethod, version, want_bindpw, debug, manageDSAit, noop, referrals;
int count, len;
char *pw_file = NULL;
- char *control, *s;
+ char *control, *cvalue;
+ int crit;
prog = lutil_progname( "ldapmodify", argc, argv );
version = -1;
while (( i = getopt( argc, argv, "acrf:E:F"
- "Cd:D:h:H:IkKMnO:p:P:QR:S:U:vw:WxX:y:Y:Z" )) != EOF )
+ "Cd:D:e:h:H:IkKMnO:p:P:QR:S:U:vw:WxX:y:Y:Z" )) != EOF )
{
switch( i ) {
/* Modify Options */
case 'c': /* continuous operation */
contoper = 1;
break;
- case 'E': /* controls */
+ case 'E': /* modify controls */
if( version == LDAP_VERSION2 ) {
- fprintf( stderr, "%s: -C incompatible with LDAPv%d\n",
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
prog, version );
return EXIT_FAILURE;
}
/* should be extended to support comma separated list of
- * key/value pairs: -E foo=123,bar=567
+ * [!]key[=value] parameters, e.g. -E !foo,bar=567
*/
- control = strdup( optarg );
- if ( (s = strchr( control, '=' )) != NULL ) {
- *s++ = '\0';
+ crit = 0;
+ cvalue = NULL;
+ if( optarg[0] == '!' ) {
+ crit = 1;
+ optarg++;
}
- if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
- if ( s == NULL ) {
- manageDSAit = 1;
-
- } else if ( strcasecmp( s, "no" ) == 0 ) {
- manageDSAit = 0;
-
- } else if ( strcasecmp( s, "yes" ) == 0 ) {
- manageDSAit = 1;
-
- } else if ( strcasecmp( s, "critical" ) == 0 ) {
- manageDSAit = 2;
-
- } else {
- fprintf( stderr, "unknown manageDSAit control "
- "value: %s (accepts \"no\", "
- "\"yes\", \"critical\")\n",
- s );
- usage(prog);
- return EXIT_FAILURE;
- }
- free( control );
- break;
-
- } else if ( strcasecmp( control, "noop" ) == 0 ) {
- if ( s == NULL ) {
- noop = 1;
-
- } else if ( strcasecmp( s, "no" ) == 0 ) {
- noop = 0;
-
- } else if ( strcasecmp( s, "yes" ) == 0 ) {
- noop = 1;
-
- } else if ( strcasecmp( s, "critical" ) == 0 ) {
- noop = 2;
-
- } else {
- fprintf( stderr, "unknown noop control "
- "value: %s (accepts \"no\", "
- "\"yes\", \"critical\")\n",
- s );
- usage(prog);
- return EXIT_FAILURE;
- }
- free( control );
- break;
-
- } else {
- fprintf( stderr, "Invalid control name: %s\n", control );
- usage(prog);
- return EXIT_FAILURE;
+ control = strdup( optarg );
+ if ( (cvalue = strchr( control, '=' )) != NULL ) {
+ *cvalue++ = '\0';
}
+ fprintf( stderr, "Invalid modify control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
case 'f': /* read from file */
if( infile != NULL ) {
fprintf( stderr, "%s: -f previously specified\n", prog );
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
{
char *infile, *entrydn = NULL, *rdn = NULL, buf[ 4096 ];
FILE *fp;
- int rc, i, remove, havedn, authmethod, version, want_bindpw, debug, manageDSAit;
+ int rc, i, remove, havedn, authmethod, version, want_bindpw, debug, manageDSAit, noop, crit;
int referrals;
char *newSuperior=NULL;
char *pw_file = NULL;
+ char *control, *cvalue;
infile = NULL;
not = contoper = verbose = remove = want_bindpw =
- debug = manageDSAit = referrals = 0;
+ debug = manageDSAit = noop = referrals = 0;
authmethod = -1;
version = -1;
prog = lutil_progname( "ldapmodrdn", argc, argv );
while (( i = getopt( argc, argv, "cf:rs:"
- "Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z" )) != EOF )
+ "Cd:D:e:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z" )) != EOF )
{
switch( i ) {
/* Modrdn Options */
case 'c':
contoper++;
break;
+ case 'E': /* modrdn controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
+ prog, version );
+ return 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 control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
case 'f': /* read from file */
if( infile != NULL ) {
fprintf( stderr, "%s: -f previously specified\n", prog );
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server(s)\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
int version = -1;
int authmethod = -1;
int manageDSAit = 0;
+ int noop = 0;
+ int crit;
+ char *control, *cvalue;
#ifdef HAVE_CYRUS_SASL
unsigned sasl_flags = LDAP_SASL_AUTOMATIC;
char *sasl_realm = NULL;
prog = lutil_progname( "ldappasswd", argc, argv );
while( (i = getopt( argc, argv, "Aa:Ss:"
- "Cd:D:h:H:InO:p:QR:U:vw:WxX:Y:Z" )) != EOF )
+ "Cd:D:e:h:H:InO:p:QR:U:vw:WxX:Y:Z" )) != EOF )
{
switch (i) {
/* Password Options */
}
break;
+ case 'E': /* passwd controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
+ prog, version );
+ return 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 passwd control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
case 'S': /* prompt for user password */
want_newpw++;
break;
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
" -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"
-" -E <ctrl>[=<ctrlparam>] controls\n"
-" manageDSAit[={no|yes|critical}] (alternate form, see -M)\n"
-" mv=<filter> (matched values filter)\n"
+" -E [!]<ctrl>[=<ctrlparam>] search controls (! indicates criticality)\n"
+" [!]mv=<filter> (matched values filter)\n"
" -F prefix URL prefix for files (default: %s)\n"
" -l limit time limit (in seconds) for search\n"
" -L print responses in LDIFv1 format\n"
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
{
char *infile, *filtpattern, **attrs = NULL, line[BUFSIZ];
FILE *fp = NULL;
- int rc, i, first, scope, deref, attrsonly, manageDSAit;
+ int rc, i, first, scope, deref, attrsonly, manageDSAit, noop, crit;
int referrals, timelimit, sizelimit, debug;
int authmethod, version, want_bindpw;
LDAP *ld = NULL;
int valuesReturnFilter;
BerElement *ber = NULL;
struct berval *bvalp = NULL;
- char *vrFilter = NULL, *control = NULL, *s;
+ char *vrFilter = NULL, *control = NULL, *cvalue;
char *pw_file = NULL;
infile = NULL;
debug = verbose = not = vals2tmp = referrals = valuesReturnFilter =
- attrsonly = manageDSAit = ldif = want_bindpw = 0;
+ attrsonly = manageDSAit = noop = ldif = want_bindpw = 0;
prog = lutil_progname( "ldapsearch", argc, argv );
urlize( def_urlpre );
while (( i = getopt( argc, argv, "Aa:b:E:F:f:Ll:S:s:T:tuz:"
- "Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z")) != EOF )
+ "Cd:e:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:y:Y:Z")) != EOF )
{
switch( i ) {
/* Search Options */
case 'b': /* search base */
base = strdup( optarg );
break;
- case 'E': /* controls */
+ case 'E': /* search controls */
if( version == LDAP_VERSION2 ) {
- fprintf( stderr, "%s: -C incompatible with LDAPv%d\n",
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
prog, version );
return EXIT_FAILURE;
}
/* should be extended to support comma separated list of
- * key/value pairs: -E foo=123,bar=567
+ * [!]key[=value] parameters, e.g. -E !foo,bar=567
*/
- control = strdup( optarg );
- if ( (s = strchr( control, '=' )) != NULL ) {
- *s++ = '\0';
+ crit = 0;
+ cvalue = NULL;
+ if( optarg[0] == '!' ) {
+ crit = 1;
+ optarg++;
}
- if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
- if ( s == NULL ) {
- manageDSAit = 1;
-
- } else if ( strcasecmp( s, "no" ) == 0 ) {
- manageDSAit = 0;
-
- } else if ( strcasecmp( s, "yes" ) == 0 ) {
- manageDSAit = 1;
-
- } else if ( strcasecmp( s, "critical" ) == 0 ) {
- manageDSAit = 2;
+ control = strdup( optarg );
+ if ( (cvalue = strchr( control, '=' )) != NULL ) {
+ *cvalue++ = '\0';
+ }
- } else {
- fprintf( stderr, "unknown manageDSAit control "
- "value: %s (accepts \"no\", "
- "\"yes\", \"critical\")\n",
- s );
- usage(prog);
- return EXIT_FAILURE;
- }
- free( control );
- break;
-
- } else if ( strcasecmp( control, "mv" ) == 0 ) {
+ if ( strcasecmp( control, "mv" ) == 0 ) {
/* ValuesReturnFilter control */
if (valuesReturnFilter!=0) {
fprintf( stderr, "ValuesReturnFilter previously specified");
return EXIT_FAILURE;
}
+ valuesReturnFilter= 1 + crit;
- if ( s == NULL ) {
- fprintf( stderr, "missing filter in ValuesReturnFilter control\n");
+ if ( cvalue == NULL ) {
+ fprintf( stderr,
+ "missing filter in ValuesReturnFilter control\n");
return EXIT_FAILURE;
}
- if ( *s == '!' ){
- s++;
- valuesReturnFilter=2;
- } else {
- valuesReturnFilter=1;
- }
-
- vrFilter = s;
+ vrFilter = cvalue;
version = LDAP_VERSION3;
break;
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
"Common options:\n"
" -d level set LDAP debugging level to `level'\n"
" -D binddn bind DN\n"
+" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
+" [!]manageDSAit (alternate form, see -M)\n"
+" [!]noop\n"
" -f file read operations from `file'\n"
" -h host LDAP server(s)\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
int use_tls = 0;
int referrals = 0;
LDAP *ld = NULL;
+ int manageDSAit=0, noop=0;
+ char *control, *cvalue;
+ int crit;
int id, code = LDAP_OTHER;
LDAPMessage *res;
prog = lutil_progname( "ldapwhoami", argc, argv );
while( (i = getopt( argc, argv,
- "Cd:D:h:H:InO:p:QR:U:vw:WxX:y:Y:Z" )) != EOF )
+ "Cd:D:e:h:H:InO:p:QR:U:vw:WxX:y:Y:Z" )) != EOF )
{
switch (i) {
+ case 'E': /* whoami controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -E incompatible with LDAPv%d\n",
+ prog, version );
+ return 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 whoami control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+
/* Common Options (including options we don't use) */
case 'C':
referrals++;
}
binddn = strdup( optarg );
break;
+ case 'e': /* general controls */
+ if( version == LDAP_VERSION2 ) {
+ fprintf( stderr, "%s: -e incompatible with LDAPv%d\n",
+ prog, version );
+ return 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';
+ }
+
+ if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "manageDSAit: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ manageDSAit = 1 + crit;
+ free( control );
+ break;
+
+ } else if ( strcasecmp( control, "noop" ) == 0 ) {
+ if( cvalue != NULL ) {
+ fprintf( stderr, "noop: no control value expected" );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
+
+ noop = 1 + crit;
+ free( control );
+ break;
+
+ } else {
+ fprintf( stderr, "Invalid general control name: %s\n", control );
+ usage(prog);
+ return EXIT_FAILURE;
+ }
case 'h': /* ldap host */
if( ldapuri != NULL ) {
fprintf( stderr, "%s: -h incompatible with -H\n", prog );
Large projects
--------------
Redesign slapd memory allocation fault handling
-Perform a security audit (and fix any hole found)
+Update to latest autoconf and friends
Implement localization
Implement Proxy Authorization Control extension
Implement LDAP Cancel extension
Implement authPassword (RFC 3112)
-Update to latest autoconf and friends
+Populate matchingRuleUse attribute in the subschema
Small projects
--------------
Add dumpasn1 logging support
Add LDIFv1 control support
-Populate matchingRuleUse attribute in the subschema
Implement -V version options
-Add No-Op Control support to client tools (e.g. ldapsearch(1))
Add tests to test suite (ACI, moddn, manageDSAit, etc.)
Recode linked-list structs to use <ldap_queue.h> macros
Create ldapbind(1) to support bind operations
objectClass: OpenLDAPperson
uid: uham
-dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-member: cn=Manager,o=University of Michigan,c=US
-member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Unive
- rsity of Michigan,c=US
-member: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c
- =US
-member: cn=John Doe,ou=Information Technology Division,ou=People,o=University
- of Michigan,c=US
-member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michiga
- n,c=US
-member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Univ
- ersity of Michigan,c=US
-member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Mich
- igan,c=US
-member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Univers
- ity of Michigan,c=US
-owner: cn=Manager,o=University of Michigan,c=US
-cn: All Staff
-description: Everyone in the sample data
-objectClass: groupofnames
-
-dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
-member: cn=Manager,o=University of Michigan,c=US
-member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-member: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c
- =US
-member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Mich
- igan,c=US
-member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michiga
- n,c=US
-member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Mic
- higan,c=US
-owner: cn=Manager,o=University of Michigan,c=US
-description: All Alumni Assoc Staff
-cn: Alumni Assoc Staff
-objectClass: groupofnames
-
-dn: ou=Alumni Association,ou=People,o=University of Michigan,c=US
-objectClass: organizationalUnit
-ou: Alumni Association
-
-dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Universit
- y of Michigan,c=US
-objectClass: OpenLDAPperson
-cn: Barbara Jensen
-cn: Babs Jensen
-sn: Jensen
-uid: bjensen
-title: Mythical Manager, Research Systems
-postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Ann
- Arbor, MI 48103-4943
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-userPassword:: YmplbnNlbg==
-mail: bjensen@mailgw.umich.edu
-homePostalAddress: 123 Wesley $ Ann Arbor, MI 48103
-description: Mythical manager of the rsdd unix project
-drink: water
-homePhone: +1 313 555 2333
-pager: +1 313 555 3233
-facsimileTelephoneNumber: +1 313 555 2274
-telephoneNumber: +1 313 555 9022
-
-dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University
- of Michigan,c=US
-objectClass: OpenLDAPperson
-cn: Bjorn Jensen
-cn: Biiff Jensen
-sn: Jensen
-uid: bjorn
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-userPassword:: Ympvcm4=
-homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
-drink: Iced Tea
-description: Hiker, biker
-title: Director, Embedded Systems
-postalAddress: Info Tech Division $ 535 W. William St. $ Ann Arbor, MI 48103
-mail: bjorn@mailgw.umich.edu
-homePhone: +1 313 555 5444
-pager: +1 313 555 4474
-facsimileTelephoneNumber: +1 313 555 2177
-telephoneNumber: +1 313 555 0355
-
-dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michiga
- n,c=US
-objectClass: OpenLDAPperson
-cn: Dorothy Stevens
-cn: Dot Stevens
-sn: Stevens
-uid: dots
-title: Secretary, UM Alumni Association
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-drink: Lemonade
-homePostalAddress: 377 White St. Apt. 3 $ Ann Arbor, MI 48104
-description: Very tall
-facsimileTelephoneNumber: +1 313 555 3223
-telephoneNumber: +1 313 555 3664
-mail: dots@mail.alumni.umich.edu
-homePhone: +1 313 555 0454
-
-dn: ou=Groups,o=University of Michigan,c=US
-objectClass: organizationalUnit
-ou: Groups
-
-dn: ou=Information Technology Division,ou=People,o=University of Michigan,c=US
-objectClass: organizationalUnit
-ou: Information Technology Division
-
-dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
-owner: cn=Manager,o=University of Michigan,c=US
-description: All ITD Staff
-cn: ITD Staff
-objectClass: groupofnames
-member: cn=Manager,o=University of Michigan,c=US
-member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Univers
- ity of Michigan,c=US
-member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Univ
- ersity of Michigan,c=US
-member: cn=John Doe,ou=Information Technology Division,ou=People,o=University
- of Michigan,c=US
-
-dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michiga
- n,c=US
-objectClass: OpenLDAPperson
-cn: James A Jones 1
-cn: James Jones
-cn: Jim Jones
-sn: Jones
-uid: jaj
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-userPassword:: amFq
-homePostalAddress: 3882 Beverly Rd. $ Ann Arbor, MI 48105
-homePhone: +1 313 555 4772
-description: Outstanding
-title: Mad Cow Researcher, UM Alumni Association
-pager: +1 313 555 3923
-mail: jaj@mail.alumni.umich.edu
-facsimileTelephoneNumber: +1 313 555 4332
-telephoneNumber: +1 313 555 0895
-
-dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Universi
- ty of Michigan,c=US
-objectClass: OpenLDAPperson
-cn: James A Jones 2
-cn: James Jones
-cn: Jim Jones
-sn: Doe
-uid: jjones
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-homePostalAddress: 933 Brooks $ Ann Arbor, MI 48104
-homePhone: +1 313 555 8838
-title: Senior Manager, Information Technology Division
-description: Not around very much
-mail: jjones@mailgw.umich.edu
-postalAddress: Info Tech Division $ 535 W William $ Ann Arbor, MI 48103
-pager: +1 313 555 2833
-facsimileTelephoneNumber: +1 313 555 8688
-telephoneNumber: +1 313 555 7334
-
-dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c=US
-objectClass: OpenLDAPperson
-cn: Jane Doe
-cn: Jane Alverson
-sn: Doe
-uid: jdoe
-title: Programmer Analyst, UM Alumni Association
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-homePostalAddress: 123 Anystreet $ Ann Arbor, MI 48104
-drink: diet coke
-description: Enthusiastic
-mail: jdoe@woof.net
-homePhone: +1 313 555 5445
-pager: +1 313 555 1220
-facsimileTelephoneNumber: +1 313 555 2311
-telephoneNumber: +1 313 555 4774
-
-dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Michigan
- ,c=US
-objectClass: OpenLDAPperson
-cn: Jennifer Smith
-cn: Jen Smith
-sn: Smith
-uid: jen
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-drink: Sam Adams
-homePostalAddress: 1000 Maple #44 $ Ann Arbor, MI 48103
-title: Telemarketer, UM Alumni Association
-mail: jen@mail.alumni.umich.edu
-homePhone: +1 313 555 2333
-pager: +1 313 555 6442
-facsimileTelephoneNumber: +1 313 555 2756
-telephoneNumber: +1 313 555 8232
-
-dn: cn=John Doe,ou=Information Technology Division,ou=People,o=University of M
- ichigan,c=US
-objectClass: OpenLDAPperson
-cn: John Doe
-cn: Jonathon Doe
-sn: Doe
-uid: johnd
-postalAddress: ITD $ 535 W. William $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-homePostalAddress: 912 East Bllvd $ Ann Arbor, MI 48104
-title: System Administrator, Information Technology Division
-description: overworked!
-mail: johnd@mailgw.umich.edu
-homePhone: +1 313 555 3774
-pager: +1 313 555 6573
-facsimileTelephoneNumber: +1 313 555 4544
-telephoneNumber: +1 313 555 9394
-
-dn: cn=Manager,o=University of Michigan,c=US
-objectClass: person
-cn: Manager
-cn: Directory Manager
-cn: Dir Man
-sn: Manager
-description: Manager of the directory
-userPassword:: c2VjcmV0
-
-dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michigan,c=
- US
-objectClass: OpenLDAPperson
-cn: Mark Elliot
-cn: Mark A Elliot
-sn: Elliot
-uid: melliot
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
-homePhone: +1 313 555 0388
-drink: Gasoline
-title: Director, UM Alumni Association
-mail: melliot@mail.alumni.umich.edu
-pager: +1 313 555 7671
-facsimileTelephoneNumber: +1 313 555 7762
-telephoneNumber: +1 313 555 4177
-
-dn: ou=People,o=University of Michigan,c=US
-objectClass: organizationalUnit
-ou: People
-
-dn: o=University of Michigan,c=US
-objectClass: organization
-objectClass: domainRelatedObject
-l: Ann Arbor, Michigan
-st: Michigan
-o: University of Michigan
-o: UMICH
-o: UM
-o: U-M
-o: U of M
-description: The University of Michigan at Ann Arbor
-postalAddress: University of Michigan $ 535 W. William St. $ Ann Arbor, MI 481
- 09 $ US
-telephoneNumber: +1 313 764-1817
-associatedDomain: umich.edu
-
-dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michiga
- n,c=US
-objectClass: OpenLDAPperson
-cn: Ursula Hampster
-sn: Hampster
-uid: uham
-title: Secretary, UM Alumni Association
-postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
-seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-homePostalAddress: 123 Anystreet $ Ann Arbor, MI 48104
-mail: uham@mail.alumni.umich.edu
-homePhone: +1 313 555 8421
-pager: +1 313 555 2844
-facsimileTelephoneNumber: +1 313 555 9700
-telephoneNumber: +1 313 555 5331
-
-dn: o=University of Michigan,c=US
-o: University of Michigan
-
--- /dev/null
+dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+member: cn=Manager,o=University of Michigan,c=US
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Unive
+ rsity of Michigan,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c
+ =US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=University
+ of Michigan,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michiga
+ n,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Univ
+ ersity of Michigan,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Mich
+ igan,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Univers
+ ity of Michigan,c=US
+owner: cn=Manager,o=University of Michigan,c=US
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupofnames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US
+member: cn=Manager,o=University of Michigan,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c
+ =US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Mich
+ igan,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michiga
+ n,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Mic
+ higan,c=US
+owner: cn=Manager,o=University of Michigan,c=US
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupofnames
+
+dn: ou=Alumni Association,ou=People,o=University of Michigan,c=US
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Universit
+ y of Michigan,c=US
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn: Jensen
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Ann
+ Arbor, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.umich.edu
+homePostalAddress: 123 Wesley $ Ann Arbor, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University
+ of Michigan,c=US
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Ann Arbor, MI 48103
+mail: bjorn@mailgw.umich.edu
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michiga
+ n,c=US
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Ann Arbor, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.umich.edu
+homePhone: +1 313 555 0454
+
+dn: ou=Groups,o=University of Michigan,c=US
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,o=University of Michigan,c=US
+objectClass: organizationalUnit
+ou: Information Technology Division
+
+dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
+owner: cn=Manager,o=University of Michigan,c=US
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupofnames
+member: cn=Manager,o=University of Michigan,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Univers
+ ity of Michigan,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Univ
+ ersity of Michigan,c=US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=University
+ of Michigan,c=US
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michiga
+ n,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Ann Arbor, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.umich.edu
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Universi
+ ty of Michigan,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+homePostalAddress: 933 Brooks $ Ann Arbor, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.umich.edu
+postalAddress: Info Tech Division $ 535 W William $ Ann Arbor, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=University of Michigan,c=US
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+homePostalAddress: 123 Anystreet $ Ann Arbor, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=University of Michigan
+ ,c=US
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Ann Arbor, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.umich.edu
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=University of M
+ ichigan,c=US
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+homePostalAddress: 912 East Bllvd $ Ann Arbor, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.umich.edu
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,o=University of Michigan,c=US
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michigan,c=
+ US
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.umich.edu
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=People,o=University of Michigan,c=US
+objectClass: organizationalUnit
+ou: People
+
+dn: o=University of Michigan,c=US
+objectClass: organization
+objectClass: domainRelatedObject
+l: Ann Arbor, Michigan
+st: Michigan
+o: University of Michigan
+o: UMICH
+o: UM
+o: U-M
+o: U of M
+description: The University of Michigan at Ann Arbor
+postalAddress: University of Michigan $ 535 W. William St. $ Ann Arbor, MI 481
+ 09 $ US
+telephoneNumber: +1 313 764-1817
+associatedDomain: umich.edu
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michiga
+ n,c=US
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=University of Michigan,c=US
+homePostalAddress: 123 Anystreet $ Ann Arbor, MI 48104
+mail: uham@mail.alumni.umich.edu
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
+dn: o=University of Michigan,c=US
+o: University of Michigan
+
TESTOUT=$DBDIR/test.out
INITOUT=$DBDIR/init.out
SEARCHOUTMASTER=$DATADIR/search.out.master
+SEARCHOUTX=$DATADIR/search.out.xsearch
MODIFYOUTMASTER=$DATADIR/modify.out.master
ADDDELOUTMASTER=$DATADIR/adddel.out.master
MODRDNOUTMASTER0=$DATADIR/modrdn.out.master.0
exit $RC
fi
-echo "Testing extended RFC2254 searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
- '(:dn:caseExactMatch:=University of Michigan)' >> $SEARCHOUT 2>&1
-
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
-echo "Testing values return filter searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
- -E 'mv=(o=University of Michigan)' \
- '(o=University of Michigan)' >> $SEARCHOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
kill -HUP $PID
LDIF=$SEARCHOUTMASTER
exit $RC
fi
+echo "Testing extended RFC2254 searching..."
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+ '(:dn:caseExactMatch:=University of Michigan)' >> $SEARCHOUT 2>&1
+
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ kill -HUP $PID
+ exit $RC
+fi
+
+echo "Testing values return filter searching..."
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+ -E '!mv=(o=University of Michigan)' \
+ '(o=University of Michigan)' >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ kill -HUP $PID
+ exit $RC
+fi
+
+
kill -HUP $PID
LDIF=$SEARCHOUTMASTER
+LDIF2=$SEARCHOUTX
echo "Filtering ldapsearch results..."
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
echo "Filtering original ldif used to create database..."
. $LDIFFILTER < $LDIF > $LDIFFLT
+. $LDIFFILTER < $LDIF2 >> $LDIFFLT
echo "Comparing filter output..."
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT