]> git.sur5r.net Git - openldap/commitdiff
Add -e authzid argument processing
authorKurt Zeilenga <kurt@openldap.org>
Thu, 28 Nov 2002 05:56:19 +0000 (05:56 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 28 Nov 2002 05:56:19 +0000 (05:56 +0000)
clients/tools/ldapdelete.c
clients/tools/ldapmodify.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
clients/tools/ldapsearch.c
clients/tools/ldapwhoami.c

index fe0e33f8081b6c3c66aca6119a7a6ce80347ffad..a326248a0474fc4d7765c0559ac079da0ea3634b 100644 (file)
@@ -197,7 +197,27 @@ main( int argc, char **argv )
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;
index adf04033068e65d22a2fd0f4a77bd0bc1de5c7cb..8d4a25da10ae74c2e21796a3084690334426b414 100644 (file)
@@ -261,7 +261,27 @@ main( int argc, char **argv )
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;
index 60fd986adbc5531d1f43998ac778577c0711db97..e2052ca01f8b6a98a0dc021983a89f854d3693ba 100644 (file)
@@ -217,7 +217,27 @@ main(int argc, char **argv)
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;
index 4d3bfb29fc2b5c669a733718195facff835f2b17..bb3536f22729d6b1f7f707c089fe7a7a3c863192 100644 (file)
@@ -217,7 +217,27 @@ main( int argc, char *argv[] )
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;
index 5ad8b5610e8761f4c738aaa5f0a1fc5964500efe..2011f8961236877d6127b81787604e4dcbe02b1e 100644 (file)
@@ -454,7 +454,27 @@ main( int argc, char **argv )
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;
index 37289e6235cbf98e70633e1f88a2e12473ca9dc8..182cfa40a6b5b986d91033954fa2561c5ae68a3e 100644 (file)
@@ -173,7 +173,27 @@ main( int argc, char *argv[] )
                        *cvalue++ = '\0';
                }
 
-               if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
+               if ( strcasecmp( control, "authzid" ) == 0 ) {
+                       if( authzid != NULL ) {
+                               fprintf( stderr, "authzid control previously specified");
+                               return EXIT_FAILURE;
+                       }
+                       if( cvalue == NULL ) {
+                               fprintf( stderr, "authzid: control value expected" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+                       if( !crit ) {
+                               fprintf( stderr, "authzid: must be marked critical" );
+                               usage(prog);
+                               return EXIT_FAILURE;
+                       }
+
+                       assert( authzid == NULL );
+                       authzid = control;
+                       break;
+                       
+               } else if ( strcasecmp( control, "manageDSAit" ) == 0 ) {
                        if( manageDSAit ) {
                                fprintf( stderr, "manageDSAit control previously specified");
                                return EXIT_FAILURE;