Don't wipe out previously entered information with each new call from clients
authorJustin Anderson <jander@mit.edu>
Tue, 14 Oct 2008 19:48:06 +0000 (19:48 +0000)
committerJustin Anderson <jander@mit.edu>
Tue, 14 Oct 2008 19:48:06 +0000 (19:48 +0000)
ticket: 6143

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

src/kim/agent/mac/IPCClient.m

index c271740a75a31371cdc86704c1765415a8640f4b..e42ef9965ffd31f73d0f92ea3e392c910e5b3d0e 100644 (file)
@@ -76,6 +76,7 @@ enum krb_agent_client_state {
         self.authController = [[[AuthenticationController alloc] init] autorelease];
         self.selectController.associatedClient = self;
         self.authController.associatedClient = self;
+        self.currentInfo = [NSMutableDictionary dictionary];
     }
     return self;
 }
@@ -84,6 +85,9 @@ enum krb_agent_client_state {
 {
     [self.selectController close];
     [self.authController close];
+    self.selectController = nil;
+    self.authController = nil;
+    self.currentInfo = nil;
 }
 
 - (void) didCancel
@@ -109,7 +113,7 @@ enum krb_agent_client_state {
 
 - (kim_error) selectIdentity: (NSDictionary *) info
 {
-    self.currentInfo = [[info mutableCopy] autorelease];
+    [self.currentInfo addEntriesFromDictionary:info];
     self.state = ipc_client_state_select;
     
     [self.selectController setContent:self.currentInfo];
@@ -137,13 +141,12 @@ enum krb_agent_client_state {
     [KerberosAgentListener didSelectIdentity:self.currentInfo error:0];
     
     // clean up state
-    self.currentInfo = nil;
     self.state = ipc_client_state_idle;
 }
 
 - (kim_error) enterIdentity: (NSDictionary *) info
 {
-    self.currentInfo = [[info mutableCopy] autorelease];
+    [self.currentInfo addEntriesFromDictionary:info];
     self.state = ipc_client_state_enter;
 
     [self.authController setContent:self.currentInfo];
@@ -164,7 +167,7 @@ enum krb_agent_client_state {
 
 - (kim_error) promptForAuth: (NSDictionary *) info
 {
-    self.currentInfo = [[info mutableCopy] autorelease];
+    [self.currentInfo addEntriesFromDictionary:info];
     self.state = ipc_client_state_auth_prompt;
     
     [self.authController setContent:self.currentInfo];
@@ -182,7 +185,7 @@ enum krb_agent_client_state {
 
 - (kim_error) changePassword: (NSDictionary *) info
 {
-    self.currentInfo = [[info mutableCopy] autorelease];
+    [self.currentInfo addEntriesFromDictionary:info];
     self.state = ipc_client_state_change_password;
     
     [self.authController setContent:self.currentInfo];
@@ -204,7 +207,7 @@ enum krb_agent_client_state {
 
 - (kim_error) handleError: (NSDictionary *) info
 {
-    self.currentInfo = [[info mutableCopy] autorelease];
+    [self.currentInfo addEntriesFromDictionary:info];
     self.state = ipc_client_state_handle_error;
     
     [self.authController setContent:self.currentInfo];