]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 21:45:43 +0000 (21:45 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 4 Jan 2011 21:45:43 +0000 (21:45 +0000)
clients/tools/common.c

index ab7e394ceef6d20616bd3580ee7df9d4a58febe2..d8a6414fd2c72903f3f80c9f8b9a02590ec689a5 100644 (file)
@@ -505,7 +505,7 @@ tool_args( int argc, char **argv )
                                        fprintf( stderr, "bauthzid: no control value expected\n" );
                                        usage();
                                }
-                               bauthzid = crit ? 2 : 1;
+                               bauthzid = 1 + crit;
 #endif
 
                        } else if ( ( strcasecmp( control, "relax" ) == 0 ) ||
@@ -637,6 +637,19 @@ tool_args( int argc, char **argv )
                                }
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
 
+#ifdef LDAP_CONTROL_X_SESSION_TRACKING
+                       } else if ( strcasecmp( control, "sessiontracking" ) == 0 ) {
+                               if ( sessionTracking ) {
+                                       fprintf( stderr, "%s: session tracking can be only specified once\n", prog );
+                                       exit( EXIT_FAILURE );
+                               }
+                               sessionTracking = 1;
+                               if( crit ) {
+                                       fprintf( stderr, "sessiontracking: critical flag not allowed\n" );
+                                       usage();
+                               }
+#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
+
                        /* this shouldn't go here, really; but it's a feature... */
                        } else if ( strcasecmp( control, "abandon" ) == 0 ) {
                                abcan = Intr_Abandon;
@@ -656,15 +669,6 @@ tool_args( int argc, char **argv )
                                        gotintr = abcan;
                                }
 
-#ifdef LDAP_CONTROL_X_SESSION_TRACKING
-                       } else if ( strcasecmp( control, "sessiontracking" ) == 0 ) {
-                               if ( sessionTracking ) {
-                                       fprintf( stderr, "%s: session tracking can be only specified once\n", prog );
-                                       exit( EXIT_FAILURE );
-                               }
-                               sessionTracking = 1;
-#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
-
                        } else if ( tool_is_oid( control ) ) {
                                LDAPControl     *tmpctrls, ctrl;