aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
AgeCommit message (Collapse)Author
2012-01-04Disallow disabling DisableDebuggerAttachment on runnning TorSebastian Hahn
Also, have tor_disable_debugger_attach() return a tristate of success/failure/don't-know-how , and only log appropriately.
2011-12-30Fix a check-spaces violation in compat.cSebastian Hahn
Also fix a comment typo
2011-12-22Prepend cwd for relative config file paths.Kamran Riaz Khan
Modifies filenames which do not start with '/' or '.' on non-Windows platforms; uses _fullpath on Windows.
2011-12-02Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-02tor_accept_socket() should take tor_addr_t for listener argNick Mathewson
Fixes bug 4535; bugfix on 0.2.2.28-beta; found by "troll_un"
2011-11-24Move disable-debugger-attachment fn to compat where it belongs. Fix whitespaceNick Mathewson
2011-11-24Fix compile warning in tor_inet_pton() (on 64bit)Sebastian Hahn
This slipped through into 0.2.3.8-alpha unfortunately.
2011-11-19Minor tor_inet_pton bug fixesAnders Sundman
In particular: * Disallow "0x10::" * Don't blow up on ":" * Disallow "::10000"
2011-11-11Fixed of-by-one error in tor_inet_ntopAnders Sundman
The of-by-one error could lead to 1 byte buffer over runs IPv6 for addresses.
2011-10-03Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-10-01Looks like Windows version 6.2 will be Windows 8Sebastian Hahn
Thanks to funkstar for the report
2011-07-01Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-07-01Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
2011-07-01Fix insanely large stack_allocation in log_credential_statusNick Mathewson
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.
2011-06-22Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-06-22Fix minor comment issuesRobert Ransom
2011-05-30Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/common/compat.c src/or/main.c
2011-05-23Use a 64-bit type to hold sockets on win64.Nick Mathewson
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.
2011-05-15Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-05-15Fix up some comment issues spotted by rransomNick Mathewson
2011-05-15Add a function to pull off the final component of a pathNick Mathewson
2011-05-11Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson
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
2011-05-11Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson
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
2011-05-11Hand-conversion and audit phase of memcmp transitionNick Mathewson
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.
2011-05-11Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson
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
2011-05-05Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-05-05Fix up some check-spaces issuesNick Mathewson
2011-04-28Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-04-28Correct the logic from f14754fbd for tor_gmtime_rJohn Brooks
2011-04-28Detect and handle NULL returns from (gm/local)time_rNick Mathewson
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.
2011-03-16Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Trivial Conflicts in src/common/crypto.c src/or/main.h src/or/or.h
2011-03-16Doxygen documentation for about 100 things that didn't have anyNick Mathewson
About 860 doxygen-less things remain in 0.2.2
2011-02-22Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-02-11Windows has EACCES, not EACCESSSebastian Hahn
Once again spotted by mobmix Also add a changes file for the fix
2011-02-08Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-02-08Locking failures on windows are indicated by EACCESSebastian Hahn
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.
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2011-01-03Bump copyright statements to 2011Nick Mathewson
2010-12-19Merge branch 'maint-0.2.2'Roger Dingledine
2010-12-15Merge remote branch fix_security_bug_021 into fix_security_bug_022Nick Mathewson
Conflicts: src/common/memarea.c src/or/or.h src/or/rendclient.c
2010-12-15Make payloads into uint8_t.Nick Mathewson
This will avoid some signed/unsigned assignment-related bugs.
2010-12-13Have all of our allocation functions and a few others check for underflowNick Mathewson
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.)
2010-12-01Merge remote branch 'sjmurdoch/cloexec'Nick Mathewson
2010-12-01Check that FD_CLOEXEC is set before using itSteven Murdoch
I don't know if any platforms we care about don't have FD_CLOEXEC, but this is what we do elsewhere
2010-11-30Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/or/relay.c
2010-11-29Add wrappers function for libc random()Nick Mathewson
On windows, it's called something different.
2010-11-21Don't both open the socket with SOCK_CLOEXEC and set FD_CLOEXECSteven Murdoch
2010-11-20Fix compile error on MacOS X (and other platforms without O_CLOEXEC)Steven Murdoch
2010-11-20Do cloexec on socketpairs and stdio filesNick Mathewson