Commit Graph

533 Commits

Author SHA1 Message Date
Roger Dingledine 57cbc35d70 bugfix for win32 with lots of users
plus general cleanup on switch_id()


svn:r684
2003-10-27 10:26:44 +00:00
Roger Dingledine 84c8ceea10 remove obsolete config file
svn:r681
2003-10-27 10:09:09 +00:00
Roger Dingledine bd99fba90c add DirBindAddress, parse the BindAddress's when you bind
exit if bind fails
add usage printfs
rearrange config options for readability


svn:r674
2003-10-25 12:01:09 +00:00
Nick Mathewson c9cbd9d2f9 Use daemon(3) function where available.
svn:r665
2003-10-23 14:28:44 +00:00
Nick Mathewson e12576f0ce resolve warning
svn:r664
2003-10-23 14:27:53 +00:00
Nick Mathewson 1cdf143984 Two-pronged attack at my overzealous skew fixes.
The problem was that the fixes had us generating TLS certs with a
2-day lifetime on the assumption that we'd rotate fairly often.  In
fact, we never rotate our TLS keys.

This patch fixes the situation in 2 ways:
   1. It bumps the default lifetime back up to one year until we get
      rotation in place.
   2. It changes tor_tls_context_new() so that it doesn't leak memory
      when you call it more than once.


svn:r663
2003-10-23 14:20:51 +00:00
Steven Hazel f9ec760bc4 switch_id() no longer tries to log the user name when it's calld on
Windows, since we don't know whether it's the user or the group that
was set.


svn:r659
2003-10-22 17:25:58 +00:00
Nick Mathewson 7b8c5d3436 Clock skew fixes.
Allow some slop (currently 3 minutes) when checking certificate validity.

Change certificate lifetime from 1 year to 2 days.  Since we
regenerate regularly (we regenerate regularly, right??), this
shouldn't be a problem.

Have directories reject descriptors published too far in the future
(currently 30 minutes).  If dirservs don't do this:
    0) Today is January 1, 2000.
    1) A very skewed server publishes descriptor X with a declared
       publication time of August 1, 2000.
    2) The directory includes X.
    3) Because of certificate lifetime issues, nobody can use the
       skewed server.
    4) The server fixes its skew, and goes to republish a new descriptor Y
       with publication time of January 1, 2000.
    5) But because the directory already has a "more recent" descriptor X,
       it rejects descriptor "Y" as superseded!

This patch should make step 2 go away.


svn:r658
2003-10-22 16:41:35 +00:00
Steven Hazel e91b84a89e - fixed a bug in the id switching code -- setgid has to happen before
setuid, because after we setuid we don't have the priviledges we
  need to setgid anymore, duh.  merged switch_user() and
  switch_group() into switch_id(), since that code has to be wound
  together.

- return -1 from switch_id() if it's not defined to do anything else.

- moved daemoinize(), write_pidfile(), and switch_id() from main.c to
  util.c


svn:r656
2003-10-22 11:21:29 +00:00
Roger Dingledine 4ca29bbce6 play with connection_edge_send_command
maybe more robust now


svn:r655
2003-10-22 09:08:10 +00:00
Roger Dingledine bf8cce8013 move default exit policy into config files
svn:r654
2003-10-22 07:56:11 +00:00
Roger Dingledine b53b2a6c41 make end relay cells have payloads
move default exit policy into config files


svn:r653
2003-10-22 07:55:44 +00:00
Steven Hazel 0ab1f075fb added User and Group options -- if you set them, tor will try to
setuid and setgid respectively, and die if it can't.

