aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
Commit message (Collapse)AuthorAge
...
* | Fixed of-by-one error in tor_inet_ntopAnders Sundman2011-11-11
| | | | | | | | The of-by-one error could lead to 1 byte buffer over runs IPv6 for addresses.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-10-03
|\|
| * Looks like Windows version 6.2 will be Windows 8Sebastian Hahn2011-10-01
| | | | | | | | Thanks to funkstar for the report
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-07-01
|\|
| * Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-07-01
| |\
| | * Fix insanely large stack_allocation in log_credential_statusNick Mathewson2011-07-01
| | | | | | | | | | | | | | | | | | | | | I'm not one to insist on C's miserly stack limits, but allocating a 256K array on the stack is too much even for me. Bugfix on 0.2.1.7-alpha. Found by coverity. Fixes CID # 450.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-22
|\| |
| * | Fix minor comment issuesRobert Ransom2011-06-22
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-30
|\| | | | | | | | | | | | | | | | | Conflicts: src/common/compat.c src/or/main.c
| * | Use a 64-bit type to hold sockets on win64.Nick Mathewson2011-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On win64, sockets are of type UINT_PTR; on win32 they're u_int; elsewhere they're int. The correct windows way to check a socket for being set is to compare it with INVALID_SOCKET; elsewhere you see if it is negative. On Libevent 2, all callbacks take sockets as evutil_socket_t; we've been passing them int. This patch should fix compilation and correctness when built for 64-bit windows. Fixes bug 3270.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-15
|\| |
| * | Fix up some comment issues spotted by rransomNick Mathewson2011-05-15
| | |
| * | Add a function to pull off the final component of a pathNick Mathewson2011-05-15
| | |
* | | Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson2011-05-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
| * | Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson2011-05-11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
| | * Hand-conversion and audit phase of memcmp transitionNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
| | * Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-05
|\| |
| * | Fix up some check-spaces issuesNick Mathewson2011-05-05
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-28
|\| |
| * | Correct the logic from f14754fbd for tor_gmtime_rJohn Brooks2011-04-28
| | |
| * | Detect and handle NULL returns from (gm/local)time_rNick Mathewson2011-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions can return NULL for otherwise-valid values of time_t. Notably, the glibc gmtime manpage says it can return NULL if the year if greater than INT_MAX, and the windows MSDN gmtime page says it can return NULL for negative time_t values. Also, our formatting code is not guaranteed to correctly handle years after 9999 CE. This patch tries to correct this by detecting NULL values from gmtime/localtime_r, and trying to clip them to a reasonable end of the scale. If they are in the middle of the scale, we call it a downright error. Arguably, it's a bug to get out-of-bounds dates like this to begin with. But we've had bugs of this kind in the past, and warning when we see a bug is much kinder than doing a NULL-pointer dereference. Boboper found this one too.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-03-16
|\| | | | | | | | | | | | | | | | | | | | Trivial Conflicts in src/common/crypto.c src/or/main.h src/or/or.h
| * | Doxygen documentation for about 100 things that didn't have anyNick Mathewson2011-03-16
| | | | | | | | | | | | About 860 doxygen-less things remain in 0.2.2
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-02-22
|\| |
| * | Windows has EACCES, not EACCESSSebastian Hahn2011-02-11
| | | | | | | | | | | | | | | | | | Once again spotted by mobmix Also add a changes file for the fix
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-02-08
|\| |
| * | Locking failures on windows are indicated by EACCESSebastian Hahn2011-02-08
| | | | | | | | | | | | | | | | | | Patch our implementation of tor_lockfile_lock() to handle this case correctly. Also add a note that blocking behaviour differs from windows to *nix. Fixes bug 2504, issue pointed out by mobmix.
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\| |
| * | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
| |\| | | | | | | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| | * Bump copyright statements to 2011Nick Mathewson2011-01-03
| | |
* | | Merge branch 'maint-0.2.2'Roger Dingledine2010-12-19
|\| |
| * | Merge remote branch fix_security_bug_021 into fix_security_bug_022Nick Mathewson2010-12-15
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/common/memarea.c src/or/or.h src/or/rendclient.c
| | * Make payloads into uint8_t.Nick Mathewson2010-12-15
| | | | | | | | | | | | This will avoid some signed/unsigned assignment-related bugs.
| | * Have all of our allocation functions and a few others check for underflowNick Mathewson2010-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's all too easy in C to convert an unsigned value to a signed one, which will (on all modern computers) give you a huge signed value. If you have a size_t value of size greater than SSIZE_T_MAX, that is way likelier to be an underflow than it is to be an actual request for more than 2gb of memory in one go. (There's nothing in Tor that should be trying to allocate >2gb chunks.)
* | | Merge remote branch 'sjmurdoch/cloexec'Nick Mathewson2010-12-01
|\ \ \
| * | | Check that FD_CLOEXEC is set before using itSteven Murdoch2010-12-01
| | | | | | | | | | | | | | | | | | | | I don't know if any platforms we care about don't have FD_CLOEXEC, but this is what we do elsewhere
| * | | Don't both open the socket with SOCK_CLOEXEC and set FD_CLOEXECSteven Murdoch2010-11-21
| | | |
| * | | Fix compile error on MacOS X (and other platforms without O_CLOEXEC)Steven Murdoch2010-11-20
| | | |
| * | | Do cloexec on socketpairs and stdio filesNick Mathewson2010-11-20
| | | |
| * | | Initial work to set CLOEXEC on all possible fdsNick Mathewson2010-11-20
| | | | | | | | | | | | | | | | Still to go: some pipes, all stdio files.
* | | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2010-11-30
|\ \ \ \ | |/ / / |/| / / | |/ / | | | Conflicts: src/or/relay.c
| * | Add wrappers function for libc random()Nick Mathewson2010-11-29
| | | | | | | | | | | | On windows, it's called something different.
* | | Autodetect the number of CPUs when possible if NumCPUs==0Nick Mathewson2010-09-28
|/ / | | | | | | | | | | | | This is needed for IOCP, since telling the IOCP backend about all your CPUs is a good idea. It'll also come in handy with asn's multithreaded crypto stuff, and for people who run servers without reading the manual.
* | Make the windows build succeed with or without -DUNICODE enabled.Nick Mathewson2010-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This should keep WinCE working (unicode always-on) and get Win98 working again (unicode never-on). There are two places where we explicitly use ASCII-only APIs, still: in ntmain.c and in the unit tests. This patch also fixes a bug in windoes tor_listdir that would cause the first file to be listed an arbitrary number of times that was also introduced with WinCE support. Should fix bug 1797.
* | Merge commit 'sebastian/mlockall'Nick Mathewson2010-08-03
|\ \
| * | Remove the request for current memlock limitsSebastian Hahn2010-02-28
| | | | | | | | | | | | | | | The getrlimit call didn't have any effect. Also make some logging less verbose on default log level, and refactor a bit.
* | | Rename log.h to torlog.hNick Mathewson2010-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should make us conflict less with system files named "log.h". Yes, we shouldn't have been conflicting with those anyway, but some people's compilers act very oddly. The actual change was done with one "git mv", by editing Makefile.am, and running find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
* | | Make pointer types correct in WinCE patchNick Mathewson2010-05-24
| | |
* | | moved wince related includes and defs to compat.h where possible, removed ↵valerino2010-05-24
| | | | | | | | | | | | unused/redundant wince includes