Commit Graph

920 Commits

Author SHA1 Message Date
Roger Dingledine
39c402c29f when add_file_log() fails, tell us why.
svn:r14277
2008-04-01 21:05:31 +00:00
Peter Palfrader
9d132fbde6 Add --hush switch.
New --hush command-line option similar to --quiet.  While --quiet disables all
logging to the console on startup, --hush limits the output to messages of
warning and error severity.


svn:r14222
2008-03-27 17:25:49 +00:00
Nick Mathewson
12b217bce8 r19091@catbus: nickm | 2008-03-27 12:42:57 -0400
Stop reading torrc when all we want to do is --hash-password.  Fix based on patch from Sebastian Hahn. Backport candidate.


svn:r14214
2008-03-27 16:46:34 +00:00
Nick Mathewson
365f16b199 r18787@catbus: nickm | 2008-03-13 11:11:52 -0400
Make set-option functions return sensible error codes from an enum, not mysterious negative integers


svn:r14004
2008-03-13 15:11:56 +00:00
Nick Mathewson
11e464c331 r18753@catbus: nickm | 2008-03-11 14:56:39 -0400
Make some assert()s into tor_assert()s.  Make some tor_assert()s called from logging into assert()s, and document why.


svn:r13977
2008-03-11 18:56:41 +00:00
Nick Mathewson
8b24e01599 r18723@catbus: nickm | 2008-03-11 00:25:30 -0400
Fix bug spotted by mwenge: a server_event should not be a sever_event.  Also, fix compile errors in config.c and control.c with --enable-gcc-warnings.


svn:r13957
2008-03-11 04:30:14 +00:00
Peter Palfrader
bc4095c70c different exit codes for options_init_from_string()
Change options_init_from_string() so that it returns different exit codes in the
error case, depending on what went wrong.  Also push the responsibility to log
the error to the caller.


svn:r13947
2008-03-10 12:41:49 +00:00
Peter Palfrader
8c71d7ea16 options_init_from_torrc(): split off options_init_from_string()
svn:r13946
2008-03-10 12:41:44 +00:00
Peter Palfrader
947fd064a3 Store options we got from commandline seperately from bare argv/argc
svn:r13945
2008-03-10 12:41:40 +00:00
Peter Palfrader
00d64fd213 options_init_from_torrc(): move code that loads torrc into its own function
move code that loads torrc from disk and sets torrc_fname into its own function


svn:r13944
2008-03-10 12:41:36 +00:00
Peter Palfrader
ded55fa296 options_init_from_torrc(): tread non-existing torrc like empty torrc.
Tread the case of a non-existing conffile, when allowed, exactly like the one
with an empty torrc.


svn:r13943
2008-03-10 12:41:33 +00:00
Peter Palfrader
e8f4d79ec1 options_init_from_torrc(): move code that looks for torrc into its own function
Part of options_init_from_torrc()'s job was looking for -f flags (to specify
an alternate config file) on the command line, complaining if more than one
is given or the given does not exist.  If none is given then use the compiled-in
default location, accepting if it does not exist.  This logic has been moved
into its own function in an attemped to make options_init_from_torrc() easier
to deal with.


svn:r13942
2008-03-10 12:41:29 +00:00
Peter Palfrader
4118e319c7 options_init_from_torrc(): Split argv processing into two parts
Split the argv processing loop into two poarts, one that deals with
figuring out which conffile to use, and the other that figures out
which "command" (hash fingerprint, verify config, list fpr, run tor)
the user asked for.

There is a third part further down that imports command line args
into the config but that is not touched.


svn:r13941
2008-03-10 12:41:26 +00:00
Roger Dingledine
0df1564298 forward-port recent changes
svn:r13935
2008-03-10 07:50:09 +00:00
Nick Mathewson
7587e16796 r18639@catbus: nickm | 2008-03-07 20:11:48 -0500
Change semantics of add-a-log functions to copy severity setup: that is way less error-prone.  Fix up config.c to act accordingly.


