Correctly parse KIM_IDENTITY_ANY in error handler
authorAlexandra Ellwood <lxs@mit.edu>
Wed, 1 Oct 2008 20:58:56 +0000 (20:58 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Wed, 1 Oct 2008 20:58:56 +0000 (20:58 +0000)
ticket: 6055

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

src/kim/agent/mac/ServerDemux.m

index 00b13c9c533bbd668d82fcf67aa5c9c9fa0d1f75..595da065646a9699ddd4b7cb003e8d75d2416e4d 100644 (file)
@@ -458,6 +458,11 @@ 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]) {
+            k5_ipc_stream_free_string (identity_string);   
+            identity_string = KIM_IDENTITY_ANY;
+        }
     }    
     
     if (!err) {
@@ -475,11 +480,11 @@ static int32_t kim_handle_request_handle_error (mach_port_t   in_client_port,
     if (!err) {
         // performs selector on main thread
         [KerberosAgentListener handleErrorWithClientPort:in_client_port
-                                                 replyPort:in_reply_port 
-                                                  identity:identity_string 
-                                                     error:error
-                                                   message:message
-                                               description:description];
+                                               replyPort:in_reply_port 
+                                                identity:identity_string 
+                                                   error:error
+                                                 message:message
+                                             description:description];
     }
     
     k5_ipc_stream_free_string (identity_string);