summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-15 17:53:12 +0100
committerwm4 <wm4@nowhere>2012-11-16 21:21:15 +0100
commitb4b86e9286ba175ba0da4d19e165660bed7002e4 (patch)
tree30a3305e6b734c51f2c78fbba453cd27366cdc72 /stream
parentdb45c8771ae54dbacd96367a72edbb6e2032e579 (diff)
downloadmpv-b4b86e9286ba175ba0da4d19e165660bed7002e4.tar.bz2
mpv-b4b86e9286ba175ba0da4d19e165660bed7002e4.tar.xz
cookies: don't read cookie files from ancient browsers
Remove the code that attempted to read cookie files from well-known browser locations. This code was written for ancient browsers, and only knew about Mozilla and Netscape. While it's possible that these browsers are still alive and still use the same config locations and cookie file formats, the only Mozilla-based browser that still matters is Firefox. Firefox uses a sqlite database for cookies, located in a slightly different config path. Just remove this code.
Diffstat (limited to 'stream')
-rw-r--r--stream/cookies.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/stream/cookies.c b/stream/cookies.c
index d4ae1afab0..2680bf1834 100644
--- a/stream/cookies.c
+++ b/stream/cookies.c
@@ -181,52 +181,13 @@ static struct cookie_list_type *load_cookies_from(const char *filename,
return list;
}
-/* Attempt to load cookies.txt from various locations. Returns a pointer to the linked list contain the cookies. */
+/* Attempt to load cookies.txt. Returns a pointer to the linked list contain the cookies. */
static struct cookie_list_type *load_cookies(void)
{
- DIR *dir;
- struct dirent *ent;
- struct cookie_list_type *list = NULL;
- char *buf;
-
- char *homedir;
-
if (cookies_file)
- return load_cookies_from(cookies_file, list);
-
- homedir = getenv("HOME");
- if (!homedir)
- return list;
-
+ return load_cookies_from(cookies_file, NULL);
- buf = malloc(strlen(homedir) + sizeof("/.mozilla/default") + 1);
- sprintf(buf, "%s/.mozilla/default", homedir);
- dir = opendir(buf);
- free(buf);
-
- if (dir) {
- while ((ent = readdir(dir)) != NULL) {
- if ((ent->d_name)[0] != '.') {
- const char *home = getenv("HOME");
- unsigned len = strlen(home) +
- sizeof("/.mozilla/default/") +
- strlen(ent->d_name) + sizeof("cookies.txt") + 1;
- buf = malloc(len);
- snprintf(buf, len, "%s/.mozilla/default/%s/cookies.txt",
- home, ent->d_name);
- list = load_cookies_from(buf, list);
- free(buf);
- }
- }
- closedir(dir);
- }
-
- buf = malloc(strlen(homedir) + sizeof("/.netscape/cookies.txt") + 1);
- sprintf(buf, "%s/.netscape/cookies.txt", homedir);
- list = load_cookies_from(buf, list);
- free(buf);
-
- return list;
+ return NULL;
}
/* Take an HTTP_header_t, and insert the correct headers. The cookie files are read if necessary. */