svn:r13888
2008-03-08 01:11:54 +00:00
Nick Mathewson
f56ba5f3d6 r18630@catbus: nickm | 2008-03-05 17:31:33 -0500
Implement domain-selection for logging.  Source is documented; needs documentation in manpage (maybe).  For now, see doxygen comment on parse_log_severity_config in log.c


svn:r13875
2008-03-05 22:31:39 +00:00
Peter Palfrader
9e7b4400dc minor cleanup
in options_act() we set running_tor to options->command == CMD_RUN_TOR
once and used that in all but one place.  Now we use running_tor in that
place also.


svn:r13819
2008-03-03 12:48:13 +00:00
Roger Dingledine
cd4b95e402 Make "HashedControlPassword" an alias for "__HashedControlSessionPassword"
if it appears on the commandline. should help with bug 586.


svn:r13683
2008-02-22 23:20:28 +00:00
Nick Mathewson
e68760ac0f r14388@tombo: nickm | 2008-02-21 22:44:28 -0500
More 64-to-32 fixes.


svn:r13672
2008-02-22 03:44:36 +00:00
Nick Mathewson
5c03f82a65 r18345@catbus: nickm | 2008-02-21 13:45:04 -0500
Do the last part of arma's fix for bug 437: Track the origin of every addrmap, and use this info so we can remove all the trackhostexits-originated mappings for a given exit.


svn:r13660
2008-02-21 18:45:11 +00:00
Roger Dingledine
b3c0d066e5 other cleanups that have been sitting in my sandbox
svn:r13649
2008-02-21 09:01:32 +00:00
Nick Mathewson
47e6247673 r18294@catbus: nickm | 2008-02-20 22:42:44 -0500
Fix a spelling error and clean up a recent veracode-induced integer overflow check.  Both spotted by Chris Palmer.


svn:r13639
2008-02-21 03:42:56 +00:00
Nick Mathewson
1df0647c66 r18291@catbus: nickm | 2008-02-20 22:35:32 -0500
Resolve all DOCDOC issues, and document some other undocumented code, and fix a changelog entry.


svn:r13638
2008-02-21 03:38:46 +00:00
Nick Mathewson
93aa335516 r18269@catbus: nickm | 2008-02-20 17:28:24 -0500
Apply patch from Sebastian Hahn: stop imposing an arbitrary maximum on the number of file descriptors used for busy servers.  Bug reported by Olaf Selke.


svn:r13626
2008-02-20 22:28:26 +00:00
Nick Mathewson
42c4670e27 r18230@catbus: nickm | 2008-02-19 18:29:43 -0500
Add a few asserts to catch possible errors found by veracode.


svn:r13598
2008-02-19 23:29:45 +00:00
Roger Dingledine
810bfe970c make explicit that we don't care if a rename() call fails.
potential bug reported by veracode.


svn:r13590
2008-02-19 22:25:20 +00:00
Roger Dingledine
33c754315b clear up another connlimit lie
svn:r13582
2008-02-19 21:08:27 +00:00
Nick Mathewson
faa56a500b r14236@tombo: nickm | 2008-02-17 13:44:55 -0500
Partial fix for bug 586: Add an ephemeral __HashedControlSessionPassword.


svn:r13543
2008-02-17 18:45:07 +00:00
Nick Mathewson
6366dcd8ee r14186@tombo: nickm | 2008-02-15 18:38:52 -0500
Add an XXXX021 item so we eventually stop calling setuid() and setgid() unnecessarily.


svn:r13533
2008-02-15 23:39:17 +00:00
Roger Dingledine
c054f90f02 New config option ServerDNSAllowBrokenResolvConf to start a relay
even when the local resolv.conf file is missing, broken, or contains
only unusable nameservers.

Now I can run a local network on my laptop when I'm on an airplane.


svn:r13402
2008-02-06 12:46:17 +00:00
Nick Mathewson
e09c207c3c r17910@catbus: nickm | 2008-02-05 15:36:29 -0500
Check for correctness of AuthDir* options in options_validate; check for possible bugs where options_validate() is happy but parse_policies_from_options() is sad.


