summary refs log tree commit diff stats
path: root/ranger
Commit message (Expand)AuthorAgeFilesLines
* fixed #69: tab completion breaks with Apps subclasshut2010-03-171-2/+6
* help.fileop: updated dochut2010-03-171-1/+1
* help.movement: corrected mix-uphut2010-03-171-2/+2
* removed the need for simple app definitionshut2010-03-172-1/+6
* apps: added zathurahut2010-03-171-1/+5
* browsercolumn: remove unnecessary multiple inheritancehut2010-03-151-1/+1
* slight correctionshut2010-03-153-7/+8
* use `file` for reliably identifying text fileshut2010-03-142-1/+15
* apps: added seperate entry for GIMPhut2010-03-141-1/+5
* general updates, allow column levels of >1hut2010-03-144-12/+31
* Changed the local config file name from "rangerrc.py" to "options.py"hut2010-03-141-2/+2
* incremented verison number v1.0.4hut2010-03-121-1/+1
* fixed shutli_generatorized.move()hut2010-03-121-5/+1
* apps: added eye of gnomehut2010-03-121-1/+6
* fixed `ranger <file>`hut2010-03-121-1/+1
* ranger.main: don't create ~/.ranger if --clean is specifiedhut2010-03-121-10/+10
* Renamed env.pwd to env.cwd ("Current Working Directory")hut2010-03-129-77/+77
* commands.delete: ask for confirmation (in some cases)hut2010-03-121-1/+24
* command_parser: fixed chunk()hut2010-03-121-1/+1
* mime.types: added audio/musepackhut2010-03-122-888/+896
* moved ranger.container.environment to ranger.core.environmenthut2010-03-122-1/+1
* actions: correct preview after deletinghut2010-03-122-0/+5
* environment: changed misleading method namehut2010-03-121-2/+2
* fsobject: fixed crash on files which exist but can't be statedhut2010-03-121-1/+1
* slightly modified keybinding syntaxhut2010-03-123-196/+173
* updated pydochut2010-03-121-0/+4
* mime.types: included div, divx and ogm extensionshut2010-03-122-935/+946
* moved ranger.actions and ranger.commandshut2010-03-125-3/+3
* removed copyright from one-line, docstring-only __init__.py fileshut2010-03-123-30/+1
* ranger.__init__: set a default value for arghut2010-03-122-3/+5
* defaults.options: fixed mistakehut2010-03-121-1/+1
* misc changes, make installhut2010-03-122-2/+3
* ranger.data.generate: added compatibility to python 2.6hut2010-03-121-1/+3
* ranger.actions: fixed error messageshut2010-03-121-1/+1
* ranger.help.starting: reverted bad changeshut2010-03-121-2/+2
* ranger.commands: added e=edit alias to make :e unambiguous.hut2010-03-121-0/+2
* ranger.commands: fixed aliaseshut2010-03-121-1/+1
* defaults.options: more extensive documentationhut2010-03-121-18/+35
* ranger.colorschemes: look for custom colorschemes!hut2010-03-121-0/+4
* added two new colorschemes using 88 colorshut2010-03-123-8/+136
* working on the configuration system / main methodhut2010-03-1216-132/+200
* openstruct: faster implementation, removed ReferencedOpenStructhut2010-03-122-21/+5
* moved ranger.ext.debug into ranger.__init__hut2010-03-123-38/+16
* misc changeshut2010-03-125-31/+12
* ranger.colorschemes.__init__: little optimizationhut2010-03-121-4/+6
* minor changeshut2010-03-081-1/+2
* disabled title drawing by default (buggy?)hut2010-03-081-1/+1
* ui: fixed title drawing codehut2010-03-081-2/+1
* apps: indented part of docstringhut2010-03-081-14/+14
* added copyright info to config files and test caseshut2010-03-083-0/+45
ss="s">"expires : %s\n", c->expires ? soup_date_to_string(c->expires, SOUP_DATE_HTTP) : ""); DNPRINTF(XT_D_COOKIE, "secure : %d\n", c->secure); DNPRINTF(XT_D_COOKIE, "http_only: %d\n", c->http_only); DNPRINTF(XT_D_COOKIE, "====================================\n"); } void set_hook(void **hook, char *name) { if (hook == NULL) errx(1, "set_hook"); if (*hook == NULL) { *hook = dlsym(RTLD_NEXT, name); if (*hook == NULL) errx(1, "can't hook %s", name); } } /* override libsoup soup_cookie_equal because it doesn't look at domain */ gboolean soup_cookie_equal(SoupCookie *cookie1, SoupCookie *cookie2) { g_return_val_if_fail(cookie1, FALSE); g_return_val_if_fail(cookie2, FALSE); return (!strcmp (cookie1->name, cookie2->name) && !strcmp (cookie1->value, cookie2->value) && !strcmp (cookie1->path, cookie2->path) && !strcmp (cookie1->domain, cookie2->domain)); } void transfer_cookies(void) { GSList *cf; SoupCookie *sc, *pc; cf = soup_cookie_jar_all_cookies(p_cookiejar); for (;cf; cf = cf->next) { pc = cf->data; sc = soup_cookie_copy(pc); _soup_cookie_jar_add_cookie(s_cookiejar, sc); } soup_cookies_free(cf); } void soup_cookie_jar_delete_cookie(SoupCookieJar *jar, SoupCookie *c) { GSList *cf; SoupCookie *ci; print_cookie("soup_cookie_jar_delete_cookie", c); if (cookies_enabled == 0) return; if (jar == NULL || c == NULL) return; /* find and remove from persistent jar */ cf = soup_cookie_jar_all_cookies(p_cookiejar); for (;cf; cf = cf->next) { ci = cf->data; if (soup_cookie_equal(ci, c)) { _soup_cookie_jar_delete_cookie(p_cookiejar, ci); break; } } soup_cookies_free(cf); /* delete from session jar */ _soup_cookie_jar_delete_cookie(s_cookiejar, c); } void soup_cookie_jar_add_cookie(SoupCookieJar *jar, SoupCookie *cookie) { struct domain *d = NULL; SoupCookie *c; FILE *r_cookie_f; DNPRINTF(XT_D_COOKIE, "soup_cookie_jar_add_cookie: %p %p %p\n", jar, p_cookiejar, s_cookiejar); if (cookies_enabled == 0) return; /* see if we are up and running */ if (p_cookiejar == NULL) { _soup_cookie_jar_add_cookie(jar, cookie); return; } /* disallow p_cookiejar adds, shouldn't happen */ if (jar == p_cookiejar) return; /* sanity */ if (jar == NULL || cookie == NULL) return; if (enable_cookie_whitelist && (d = wl_find(cookie->domain, &c_wl)) == NULL) { blocked_cookies++; DNPRINTF(XT_D_COOKIE, "soup_cookie_jar_add_cookie: reject %s\n", cookie->domain); if (save_rejected_cookies) { if ((r_cookie_f = fopen(rc_fname, "a+")) == NULL) { show_oops(NULL, "can't open reject cookie file"); return; } fseek(r_cookie_f, 0, SEEK_END); fprintf(r_cookie_f, "%s%s\t%s\t%s\t%s\t%lu\t%s\t%s\n", cookie->http_only ? "#HttpOnly_" : "", cookie->domain, *cookie->domain == '.' ? "TRUE" : "FALSE", cookie->path, cookie->secure ? "TRUE" : "FALSE", cookie->expires ? (gulong)soup_date_to_time_t(cookie->expires) : 0, cookie->name, cookie->value); fflush(r_cookie_f); fclose(r_cookie_f); } if (!allow_volatile_cookies) return; } if (cookie->expires == NULL && session_timeout) { soup_cookie_set_expires(cookie, soup_date_new_from_now(session_timeout)); print_cookie("modified add cookie", cookie); } /* see if we are white listed for persistence */ if ((d && d->handy) || (enable_cookie_whitelist == 0)) { /* add to persistent jar */ c = soup_cookie_copy(cookie); print_cookie("soup_cookie_jar_add_cookie p_cookiejar", c); _soup_cookie_jar_add_cookie(p_cookiejar, c); } /* add to session jar */ print_cookie("soup_cookie_jar_add_cookie s_cookiejar", cookie); _soup_cookie_jar_add_cookie(s_cookiejar, cookie); } void setup_cookies(void) { char file[PATH_MAX]; set_hook((void *)&_soup_cookie_jar_add_cookie, "soup_cookie_jar_add_cookie"); set_hook((void *)&_soup_cookie_jar_delete_cookie, "soup_cookie_jar_delete_cookie"); if (cookies_enabled == 0) return; /* * the following code is intricate due to overriding several libsoup * functions. * do not alter order of these operations. */ /* rejected cookies */ if (save_rejected_cookies) snprintf(rc_fname, sizeof file, "%s/%s", work_dir, XT_REJECT_FILE); /* persistent cookies */ snprintf(file, sizeof file, "%s/%s", work_dir, XT_COOKIE_FILE); p_cookiejar = soup_cookie_jar_text_new(file, read_only_cookies); /* session cookies */ s_cookiejar = soup_cookie_jar_new(); g_object_set(G_OBJECT(s_cookiejar), SOUP_COOKIE_JAR_ACCEPT_POLICY, cookie_policy, (void *)NULL); transfer_cookies(); soup_session_add_feature(session, (SoupSessionFeature*)s_cookiejar); }