lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

invalid cookie patch (was: Re: lynx-dev Status of lynx?)


From: Leonid Pauzner
Subject: invalid cookie patch (was: Re: lynx-dev Status of lynx?)
Date: Sat, 19 May 2001 00:12:04 +0400 (MSD)

18-May-2001 11:25 Larry W. Virden wrote:
> Re: cookies problem at groups.yahoo.com

> I thought I had shipped the details a number of times before - but then,
> I've had sporadic problems with email and perhaps these were lost during
> some of those.

> I have lynx configured to automatically accept all cookies and to not prompt
> me.

> When visiting http://groups.yahoo.com/group/sftvnews for instance,
> I get this prompt:
> Accept invalid cookie path=/group/sftvnews/ as a prefix of '/group'? (n)

In your case this is still an invalid cookie since /group/sftvnews/ is not a
prefix of /group/sftvnews (slash!)  But lynx also wrong: it truncates
request path up to the nearest right slash instead of using it litterally,
that is exactly the case I wrote back on January:
   http://www.flora.org/lynx-dev/html/month012001/msg00122.html

Try this patch (untested):

* Cookie path= should be a prefix of the request-URI path, so do not
  truncate request-URI path in LYSetCookie() [we got mistaken "invalid
  cookie path=..." prompt in some cases previously].


diff -u -p old/LYCookie.c ./LYCookie.c
--- old/LYCookie.c      Sun Mar 26 19:14:00 2000
+++ ./LYCookie.c        Fri May 18 22:27:58 2001
@@ -1896,15 +1896,8 @@ PUBLIC void LYSetCookie ARGS3(
     } else if (!strncasecomp(address, "https:", 6)) {
        port = 443;
     }
-    if (((path = HTParse(address, "",
-                        PARSE_PATH|PARSE_PUNCTUATION)) != NULL) &&
-       (ptr = strrchr(path, '/')) != NULL) {
-       if (ptr == path) {
-           *(ptr+1) = '\0';    /* Leave a single '/' alone */
-       } else {
-           *ptr = '\0';
-       }
-    }
+    path = HTParse(address, "", PARSE_PATH|PARSE_PUNCTUATION);
+
     if (!(SetCookie && *SetCookie) &&
        !(SetCookie2 && *SetCookie2)) {
        /*



; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]