Reversed sense of checks for NUL character in empty string. Fixed
authorAlexandra Ellwood <lxs@mit.edu>
Wed, 1 Oct 2008 21:00:49 +0000 (21:00 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Wed, 1 Oct 2008 21:00:49 +0000 (21:00 +0000)
ticket: 6055

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20802 dc483132-0cff-0310-8789-dd5450dbe970

src/kim/agent/mac/ServerDemux.m
src/kim/lib/kim_selection_hints.c

index 595da065646a9699ddd4b7cb003e8d75d2416e4d..ea1943592d731e006aa39761d303e46ebf51450f 100644 (file)
@@ -459,7 +459,7 @@ static int32_t kim_handle_request_handle_error (mach_port_t   in_client_port,
     if (!err) {
         err = k5_ipc_stream_read_string (in_request_stream, &identity_string);
         /* Can be empty string "" if there is no identity */
-        if (!err && identity_string[0]) {
+        if (!err && !identity_string[0]) {
             k5_ipc_stream_free_string (identity_string);   
             identity_string = KIM_IDENTITY_ANY;
         }
index a04541bd7775d3417ad6876c97ecbfc67e3848ab..7954353597629d4be1eb5c8f3f44b461deb5d2db 100644 (file)
@@ -651,7 +651,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &explanation);
         
         if (!err) {
-            if (explanation[0]) {
+            if (!explanation[0]) {
                 err = kim_string_copy (&io_selection_hints->explanation, 
                                        explanation);
             } else {
@@ -678,7 +678,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &service_identity);
         
         if (!err) {
-            if (service_identity[0]) {
+            if (!service_identity[0]) {
                 err = kim_string_copy (&io_selection_hints->service_identity, 
                                        service_identity);
             } else {
@@ -696,7 +696,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &client_realm);
         
         if (!err) {
-            if (client_realm[0]) {
+            if (!client_realm[0]) {
                 err = kim_string_copy (&io_selection_hints->client_realm, 
                                        client_realm);
             } else {
@@ -714,7 +714,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &user);
         
         if (!err) {
-            if (user[0]) {
+            if (!user[0]) {
                 err = kim_string_copy (&io_selection_hints->user, user);
             } else {
                 err = kim_selection_hints_set_hint (io_selection_hints,
@@ -731,7 +731,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &service_realm);
         
         if (!err) {
-            if (service_realm[0]) {
+            if (!service_realm[0]) {
                 err = kim_string_copy (&io_selection_hints->service_realm, 
                                        service_realm);
             } else {
@@ -749,7 +749,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &service);
         
         if (!err) {
-            if (service[0]) {
+            if (!service[0]) {
                 err = kim_string_copy (&io_selection_hints->service, service);
             } else {
                 err = kim_selection_hints_set_hint (io_selection_hints,
@@ -766,7 +766,7 @@ kim_error kim_selection_hints_read_from_stream (kim_selection_hints io_selection
         err = k5_ipc_stream_read_string (io_stream, &server);
         
         if (!err) {
-            if (server[0]) {
+            if (!server[0]) {
                 err = kim_string_copy (&io_selection_hints->server, server);
             } else {
                 err = kim_selection_hints_set_hint (io_selection_hints,