aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
Commit message (Collapse)AuthorAge
* Thread support is now requiredNick Mathewson2014-06-20
| | | | | | | | | | | Long ago we supported systems where there was no support for threads, or where the threading library was broken. We shouldn't have do that any more: on every OS that matters, threads exist, and the OS supports running threads across multiple CPUs. This resolves tickets 9495 and 12439. It's a prerequisite to making our workqueue code work better, since sensible workqueue implementations don't split across multiple processes.
* Remove code for Windows CE supportNick Mathewson2014-06-20
| | | | | | | As far as I know, nobody has used this in ages. It would be a pretty big surprise if it had worked. Closes ticket 11446.
* Merge branch 'bug8746_v2_squashed'Nick Mathewson2014-06-14
|\ | | | | | | | | Conflicts: src/common/include.am
| * New testing-only tor_sleep_msec functionNick Mathewson2014-06-14
| | | | | | | | | | In the unit tests I want to loop with a delay, but I want less than a 1 second delay. This, sadly, requires compatibility code.
* | whitespace fix, moreNick Mathewson2014-05-14
| |
* | Improved comments on bug11946 fixNick Mathewson2014-05-14
| |
* | Use tor_getpw{nam,uid} wrappers to fix bug 11946Nick Mathewson2014-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When running with User set, we frequently try to look up our information in the user database (e.g., /etc/passwd). The seccomp2 sandbox setup doesn't let us open /etc/passwd, and probably shouldn't. To fix this, we have a pair of wrappers for getpwnam and getpwuid. When a real call to getpwnam or getpwuid fails, they fall back to a cached value, if the uid/gid matches. (Granting access to /etc/passwd isn't possible with the way we handle opening files through the sandbox. It's not desirable either.)
* | Add a pair of wrapper functions: tor_getpwnam() and tor_getpwuid()Nick Mathewson2014-05-14
| | | | | | | | | | We'll use these to deal with being unable to access the user DB after we install the sandbox, to fix bug 11946.
* | Return success when get_total_system_memory() succeeds.Nick Mathewson2014-05-08
| | | | | | | | Fixes bug 11805; bugfix on 0.2.5.4-alpha.
* | Merge remote-tracking branch 'public/bug4345a_024'Nick Mathewson2014-05-01
|\ \ | |/ |/|
| * More hacking around spawn_func issuesNick Mathewson2014-02-07
| | | | | | | | | | | | | | | | | | This time, we use a pthread_attr to make sure that if pthread_create succeeds, the thread is successfully detached. This probably isn't the big thing going on with 4345, since it'd be a bit weird for pthread_detach to be failing. But it's worth getting it right.
* | Merge branch 'scanbuild_fixes'Nick Mathewson2014-04-25
|\ \
| * | scan-build: avoid undef behaior in tor_inet_ptonNick Mathewson2014-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we had an address of the form "1.2.3.4" and we tried to pass it to tor_inet_pton with AF_INET6, it was possible for our 'eow' pointer to briefly move backwards to the point before the start of the string, before we moved it right back to the start of the string. C doesn't allow that, and though we haven't yet hit a compiler that decided to nuke us in response, it's best to fix. So, be more explicit about requiring there to be a : before any IPv4 address part of the IPv6 address. We would have rejected addresses without a : for not being IPv6 later on anyway.
* | | Merge branch 'bug11396_v2_squashed'Nick Mathewson2014-04-24
|\ \ \ | |/ / |/| | | | | | | | Conflicts: src/or/main.c
| * | get_total_system_memory(): see how much RAM we haveNick Mathewson2014-04-24
| | |
* | | Make sure everything using an interned string is preceded by a logNick Mathewson2014-04-16
| | | | | | | | | | | | | | | (It's nice to know what we were about to rename before we died from renaming it.)
* | | Add 'rename' to the sandboxed syscallsNick Mathewson2014-04-16
| | | | | | | | | | | | | | | | | | (If we don't restrict rename, there's not much point in restricting open, since an attacker could always use rename to make us open whatever they want.)
* | | Merge remote-tracking branch 'public/bug10363_024_squashed'Nick Mathewson2014-04-07
|\ \ \ | |/ / |/| |
| * | Another 10363 instance: this one in tor_memmem fallback codeNick Mathewson2014-04-07
| |/
* | Handle tor_munmap_file(NULL) consistentlyNick Mathewson2014-03-31
| |
* | Eliminate lseek() with unchecked return in tor_mmap_file()Andrea Shepard2014-03-31
| |
* | Add return value and assert for null parameter to tor_munmap_file()Andrea Shepard2014-03-31
| |
* | Merge remote-tracking branch 'ctoader/gsoc-cap-stage2'Nick Mathewson2013-09-13
|\ \ | | | | | | | | | | | | Conflicts: src/common/sandbox.c
| * | added comments for sandbox.hCristian Toader2013-08-15
| | |
| * | Changes as suggested by nickmCristian Toader2013-07-29
| | | | | | | | | | | | | | | - char* to const char* and name refactoring - workaround for accept4 syscall
| * | added experimental support for open syscall path paramCristian Toader2013-07-23
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-09-03
|\ \ \ | | |/ | |/|
| * | Avoid a double-close on one failing case of the socketpair replacement codeNick Mathewson2013-09-03
| | | | | | | | | | | | | | | Fix for bug 9400, spotted by coverity. Bug introduced in revision 2cb4f7a4 (subversion revision r389).
| * | Use SOCKET_OK/TOR_INVALID_SOCKET in socketpair replacement codeNick Mathewson2013-08-06
| |/
* | Fixed "unused parameter cloexec" warnings on windowsNick Mathewson2013-08-02
| |
* | Split the socketpair replacement code into its own function for testingNick Mathewson2013-08-02
| |
* | Actually use the cloexec argument in the !defined(SOCK_CLOEXEC) caseNick Mathewson2013-08-02
| |
* | Prepare patch for ticket 5129 for merging.Peter Retzlaff2013-08-02
| | | | | | | | | | | | - Preserve old eventdns code. - Add function to close sockets cross-platform, without accounting. - Add changes/ file.
* | Fix two pre-coffee typosPeter Palfrader2013-07-15
| |
* | Document get_parent_directory morePeter Palfrader2013-07-15
|/
* Define SEEK_SET for platforms that lack it.Nick Mathewson2013-06-13
|
* If we write the annotation but not the microdescriptor, rewind.Nick Mathewson2013-06-13
| | | | | This fixes bug 9047 (and some parts of 9031, 8922, 8883 that weren't fixed in 8822). Bugfix on 0.2.2.6-alpha.
* Revert "Use the FILE_SHARE_DELETE flag for CreateFile on a mapping"Nick Mathewson2013-06-12
| | | | | | | This reverts commit 884a0e269c382f9e927d8c8b1ef4ef9d2d48379d. I'm reverting this because it doesn't actually make the problem go away. It appears that instead we need to do unmap-then-replace.
* Merge remote-tracking branch 'public/bug2077_share_delete' into maint-0.2.4Nick Mathewson2013-06-12
|\
| * Use the FILE_SHARE_DELETE flag for CreateFile on a mappingNick Mathewson2013-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A comment by rransom on #8795 taken together with a comment by doorss recorded on #2077 suggest that *every* attempt to replace the md cache will fail on Vista/Win7 if we don't have the FILE_SHARE_DELETE flag passed to CreateFile, and if we try to replace the file ourselves before unmapping it. I'm adding the FILE_SHARE_DELETE, since that's this simplest fix. Broken indexers (the favored #2077 hypothesis) could still cause trouble here, but at least this patch should make us stop stepping on our own feet. Likely fix for #2077 and its numerous duplicates. Bugfix on 0.2.2.6-alpha, which first had a microdescriptor cache that would get replaced before remapping it.
* | Merge remote-tracking branch 'public/bug8002' into maint-0.2.4Nick Mathewson2013-03-19
|\ \
| * | Check for CPUs more accurartely when ONLN != CONF.Nick Mathewson2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways to use sysconf to ask about the number of CPUs. When we're on a VM, we would sometimes get it wrong by asking for the number of total CPUs (say, 64) when we should have been asking for the number of CPUs online (say, 1 or 2). Fix for bug 8002.
* | | Fix another case of bug 8206; patch from flupzorNick Mathewson2013-03-18
| | |
* | | Check return values from fcntl and setsockoptNick Mathewson2013-03-18
|/ / | | | | | | (Based on a patch from flupzor; bug #8206)
* | Fix numerous problems with Tor's weak RNG.Nick Mathewson2013-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need a weak RNG in a couple of places where the strong RNG is both needless and too slow. We had been using the weak RNG from our platform's libc implementation, but that was problematic (because many platforms have exceptionally horrible weak RNGs -- like, ones that only return values between 0 and SHORT_MAX) and because we were using it in a way that was wrong for LCG-based weak RNGs. (We were counting on the low bits of the LCG output to be as random as the high ones, which isn't true.) This patch adds a separate type for a weak RNG, adds an LCG implementation for it, and uses that exclusively where we had been using the platform weak RNG.
* | Rename *_isin to *_containsNick Mathewson2013-01-16
| | | | | | | | | | | | | | | | | | | | | | This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
* | Update the copyright date to 201.Nick Mathewson2013-01-16
| |
* | Merge branch 'win64-7260'Nick Mathewson2012-12-07
|\ \ | | | | | | | | | | | | Conflicts: src/or/dns.c
| * | Remove an unused variable; part of mingw64 patch from yayoooNick Mathewson2012-11-02
| | |
| * | Compile (with warnings) with mingw64Nick Mathewson2012-11-02
| | | | | | | | | | | | Patch from yayooo for bug 7260, forward-ported to 0.2.4.