(If the User option is set, tor will setgid to the user's gid as well.)

This happens after the pidfile is created, so that in cases where tor
needs to be root to work with the pidfile, it will at least be able to
create it, although it won't be able to delete it.  That sucks, but
it's somewhat better than not being able to create the pidfile in the
first place.


svn:r652
2003-10-22 06:03:11 +00:00
Nick Mathewson a99360b1e3 Update .cvsignores to exclude files generated due to recent build improvements
svn:r647
2003-10-21 17:49:52 +00:00
Roger Dingledine f094a31d52 APPort is now SocksPort
svn:r644
2003-10-21 09:49:39 +00:00
Roger Dingledine bafba58aaf introduce new tor_free() macro
svn:r643
2003-10-21 09:48:58 +00:00
Roger Dingledine 689f044753 move closer to being able to reload config on HUP
rename APPort to SocksPort
introduce new tor_free() macro


svn:r642
2003-10-21 09:48:17 +00:00
Roger Dingledine eb69ae9350 remove obsolete config file
svn:r641
2003-10-21 09:22:38 +00:00
Roger Dingledine c7b97017ad send the end cell when we realize we're going to end,
not when we're closing the stream.

this lets us put a payload in the end cell if we want to,
to describe why we're closing the stream.

there are still some places where we don't send the end cell
immediately. i need to track them down. but it's a low priority,
since i've made it send the end cell when we close the stream if
we haven't already sent it.


svn:r640
2003-10-21 08:37:07 +00:00
Roger Dingledine 1692d01b04 include our own timegm() impl, since it's not portable
svn:r635
2003-10-20 20:19:59 +00:00
Roger Dingledine 252da83412 a skeletal print_usage() function
svn:r634
2003-10-20 01:19:54 +00:00
Roger Dingledine 98ad637703 add an Address line to the sample server rc file
svn:r633
2003-10-19 05:50:52 +00:00
Roger Dingledine 0bb0a22f00 move to 0.0.2pre13
svn:r631
2003-10-19 05:45:22 +00:00
Roger Dingledine bfa8d8886c warn, not err
svn:r630
2003-10-19 01:15:36 +00:00
Roger Dingledine d393b01405 put small buffers back in place
svn:r629
2003-10-19 01:10:38 +00:00
Nick Mathewson 7996827e00 Example code to get nickname from cert
svn:r628
2003-10-19 00:47:03 +00:00
Nick Mathewson da3c1f0287 Code to get nicknames from peer certs
svn:r627
2003-10-19 00:46:51 +00:00
Roger Dingledine 6c7b031c9d let tls tolerate reallocing the buf
and also remember the params for ssl_write if it returns wantread.


svn:r626
2003-10-19 00:39:48 +00:00
Roger Dingledine a95f1a895e first steps toward a WANTWRITE SSL_write tls bug fix
how exactly the same do the arguments need to be? :(


svn:r625
2003-10-18 08:00:19 +00:00
Roger Dingledine b2ce2eb7b9 another minor memory leak
make dnsconn->address reflect what it's currently resolving


svn:r624
2003-10-18 07:09:09 +00:00
Roger Dingledine 862cb17105 start to track down the 'peer has invalid cert' bug
svn:r623
2003-10-18 06:48:46 +00:00
Roger Dingledine 8a810d38c7 no more memory leaks
when you run it under normal operation
for as many as three minutes


svn:r622
2003-10-18 04:18:26 +00:00
Roger Dingledine 4905165081 fix two more memory problems
one remains :)


svn:r621
2003-10-18 03:23:26 +00:00
Roger Dingledine 12842c22a1 clean up memory leaks, confusions
still one memory leak remaining here.


svn:r620
2003-10-18 02:18:22 +00:00
Roger Dingledine 403bef7c81 we've been stomping on memory while reading config
doesn't seem to have bitten us yet, but let's fix that :)


svn:r619
2003-10-18 01:28:39 +00:00
Roger Dingledine 85811499a9 log to stdout while parsing config,
otherwise we log to nothing and give no feedback!


svn:r617
2003-10-18 00:13:08 +00:00
Roger Dingledine 99cf41464f rewrite close_logs so it could possibly work
remove deadbeef memory-clobber testing (for now)


svn:r616
2003-10-18 00:07:58 +00:00
Roger Dingledine ce965f289b put a blank line in the directory, before the first router
this makes it easier to read (at least for me)


svn:r613
2003-10-17 10:24:58 +00:00
Roger Dingledine 6e07201a02 try to make cvs more stable for now. need to test this more in a bit.
svn:r612
2003-10-17 10:00:01 +00:00
Roger Dingledine 7ef6d7e029 reload the fingerprints file on HUP
svn:r611
2003-10-17 05:23:48 +00:00
Roger Dingledine 35a856a1e1 catch misconfigured machines that return hostname as fqdn
svn:r610
2003-10-17 04:48:20 +00:00
Nick Mathewson 729a957302 Log TLS errors even harder
svn:r604
2003-10-15 23:50:25 +00:00
Nick Mathewson 9fb7e99e85 Add more logging on some ssl errors.
svn:r603
2003-10-15 23:42:44 +00:00
Roger Dingledine 97fd8d20eb closing stdout *should* be safe (we'll see)
svn:r601
2003-10-15 19:27:51 +00:00
Nick Mathewson dea4cb2ebf Report delivery cell fullness correctly
svn:r600
2003-10-15 19:25:28 +00:00
Roger Dingledine bb9f1f9a8b change buf->buf to buf->mem
maybe this will mean fewer dumb errors


svn:r599
2003-10-15 19:17:21 +00:00
Nick Mathewson ba009ad2be fix bug with overzealous shrinking; add more comments.
svn:r597
2003-10-15 19:07:07 +00:00
Roger Dingledine fe75267591 clean up logging, allow user to specify log files
If DebugLogFile is specified, log to it at -l debug
If LogFile is specified, log to it at the -l from the commandline
  (default info)
If no LogFile *and* not a Daemon, then log to stdout.
Make conn->s = -1 by default (this might break things)
When kill -USR1, prefer to log at INFO, but make sure they always see it.


svn:r596
2003-10-15 18:50:16 +00:00
Nick Mathewson d003612bb5 Build without warnings on OS X.
svn:r595
2003-10-15 18:48:48 +00:00
Nick Mathewson ff0461419e Make add_file_log return 0 on success.
svn:r594
2003-10-15 18:38:38 +00:00