svn:r13384
2008-02-05 21:39:32 +00:00
Roger Dingledine
426a9bbde1 Don't trigger an assert if we start a directory authority with a
private IP address (like 127.0.0.1).


svn:r13371
2008-02-04 16:58:50 +00:00
Roger Dingledine
dad9f434e0 correct copyright statement
svn:r13370
2008-02-04 16:54:14 +00:00
Roger Dingledine
9d1832dd5a Set up dannenberg (run by CCC) as the sixth v3 directory
authority.


svn:r13231
2008-01-22 22:38:38 +00:00
Roger Dingledine
ff62154ba3 New config options WarnPlaintextPorts and RejectPlaintextPorts so
Tor can warn and/or refuse connections to ports commonly used with
vulnerable-plaintext protocols.

We still need to figure out some good defaults for them.


svn:r13198
2008-01-20 05:54:15 +00:00
Nick Mathewson
4a3b7496f0 r17639@catbus: nickm | 2008-01-15 19:09:21 -0500
Fix some hard to trigger but nonetheless real memory leaks spotted by an anonymous contributor.  Needs review.  Partial backport candidate.


svn:r13147
2008-01-16 05:27:19 +00:00
Nick Mathewson
a984011814 r17623@catbus: nickm | 2008-01-15 00:22:04 -0500
bulletproof option_get_canonical_name()


svn:r13135
2008-01-15 05:57:14 +00:00
Nick Mathewson
3b8f76aa51 r17611@catbus: nickm | 2008-01-14 13:44:16 -0500
add some missing checks for failing return values.


svn:r13130
2008-01-14 19:00:23 +00:00
Nick Mathewson
ca5f670fab r17548@catbus: nickm | 2008-01-10 11:08:12 -0500
Make proposal-109 behavior optional.


svn:r13090
2008-01-10 16:08:47 +00:00
Roger Dingledine
7d3bf1608b Set up gabelmoo (run by Karsten Loesing) as the fifth v3 directory
authority.


svn:r13079
2008-01-08 23:51:48 +00:00
Nick Mathewson
dd35fe59c4 r17499@catbus: nickm | 2008-01-07 13:39:46 -0500
Bugfix on fix for 557: Make values containing special characters work right with getconf, setconf, and saveconf.  Document this in control-spec.txt


svn:r13056
2008-01-07 18:54:55 +00:00
Nick Mathewson
17036de8b7 r17469@catbus: nickm | 2008-01-05 20:14:07 -0500
Fix bug 579: Count DNSPort and hidden services when checking whether Tor is going to do anything.  Change "no configured ports" from fatal to warning.


svn:r13036
2008-01-06 01:14:11 +00:00
Nick Mathewson
86f5180853 r15786@tombo: nickm | 2008-01-02 01:11:51 -0500
Push the strdups used for parsing configuration lines into parse_line_from_string().  This will make it easier to parse more complex value formats, which in turn will help fix bug 557


svn:r13020
2008-01-02 06:59:12 +00:00
Roger Dingledine
c10faf5085 fix some irix compile complaints; make "kbytes" work as a memory unit
svn:r12936
2007-12-23 04:22:55 +00:00
Roger Dingledine
abf9fadcca start working on serving bridge status from the dirport, for
bridge communities.


svn:r12927
2007-12-22 10:54:21 +00:00
Roger Dingledine
ce636beff9 If the user sets RelayBandwidthRate but doesn't set
RelayBandwidthBurst, then make them equal rather than erroring out.


svn:r12925
2007-12-22 09:13:24 +00:00
Roger Dingledine
be906a836a If BridgeRelay is set to 1, then the default for
PublishServerDescriptor is now "bridge" rather than "v2,v3".


svn:r12923
2007-12-22 09:04:46 +00:00
Roger Dingledine
39d910e97b Make PublishServerDescriptor default to 1, so the default doesn't
have to change as we invent new directory protocol versions.


svn:r12922
2007-12-22 08:27:42 +00:00
Roger Dingledine
7b60d6c526 Directory authorities should only automatically download Extra Info
documents if they're v1, v2, or v3 authorities.


