* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
+/* $OpenLDAP$
#include "portable.h"
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -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, crit, 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;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
- debug = verbose = not = referrals =
+ debug = verbose = not = referrals = noop =
manageDSAit = want_bindpw = quiet = 0;
version = -1;
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
}
}
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -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, crit;
+ int i, rc, authmethod, referrals, want_bindpw, version, debug, manageDSAit, noop, crit;
char *pw_file;
char *control, *cvalue;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
not = verbose = contoper = want_bindpw = debug
- = manageDSAit = referrals = 0;
+ = manageDSAit = noop = referrals = 0;
fp = NULL;
authmethod = -1;
version = -1;
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
}
}
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
-
+
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
if( err != LDAP_OPT_SUCCESS ) {
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -f file read operations from `file'\n"
" -h host LDAP server\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
char *infile, *rejfile, *rbuf, *start, *rejbuf = NULL;
FILE *fp, *rejfp;
char *matched_msg = NULL, *error_msg = NULL;
- int rc, i, authmethod, version, want_bindpw, debug, manageDSAit, referrals;
+ int rc, i, authmethod, version, want_bindpw, debug, manageDSAit, noop, referrals;
int count, len;
char *pw_file = NULL;
char *control, *cvalue;
int crit;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
prog = lutil_progname( "ldapmodify", argc, argv );
infile = NULL;
rejfile = NULL;
- not = verbose = want_bindpw = debug = manageDSAit = referrals = 0;
+ not = verbose = want_bindpw = debug = manageDSAit = noop = referrals = 0;
authmethod = -1;
version = -1;
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
rc = 0;
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
-
+
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
if( err != LDAP_OPT_SUCCESS ) {
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -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, crit;
+ 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;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
infile = NULL;
not = contoper = verbose = remove = want_bindpw =
- debug = manageDSAit = referrals = 0;
+ debug = manageDSAit = noop = referrals = 0;
authmethod = -1;
version = -1;
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
+
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
usage(prog);
}
}
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
-
+
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
if( err != LDAP_OPT_SUCCESS ) {
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -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;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
+ int noop = 0;
int crit;
char *control, *cvalue;
#ifdef HAVE_CYRUS_SASL
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
+
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
usage(prog);
}
}
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
-
+
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
if( err != LDAP_OPT_SUCCESS ) {
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -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, crit;
+ int rc, i, first, scope, deref, attrsonly, manageDSAit, noop, crit;
int referrals, timelimit, sizelimit, debug;
int authmethod, version, want_bindpw;
LDAP *ld = NULL;
struct berval *bvalp = NULL;
char *vrFilter = NULL, *control = NULL, *cvalue;
char *pw_file = NULL;
-#ifdef LDAP_CONTROL_NOOP
- int noop=0;
-#endif
+
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 );
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
+
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
usage(prog);
}
}
- if ( manageDSAit || valuesReturnFilter
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop || valuesReturnFilter ) {
int err;
int i=0;
LDAPControl c1,c2,c3;
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
if ( valuesReturnFilter ) {
ctrls[i++]=&c3;
printf("\n# with manageDSAit %scontrol",
manageDSAit > 1 ? "critical " : "" );
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
printf("\n# with noop %scontrol",
noop > 1 ? "critical " : "" );
}
-#endif
if ( valuesReturnFilter ) {
printf("\n# with valuesReturnFilter %scontrol: %s",
valuesReturnFilter > 1 ? "critical " : "", vrFilter );
" -D binddn bind DN\n"
" -e [!]<ctrl>[=<ctrlparam>] general controls (! indicates criticality)\n"
" [!]manageDSAit (alternate form, see -M)\n"
-#ifdef LDAP_CONTROL_NOOP
" [!]noop\n"
-#endif
" -f file read operations from `file'\n"
" -h host LDAP server(s)\n"
" -H URI LDAP Uniform Resource Indentifier(s)\n"
int referrals = 0;
LDAP *ld = NULL;
int manageDSAit=0;
-#ifdef LDAP_CONTROL_NOOP
int noop=0;
-#endif
char *control, *cvalue;
int crit;
free( control );
break;
-#ifdef LDAP_CONTROL_NOOP
} else if ( strcasecmp( control, "noop" ) == 0 ) {
if( cvalue != NULL ) {
fprintf( stderr, "noop: no control value expected" );
noop = 1 + crit;
free( control );
break;
-#endif
+
} else {
fprintf( stderr, "Invalid general control name: %s\n", control );
usage(prog);
goto skip;
}
- if ( manageDSAit
-#ifdef LDAP_CONTROL_NOOP
- || noop
-#endif
- ) {
+ if ( manageDSAit || noop ) {
int err, i = 0;
LDAPControl c1, c2;
LDAPControl *ctrls[3];
c1.ldctl_iscritical = manageDSAit > 1;
}
-#ifdef LDAP_CONTROL_NOOP
if ( noop ) {
ctrls[i++] = &c2;
ctrls[i] = NULL;
c2.ldctl_value.bv_len = 0;
c2.ldctl_iscritical = noop > 1;
}
-#endif
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );