Write the nickname entry as well when adding a nickname to a bug.
authorrelyea%netscape.com
Fri, 26 Apr 2002 01:09:21 +0000
changeset 3065 68cd3999c9c5cddd7b6c4fecd4d95f33b43413d1
parent 3062 9232d7c6b0f1dced10c0762dc34cd7273cf5ef7d (current diff)
parent 3063 6645fb60d990f39b7cb3a64291c9e72796a3e789 (diff)
child 3066 394a55b208636a2d101f14ce819158201722c5c0
push idunknown
push userunknown
push dateunknown
Write the nickname entry as well when adding a nickname to a bug.
security/nss/lib/softoken/pcertdb.c
--- a/security/nss/lib/softoken/pcertdb.c
+++ b/security/nss/lib/softoken/pcertdb.c
@@ -3011,25 +3011,36 @@ nsslowcert_AddPermNickname(NSSLOWCERTCer
 	rv = SECSuccess;
 	goto loser;
     }
 
     entry = ReadDBSubjectEntry(dbhandle, &cert->derSubject);
     if (entry == NULL) goto loser;
 
     if ( entry->nickname == NULL ) {
+        certDBEntryNickname *nicknameEntry = NULL;
+
 	/* no nickname for subject */
 	rv = AddNicknameToSubject(dbhandle, cert, nickname);
 	if ( rv != SECSuccess ) {
 	    goto loser;
 	}
 	rv = AddNicknameToPermCert(dbhandle, cert, nickname);
 	if ( rv != SECSuccess ) {
 	    goto loser;
 	}
+	nicknameEntry = NewDBNicknameEntry(nickname, &cert->derSubject, 0);
+	if ( nicknameEntry == NULL ) {
+	    goto loser;
+	}
+    
+	rv = WriteDBNicknameEntry(dbhandle, nicknameEntry);
+	if ( rv != SECSuccess ) {
+	    goto loser;
+	}
     } else {
 	/* subject already has a nickname */
 	rv = AddNicknameToPermCert(dbhandle, cert, entry->nickname);
 	if ( rv != SECSuccess ) {
 	    goto loser;
 	}
     }
     rv = SECSuccess;