svn:r12898
2007-12-21 06:33:02 +00:00
Roger Dingledine
9ebf86bb66 new config option FetchDirInfoEarly for tup/ioerror and the tordnsel
svn:r12896
2007-12-21 06:08:00 +00:00
Roger Dingledine
f0e7c4f0da Only Tors that want to mirror the v2 directory info should
create the "cached-status" directory in their datadir. All Tors
used to create it. Bugfix on 0.1.2.x.

Bridge relays with DirPort set to 0 no longer cache v1 or v2
directory information; there's no point. Bugfix on trunk.


svn:r12887
2007-12-20 06:47:59 +00:00
Nick Mathewson
2f922937d3 r17274@catbus: nickm | 2007-12-20 01:14:09 -0500
Don't try to create the datadir when we are only verifying the configuration or hashing a password. Resolves bug 540.


svn:r12884
2007-12-20 06:15:09 +00:00
Roger Dingledine
f405f9b614 Make getinfo ns/purpose/bridge actually work
Also, dump our bridge router status entries to disk every 30 minutes.


svn:r12871
2007-12-19 04:58:58 +00:00
Nick Mathewson
a697573ce9 r15562@tombo: nickm | 2007-12-18 23:23:59 -0500
Remove the LearnAuthorityAddrFromCerts option; make it always-on.  One option down, ~160 options to go.


svn:r12870
2007-12-19 04:24:05 +00:00
Nick Mathewson
5488bc3e16 r17231@catbus: nickm | 2007-12-18 16:21:55 -0500
Document and clean-up geoip code; give it some unit tests.


svn:r12856
2007-12-18 21:27:08 +00:00
Nick Mathewson
820159cac5 r15530@tombo: nickm | 2007-12-17 16:54:03 -0500
First wodge of geoip code so bridges can figure out which countries are blocking them.


svn:r12845
2007-12-17 22:44:11 +00:00
Roger Dingledine
1d8a8063b9 clean up copyrights, and assign 2007 copyrights to The Tor Project, Inc
svn:r12786
2007-12-12 21:09:01 +00:00
Roger Dingledine
40efd7d47b but don't disable all the default v1 authorities quite yet
svn:r12778
2007-12-12 04:46:16 +00:00
Roger Dingledine
3b2dd8d763 Three new config options (AlternateDirAuthority,
AlternateBridgeAuthority, and AlternateHSAuthority) that let the
user selectively replace the default directory authorities, rather
than the all-or-nothing replacement that DirServer offers.


svn:r12777
2007-12-12 04:38:54 +00:00
Roger Dingledine
78f532678c Relays were publishing their server descriptor to v1 and v2
directory authorities, but they didn't try publishing to v3-only
authorities. Fix this; and also stop publishing to v1 authorities.


svn:r12759
2007-12-11 20:18:12 +00:00
Roger Dingledine
ee6ae92670 New config options AuthDirBadDir and AuthDirListBadDirs for
authorities to mark certain relays as "bad directories" in the
networkstatus documents. Also supports the "!baddir" directive in
the approved-routers file.


svn:r12754
2007-12-10 16:49:54 +00:00
Roger Dingledine
d95e7c7d67 also clear the hsdir status flag in routerinfo_t when the relay is no
longer listed in the relevant networkstatus document.


svn:r12752
2007-12-10 16:40:14 +00:00
Roger Dingledine
6dfd47467e Allow multiple HashedControlPassword config lines, to support
multiple controller passwords.


svn:r12732
2007-12-09 04:59:27 +00:00
Roger Dingledine
9b162ef430 only clear the bridge list if options->Bridges is set.
this doesn't matter yet so we aren't adding them in other
ways yet.


svn:r12730
2007-12-09 03:38:57 +00:00
Roger Dingledine
ae1aa5a1bb Set up lefkada (run by Geoff Goodell) as the fourth v3 directory
authority.


