summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2017-09-15Split some long #if lines to make the #endif annotator happyNick Mathewson
2017-09-15Merge branch 'bug23487_029'Nick Mathewson
2017-09-15Use different variable names for pw_uid usagesNick Mathewson
Catalyst points out that using pw_uid for two different purposes here is likely to be confusing.
2017-09-15Merge remote-tracking branch 'dgoulet/ticket12541_032_02'Nick Mathewson
2017-09-15sched: Add sandbox support for KISTDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15Explain the restrictions on divisor in round*_to_next_multiple_ofteor
Closes 23528.
2017-09-12Log correctly on owner/user mismatch.Nick Mathewson
Found with clang's scan-build while looking at dead assignments. Fixes bug 23487; bugfix on 1135405c8c6ea31 in 0.2.9.1-alpha
2017-09-12One more implicit fallthrough warning to fix on GCC 7Nick Mathewson
2017-09-11Fix mixed-sign comparison warning in fix for 22797.Nick Mathewson
2017-09-11Merge branch 'teor-bug22797-025' into maint-0.2.9Nick Mathewson
2017-09-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-11Extract the important parts of the run-pending-timers function.Nick Mathewson
Our unit tests will need this, so that they can simulate advancing time without getting libevent involved.
2017-09-08Merge branch 'ticket20119'Nick Mathewson
2017-09-07Add a module comment to util_bug.hNick Mathewson
Closes ticket 22824.
2017-09-06Better error on failure to load seccomp2 sandboxNick Mathewson
There are two reasons this is likeliest to happen -- no kernel support, and some bug in Tor. We'll ask people to check the former before they report. Closes 23090.
2017-09-06Exit when we can't write to a configured pid fileNick Mathewson
This is probably what the user wants, according to 20119.
2017-09-05Make preferred_chunk_size nonstatic, and add a prefix to itNick Mathewson
2017-09-05Refactor buffer APIs to put a buf_t first.Nick Mathewson
By convention, a function that frobs a foo_t should be called foo_frob, and it should have a foo_t * as its first argument. But for many of the buf_t functions, the buf_t was the final argument, which is silly.
2017-09-05Repair wide lines from previous commit.Nick Mathewson
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
2017-09-05Move buffers.c and buffers_tls.c into src/commonNick Mathewson
These are no longer tor-specific, so they can be part of the infrastructure.
2017-08-28Merge branch 'bug22802_squashed'Nick Mathewson
2017-08-28Don't fall back to _atoi64Nick Mathewson
We only did this on windows when building with MSVC 6 and earlier, which is now considered a screamingly bad idea.
2017-08-28Don't use "0" as a "base" argument to tor_parse_*().Nick Mathewson
Telling these functions to autodetect the numeric base has lead to trouble in the past. Fixes bug 22469. Bugfix on 0.2.2.various.
2017-08-25Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-24Fix a needless line-continuation in aes.cNick Mathewson
coccinelle was getting confused
2017-08-24Apply test-operator-cleanup to src/common too.Nick Mathewson
2017-08-24Merge branch 'feature22976_squashed'Nick Mathewson
2017-08-11Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-09Treat a bad tor_spawn_background() as a BUG().Nick Mathewson
The contract is that, if may_spawn_background_process() is 0, you're not even allowed to try to spawn a process.
2017-08-09Add a 'NoExec' option that causes tor_spawn_background() to failNick Mathewson
Core of an implementation for 22976.
2017-08-09Remove the #if 0ed code that was supposed to let the sandbox allow execNick Mathewson
2017-08-09Make sure we always wind up checking i2d_*'s output.Nick Mathewson
The biggest offender here was sometimes not checking the output of crypto_pk_get_digest. Fixes bug 19418. Reported by Guido Vranken.
2017-08-08Use a single free-and-exit strategy in config_process_include.Nick Mathewson
This avoids a double-free when a pointer already freed with tor_free(config_line) is freed again in the cleanup-and-exit code. Fixes bug 23155.
2017-08-08Remove a needless memwipe.Nick Mathewson
The interior of ctx here is already wiped by crypto_digest_free(). This memwipe call only wiped the pointer itself, which isn't sensitive.
2017-08-08Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-08Remove some LCOV_EXCL stuff that I think may be testable after all.Nick Mathewson
This is partial revert on 22286. Also, tweak some log messages to be distinct.
2017-08-08Merge remote-tracking branch 'ahf/bugs/22286' into maint-0.3.1Nick Mathewson
2017-08-07fix typo in commentRoger Dingledine
2017-08-04Tweak usage of get_current_working_dir() for tor_malloc() paranoia.Nick Mathewson
We assume that tor_free() is not required to be compatible with the platform malloc(), so we need to use a strdup here.
2017-08-04Refactor retrieving the current working directorycypherpunks
The GNU C Library (glibc) offers an function which allocates the necessary memory automatically [0]. When it is available, we use that. Otherwise we depend upon the `getcwd` function which requires a preallocated buffer (and its size). This function was used incorrectly by depending on the initial buffer size being big enough and otherwise failing to return the current working directory. The proper way of getting the current working directory requires a loop which doubles the buffer size if `getcwd` requires it. This code was copied from [1] with modifications to fit the context. [0] https://www.gnu.org/software/hurd/hurd/porting/guidelines.html [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html
2017-08-03Switch to offsetof()Neel Chauhan
2017-07-28Turn base < 0 into a BUG() in our long-parse functions.Nick Mathewson
2017-07-28Coverity deadcode shenanigans on BUG() macro.Nick Mathewson
We don't actually want Coverity to complain when a BUG() check can never fail, since such checks can prevent us from introducing bugs later on. Closes ticket 23054. Closes CID 1415720, 1415724.
2017-07-27Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-27Try to work around a compile warning in workqueue.cNick Mathewson
2017-07-27Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-27Merge branch 'multi-priority_squashed' into maint-0.3.1Nick Mathewson
2017-07-27Note that threadpool_queue_work...() can't actually return NULLNick Mathewson