Commit Graph

15 Commits (master)

Author SHA1 Message Date
Ori Bernstein 50efe18550 webcookies: remove straggling custom date parser
One place missed in the tmdate purge.
2021-01-19 18:14:53 -08:00
cinap_lenrek 1eca33b48c always zero initialize Tm structure for tm2sec() 2019-12-03 08:22:02 +01:00
cinap_lenrek bdaa002255 webcookies: strdup() file argument to avoid crash (thanks mischief)
mischief reports:

 acid: lstk()
 abort()+0x0 /sys/src/libc/9sys/abort.c:6
 ppanic(p=0x1bff4,fmt=0x1d749)+0x146 /sys/src/libc/port/malloc.c:166
         pv=0x1dad8
         msg=0x1e4a8
         v=0x3ffffe7c
         n=0x2f
 D2B(p=0x1bff4,v=0x3fffffae)+0x57 /sys/src/libc/port/pool.c:926
         a=0x3fffffa4
 poolfreel(v=0x3fffffae,p=0x1bff4)+0x20 /sys/src/libc/port/pool.c:1152
         ab=0x1dad8
 poolfree(p=0x1bff4,v=0x3fffffae)+0x3b /sys/src/libc/port/pool.c:1287
 free(v=0x3fffffb6)+0x23 /sys/src/libc/port/malloc.c:250
 readjar(file=0x3fffffb6)+0xce /sys/src/cmd/webcookies.c:473
         jar=0x1ea28
         lock=0x1ea68
         p=0x1ea6d
 main(argv=0x3fffffa0,argc=0x0)+0x10f /sys/src/cmd/webcookies.c:1295
         file=0x3fffffb6
         srv=0x0
         mtpt=0x1cfd0
         _argc=0x66
         _args=0x1cfe0
         home=0x0
 _main+0x31 /sys/src/libc/386/main9.s:16
 acid:
2015-11-30 20:08:22 +01:00
cinap_lenrek 887ae1a17b webcookies: fix typo 2015-08-03 15:52:03 +02:00
cinap_lenrek 8aee1c5060 webcookies: use strtol() to parse HH:MM:SS
atoi() currently interprets leading zeros as octal (BUG!),
so use strtol with explicit base 10 avoiding the issue.
2015-08-03 14:28:16 +02:00
cinap_lenrek f62a2efb7a webcookies: create lockfile with 0600 permission, always use create() with perm 0600 for rewriting jar 2015-08-01 03:18:44 +02:00
cinap_lenrek 18169e03de webcookies: fix implicit path cookie handling
parsecookie() used to inplace modify the request path
for implicit path (to get the directory from path) and
also did it wrong. now have a static copy and do not
remove the last slash.
2015-07-31 01:10:53 +02:00
cinap_lenrek a8735c02b6 webcookies: fix isdomainmatch() (fixes livejournal.com login)
when cookie is domain=example.com, then we implicitely add
dot to the domain name, which made us reject the cookie as the
request domain "example.com" != ".example.com". fix by making
isdomainmatch() skip the implicit dot in pattern before string
comparsion.
2015-07-29 08:50:53 +02:00
cinap_lenrek 511cee2f22 webcookies: only sync the jar when dirty on clunk
avoid sync the jar file when fids get clunked.
the only reason to sync the jar on clunk is when it has
been marked dirty (cookies added or deleted) and we
want to flush the changes to disk.
2015-01-16 04:46:52 +01:00
cinap_lenrek e41faad5a6 webcookies: avoid rereading and rewriting the cookie jar file all the time, dont return deleted cookies on search
- rewrite when jar->dirty != 0 (caller modified the in memory jar)
- reread when the jar->qid != stat(jar->file)->qid (on disk file changed)
- ignore deleted cookies in cookiesearch()
2015-01-16 04:04:55 +01:00
cinap_lenrek ef5e19b9be add leading dot for explicit domain in webcookies, bump redirection limit to 12 in webfs 2013-05-26 03:33:39 +02:00
cinap_lenrek 31ed86ce23 webcookies: create $home/lib/webcookies as 0600 2012-08-17 18:14:34 +02:00
cinap_lenrek 272d76f2b1 webcookies: fix memory leak, remove fragment from url 2011-12-29 17:56:28 +01:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00