svn:r12724
2007-12-08 20:16:34 +00:00
Roger Dingledine
2b8ca7b4a4 patch from karsten to clean up documentation and to integrate
more fixes into rend-spec.txt.


svn:r12715
2007-12-07 21:27:58 +00:00
Nick Mathewson
2e378295d6 r16997@catbus: nickm | 2007-12-06 18:56:33 -0500
Make http://torproject urls into https://torproject urls.  Patch from steve.


svn:r12708
2007-12-06 23:56:36 +00:00
Nick Mathewson
92372b156a r16995@catbus: nickm | 2007-12-06 18:42:53 -0500
patch from steve: replace more tor.eff.org instances with torproject.org


svn:r12707
2007-12-06 23:42:59 +00:00
Roger Dingledine
b277954501 put a note so the distant future developers can simplify tor
svn:r12691
2007-12-06 11:19:00 +00:00
Roger Dingledine
d46b8a3eac Stop being so aggressive about fetching dir info if your DirPort is
on but your ORPort is off.

Add a new config option BridgeRelay that specifies you want to
be a bridge relay. Right now the only difference is that it makes
you answer begin_dir requests, and it makes you cache dir info,
even if your DirPort isn't on.

Refactor directory_caches_dir_info() into some more functions.


svn:r12668
2007-12-04 18:35:03 +00:00
Roger Dingledine
f8df8d791e start to refactor dirserver_mode()
svn:r12621
2007-12-01 04:58:53 +00:00
Roger Dingledine
ad0fcef576 other trivial tweaks
svn:r12614
2007-11-30 18:53:14 +00:00
Roger Dingledine
fea55c7c2d two pieces of r12607 for karsten to look at closer
svn:r12609
2007-11-29 15:37:17 +00:00
Roger Dingledine
aaf35cccf7 karsten's second refactoring patch
svn:r12607
2007-11-29 15:25:04 +00:00
Roger Dingledine
2e40510f02 if we think our ip address just changed, log what we thought it
changed *to*.


svn:r12551
2007-11-22 01:38:54 +00:00
Roger Dingledine
aaefad64a1 stop lying in the config file comment we write out regarding
PublishServerDescriptor.


svn:r12550
2007-11-22 00:44:08 +00:00
Roger Dingledine
a54ce34e35 Don't crash if we get an unexpected value for the
PublishServerDescriptor config option. Reported by Matt Edman;
bugfix on 0.2.0.9-alpha.


svn:r12549
2007-11-22 00:43:22 +00:00
Roger Dingledine
094096d320 get rid of the __ConsiderAllRoutersAsHidServDirectories config option
svn:r12528
2007-11-17 12:28:18 +00:00
Roger Dingledine
6514843026 cleanups, bump to 0.2.0.12-alpha
svn:r12516
2007-11-17 02:22:56 +00:00
Peter Palfrader
3e9369ebd9 Changing the ExitPolicyRejectPrivate setting should cause us to rebuild the
descriptor.


svn:r12507
2007-11-15 15:51:17 +00:00
Roger Dingledine
8ca51869fd Allow people to say PreferTunnelledDirConns rather than
PreferTunneledDirConns, for those alternate-spellers out there.


svn:r12466
2007-11-11 01:06:16 +00:00
Roger Dingledine
473a054b4c Set up ides (run by Mike Perry) as the third v3 directory authority.
svn:r12423
2007-11-07 21:20:45 +00:00
Roger Dingledine
fcc115e763 Raise the default BandwidthRate/BandwidthBurst to 5MB/10MB, to
accommodate the growing number of servers that use the default
and are reaching it.


svn:r12364
2007-11-03 22:08:52 +00:00
Nick Mathewson
832ef9562f r14623@tombo: nickm | 2007-11-01 22:25:18 -0400
More tweaks from karsten, with some cleanup and commentary.


svn:r12319
2007-11-02 02:25:28 +00:00
Nick Mathewson
2645219b4c r16322@catbus: nickm | 2007-11-01 00:26:15 -0400
Implement --quiet.


