Nick Mathewson
d7f55dafe0
Properly zero-out addresses when setting them. Probably this was not hurting anything.
...
svn:r17749
2008-12-23 14:21:34 +00:00
Nick Mathewson
b4d387c28b
Make freelist_len in memarea.c static; document a few variables.
...
svn:r17741
2008-12-22 19:14:08 +00:00
Nick Mathewson
b68379b13b
Add DOCDOC entries for undocumented static and global variables.
...
svn:r17739
2008-12-22 19:00:05 +00:00
Nick Mathewson
1e5f457461
Fix most DOCDOCs remaining and/or added by redox.
...
svn:r17734
2008-12-22 17:53:04 +00:00
Nick Mathewson
1725c0c8a5
Add DOCDOC comments for all undocumented functions. Add missing *s to other comments so that they will get recognized as doxygen.
...
svn:r17729
2008-12-22 14:56:28 +00:00
Nick Mathewson
55348884b5
Fix all of the doxygen warnings not pertaining to missing documentation.
...
svn:r17727
2008-12-22 14:56:16 +00:00
Nick Mathewson
029be5ad02
Move in-addr.arpa parsing and generation into address.c, and simplify the code that does it elsewhere. Incidentally, this lets exit servers answer requests for ip6.arpa addresses.
...
svn:r17707
2008-12-19 18:52:00 +00:00
Nick Mathewson
efb863189c
Expose hex_decode_digit from util.c
...
svn:r17706
2008-12-19 18:51:52 +00:00
Nick Mathewson
bf80e2df3f
Replace calls to time(NULL) that occur on the order of once per read, one per write, or once per cell with calls to a function that looks at a cached value of time. This is tricksy to benchmark, since it will only help on systems where time() is a syscall and syscalls are relatively slow.
...
svn:r17690
2008-12-18 17:19:04 +00:00
Nick Mathewson
b6f89a647a
One log.c XXX021 was a misunderstanding. Also, clip log messages passed to syslog to their maximum length when there is a maximum.
...
svn:r17688
2008-12-18 17:18:06 +00:00
Nick Mathewson
122170c1d3
Downlgrade tweak, and answer lots of XXX021s. No actual code fixes in this patch.
...
svn:r17686
2008-12-18 16:11:24 +00:00
Nick Mathewson
6c6b0283cb
Ben confirms that the MUST in rfc2631 is only for compatibility with X9.42, and isn't actually a security thing.
...
svn:r17685
2008-12-18 16:11:16 +00:00
Nick Mathewson
8d5a9d762c
Log an error on win32 if directory listing fails.
...
svn:r17684
2008-12-18 16:11:12 +00:00
Nick Mathewson
9c3d17ebb5
Fix a small memory leak of around 32 bytes per TLS connection opened. Bugfix on 0.2.1.1-alpha.
...
svn:r17678
2008-12-18 15:00:09 +00:00
Nick Mathewson
cebdf93949
Fix bug 889: share deep-copied keys between threads to avoid races in reference counts. Bugfix on 0.1.0.1-rc.
...
svn:r17672
2008-12-18 05:28:27 +00:00
Nick Mathewson
6693f32530
Resolve many DOCDOCs.
...
svn:r17662
2008-12-17 22:58:20 +00:00
Nick Mathewson
f43bcdc063
Use ctags and a python script to find identifiers that are never used anywhere, and remove the ones that we really want gone.
...
svn:r17651
2008-12-17 17:20:42 +00:00
Nick Mathewson
98066d62bc
Lower sprintf buffer max to ~SSIZE_T_MAX from SIZE_T_CEILING, since we need to compare it to a signed int.
...
svn:r17600
2008-12-11 21:11:22 +00:00
Nick Mathewson
4277b0e926
Remove some cargo-cult gcc hacks around tor_assert and predict_unlikely; instead, use the standard convert-to-boolean hack of "svn st"
...
svn:r17597
2008-12-11 20:23:46 +00:00
Nick Mathewson
3be88b2c70
Change test_memeq macro to not leak memory. Addresses coverity CID 47.
...
svn:r17577
2008-12-11 06:17:54 +00:00
Nick Mathewson
d60d8976b9
Better error message when told to setuid to ourself.
...
svn:r17543
2008-12-09 23:26:12 +00:00
Nick Mathewson
07c8b2be21
Compile without warnings on mingw.
...
svn:r17522
2008-12-08 19:52:26 +00:00
Nick Mathewson
6fb06f334a
Try to fix windows mmap code.
...
svn:r17493
2008-12-05 19:36:35 +00:00
Nick Mathewson
7f793fa733
Simplify mmap object layout to avoid confusing static analysis tools, and us too.
...
svn:r17490
2008-12-05 02:17:41 +00:00
Nick Mathewson
2be5215181
Fix a hard-to-trigger memory leak in log_credential status. Found by Coverity scan. CID 349.
...
svn:r17484
2008-12-05 01:29:59 +00:00
Nick Mathewson
37bd9181f0
Do not use O_APPEND on fd-based operations that do not really want it; have them just lseek instead.
...
svn:r17460
2008-12-02 23:49:40 +00:00
Roger Dingledine
96a185d9b7
style cleanup
...
svn:r17457
2008-12-02 23:42:21 +00:00
Nick Mathewson
bd6b3072f9
Change logging code to use fds instead of stdio. Fixes bug 861, and probably makes logging slightly faster. Not a backport candidate: bug 861 is too obscure and harmless.
...
svn:r17456
2008-12-02 23:36:58 +00:00
Nick Mathewson
6221bdd294
Add two lseek wrappers to compat.[ch]: one to return current fd position, and one to move the fd to the end of the file.
...
svn:r17454
2008-12-02 23:26:04 +00:00
Nick Mathewson
60738daf85
Define socklen_t before using it in compat.h
...
svn:r17444
2008-12-02 18:54:47 +00:00
Nick Mathewson
191197eff7
Revert my older supposed gcc-4.4 warning workaround. GCC was not being needlessly prissy; it was hinting at the wrongly pure smartlist_bsearch_idx.
...
svn:r17396
2008-11-26 17:14:59 +00:00
Nick Mathewson
651a0a2fb5
Stop marking bsearch_idx as pure; it is not.
...
svn:r17393
2008-11-26 16:57:46 +00:00
Nick Mathewson
4cddcf8873
Cast uid_t and gid_t to unsigned before passing to printf %u.
...
svn:r17392
2008-11-26 16:13:12 +00:00
Nick Mathewson
bc597758dc
Use fcntl for file locking when flock() is not available.
...
svn:r17391
2008-11-26 16:10:56 +00:00
Nick Mathewson
07a08d933d
Resolve a warning under gcc 4.4 trunk.
...
svn:r17357
2008-11-22 02:19:14 +00:00
Nick Mathewson
bdc0aec00a
Update _log_global_min_severity after switch_logs_debug(), so that USR2 will work again. Bugfix on 0.1.2.8-beta. Spotted by Geoff Down.
...
svn:r17317
2008-11-17 19:58:51 +00:00
Nick Mathewson
a790a13705
define get_uint8 and set_uint8 macros to make code cleaner.
...
svn:r17261
2008-11-12 14:39:25 +00:00
Nick Mathewson
a95e0e7355
apply sebastian's fix for bug 859. Apparently on win32 one must lock at least one byte when locking, but locking a nonexistant byte is okay. )
...
svn:r17244
2008-11-11 15:29:40 +00:00
Nick Mathewson
6c50ab6e61
Document a couple of functions.
...
svn:r17239
2008-11-10 20:40:01 +00:00
Roger Dingledine
c62d5f6a5c
beg nick for some documentation on the locking functions
...
svn:r17233
2008-11-10 00:48:13 +00:00
Roger Dingledine
0554e87f58
better error message when you set User but start tor as non-root.
...
hopefully will address bug 857.
svn:r17232
2008-11-10 00:41:07 +00:00
Nick Mathewson
13e079f9ec
Log a little more when credential-switching fails.
...
svn:r17228
2008-11-09 16:54:54 +00:00
Roger Dingledine
b32e600d50
while we're cleaning code, get rid of some unreachable code at
...
the bottom of switch_id
svn:r17205
2008-11-07 04:35:41 +00:00
Roger Dingledine
14773f42a7
now that we drop privs more thoroughly, switch_id() is no longer
...
idempotent. so now we remember if we've succeeded, and if so we
don't even try.
svn:r17204
2008-11-07 04:34:47 +00:00
Roger Dingledine
7c65792500
remove more redundant code from r17200
...
svn:r17203
2008-11-07 04:11:03 +00:00
Nick Mathewson
1b98f45b3d
Developers should usually configure with --enable-gcc-warnings, and should regularly make check-spaces. Also, int fn() does not mean the same in C as it does in C++ or Java.
...
svn:r17201
2008-11-07 02:53:46 +00:00
Steven Murdoch
9d68ed08e9
Patch from Jacob Appelbaum and me to make User option more robust, properly set supplementary groups, deprecated the Group option, and log more information on credential switching
...
svn:r17200
2008-11-07 02:06:12 +00:00
Nick Mathewson
3ebd1ebeca
The chunk_size field in memarea_t was never actually set. Remove the whole thing.
...
svn:r17195
2008-11-05 20:34:22 +00:00
Nick Mathewson
35bef7fefd
make read_all and write_all return ssize_t.
...
svn:r17194
2008-11-05 19:29:17 +00:00
Nick Mathewson
b56d1545db
Fix freebsd 7 compile by adding malloc_np.h header. Fix bug 850.
...
svn:r17190
2008-11-05 15:56:53 +00:00
Nick Mathewson
3f84ed3d46
Add a new memcmpstart to use instead of strcmpstart when the thing we are comparing is not nul-terminated.
...
svn:r17187
2008-11-03 16:35:48 +00:00
Nick Mathewson
361086005c
Fix a possible negative shift in address comparison. May fix bug 845 and bug 811
...
svn:r17169
2008-10-29 13:29:54 +00:00
Nick Mathewson
0ab45fee73
Document some dmalloc stuff and some stupid C tricks.
...
svn:r17161
2008-10-27 16:30:52 +00:00
Jacob Appelbaum
7873d324df
This patch changes some of the code in util.c to refactor calls to
...
dmalloc_malloc, dmalloc_realloc and dmalloc_strdup. It only calls those
functions if we're using the magic USE_DMALLOC macro. If we're not doing
that, we call the normal malloc, realloc and strdup. This is my first
night at malloc disambiguation club, so I had to disambiguate. Also, first commit, I have my commit bit now. Huzzzah!!!
svn:r17157
2008-10-26 22:56:53 +00:00
Roger Dingledine
c7af43a624
Now NodeFamily and MyFamily config options allow spaces in
...
identity fingerprints, so it's easier to paste them in.
Suggested by Lucky Green.
svn:r17021
2008-10-01 03:41:33 +00:00
Roger Dingledine
982a22a121
fix typo
...
svn:r16949
2008-09-24 00:49:29 +00:00
Nick Mathewson
f28fc83ea5
More logging for mtbf/wfu calculations.
...
svn:r16941
2008-09-23 18:24:20 +00:00
Nick Mathewson
f95d7c189b
Refactor unit test macros and tor_free_all() logic a bit so as to make it easier to free memory on failing tests, in order to suppress scanner warnings and to make dmalloc() usable with tests.
...
svn:r16816
2008-09-09 20:43:31 +00:00
Nick Mathewson
6c432a5565
Replace the dummy-use var in SMARTLIST_FOREACH_END() with one that is less likely to confuse analysis tools into thinking we do use after free. Arguably, (void)x should count as use in suppressing unused variable warnings, but not in generating hey-you-used-a-variable warnings. Arguably, though, it shouldn't.
...
svn:r16815
2008-09-09 19:29:33 +00:00
Nick Mathewson
aacda9cd8e
We should not alter an addr_policy_t that has been canonicalized.
...
svn:r16802
2008-09-09 03:48:01 +00:00
Nick Mathewson
339f094056
Refactor some code and add some asserts based on scanner results.
...
svn:r16783
2008-09-05 21:19:53 +00:00
Nick Mathewson
a345506672
Add an assert to make tools happier.
...
svn:r16782
2008-09-05 20:59:09 +00:00
Nick Mathewson
4d94e061c7
Clean up some redundant stuff in crypto_dh_new().
...
svn:r16778
2008-09-05 20:18:22 +00:00
Nick Mathewson
8ea780632f
Make severity args to add_*_log() functions be const
...
svn:r16775
2008-09-05 19:52:44 +00:00
Nick Mathewson
c33dde4ac1
Fix mingw build with --enable-gcc-warnings set.
...
svn:r16759
2008-09-04 21:58:09 +00:00
Nick Mathewson
fa2f72ded7
An asterisk makes a difference sometimes. Fixes bug 809.
...
svn:r16758
2008-09-04 20:42:02 +00:00
Roger Dingledine
ed45a42f98
take out the crazy line from last night that made no sense. apparently
...
it does work for tas after all.
svn:r16724
2008-09-01 21:24:25 +00:00
Roger Dingledine
9f823f54d5
remove some redundant includes. i expect the first one to be a problem
...
for tas, but who knows.
svn:r16723
2008-09-01 21:16:07 +00:00
Nick Mathewson
f80ac31d74
Add a lockfile to the Tor data directory to avoid situations where two Tors start with the same datadir, or where a --list-fingerprints races with a server to create keys, or such.
...
svn:r16722
2008-09-01 20:06:26 +00:00
Roger Dingledine
04eded4a5c
take out a line that i think is extraneous. come on, what could
...
go wrong?
svn:r16714
2008-09-01 08:01:40 +00:00
Roger Dingledine
6942bd66ea
Fix compile on OpenBSD 4.4-current. Bugfix on 0.2.1.5-alpha.
...
Reported by Tas.
svn:r16713
2008-09-01 08:01:22 +00:00
Roger Dingledine
4eab76f074
remove a code path that should never happen (and if it did, we'd be
...
complaining about an errno set from some arbitrary previous problem).
svn:r16684
2008-08-29 09:06:18 +00:00
Roger Dingledine
c5fef3c57f
commit jake's patch to include strings with socks5 error numbers
...
svn:r16657
2008-08-25 21:02:22 +00:00
Nick Mathewson
88e6162649
r17848@tombo: nickm | 2008-08-22 12:10:11 -0400
...
Make definition of tor_mutex_t go into compat.h, so that it is possible to inline mutexes in critical objects. Add init/uninit functions for mutexes allocated inside other structs.
svn:r16623
2008-08-22 16:24:52 +00:00
Nick Mathewson
0711408c22
Adjust definition of SMARTLIST_FOREACH_END() to enforce matching variable.
...
svn:r16597
2008-08-19 15:33:03 +00:00
Nick Mathewson
22259a0877
The first of Karsten's proposal 121 patches: configure and maintain client authorization data. Tweaked a bit: see comments on or-dev.
...
svn:r16475
2008-08-08 14:36:11 +00:00
Nick Mathewson
f6879caa04
Try once again to make BSD compilation happy.
...
svn:r16474
2008-08-08 12:58:17 +00:00
Nick Mathewson
d9601c65e0
r17666@tombo: nickm | 2008-08-07 15:12:30 -0400
...
Make tor_addr_from_sockaddr also give away the port in a useful format
svn:r16458
2008-08-07 19:13:35 +00:00
Nick Mathewson
2905291af2
r17659@tombo: nickm | 2008-08-06 12:22:11 -0400
...
Fix bug 794: recover 3 bytes wasted per memory chunk. Fix from rovv.
svn:r16447
2008-08-06 16:22:25 +00:00
Nick Mathewson
645cbd690b
r17643@31-33-44: nickm | 2008-08-05 16:18:25 -0400
...
Oops. Remove code to set (nonportable) sin_len fields. Added it to try to fix a bug that turned out to be something else.
svn:r16436
2008-08-05 20:18:28 +00:00
Nick Mathewson
960a0f0a99
r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400
...
Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types. Most of the Tor wire formats using these new types are in, but the code to generate and use it is not. This is a big patch. Let me know what it breaks for you.
svn:r16435
2008-08-05 20:08:19 +00:00
Karsten Loesing
626fafe563
Make compiler with GCC warnings enabled happy.
...
svn:r16300
2008-07-31 10:33:02 +00:00
Nick Mathewson
f366d10a2f
r17435@tombo: nickm | 2008-07-30 08:50:54 -0400
...
Allow alternate form of SMARTLIST_FOREACH with paired BEGIN and END macros. This lets the compiler tell us which line an error has occurred on.
svn:r16256
2008-07-30 13:04:28 +00:00
Nick Mathewson
e5bc5f11b8
r17434@tombo: nickm | 2008-07-29 10:58:36 -0400
...
Refactor tor_addr_from_string: it didnt need most of parse_addr_mask_port_range, and its dependence on that latter function made it less flexible.
svn:r16255
2008-07-30 13:04:26 +00:00
Nick Mathewson
507b01357a
r17426@tombo: nickm | 2008-07-28 20:34:03 -0400
...
More test coverage for tor_addr_t; fix a couple of bugs.
svn:r16234
2008-07-29 00:34:50 +00:00
Nick Mathewson
056d97da0c
r17391@pc-10-8-1-079: nickm | 2008-07-25 17:11:17 +0200
...
Tor_addr_compare did a semantic comparison, such that ::1.2.3.4 and 1.2.3.4 were "equal". we sometimes need an exact comparison. Add a feature to do that.
svn:r16210
2008-07-25 15:11:21 +00:00
Nick Mathewson
9da0482007
r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200
...
Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much.
svn:r16208
2008-07-25 14:43:24 +00:00
Nick Mathewson
3ce6e2fba2
r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200
...
Make generic address manipulation functions work better. Switch address policy code to use tor_addr_t, so it can handle IPv6. That is a good place to start.
svn:r16178
2008-07-24 13:44:04 +00:00
Karsten Loesing
9231858ff5
Fix bug 763. When a hidden service is giving up on an introduction point candidate that was not included in the last published rendezvous descriptor, don't reschedule publication of the next descriptor.
...
svn:r15825
2008-07-10 21:02:01 +00:00
Nick Mathewson
cb7cc9e12d
r16882@tombo: nickm | 2008-07-10 14:31:25 -0400
...
Fix for session-related bug found by Geoff Goodell. backport candidate, once tested.
svn:r15821
2008-07-10 18:31:33 +00:00
Nick Mathewson
c5ec7a3677
Stop using __attribute__((nonnull)): It gets us occcasional warnings when we do something so foolish it can be detected without dataflow analysis, but it also eliminates some of our error checking code. Suggested by Peter Gutmann.
...
svn:r15803
2008-07-09 15:23:23 +00:00
Nick Mathewson
1a564901e4
Fix the rest of the GCC warnings on OpenBSD_malloc_linux.c
...
svn:r15698
2008-07-06 18:33:35 +00:00
Nick Mathewson
8bc2ab03f8
Remove spurious "netintet" check from configure.in
...
svn:r15672
2008-07-05 21:17:04 +00:00
Nick Mathewson
9d7a2d4eae
r16689@tombo: nickm | 2008-07-03 11:03:14 -0400
...
Fix for bug 742: do not use O_CREAT on 2-option version of open(). Especially do not use it on /dev/null. Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow).
svn:r15626
2008-07-03 15:04:16 +00:00
Nick Mathewson
3ec25c2410
r16587@tombo: nickm | 2008-06-28 00:13:40 -0400
...
fix for bug 704; found by sjmurdoch. Windows and recent openssl both want to define OCSP_RESPONSE; do not let them.
svn:r15533
2008-06-28 04:16:17 +00:00
Nick Mathewson
d4ed91c672
Set dynamic-locking callbacks in openssl. These can be more efficient when openssl uses them.
...
svn:r15222
2008-06-13 16:35:12 +00:00
Roger Dingledine
d395135e2f
fix a few typos, and give the bootstrap phase stuff a changelog entry.
...
svn:r15183
2008-06-13 04:26:05 +00:00
Nick Mathewson
22080354ed
r16217@tombo: nickm | 2008-06-12 21:13:09 -0400
...
Remove spurious debugging message.
svn:r15176
2008-06-13 01:13:12 +00:00
Nick Mathewson
617843988c
r16215@tombo: nickm | 2008-06-12 18:39:03 -0400
...
Implement code to manually force the OpenSSL client cipher list to match the one recommended in proposal 124, *even if* we do not know all those ciphers. This is a bit of a kludge, but it is at least decently well commented.
svn:r15173
2008-06-12 22:39:13 +00:00
Nick Mathewson
d0a4ad3a1c
r16127@tombo: nickm | 2008-06-10 14:03:01 -0400
...
Improved code for counting clients by country: support recording by number of directory status requests in addition to number of IPs seen.
svn:r15097
2008-06-10 18:08:56 +00:00