int assertctl;
char *assertion = NULL;
char *authzid = NULL;
+int manageDIT = 0;
int manageDSAit = 0;
int noop = 0;
int ppolicy = 0;
N_(" one of \"chainingPreferred\", \"chainingRequired\",\n")
N_(" \"referralsPreferred\", \"referralsRequired\"\n")
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
+N_(" [!]manageDIT\n")
N_(" [!]manageDSAit\n")
N_(" [!]noop\n")
#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
assert( authzid == NULL );
authzid = cvalue;
+ } else if ( strcasecmp( control, "manageDIT" ) == 0 ) {
+ if( manageDIT ) {
+ fprintf( stderr,
+ "manageDIT control previously specified\n");
+ exit( EXIT_FAILURE );
+ }
+ if( cvalue != NULL ) {
+ fprintf( stderr,
+ "manageDIT: no control value expected\n" );
+ usage();
+ }
+
+ manageDIT = 1 + crit;
+
} else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
if( manageDSAit ) {
fprintf( stderr,
}
}
if( protocol == LDAP_VERSION2 ) {
- if( authzid || manageDSAit || noop || ppolicy ) {
+ if( assertctl || authzid || manageDIT || manageDSAit ||
+#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
+ chaining ||
+#endif
+ noop || ppolicy || preread || postread )
+ {
fprintf( stderr, "%s: -e/-M incompatible with LDAPv2\n", prog );
exit( EXIT_FAILURE );
}
tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
{
int i = 0, j, crit = 0, err;
- LDAPControl c[9], **ctrls;
+ LDAPControl c[10], **ctrls;
ctrls = (LDAPControl**) malloc(sizeof(c) + (count+1)*sizeof(LDAPControl*));
if ( ctrls == NULL ) {
i++;
}
+ if ( manageDIT ) {
+ c[i].ldctl_oid = LDAP_CONTROL_MANAGEDIT;
+ BER_BVZERO( &c[i].ldctl_value );
+ c[i].ldctl_iscritical = manageDIT > 1;
+ ctrls[i] = &c[i];
+ i++;
+ }
+
if ( manageDSAit ) {
c[i].ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
BER_BVZERO( &c[i].ldctl_value );
#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.666.5.2"
#define LDAP_CONTROL_PRE_READ "1.3.6.1.4.1.4203.666.5.10.1"
#define LDAP_CONTROL_POST_READ "1.3.6.1.4.1.4203.666.5.10.2"
+#define LDAP_CONTROL_MANAGEDIT "1.3.6.1.4.1.4203.666.5.11"
/* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
fi
echo "Testing modify, add, and delete..."
-$LDAPMODIFY -v -MM -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
+ -e \!ManageDIT > \
$TESTOUT 2>&1 << EOMODS
version: 1
changetype: modify
replace: objectClass
objectClass: testPerson
+-
+replace: objectClass
+objectClass: structuralObjectClass
dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
# update structural object class of entry via objectClass modify
-
add: objectClass
objectClass: testPerson
+-
+delete: structuralObjectClass
+-
+add: objectClass
+objectClass: testPerson
dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
# change entryUUID