aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
Commit message (Expand)AuthorAge
* fix a compiler warning added in one of my XXX023 fixes.Nick Mathewson2012-06-15
* Refactor GETINFO process/descriptor-limit•••Previously it duplicated some getrlimit code and content from compat.c; now it doesn't. Nick Mathewson2012-06-15
* Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson2012-06-15
* Merge branch 'bug6097'Nick Mathewson2012-06-11
|\
| * Be more careful calling wcstombs•••The function is not guaranteed to NUL-terminate its output. It *is*, however, guaranteed not to generate more than two bytes per multibyte character (plus terminating nul), so the general approach I'm taking is to try to allocate enough space, AND to manually add a NUL at the end of each buffer just in case I screwed up the "enough space" thing. Fixes bug 5909. Nick Mathewson2012-06-07
* | typo noticed by "_raptor"Roger Dingledine2012-06-07
|/
* Merge remote-tracking branch 'public/getfilesize_64'•••Conflicts: src/common/compat.c The getfilesize change conflicted with the removal of file_handle from the windows tor_mmap_t. Nick Mathewson2012-06-05
|\
| * Use GetFileSize correctly on win32•••(Use its second parameter to find the high 32 bits of the file size; check its return value for error conditions.) Nick Mathewson2012-05-24
* | Resolve about 24 DOCDOCsNick Mathewson2012-06-05
* | Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
* | Add about 60 more DOCDOC comments to 0.2.3•••Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together. Nick Mathewson2012-06-04
* | Resolve all currently pending DOCDOC items in masterNick Mathewson2012-06-04
* | Merge remote-tracking branch 'public/bug5089'•••Conflicts: src/test/test_util.c Merge the unit tests; I added some when I did this branch against 0.2.2, and then the test format changed and master added more tests. Nick Mathewson2012-05-31
|\ \
| * | Have get_parent_directory() handle "/foo" and "/" correctly.•••The parent of "/foo" is "/"; and "/" is its own parent. This would cause Tor to fail if you tried to have a PF_UNIX control socket in the root directory. That would be a stupid thing to do for other reasons, but there's no reason to fail like _this_. Bug found by Esteban Manchado Velázquez. Fix for bug 5089; bugfix on Tor 0.2.2.26-beta. Unit test included. Nick Mathewson2012-05-24
| |/
* | Merge remote-tracking branch 'public/close_file_mapping'•••Conflicts: src/common/compat.h Conflict was between replacement of MS_WINDOWS with _WIN32 in master, and with removal of file_handle from tor_mmap_t struct in close_file_mapping branch (for bug 5951 fix). Nick Mathewson2012-05-31
|\ \
| * | reindent CreateFile arguments.Nick Mathewson2012-05-31
| * | Close the windows file handle after CreateFileMapping; it isn't needed•••I did the changes file; the rest came pseudonymously Nick Mathewson2012-05-23
| |/
* | Merge remote-tracking branch 'linus/bug5355_ln'Nick Mathewson2012-05-31
|\ \
| * | Don't stomp on errno.Linus Nordberg2012-05-29
| * | Refactor new getcwd code•••Make sure that the "path_length *= 2" statement can't overflow. Move the "malloc and getcwd" loop into its own function. Nick Mathewson2012-05-10
| * | Stop using MAX_PATH, it might not be defined•••This broke compilation on Hurd Sebastian Hahn2012-03-10
* | | Fix win32 compilation of 31eb73f88e8Nick Mathewson2012-05-14
* | | Cut down on the OS information we give.•••For uname-based detection, we now give only the OS name (e.g., "Darwin", "Linux".) For Windows, we give only the Operating System name as inferred from dw(Major|Minor)version, (e.g., "Windows XP", "Windows 7"), and whether the VER_NT_SERVER flag is set. For ticket 2988. Nick Mathewson2012-05-11
* | | Merge remote-tracking branch 'public/bug5091'Nick Mathewson2012-05-11
|\ \ \
| * | | Fix tor_strtok_r_impl and test cases per bug #5091•••== Nick here. I tweaked this patch a little to make it apply cleanly to master, to extract some common code into a function, and to replace snprintf with tor_snprintf. -- nickm nils2012-03-30
| |/ /
* | | fix quad typo in comments•••i assume if nickm maintained "libeven" this would never have been introduced. :) Roger Dingledine2012-05-07
* | | Fix bug 5762: detect missing accept4 that gives ENOSYS•••We had been checking for EINVAL, but that means that SOCK_* isn't supported, not that the syscall itself is missing. Bugfix on 0.2.3.1-alpha, which started to use accept4. Nick Mathewson2012-05-04
* | | Remove __ from HAVE_EXTERN_ENVIRON_DECLARED__•••I think that the trailing __ got added in false analogy to HAVE_MACRO__func__, HAVE_MACRO__FUNC__, and HAVE_MACRO__FUNCTION__. But those macros actually indicate the presence of __func__, __FUNC__, and __FUNCTION__ respectively. The __ at the end of HAVE_EXTERN_ENVIRON_DECLARED would only be appropriate if the environ were declared__, whatever that means. (As a side-note, HAVE_MACRO__func__ and so on should probably be renamed HAVE_MACRO___func__ and so on. But that can wait.) This is an identifier renaming only. Nick Mathewson2012-04-30
* | | Merge remote-tracking branch 'public/bug5112'Nick Mathewson2012-04-24
|\ \ \ | |/ / |/| |
| * | If SOCK_CLOEXEC and friends fail, fall back to regular socket() calls•••Since 0.2.3.1-alpha, we've supported the Linux extensions to socket(), open(), socketpair(), and accept() that enable us to create an fd and make it close-on-exec with a single syscall. This not only saves us a syscall (big deal), but makes us less vulnerable to race conditions where we open a socket and then exec before we can make it close-on-exec. But these extensions are not supported on all Linuxes: They were added between 2.6.23 or so and 2.6.28 or so. If you were to build your Tor against a recent Linux's kernel headers, and then run it with a older kernel, you would find yourselve unable to open sockets. Ouch! The solution here is that, when one of these syscalls fails with EINVAL, we should try again in the portable way. This adds an extra syscall in the case where we built with new headers and are running with old ones, but it will at least allow Tor to work. Fixes bug 5112; bugfix on 0.2.3.1-alpha. Nick Mathewson2012-02-14
* | | Don't redeclare environ if std headers already did•••This would cause a redundant redeclaration warning on some versions of Linux otherwise. Sebastian Hahn2012-02-19
* | | Use _NSGetEnviron() instead of environ where required•••OS X would otherwise crash with a segfault when linked statically to some libraries. Sebastian Hahn2012-02-14
|/ /
* | Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32•••This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; } Nick Mathewson2012-01-31
* | Actually enable the windows absolute-path code•••Checking for "WINDOWS" is wrong; our magic macro is MS_WINDOWS Fixes bug 4973; bugfix on 0.2.3.11-alpha. Nick Mathewson2012-01-31
* | Rename nonconformant identifiers.•••Fixes bug 4893. These changes are pure mechanical, and were generated with this perl script: /usr/bin/perl -w -i.bak -p s/crypto_pk_env_t/crypto_pk_t/g; s/crypto_dh_env_t/crypto_dh_t/g; s/crypto_cipher_env_t/crypto_cipher_t/g; s/crypto_digest_env_t/crypto_digest_t/g; s/aes_free_cipher/aes_cipher_free/g; s/crypto_free_cipher_env/crypto_cipher_free/g; s/crypto_free_digest_env/crypto_digest_free/g; s/crypto_free_pk_env/crypto_pk_free/g; s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g; s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g; s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g; s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g; s/crypto_new_cipher_env/crypto_cipher_new/g; s/crypto_new_digest_env/crypto_digest_new/g; s/crypto_new_digest256_env/crypto_digest256_new/g; s/crypto_new_pk_env/crypto_pk_new/g; s/crypto_create_crypto_env/crypto_cipher_new/g; s/connection_create_listener/connection_listener_new/g; s/smartlist_create/smartlist_new/g; s/transport_create/transport_new/g; Nick Mathewson2012-01-18
* | Warn if sizeof(tor_socket_t) != sizeof(SOCKET)Nick Mathewson2012-01-17
* | Use SOCKET_OK macros in even more places•••Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533. Nick Mathewson2012-01-17
* | Convert instances of tor_malloc+tor_snprintf into tor_asprintf•••These were found by looking for tor_snprintf() instances that were preceeded closely by tor_malloc(), though I probably converted some more snprintfs as well. (In every case, make sure that the length variable (if any) is removed, renamed, or lowered, so that anything else that might have assumed a longer buffer doesn't exist.) Nick Mathewson2012-01-16
* | Disallow disabling DisableDebuggerAttachment on runnning Tor•••Also, have tor_disable_debugger_attach() return a tristate of success/failure/don't-know-how , and only log appropriately. Sebastian Hahn2012-01-04
* | Fix a check-spaces violation in compat.c•••Also fix a comment typo Sebastian Hahn2011-12-30
* | Prepend cwd for relative config file paths.•••Modifies filenames which do not start with '/' or '.' on non-Windows platforms; uses _fullpath on Windows. Kamran Riaz Khan2011-12-22
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-12-02
|\|
| * tor_accept_socket() should take tor_addr_t for listener arg•••Fixes bug 4535; bugfix on 0.2.2.28-beta; found by "troll_un" Nick Mathewson2011-12-02
* | Move disable-debugger-attachment fn to compat where it belongs. Fix whitespaceNick Mathewson2011-11-24
* | Fix compile warning in tor_inet_pton() (on 64bit)•••This slipped through into 0.2.3.8-alpha unfortunately. Sebastian Hahn2011-11-24
* | Minor tor_inet_pton bug fixes•••In particular: * Disallow "0x10::" * Don't blow up on ":" * Disallow "::10000" Anders Sundman2011-11-19
* | Fixed of-by-one error in tor_inet_ntop•••The of-by-one error could lead to 1 byte buffer over runs IPv6 for addresses. Anders Sundman2011-11-11
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-10-03
|\|
| * Looks like Windows version 6.2 will be Windows 8•••Thanks to funkstar for the report Sebastian Hahn2011-10-01
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-07-01
|\|