Commit 28e98d78 authored by Tails developers's avatar Tails developers

Merge branch 'bugfix/6477-htpdate-user-agent' into stable

parents d0d91ffe cbf6f4c4
HTP_POOL_PAL="boum.org,chavez.indymedia.org,db.debian.org,epic.org,mail.riseup.net,sarava.org,squat.net,tachanka.org,www.1984.is,www.eff.org,www.immerda.ch,www.privacyinternational.org,www.torproject.org"
HTP_POOL_NEUTRAL="cve.mitre.org,en.wikipedia.org,lkml.org,thepiratebay.org,www.apache.org,www.centos.org,www.democracynow.org,www.duckduckgo.com,www.gnu.org,www.kernel.org,www.mozilla.org,www.stackexchange.com,www.startpage.com,www.xkcd.com"
HTP_POOL_FOE="encrypted.google.com,github.com,login.live.com,login.yahoo.com,secure.flickr.com,tumblr.com,twitter.com,www.adobe.com,www.gandi.net,www.myspace.com,www.paypal.com,www.rsa.com,www.sony.com"
HTTP_USER_AGENT="$(/usr/local/bin/getTorbuttonUserAgent)"
HTTP_USER_AGENT="$(/usr/local/bin/getTorBrowserUserAgent)"
......@@ -5,28 +5,22 @@ use strict;
use 5.10.0;
use Fatal qw( open close );
sub getTorbuttonUserAgent {
sub getTorBrowserUserAgent {
my $file = shift;
my $ua;
open (my $in, "<", $file);
while (my $line = <$in>) {
chomp $line;
if ($line =~ m/^pref\("extensions\.torbutton\.useragent_override",$/) {
my $next_line = <$in>;
if (($ua) = ($next_line =~ m/^ *"(.*)"\);$/)) {
if (($ua) = ($line =~ m/^pref[(]"general[.]useragent[.]override", "(.*)"[)];$/)) {
last;
}
else {
die "Unparseable file.";
}
}
}
close $in;
return $ua;
}
my $ua = getTorbuttonUserAgent('/usr/share/xul-ext/torbutton/defaults/preferences/preferences.js');
my $ua = getTorBrowserUserAgent('/etc/iceweasel/pref/000-tor-browser.js');
if (defined $ua && $ua) {
say $ua;
}
......
......@@ -67,7 +67,7 @@ tracked by tickets prefixed with `todo/test_suite:`.
* does the exposed User-Agent match the TBB's one?
(connect to a website you can check the access logs for)
* Running `getTorbuttonUserAgent` should produce the useragent set by the
* Running `getTorBrowserUserAgent` should produce the useragent set by the
Torbutton version installed and used in Iceweasel.
* Browsing (by IP) a HTTP or HTTPS server on the LAN should be possible.
* Browsing (by IP) a FTP server on the LAN should be possible.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment