From 5a0eccaf232a5123a56f2425fd9abb2699b3b77e Mon Sep 17 00:00:00 2001 From: Ben Woolley Date: Wed, 7 Jan 2015 10:13:26 -0800 Subject: [PATCH] Add a download folder to avoid drive-by .bashrc installation and such. --- config.def.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 80a0feb..af47879 100644 --- a/config.def.h +++ b/config.def.h @@ -2,6 +2,7 @@ static char *useragent = "Mozilla/5.0 (X11; U; Unix; en-US) " "AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 " "Safari/537.15 Surf/"VERSION; +static char *downloadfolder = "~/Downloads/"; static char *stylefile = "~/.surf/style.css"; static char *scriptfile = "~/.surf/script.js"; @@ -42,10 +43,10 @@ static Bool allowgeolocation = TRUE; /* DOWNLOAD(URI, referer) */ #define DOWNLOAD(d, r) { \ .v = (char *[]){ "/bin/sh", "-c", \ - "st -e /bin/sh -c \"curl -L -J -O --user-agent '$1'" \ + "st -e /bin/sh -c \"mkdir -p $4 && cd $4 && curl -L -J -O --user-agent '$1'" \ " --referer '$2' -b $3 -c $3 '$0';" \ " sleep 5;\"", \ - d, useragent, r, cookiefile, NULL \ + d, useragent, r, cookiefile, downloadfolder, NULL \ } \ } -- 2.1.2