From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <9ddea4a75d97dd4c46decb5efb45f6e4@yourdomain.dom> To: 9fans@cse.psu.edu Subject: Re: [9fans] Laptop! From: benavento@gmail.com (Federico G. Benavento) Date: Sun, 1 Apr 2007 02:57:22 -0300 In-Reply-To: <9ab217670703312229l712e6d5bl708ab42ee7944993@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 3a323362-ead2-11e9-9d60-3106f5b1d025 > I'm sending this mail with abaco + > the webfs patch. Though the cookie handling seems like it could use > with some help in any case -- it is broken for eBay. > I think I fixed some of the bugs in the cookie's code, I'm not sure my changes are fixes or hacks, that's why this is not patch. I'd really like someone to review them and submit the appropriate patch. thanks. g% 9fs sources post... g% diff -c /n/sources/plan9/sys/src/cmd/webfs /sys/src/cmd/webfs diff -c /n/sources/plan9/sys/src/cmd/webfs/cookies.c /sys/src/cmd/webfs/cookies.c /n/sources/plan9/sys/src/cmd/webfs/cookies.c:533,545 - /sys/src/cmd/webfs/cookies.c:533,548 { int lname, lpattern; - if(cistrcmp(name, pattern)==0) + if(pattern[0] != '.') + return 0; + + if(cistrcmp(name, pattern+1) == 0) return 1; if(strcmp(ipattr(name), "dom")==0 && pattern[0]=='.'){ lname = strlen(name); lpattern = strlen(pattern); - if(lname >= lpattern && cistrcmp(name+lname-lpattern, pattern)==0) + if(lname>=lpattern && cistrcmp(name+lname-lpattern, pattern)==0) return 1; } /n/sources/plan9/sys/src/cmd/webfs/cookies.c:557,563 - /sys/src/cmd/webfs/cookies.c:560,566 { return isdomainmatch(dom, c->dom) && strncmp(c->path, path, strlen(c->path))==0 - && c->expire >= now; + && (c->expire==0 || c->expire>=now); } /* /n/sources/plan9/sys/src/cmd/webfs/cookies.c:578,584 - /sys/src/cmd/webfs/cookies.c:581,587 for(i=0; inc; i++){ if(cookiedebug) fprint(2, "\ttry %s %s %d %s\n", jar->c[i].dom, jar->c[i].path, jar->c[i].secure, jar->c[i].name); - if((issecure || !jar->c[i].secure) && iscookiematch(&jar->c[i], dom, path, now)){ + if(/*(issecure || !jar->c[i].secure) &&*/ iscookiematch(&jar->c[i], dom, path, now)){ if(cookiedebug) fprint(2, "\tmatched\n"); addcookie(j, &jar->c[i]); /n/sources/plan9/sys/src/cmd/webfs/cookies.c:612,618 - /sys/src/cmd/webfs/cookies.c:615,621 return "request host does not match cookie domain"; if(strcmp(ipattr(dom), "dom")==0 - && memchr(dom, '.', strlen(dom)-strlen(c->dom)) != nil) + && memchr(dom, '.', strlen(c->dom)-strlen(dom)) != nil) return "request host contains dots before cookie domain"; return 0; Federico G. Benavento --- /bin/fortune: It's not Camelot, but it's not Cleveland, either. -Boston Mayor Kevin White