[Fedora-directory-commits] mod_nss nss_pcache.c,1.9,1.10

Robert Crittenden (rcritten) fedora-directory-commits at redhat.com
Wed Jul 2 14:54:09 UTC 2008


Author: rcritten

Update of /cvs/dirsec/mod_nss
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19626

Modified Files:
	nss_pcache.c 
Log Message:
Fix parsing error where a token with no password would end up with a 
trailing tab in its value causing NSS to not find it.

If there is no password stored for a token return a 1-byte response
so that the read on the other end won't time out.



Index: nss_pcache.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_pcache.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- nss_pcache.c	10 Jan 2007 20:56:00 -0000	1.9
+++ nss_pcache.c	2 Jul 2008 14:54:06 -0000	1.10
@@ -410,7 +410,10 @@
                 for (node = pinList; node != NULL; node = node->next) {
                     if (!strcmp(node->tokenName, tokenName)) {
                         if (Pk11StoreGetPin(&pin, node->store) == SECSuccess) {
-                            PR_Write(out, pin, strlen(pin));
+                            if (strlen(pin) == 0)
+                                PR_Write(out, "", 1);
+                            else
+                                PR_Write(out, pin, strlen(pin));
                             memset(pin, 0, strlen(pin));
                             free(pin);
                             found = PR_TRUE;
@@ -453,7 +456,7 @@
     while (*s) {
         if (*s == '\t' || *s == '\0') {
             if (i == el) {
-                if (*peek != '\0')
+                if (*peek != '\0' || *s == '\t')
                     *s = '\0';
                 r = strdup(t);
                 free(work);




More information about the Fedora-directory-commits mailing list