svn:r12306
2007-11-01 04:38:43 +00:00
Nick Mathewson
401b5c26de r16320@catbus: nickm | 2007-11-01 00:11:20 -0400
Learn new addresses for authorities from their certificates.


svn:r12305
2007-11-01 04:14:23 +00:00
Nick Mathewson
fcd42ebef4 r16301@catbus: nickm | 2007-10-31 16:43:49 -0400
A couple of small tweaks to karsten's latest patch, and note an issue with using a bitmap to represent a single int.


svn:r12300
2007-10-31 20:48:08 +00:00
Nick Mathewson
779b615bc2 r16300@catbus: nickm | 2007-10-31 15:36:41 -0400
Next patch from Karsten:  rename some macros, tunnel dir connections, generate (and upload) multiple descriptors as appropriate.


svn:r12299
2007-10-31 20:48:06 +00:00
Nick Mathewson
024798ee4c r16263@catbus: nickm | 2007-10-29 15:08:17 -0400
Tidy last patch a bit.


svn:r12273
2007-10-29 19:10:47 +00:00
Nick Mathewson
e136f00ca8 r16262@catbus: nickm | 2007-10-29 13:21:35 -0400
Patch from Karsten: Code to act as (and use) v2 hidden service directories.


svn:r12272
2007-10-29 19:10:42 +00:00
Nick Mathewson
1c451b9db9 r16252@catbus: nickm | 2007-10-29 11:13:03 -0400
Change symbol from DATADIR to SHARE_DATADIR, since DATADIR conflicts with objidl.h in mingw.


svn:r12268
2007-10-29 15:15:49 +00:00
Nick Mathewson
f09d53bbf1 r16246@catbus: nickm | 2007-10-28 19:34:58 -0400
Implement a FallbackNetworkstatusFile (default to $prefix/share/tor/fallback-consensus) to that we know about lots of directory servers and routers when we start up the first time.


svn:r12259
2007-10-28 23:44:53 +00:00
Roger Dingledine
4ef1c459ba Refuse to start if both ORPort and UseBridges are set. Bugfix
on 0.2.0.x.


svn:r12182
2007-10-25 04:40:27 +00:00
Nick Mathewson
64b4b5a04e r16051@catbus: nickm | 2007-10-22 18:53:53 -0400
fix a dumb bug in r12102.


svn:r12111
2007-10-22 22:54:28 +00:00
Nick Mathewson
c47eb2c8d9 r16032@catbus: nickm | 2007-10-22 11:56:53 -0400
When our directory status or our v3 authority status changes, reschedule operations as appropriate. (Fixes some xxxx020 items)


svn:r12102
2007-10-22 16:32:04 +00:00
Nick Mathewson
59b1b08753 r15905@catbus: nickm | 2007-10-18 09:58:54 -0400
Document some functions while I can still rememberf what they do.  Fix up some whitespace.


svn:r12018
2007-10-18 14:19:51 +00:00
Nick Mathewson
35abfa1f77 r15899@catbus: nickm | 2007-10-18 07:49:15 -0400
"if (!router_get_trusted_dirservers())" is a bad test: router_get_trusted_dirservers() always returns a list.  Instead, check for whether the list is empty.


svn:r12013
2007-10-18 11:50:20 +00:00
Nick Mathewson
e8bd32b347 r15880@catbus: nickm | 2007-10-17 14:56:51 -0400
Patch from robert hogan: do not reset trusted dir server list when we get a config option.


svn:r12001
2007-10-17 19:23:52 +00:00
Nick Mathewson
f988f93b1a r15877@catbus: nickm | 2007-10-17 12:54:56 -0400
Make unverified-consensus get removed when it is accepted or rejected.  Make a new get_datadir_fname*() set of functions to eliminate the common code of "get the options, get the datadir, append some stuff".


svn:r12000
2007-10-17 16:55:44 +00:00
Roger Dingledine
5aa76cdaa8 Correctly check for bad options to the "PublishServerDescriptor"
config option. Bugfix on 0.2.0.1-alpha; reported by Matt Edman.


svn:r11968
2007-10-16 03:26:39 +00:00