Commit Graph

3381 Commits

Author SHA1 Message Date
Nick Mathewson
b8e8910d60 Merge branch 'bug18686_025' into maint-0.2.8 2016-05-04 15:12:11 -04:00
Nick Mathewson
c7b9e0b8ed Report success when not terminating an already terminated process.
Also, document the actual behavior and return values of
tor_terminate_process.

Fixes bug18686; bugfix on 0.2.3.9-alpha.
2016-05-04 15:10:36 -04:00
Nick Mathewson
7babf33239 Merge remote-tracking branch 'public/bug18716_027' into maint-0.2.8 2016-04-12 13:02:02 -04:00
Nick Mathewson
39c057d45a memarea: Don't assume that sizeof(ulong) >= sizeof(void*).
Fixes bug 18716; bugfix on 0.2.1.1-alpha where memarea.c was
introduced.  Found by wbenny.
2016-04-07 11:10:14 -04:00
Nick Mathewson
967491f156 Only define NEW_THREAD_API when not building with LibreSSL. 2016-04-05 10:38:15 -04:00
Yawning Angel
5db21f8f81 OpenSSL 1.1.0-pre5-dev and later made BIO opaque.
Detect newer versions and fix our TLS code to use the new API.
2016-04-05 10:03:24 -04:00
Yawning Angel
6729d7328c OpenSSL 1.1.0-pre4 and later(?) have a new "thread API".
It appears that setting the various callbacks is no longer required, so
don't.
2016-04-05 10:03:24 -04:00
Nick Mathewson
4895d8288c Do not treat "DOCDOC" as doxygen. 2016-03-26 10:11:45 -04:00
Nick Mathewson
cc90b57b04 add a little documentation to memarea. (I have been testing a tool.) 2016-03-26 10:09:19 -04:00
Nick Mathewson
c0568a89d9 Whitespace fixes 2016-03-26 09:54:31 -04:00
Nick Mathewson
dd572dac34 Fix all doxygen warnings (other than missing docs) 2016-03-26 09:53:12 -04:00
Nick Mathewson
4bb44f2c15 Only check in-boundsness of seconds when time_t is smaller than i64
Otherwise coverity complains that we're checking an whether an int64 is
less than INT64_MIN, which of course it isn't.

Fixes CID 1357176. Not in any released Tor.
2016-03-25 16:46:02 -04:00
Nick Mathewson
6256c61d95 Merge branch 'timegm_overflow_squashed' 2016-03-24 10:18:00 -04:00
teor (Tim Wilson-Brown)
e71e8e005a Avoid overflow in tor_timegm on 32 bit platforms due to year 2038 2016-03-24 10:17:48 -04:00
Nick Mathewson
7123e9706e Repair build when no sandbox support is enabled. 2016-03-22 13:18:18 -04:00
Nick Mathewson
ca8423a703 Merge remote-tracking branch 'public/bug18253' 2016-03-22 10:08:50 -04:00
Nick Mathewson
a17537a238 Fix an fd leak in check_private_dir().
The fd would leak when the User wasn't recogniezed by
getpwnam(). Since we'd then go on to exit, this wasn't a terribad
leak, but it's still not as nice as no leak at all.

CID 1355640; bugfix on no released Tor.
2016-03-22 08:29:51 -04:00
Nick Mathewson
b48f8a8114 Fix whitespace. 2016-03-15 09:21:29 -04:00
Nick Mathewson
c9899ee640 Merge remote-tracking branch 'weasel/bug18458' 2016-03-15 09:18:24 -04:00
Nick Mathewson
4b02af452d Merge branch 'bug15221_027' 2016-03-14 14:10:47 -04:00
Nick Mathewson
dd7c999617 Make unix sockets work with the linux seccomp2 sandbox again
I didn't want to grant blanket permissions for chmod() and chown(),
so here's what I had to do:
   * Grant open() on all parent directories of a unix socket
   * Write code to allow chmod() and chown() on a given file only.
   * Grant chmod() and chown() on the unix socket.
2016-03-14 14:07:02 -04:00
Nick Mathewson
725e0c76e3 Permit setrlimit, prlimit, prlimit64 calls.
We call setrlimit under some circumstances, and it can call prlimit
and prlimit64 under the hood.

Fixes bug 15221.
2016-03-14 13:21:16 -04:00
Nick Mathewson
36ad65a7d1 When using open() to make sure we created a dir, close the fd afterwards
Found by coverity. Not in any released Tor. Fixes CID 1355640.

