mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Add manageDsaIt/NOOP control support to every tool.
Update NT build.
This commit is contained in:
parent
96ae8aa2c3
commit
2de5c33ba7
@ -123,9 +123,6 @@ Package=<4>
|
||||
Project_Dep_Name testavl
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ud
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name slapcat
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
@ -155,6 +152,9 @@ Package=<4>
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ftest
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name ldapwhoami
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
@ -354,6 +354,27 @@ Package=<4>
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ldapwhoami"=..\clients\tools\ldapwhoami.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "libavl"=..\libraries\libavl\libavl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
@ -777,27 +798,6 @@ Package=<4>
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ud"=..\clients\ud\ud.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libldap
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblber
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name liblutil
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
|
@ -726,24 +726,37 @@ main( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
|
||||
if ( manageDSAit ) {
|
||||
int err;
|
||||
LDAPControl c;
|
||||
LDAPControl *ctrls[2];
|
||||
ctrls[0] = &c;
|
||||
ctrls[1] = NULL;
|
||||
if ( manageDSAit || noop ) {
|
||||
int err, i = 0;
|
||||
LDAPControl c1, c2;
|
||||
LDAPControl *ctrls[3];
|
||||
|
||||
c.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c.ldctl_value.bv_val = NULL;
|
||||
c.ldctl_value.bv_len = 0;
|
||||
c.ldctl_iscritical = manageDSAit > 1;
|
||||
if ( manageDSAit ) {
|
||||
ctrls[i++] = &c1;
|
||||
ctrls[i] = NULL;
|
||||
c1.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c1.ldctl_value.bv_val = NULL;
|
||||
c1.ldctl_value.bv_len = 0;
|
||||
c1.ldctl_iscritical = manageDSAit > 1;
|
||||
}
|
||||
|
||||
if ( noop ) {
|
||||
ctrls[i++] = &c2;
|
||||
ctrls[i] = NULL;
|
||||
|
||||
c2.ldctl_oid = LDAP_CONTROL_NOOP;
|
||||
c2.ldctl_value.bv_val = NULL;
|
||||
c2.ldctl_value.bv_len = 0;
|
||||
c2.ldctl_iscritical = noop > 1;
|
||||
}
|
||||
|
||||
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
|
||||
|
||||
if( err != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set ManageDSAit %scontrol\n",
|
||||
c.ldctl_iscritical ? "critical " : "" );
|
||||
if( c.ldctl_iscritical ) {
|
||||
fprintf( stderr, "Could not set %scontrols\n",
|
||||
(c1.ldctl_iscritical || c2.ldctl_iscritical)
|
||||
? "critical " : "" );
|
||||
if ( c1.ldctl_iscritical && c2.ldctl_iscritical ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -694,25 +694,38 @@ main( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
|
||||
if ( manageDSAit ) {
|
||||
int err;
|
||||
LDAPControl c;
|
||||
LDAPControl *ctrls[2];
|
||||
ctrls[0] = &c;
|
||||
ctrls[1] = NULL;
|
||||
if ( manageDSAit || noop ) {
|
||||
int err, i = 0;
|
||||
LDAPControl c1, c2;
|
||||
LDAPControl *ctrls[3];
|
||||
|
||||
c.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c.ldctl_value.bv_val = NULL;
|
||||
c.ldctl_value.bv_len = 0;
|
||||
c.ldctl_iscritical = manageDSAit > 1;
|
||||
if ( manageDSAit ) {
|
||||
ctrls[i++] = &c1;
|
||||
ctrls[i] = NULL;
|
||||
c1.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c1.ldctl_value.bv_val = NULL;
|
||||
c1.ldctl_value.bv_len = 0;
|
||||
c1.ldctl_iscritical = manageDSAit > 1;
|
||||
}
|
||||
|
||||
if ( noop ) {
|
||||
ctrls[i++] = &c2;
|
||||
ctrls[i] = NULL;
|
||||
|
||||
c2.ldctl_oid = LDAP_CONTROL_NOOP;
|
||||
c2.ldctl_value.bv_val = NULL;
|
||||
c2.ldctl_value.bv_len = 0;
|
||||
c2.ldctl_iscritical = noop > 1;
|
||||
}
|
||||
|
||||
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
|
||||
|
||||
if( err != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set ManageDSAit %scontrol\n",
|
||||
c.ldctl_iscritical ? "critical " : "" );
|
||||
if( c.ldctl_iscritical ) {
|
||||
exit( EXIT_FAILURE );
|
||||
fprintf( stderr, "Could not set %scontrols\n",
|
||||
(c1.ldctl_iscritical || c2.ldctl_iscritical)
|
||||
? "critical " : "" );
|
||||
if ( c1.ldctl_iscritical && c2.ldctl_iscritical ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -729,25 +729,38 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if ( manageDSAit ) {
|
||||
int err;
|
||||
LDAPControl c;
|
||||
LDAPControl *ctrls[2];
|
||||
ctrls[0] = &c;
|
||||
ctrls[1] = NULL;
|
||||
if ( manageDSAit || noop ) {
|
||||
int err, i = 0;
|
||||
LDAPControl c1, c2;
|
||||
LDAPControl *ctrls[3];
|
||||
|
||||
c.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c.ldctl_value.bv_val = NULL;
|
||||
c.ldctl_value.bv_len = 0;
|
||||
c.ldctl_iscritical = manageDSAit > 1;
|
||||
if ( manageDSAit ) {
|
||||
ctrls[i++] = &c1;
|
||||
ctrls[i] = NULL;
|
||||
c1.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c1.ldctl_value.bv_val = NULL;
|
||||
c1.ldctl_value.bv_len = 0;
|
||||
c1.ldctl_iscritical = manageDSAit > 1;
|
||||
}
|
||||
|
||||
if ( noop ) {
|
||||
ctrls[i++] = &c2;
|
||||
ctrls[i] = NULL;
|
||||
|
||||
c2.ldctl_oid = LDAP_CONTROL_NOOP;
|
||||
c2.ldctl_value.bv_val = NULL;
|
||||
c2.ldctl_value.bv_len = 0;
|
||||
c2.ldctl_iscritical = noop > 1;
|
||||
}
|
||||
|
||||
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
|
||||
|
||||
if( err != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set ManageDSAit %scontrol\n",
|
||||
c.ldctl_iscritical ? "critical " : "" );
|
||||
if( c.ldctl_iscritical ) {
|
||||
exit( EXIT_FAILURE );
|
||||
fprintf( stderr, "Could not set %scontrols\n",
|
||||
(c1.ldctl_iscritical || c2.ldctl_iscritical)
|
||||
? "critical " : "" );
|
||||
if ( c1.ldctl_iscritical && c2.ldctl_iscritical ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -729,6 +729,42 @@ main( int argc, char *argv[] )
|
||||
}
|
||||
}
|
||||
|
||||
if ( manageDSAit || noop ) {
|
||||
int err, i = 0;
|
||||
LDAPControl c1, c2;
|
||||
LDAPControl *ctrls[3];
|
||||
|
||||
if ( manageDSAit ) {
|
||||
ctrls[i++] = &c1;
|
||||
ctrls[i] = NULL;
|
||||
c1.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c1.ldctl_value.bv_val = NULL;
|
||||
c1.ldctl_value.bv_len = 0;
|
||||
c1.ldctl_iscritical = manageDSAit > 1;
|
||||
}
|
||||
|
||||
if ( noop ) {
|
||||
ctrls[i++] = &c2;
|
||||
ctrls[i] = NULL;
|
||||
|
||||
c2.ldctl_oid = LDAP_CONTROL_NOOP;
|
||||
c2.ldctl_value.bv_val = NULL;
|
||||
c2.ldctl_value.bv_len = 0;
|
||||
c2.ldctl_iscritical = noop > 1;
|
||||
}
|
||||
|
||||
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
|
||||
|
||||
if( err != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set %scontrols\n",
|
||||
(c1.ldctl_iscritical || c2.ldctl_iscritical)
|
||||
? "critical " : "" );
|
||||
if ( c1.ldctl_iscritical && c2.ldctl_iscritical ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( user != NULL || oldpw != NULL || newpw != NULL ) {
|
||||
/* build change password control */
|
||||
BerElement *ber = ber_alloc_t( LBER_USE_DER );
|
||||
|
@ -662,6 +662,42 @@ main( int argc, char *argv[] )
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if ( manageDSAit || noop ) {
|
||||
int err, i = 0;
|
||||
LDAPControl c1, c2;
|
||||
LDAPControl *ctrls[3];
|
||||
|
||||
if ( manageDSAit ) {
|
||||
ctrls[i++] = &c1;
|
||||
ctrls[i] = NULL;
|
||||
c1.ldctl_oid = LDAP_CONTROL_MANAGEDSAIT;
|
||||
c1.ldctl_value.bv_val = NULL;
|
||||
c1.ldctl_value.bv_len = 0;
|
||||
c1.ldctl_iscritical = manageDSAit > 1;
|
||||
}
|
||||
|
||||
if ( noop ) {
|
||||
ctrls[i++] = &c2;
|
||||
ctrls[i] = NULL;
|
||||
|
||||
c2.ldctl_oid = LDAP_CONTROL_NOOP;
|
||||
c2.ldctl_value.bv_val = NULL;
|
||||
c2.ldctl_value.bv_len = 0;
|
||||
c2.ldctl_iscritical = noop > 1;
|
||||
}
|
||||
|
||||
err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
|
||||
|
||||
if( err != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not set %scontrols\n",
|
||||
(c1.ldctl_iscritical || c2.ldctl_iscritical)
|
||||
? "critical " : "" );
|
||||
if ( c1.ldctl_iscritical && c2.ldctl_iscritical ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rc = ldap_extended_operation( ld,
|
||||
LDAP_EXOP_X_WHO_AM_I, NULL,
|
||||
NULL, NULL, &id );
|
||||
|
@ -204,6 +204,10 @@ SOURCE=.\ntservice.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\passfile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\passwd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Loading…
Reference in New Issue
Block a user