aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/auto-naming/README65
-rw-r--r--contrib/auto-naming/Sample-Makefile20
-rw-r--r--contrib/auto-naming/Sample-crontab3
-rwxr-xr-xcontrib/auto-naming/build-approved-routers45
-rw-r--r--contrib/auto-naming/create-db.sql50
-rw-r--r--contrib/auto-naming/db-config.rb8
-rw-r--r--contrib/auto-naming/db.rb165
-rwxr-xr-xcontrib/auto-naming/process-consensus119
-rwxr-xr-xcontrib/auto-naming/update-named-status.rb70
-rwxr-xr-xcontrib/checkOptionDocs.pl1
-rwxr-xr-xcontrib/checkSpace.pl5
-rwxr-xr-xcontrib/cross.sh3
-rw-r--r--contrib/id_to_fp.c1
-rwxr-xr-xcontrib/nagios-check-tor-authority-cert2
-rwxr-xr-xcontrib/osx/Tor8
-rw-r--r--contrib/osx/package.sh7
-rw-r--r--contrib/polipo/package.sh1
-rw-r--r--contrib/rc.subr1
-rw-r--r--contrib/tor-mingw.nsi.in3
-rwxr-xr-xcontrib/tor-resolve.py1
-rw-r--r--contrib/torify.118
-rwxr-xr-xcontrib/torify.in78
22 files changed, 80 insertions, 594 deletions
diff --git a/contrib/auto-naming/README b/contrib/auto-naming/README
index 77e6af6483..e2f9ff8c2a 100644
--- a/contrib/auto-naming/README
+++ b/contrib/auto-naming/README
@@ -1,65 +1,6 @@
-=== AUTONAMING FOR TOR ===
-
Tor directory authorities may maintain a binding of server identities
-(their long term identity key) and nicknames. In their status documents
-they may for each router they know tell if this is indeed the owner of
-that nickname or not.
-
-This toolset allows automatic maintaining of a binding list of nicknames
-to identity keys, implementing Tor proposal 123[1].
-
-The rules are simple:
- - A router claiming to be Bob is named (i.e. added to the binding list)
- if there currently does not exist a different binding for that
- nickname, the router has been around for a bit (2 weeks), no other
- router has used that nickname in a while (1 month).
- - A binding is removed if the server that owns it has not been seen
- in a long time (6 months).
-
-
-=== REQUIREMENTS ===
-
- * ruby, and its postgres DBI interface (Debian packages: ruby, ruby1.8, libdbi-ruby1.8, libdbd-pg-ruby1.8)
- * postgres (tested with >= 8.1)
- * cron
-
-=== SETUP ===
-
- * copy this tree some place, like into a 'auto-naming' directory in your Tor's
- data directory
- * create a database and a user, modifying db-config.rb accordingly
- * initialize the database by executing the sql statements in create-db.sql
- * setup a cronjob that feeds the current consensus to the process-consensus
- script regularly.
- * once the database is sufficiently populated, maybe a month or so after the
- previous step, setup a cronjob to regularly build the binding list using
- the build-approved-routers script. You probably want to append a manually
- managed list of rejections to that file and give it to tor as its
- "approved-routers" file.
- The Sample-Makefile and Sample-crontab demonstrate the method used at tor26.
-
-
-1. https://tor-svn.freehaven.net/svn/tor/trunk/doc/spec/proposals/123-autonaming.txt
-
-
-
-
-Copyright (c) 2007 Peter Palfrader
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+(their long term identity key) and nicknames.
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The auto-naming scripts have been moved to svn in
+projects/tor-naming/auto-naming/trunk/
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/contrib/auto-naming/Sample-Makefile b/contrib/auto-naming/Sample-Makefile
deleted file mode 100644
index e3e0351df8..0000000000
--- a/contrib/auto-naming/Sample-Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-all: ../approved-routers
-
-update:
- wget -q -O - http://tor.noreply.org/tor/status-vote/current/consensus | \
- ./process-consensus
-
-.PHONY: approved-routers-auto
-approved-routers-auto:
- ./build-approved-routers > "$@"
-
-.INTERMEDIATE: approved-routers
-approved-routers: approved-routers-auto /etc/tor/approved-routers
- cat $^ > "$@"
-
-../approved-routers: approved-routers
- if ! diff -q "$<" "$@"; then \
- mv "$<" "$@" &&\
- (! [ -e /var/run/tor/tor.pid ] || kill -HUP `cat /var/run/tor/tor.pid`) ; \
- fi
diff --git a/contrib/auto-naming/Sample-crontab b/contrib/auto-naming/Sample-crontab
deleted file mode 100644
index b50c07bb81..0000000000
--- a/contrib/auto-naming/Sample-crontab
+++ /dev/null
@@ -1,3 +0,0 @@
-MAILTO=admin
-# cronjob for tor naming
-23 * * * * make -s -C auto-naming update && make -s -C auto-naming
diff --git a/contrib/auto-naming/build-approved-routers b/contrib/auto-naming/build-approved-routers
deleted file mode 100755
index 805321f208..0000000000
--- a/contrib/auto-naming/build-approved-routers
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/ruby
-
-# build-approved-routers - create a name-binding list for use at a Tor
-# directory authority
-#
-# Copyright (c) 2007 Peter Palfrader
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require "yaml"
-
-require 'db'
-require 'db-config'
-
-verbose = ARGV.first == "-v"
-
-db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password'])
-
-db.transaction_begin
-named = db.query2("
- SELECT fingerprint, router_id, nickname_id, nick, first_seen, last_seen
- FROM router NATURAL JOIN router_claims_nickname NATURAL JOIN nickname
- WHERE named")
-while (n=named.next) do
- puts "# (r##{n['router_id']},n##{n['nickname_id']}); first_seen: #{n['first_seen']}, last_seen: #{n['last_seen']}"
- fpr = n['fingerprint'].split(/(....)/).delete_if{|x| x=="" }.join(' ')
- puts "#{n['nick']} #{fpr}"
-end
-db.transaction_commit
diff --git a/contrib/auto-naming/create-db.sql b/contrib/auto-naming/create-db.sql
deleted file mode 100644
index 86e3e63911..0000000000
--- a/contrib/auto-naming/create-db.sql
+++ /dev/null
@@ -1,50 +0,0 @@
-
-CREATE TABLE router (
- router_id SERIAL PRIMARY KEY,
- fingerprint CHAR(40) NOT NULL,
- UNIQUE(fingerprint)
-);
--- already created implicitly due to unique contraint
--- CREATE INDEX router_fingerprint ON router(fingerprint);
-
-CREATE TABLE nickname (
- nickname_id SERIAL PRIMARY KEY,
- nick VARCHAR(30) NOT NULL,
- UNIQUE(nick)
-);
--- already created implicitly due to unique contraint
--- CREATE INDEX nickname_nick ON nickname(nick);
-
-CREATE TABLE router_claims_nickname (
- router_id INTEGER NOT NULL REFERENCES router(router_id) ON DELETE CASCADE,
- nickname_id INTEGER NOT NULL REFERENCES nickname(nickname_id) ON DELETE CASCADE,
- first_seen TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
- last_seen TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
- named BOOLEAN NOT NULL DEFAULT 'false',
- UNIQUE(router_id, nickname_id)
-);
-CREATE INDEX router_claims_nickname_router_id ON router_claims_nickname(router_id);
-CREATE INDEX router_claims_nickname_nickname_id ON router_claims_nickname(nickname_id);
-CREATE INDEX router_claims_nickname_first_seen ON router_claims_nickname(first_seen);
-CREATE INDEX router_claims_nickname_last_seen ON router_claims_nickname(last_seen);
-
-
--- Copyright (c) 2007 Peter Palfrader
---
--- Permission is hereby granted, free of charge, to any person obtaining a copy
--- of this software and associated documentation files (the "Software"), to deal
--- in the Software without restriction, including without limitation the rights
--- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
--- copies of the Software, and to permit persons to whom the Software is
--- furnished to do so, subject to the following conditions:
---
--- The above copyright notice and this permission notice shall be included in
--- all copies or substantial portions of the Software.
---
--- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
--- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
--- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
--- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
--- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
--- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
--- SOFTWARE.
diff --git a/contrib/auto-naming/db-config.rb b/contrib/auto-naming/db-config.rb
deleted file mode 100644
index b1508c1b70..0000000000
--- a/contrib/auto-naming/db-config.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-$CONFIG = {} unless $CONFIG
-$CONFIG['database'] = {} unless $CONFIG['database']
-
-# if you use postgres' "ident sameuser" auth set dbhost to ''
-$CONFIG['database']['dbhost'] = 'localhost';
-$CONFIG['database']['dbname'] = 'tornaming';
-$CONFIG['database']['user'] = 'tornaming';
-$CONFIG['database']['password'] = 'x';
diff --git a/contrib/auto-naming/db.rb b/contrib/auto-naming/db.rb
deleted file mode 100644
index 822a26bad7..0000000000
--- a/contrib/auto-naming/db.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/ruby
-
-# Copyright (c) 2006, 2007 Peter Palfrader
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require "dbi"
-
-class WeaselDbQueryHandle
- def initialize(sth)
- @sth = sth
- end
-
- def next()
- row = @sth.fetch_hash
- if row
- return row
- else
- @sth.finish
- return nil
- end
- end
-end
-
-class Db
- def initialize(host, database, user, password)
- @dbh = DBI.connect("dbi:Pg:#{database}:#{host}", user, password);
- @dbh['AutoCommit'] = false
- @transaction = false
- @pre_initial_transaction=true
- end
-
- def do(query,*args)
- @dbh.do(query,*args)
- end
- def transaction_begin()
- @dbh.do("BEGIN") unless @pre_initial_transaction
- @transaction = true
- @pre_initial_transaction=false
- end
- def transaction_commit()
- @dbh.do("COMMIT")
- @transaction = false
- end
- def transaction_rollback()
- @dbh.do("ROLLBACK")
- end
- def get_primarykey_name(table);
- #return 'ref';
- return table+'_id';
- end
-
- def update(table, values, keys)
- cols = []
- vals = []
- values.each_pair{ |k,v|
- cols << "#{k}=?"
- vals << v
- }
-
- wheres = []
- keys.each_pair{ |k,v|
- wheres << "#{k}=?"
- vals << v
- }
-
- throw "update value set empty" unless cols.size > 0
- throw "where clause empty" unless wheres.size > 0
-
- query = "UPDATE #{table} SET #{cols.join(',')} WHERE #{wheres.join(' AND ')}"
- transaction_begin unless transaction_before=@transaction
- r = @dbh.do(query, *vals)
- transaction_commit unless transaction_before
- return r
- end
-
- def update_row(table, values)
- pk_name = get_primarykey_name(table);
- throw "Ref not defined" unless values[pk_name]
- return update(table, values.clone.delete_if{|k,v| k == pk_name}, { pk_name => values[pk_name] });
- end
- def insert(table, values)
- cols = values.keys
- vals = values.values
- qmarks = values.values.collect{ '?' }
-
- query = "INSERT INTO #{table} (#{cols.join(',')}) VALUES (#{qmarks.join(',')})"
- transaction_begin unless transaction_before=@transaction
- @dbh.do(query, *vals)
- transaction_commit unless transaction_before
- end
-
- def insert_row(table, values)
- pk_name = get_primarykey_name(table);
- if values[pk_name]
- insert(table, values)
- else
- transaction_begin unless transaction_before=@transaction
- row = query_row("SELECT nextval(pg_get_serial_sequence('#{table}', '#{pk_name}')) AS newref");
- throw "No newref?" unless row['newref']
- values[pk_name] = row['newref']
- insert(table, values);
- transaction_commit unless transaction_before
- end
- end
- def delete_row(table, ref)
- pk_name = get_primarykey_name(table);
- query = "DELETE FROM #{table} WHERE #{pk_name}=?"
- transaction_begin unless transaction_before=@transaction
- @dbh.do(query, ref)
- transaction_commit unless transaction_before
- end
- def query(query, *params)
- sth = @dbh.execute(query, *params)
- while row = sth.fetch_hash
- yield row
- end
- sth.finish
- end
- # nil if no results
- # hash if one match
- # throw otherwise
- def query_row(query, *params)
- sth = @dbh.execute(query, *params)
-
- row = sth.fetch_hash
- if row == nil
- sth.finish
- return nil
- elsif sth.fetch_hash != nil
- sth.finish
- throw "More than one result when querying for #{query}"
- else
- sth.finish
- return row
- end
- end
- def query_all(query, *params)
- sth = @dbh.execute(query, *params)
-
- rows = sth.fetch_all
- return nil if rows.size == 0
- return rows
- end
- def query2(query, *params)
- sth = @dbh.execute(query, *params)
- return WeaselDbQueryHandle.new(sth)
- end
-end
diff --git a/contrib/auto-naming/process-consensus b/contrib/auto-naming/process-consensus
deleted file mode 100755
index dc9d207e43..0000000000
--- a/contrib/auto-naming/process-consensus
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/ruby
-
-# process-consensus - read a current consensus document, inserting the
-# information into a database then calling
-# update-named-status.rb to update the name-binding
-# flags
-#
-# Copyright (c) 2007 Peter Palfrader
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require "yaml"
-
-require 'db'
-require 'db-config'
-require 'update-named-status'
-
-$db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password'])
-
-$router_cache = {}
-$nickname_cache = {}
-
-def parse_consensus consensus
- ts = nil
- routers = []
- consensus.each do |line|
- (key, value) = line.split(' ',2)
- case key
- when "valid-after", "published": ts = DateTime.parse(value)
- when "r":
- (nick, fpr, _) = value.split(' ', 3)
- nick.downcase!
- next if nick == 'unnamed'
- routers << {
- 'nick' => nick,
- 'fingerprint' => (fpr+'=').unpack('m').first.unpack('H*').first
- }
- end
- end
- throw "Did not find a timestamp" unless ts
- throw "Did not find any routers" unless routers.size > 0
- return ts, routers
-end
-
-def insert_routers_into_db(router, table, field, value)
- pk = table+'_id'
- row = $db.query_row("SELECT #{pk} FROM #{table} WHERE #{field}=?", value)
- if row
- return row[pk]
- else
- r = { field => value }
- $db.insert_row( table, r )
- return r[pk]
- end
-end
-
-def handle_one_consensus(c)
- puts "parsing..." if $verbose
- timestamp, routers = parse_consensus c
- puts "storing..." if $verbose
-
- routers.each do |router|
- fpr = router['fingerprint']
- nick = router['nick']
- $router_cache[fpr] = router_id = ($router_cache[fpr] or insert_routers_into_db(router, 'router', 'fingerprint', router['fingerprint']))
- $nickname_cache[nick] = nickname_id = ($nickname_cache[nick] or insert_routers_into_db(router, 'nickname', 'nick', router['nick']))
-
- row = $db.update(
- 'router_claims_nickname',
- { 'last_seen' => timestamp.to_s },
- { 'router_id' => router_id, 'nickname_id' => nickname_id} )
- case row
- when 0:
- $db.insert('router_claims_nickname',
- {
- 'first_seen' => timestamp.to_s,
- 'last_seen' => timestamp.to_s,
- 'router_id' => router_id, 'nickname_id' => nickname_id} )
- when 1:
- else
- throw "Update of router_claims_nickname returned unexpected number of affected rows(#{row})"
- end
- end
-end
-
-$db.transaction_begin
-if ARGV.first == '-v'
- $verbose = true
- ARGV.shift
-end
-
-if ARGV.size == 0
- handle_one_consensus STDIN.readlines
- do_update $verbose
-else
- ARGV.each do |filename|
- puts filename if $verbose
- handle_one_consensus File.new(filename).readlines
- puts "updating..." if $verbose
- do_update $verbose
- end
-end
-$db.transaction_commit
diff --git a/contrib/auto-naming/update-named-status.rb b/contrib/auto-naming/update-named-status.rb
deleted file mode 100755
index b58b24d58f..0000000000
--- a/contrib/auto-naming/update-named-status.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/ruby
-
-# update-named-status.rb - update the named status of routers in our database
-#
-# Copyright (c) 2007 Peter Palfrader
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-require "yaml"
-
-require 'db'
-require 'db-config'
-
-def do_update(verbose)
- now = $db.query_row("SELECT max(last_seen) AS max FROM router_claims_nickname")['max']
- unless now
- STDERR.puts "Could not find the latest last_seen timestamp. Is the database empty still?"
- return
- end
- now = "TIMESTAMP '" + now.to_s + "'"
-
- denamed = $db.do("
- UPDATE router_claims_nickname
- SET named=false
- WHERE named
- AND last_seen < #{now} - INTERVAL '6 months'")
- puts "de-named: #{denamed}" if verbose
-
- named = $db.do("
- UPDATE router_claims_nickname
- SET named=true
- WHERE NOT named
- AND first_seen < #{now} - INTERVAL '2 weeks'
- AND last_seen > #{now} - INTERVAL '2 days'
- AND NOT EXISTS (SELECT *
- FROM router_claims_nickname AS innertable
- WHERE named
- AND router_claims_nickname.nickname_id=innertable.nickname_id) "+ # if that nickname is already named, we lose.
- " AND NOT EXISTS (SELECT *
- FROM router_claims_nickname AS innertable
- WHERE router_claims_nickname.nickname_id=innertable.nickname_id
- AND router_claims_nickname.router_id <> innertable.router_id
- AND last_seen > #{now} - INTERVAL '1 month') ") # if nobody else wanted that nickname in the last month we are set
- puts "named: #{named}" if verbose
-end
-
-if __FILE__ == $0
- $db = Db.new($CONFIG['database']['dbhost'], $CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password'])
- verbose = ARGV.first == "-v"
-
- $db.transaction_begin
- do_update verbose
- $db.transaction_commit
-end
diff --git a/contrib/checkOptionDocs.pl b/contrib/checkOptionDocs.pl
index ca3fba55e3..c2e8757362 100755
--- a/contrib/checkOptionDocs.pl
+++ b/contrib/checkOptionDocs.pl
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
-# $Id
use strict;
my %options = ();
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl
index 37f079c52b..db061a0828 100755
--- a/contrib/checkSpace.pl
+++ b/contrib/checkSpace.pl
@@ -42,9 +42,8 @@ for $fn (@ARGV) {
$lastnil = 0;
}
## Terminals are still 80 columns wide in my world. I refuse to
- ## accept double-line lines. Except, of course, svn Id tags
- ## can make us go long.
- if (/^.{80}/ && !/\$Id: /) {
+ ## accept double-line lines.
+ if (/^.{80}/) {
print " Wide:$fn:$.\n";
}
### Juju to skip over comments and strings, since the tests
diff --git a/contrib/cross.sh b/contrib/cross.sh
index e660be780d..a6085a400f 100755
--- a/contrib/cross.sh
+++ b/contrib/cross.sh
@@ -1,5 +1,4 @@
#!/bin/bash
-# $Id$
# Copyright 2006 Michael Mohr with modifications by Roger Dingledine
# See LICENSE for licensing information.
@@ -186,7 +185,7 @@ if [ ! -z $STRIP ]
then
${HOST_TRIPLET}strip \
src/or/tor \
- src/or/test \
+ src/test/test \
src/tools/tor-resolve
fi
diff --git a/contrib/id_to_fp.c b/contrib/id_to_fp.c
index 73395e16c1..55b025dfaf 100644
--- a/contrib/id_to_fp.c
+++ b/contrib/id_to_fp.c
@@ -1,5 +1,4 @@
/* Copyright 2006 Nick Mathewson; see LICENSE for licensing information */
-/* $Id$ */
/* id_to_fp.c : Helper for directory authority ops. When somebody sends us
* a private key, this utility converts the private key into a fingerprint
diff --git a/contrib/nagios-check-tor-authority-cert b/contrib/nagios-check-tor-authority-cert
index 0e2c1d06c4..46dc7284b7 100755
--- a/contrib/nagios-check-tor-authority-cert
+++ b/contrib/nagios-check-tor-authority-cert
@@ -8,8 +8,6 @@
# Usage: nagios-check-tor-authority-cert <authority identity fingerprint>
# e.g.: nagios-check-tor-authority-cert A9AC67E64B200BBF2FA26DF194AC0469E2A948C6
-# $Id$
-
# Copyright (c) 2008 Peter Palfrader <peter@palfrader.org>
#
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/contrib/osx/Tor b/contrib/osx/Tor
index 0660fd7c8d..bcddc0c42b 100755
--- a/contrib/osx/Tor
+++ b/contrib/osx/Tor
@@ -25,9 +25,9 @@ if [ -x /usr/bin/sw_vers ]; then
# the OS version
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
- "10.6") ARCH="universal";;
- "10.5") ARCH="universal";;
- "10.4") ARCH="universal";;
+ "10.6") ARCH="i386";;
+ "10.5") ARCH="i386";;
+ "10.4") ARCH="i386";;
"10.3") ARCH="ppc";;
"10.2") ARCH="ppc";;
"10.1") ARCH="ppc";;
@@ -37,7 +37,7 @@ else
ARCH="unknown"
fi
-if [ $ARCH != "universal" ]; then
+if [ $ARCH != "i386" ]; then
export EVENT_NOKQUEUE=1
fi
diff --git a/contrib/osx/package.sh b/contrib/osx/package.sh
index 040c7cd4c9..488bd27c1b 100644
--- a/contrib/osx/package.sh
+++ b/contrib/osx/package.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-# $Id$
# Copyright 2004-2005 Nick Mathewson.
# Copyright 2005-2007 Andrew Lewman
# Copyright 2008 The Tor Project, Inc.
@@ -35,9 +34,9 @@ if [ -x /usr/bin/sw_vers ]; then
# the OS version
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
- "10.6") ARCH="universal";;
- "10.5") ARCH="universal";;
- "10.4") ARCH="universal";;
+ "10.6") ARCH="i386";;
+ "10.5") ARCH="i386";;
+ "10.4") ARCH="i386";;
"10.3") ARCH="ppc";;
"10.2") ARCH="ppc";;
"10.1") ARCH="ppc";;
diff --git a/contrib/polipo/package.sh b/contrib/polipo/package.sh
index 83f74212be..4ec72c81d8 100644
--- a/contrib/polipo/package.sh
+++ b/contrib/polipo/package.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-# $Id: package.sh 8992 2006-12-23 03:12:09Z phobos $
# Copyright 2004-2005 Nick Mathewson & Andrew Lewman.
# Copyright 2005-2008 Andrew Lewman
# This is licensed under the Modified BSD License.
diff --git a/contrib/rc.subr b/contrib/rc.subr
index 117ae71d47..d757e89528 100644
--- a/contrib/rc.subr
+++ b/contrib/rc.subr
@@ -1,5 +1,4 @@
#!/bin/sh
-# $Id$
# $FreeBSD: ports/security/tor-devel/files/tor.in,v 1.1 2006/02/17 22:21:25 mnag Exp $
#
# (rc.subr written by Peter Thoenen for Net/FreeBSD)
diff --git a/contrib/tor-mingw.nsi.in b/contrib/tor-mingw.nsi.in
index a6124c8568..83bcf50b88 100644
--- a/contrib/tor-mingw.nsi.in
+++ b/contrib/tor-mingw.nsi.in
@@ -8,8 +8,7 @@
!include "LogicLib.nsh"
!include "FileFunc.nsh"
!insertmacro GetParameters
-
-!define VERSION "0.2.1.22"
+!define VERSION "0.2.2.7-alpha"
!define INSTALLER "tor-${VERSION}-win32.exe"
!define WEBSITE "https://www.torproject.org/"
!define LICENSE "LICENSE"
diff --git a/contrib/tor-resolve.py b/contrib/tor-resolve.py
index 919bc876cc..47ae1a0c38 100755
--- a/contrib/tor-resolve.py
+++ b/contrib/tor-resolve.py
@@ -1,5 +1,4 @@
#!/usr/bin/python
-#$Id$
import socket
import struct
diff --git a/contrib/torify.1 b/contrib/torify.1
index b08d468451..9ae4e40d9d 100644
--- a/contrib/torify.1
+++ b/contrib/torify.1
@@ -1,22 +1,27 @@
.TH torify 1 "" Jan-2009 ""
-.\" manual page by Peter Palfrader
+.\" manual page by Peter Palfrader and Jacob Appelbaum
.SH NAME
.LP
-torify \- wrapper for tsocks and tor
+torify \- wrapper for torsocks or tsocks and tor
.SH SYNOPSIS
\fBtorify\fP\ \fIapplication\fP\ [\fIapplication's\ arguments\fP]
.SH DESCRIPTION
-\fBtorify\fR is a simple wrapper that calls tsocks with a tor specific
+\fBtorify\fR is a simple wrapper that attempts to find the best underlying Tor
+wrapper available on a system. It calls torsocks or tsocks with a tor specific
configuration file.
+torsocks is an improved wrapper that explictly rejects UDP, safely resolves DNS
+lookups and properly socksifies your TCP connections.
+
tsocks itself is a wrapper between the tsocks library and the application
that you would like to run socksified.
-Please note that since tsocks uses LD_PRELOAD, torify cannot be applied
+Please note that since both method use LD_PRELOAD, torify cannot be applied
to suid binaries.
+.SH WARNING
You should also be aware that the way tsocks currently works only TCP
connections are socksified. Be aware that this will in most circumstances
not include hostname lookups which would still be routed through your
@@ -25,8 +30,13 @@ normal system resolver to your usual resolving nameservers. The
The Tor FAQ at https://wiki.torproject.org/noreply/TheOnionRouter/TorFAQ might
have further information on this subject.
+When used with torsocks, torify should not leak DNS requests or UDP data.
+
+Both will leak ICMP data.
+
.SH SEE ALSO
.BR tor (1),
.BR tor-resolve (1),
+.BR torsocks (1),
.BR tsocks (1),
.BR tsocks.conf (5).
diff --git a/contrib/torify.in b/contrib/torify.in
index 05645fd07c..d430da8ce7 100755
--- a/contrib/torify.in
+++ b/contrib/torify.in
@@ -3,43 +3,69 @@
# Wrapper script for use of the tsocks(8) transparent socksification library
# See the tsocks(1) and torify(1) manpages.
-# Copyright (c) 2004, 2006 Peter Palfrader
+# Copyright (c) 2004, 2006, 2009 Peter Palfrader
# Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006
# May be distributed under the same terms as Tor itself
+# taken from Debian's Developer's Reference, 6.4
+pathfind() {
+ OLDIFS="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if [ -x "$p/$*" ]; then
+ IFS="$OLDIFS"
+ return 0
+ fi
+ done
+ IFS="$OLDIFS"
+ return 1
+}
-# Define and ensure we have tsocks
-# XXX: what if we don't have which?
-TSOCKS="`which tsocks`"
-if [ ! -x "$TSOCKS" ]
-then
- echo "$0: Can't find tsocks in PATH. Perhaps you haven't installed it?" >&2
- exit 1
+# Check for any argument list
+if [ "$#" = 0 ]; then
+ echo "Usage: $0 [-hv] <command> [<options>...]" >&2
+ exit 1
fi
-# Check for any argument list
-if [ "$#" = 0 ]
-then
- echo "Usage: $0 <command> [<options>...]" >&2
- exit 1
+if [ "$#" = 1 ] && ( [ "$1" = "-h" ] || [ "$1" = "--help" ] ); then
+ echo "Usage: $0 [-hv] <command> [<options>...]"
+ exit 0
fi
-if [ "$#" = 1 ] && ( [ "$1" = "-h" ] || [ "$1" = "--help" ] )
-then
- echo "Usage: $0 <command> [<options>...]"
- exit 0
+
+if [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
+ verbose=1
+ shift 1
+else
+ verbose=0
fi
-# Define our tsocks config file
-TSOCKS_CONF_FILE="@CONFDIR@/tor-tsocks.conf"
-export TSOCKS_CONF_FILE
+if pathfind torsocks; then
+ ! [ "$verbose" -ge 1 ] || echo "Using torsocks as socksifier." >&2
-# Check that we've got a tsocks config file
-if [ -r "$TSOCKS_CONF_FILE" ]
-then
- exec tsocks "$@"
- echo "$0: Failed to exec tsocks $@" >&2
+ exec torsocks "$@"
+ echo "$0: Failed to exec torsocks $@" >&2
exit 1
+
+elif pathfind tsocks; then
+ ! [ "$verbose" -ge 1 ] || echo "Using tsocks as socksifier." >&2
+
+ # Define our tsocks config file
+ TSOCKS_CONF_FILE="/etc/tor/tor-tsocks.conf"
+ export TSOCKS_CONF_FILE
+
+ # Check that we've got a tsocks config file
+ if [ -r "$TSOCKS_CONF_FILE" ]
+ then
+ echo "WARNING: tsocks is known to leak DNS and UDP data. If you had torsocks we would use that." >&2
+ exec tsocks "$@"
+ echo "$0: Failed to exec tsocks $@" >&2
+ exit 1
+ else
+ echo "$0: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2
+ exit 1
+ fi
+
else
- echo "$0: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2
+ echo "$0: Can't find either tsocks or torsocks in your PATH. Perhaps you haven't installed either?" >&2
exit 1
fi