Also, don't check for fd correctness with assert(fd).  You need to
assert (fd >= 0).
2016-03-14 13:03:44 -04:00
teor (Tim Wilson-Brown)
9f98e6535a Correctly duplicate addresses in get_interface_address6_list 2016-03-04 18:42:27 +01:00
teor (Tim Wilson-Brown)
2627299ef0 Avoid freeing an uninitialised pointer in get_interface_addresses_ioctl 2016-03-04 18:41:49 +01:00
Peter Palfrader
1ef7df551d First RelaxDirModeCheck implementation 2016-03-01 17:08:14 +01:00
Nick Mathewson
9fc472e1a8 clean/extend some module docs, including fix from #18403 2016-02-28 17:57:47 +01:00
Nick Mathewson
57699de005 Update the copyright year. 2016-02-27 18:48:19 +01:00
Nick Mathewson
f4864d37ec It appears I added an empty file by mistake. 2016-02-27 18:25:51 +01:00
Nick Mathewson
23f8c9b32f Add a brief file-level description for everything in src/common 2016-02-27 18:19:57 +01:00
Nick Mathewson
d5cbc21ad1 Fix an unused-variable warning 2016-02-27 10:20:15 +01:00
Nick Mathewson
0a276947ba Merge branch 'bug18392' 2016-02-27 10:17:51 +01:00
Nick Mathewson
7255b1121d Fix check_private_dir() to work on Windows again.
On windows, you cannot open() a directory.  So for Windows we should
just take our previous stat-based approach.

Closes bug 18392; bug not in any released Tor.
2016-02-25 13:34:12 -05:00
Nick Mathewson
7a782820e9 Make the sandbox work again with chutney.
Previously, we had a problem due to the check_private_dir() rewrite.

Bug not in any released Tor.
2016-02-24 16:01:24 -05:00
Nick Mathewson
73c433a48a Remove the freelist from memarea.c
This is in accordance with our usual policy against freelists,
now that working allocators are everywhere.

It should also make memarea.c's coverage higher.

I also doubt that this code ever helped performance.
2016-02-24 14:32:09 -05:00
Nick Mathewson
a7f303a481 Merge branch 'maint-0.2.7' 2016-02-23 14:05:54 -05:00
Nick Mathewson
67e5d49d8a Make clang asan work with FORTIFIED_SOURCE again.
Short version: clang asan hates the glibc strcmp macro in
bits/string2.h if you are passing it a constant string argument of
length two or less.  (I could be off by one here, but that's the
basic idea.)

Closes issue 14821.
2016-02-23 14:05:34 -05:00
Nick Mathewson
48c1c028ca Merge branch 'bug18296_squashed' 2016-02-23 07:32:18 -05:00
Nick Mathewson
21f72990db Simple fix for integer overflow in smartlist_heapify. 2016-02-23 07:31:58 -05:00
Nick Mathewson
882e0fbd76 Merge branch 'bug17795' 2016-02-23 07:25:12 -05:00
Nick Mathewson
e202f3a1ca Fix an erroneous renaming
Did you know that crypto_digest_all is a substring of
crypto_digest_alloc_bytes()?  Hence the mysterious emergence of
"crypto_common_digestsoc_bytes".

Next time I should use the \b assertion in my regexen.

Spotted by Mike.
2016-02-23 07:22:53 -05:00
Andrea Shepard
cda2381789 Appease make check-spaces 2016-02-23 05:07:29 +00:00
cypherpunks
1e9950847c Define O_NOFOLLOW on platforms that do not have it
Fixes #18339
2016-02-22 15:28:24 -05:00
Nick Mathewson
5cd6c577df Merge branch 'bug17852_revised' 2016-02-16 11:34:06 -05:00
Jeremy
f48c607fd9 Harden check_private_dir() to remove any potential race.
Remove any potential race between stat() and chmod().
Replace stat() with fstat().
Replace chmod() with fchmod()
2016-02-16 11:21:46 -05:00
Jeremy
4e19133dcc src/common/util.c:expand_filename() - Perhaps use GetFullPathName() as a form of input validation on the filename argument. 2016-02-16 11:21:45 -05:00
Nick Mathewson
fed8c5199a Merge branch 'check_log_mutex_uncherrypicked' 2016-02-11 13:41:31 -05:00
Nick Mathewson
7788ee43e5 Merge branch 'maint-0.2.7' 2016-02-11 13:04:43 -05:00
Nick Mathewson
be6174f8f6 Merge branch 'maint-0.2.6' into maint-0.2.7 2016-02-11 13:01:46 -05:00
Nick Mathewson
740421af19 Merge branch 'maint-0.2.5' into maint-0.2.6 2016-02-11 13:00:25 -05:00