]> git.sur5r.net Git - openldap/commitdiff
Add manageDsaIt/NOOP control support to every tool.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 29 Aug 2002 21:52:45 +0000 (21:52 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 29 Aug 2002 21:52:45 +0000 (21:52 +0000)
Update NT build.

build/main.dsw
clients/tools/ldapcompare.c
clients/tools/ldapdelete.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
clients/tools/ldapwhoami.c
libraries/liblutil/liblutil.dsp

index f198bf3c05e979c4aae55079885084db4c7e5538..b5d01bfcb82859ffc0720adcaba8c75d9d9faf97 100644 (file)
@@ -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>
index 1f01d7e74e0f2b9050b8376087a55f216a2f6637..4786bd991cb4d7da3e2cd9636d12a8a12e5bb3e7 100644 (file)
@@ -726,24 +726,37 @@ main( int argc, char **argv )
                }
        }
 
-       if ( manageDSAit ) {
-               int err;
-               LDAPControl c;
-               LDAPControl *ctrls[2];
-               ctrls[0] = &c;
-               ctrls[1] = NULL;
-
-               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 || 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 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;
                        }
                }
index 6abefbe2e1258590b4c3652697b5c66b39a90029..f08bdba11faca5f167bdf55debd9e8e24f12260e 100644 (file)
@@ -694,25 +694,38 @@ main( int argc, char **argv )
                }
        }
 
-       if ( manageDSAit ) {
-               int err;
-               LDAPControl c;
-               LDAPControl *ctrls[2];
-               ctrls[0] = &c;
-               ctrls[1] = NULL;
-
-               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 || 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 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;
                        }
                }
        }
index daf1eeddabb3e3fe44e70268d50ac169c1ef8949..68633b8439305a8e20ee012f5dc7e48b86f51ebc 100644 (file)
@@ -729,25 +729,38 @@ main(int argc, char **argv)
                }
        }
 
-       if ( manageDSAit ) {
-               int err;
-               LDAPControl c;
-               LDAPControl *ctrls[2];
-               ctrls[0] = &c;
-               ctrls[1] = NULL;
-
-               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 || 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 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;
                        }
                }
        }
index b39d7d387a24079c12da5c362449f8f61e8df7e9..dda3651ab5685f04bac10e50354715f76d783852 100644 (file)
@@ -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 );
index ca4d0fa817cd7f224afc759bf100d8a8c23e58f9..841a0487901c3c64ee33deed698a8d78c86748d1 100644 (file)
@@ -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 );
index 436a6981bf7aeef502b0301375bfec07d163a915..013a800c12031bd34f407fa32bcbc4cfb2ace6d4 100644 (file)
@@ -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