aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
AgeCommit message (Collapse)Author
2016-02-16Merge branch 'bug17852_revised'Nick Mathewson
2016-01-27Correct further grammatical errors in tor commentsNick Mathewson
Avoid using a pronoun where it makes comments unclear. Avoid using gender for things that don't have it. Avoid assigning gender to people unnecessarily.
2016-01-13Add tests for options_actOla Bini
2015-12-17Improve warning messagecypherpunks
The user parameter is not checked so we do not know the user has been specified.
2015-12-15Merge branch 'feature8195_small_squashed'Nick Mathewson
2015-12-15Update KeepCapabilities based on comments from asnNick Mathewson
* The option is now KeepBindCapabilities * We now warn if the user specifically asked for KeepBindCapabilities and we can't deliver. * The unit tests are willing to start. * Fewer unused-variable warnings. * More documentation, fewer misspellings.
2015-12-15Add ability to keep the CAP_NET_BIND_SERVICE capability on LinuxNick Mathewson
This feature allows us to bind low ports when starting as root and switching UIDs. Based on code by David Goulet. Implement feature 8195
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-12-01src/common/compat.c:tor_vasprintf() - vsnprintf() was properly checked but ↵Jeremy
tor_vsnprintf() available so why not use it?
2015-12-01src/common/compat.c:tor_vasprintf() - changed vsnprintf() to tor_vsnprintf() ↵Jeremy
which ensures string is null terminated.
2015-11-27use sockaddr_storage for stack-allocated sockets in ersatz socketpairNick Mathewson
2015-11-27Make SIZEOF_SOCKADDR return socklen_t to avoid bad compares.Nick Mathewson
2015-11-27Use uint16_t, not in_port_t (which does not exist on Windows). See #17638.Nick Mathewson
2015-11-20fix "make check-spaces"Nick Mathewson
2015-11-19Make tor_ersatz_socketpair work on IPv6-only systemsteor (Tim Wilson-Brown)
(But it won't work on some systems without IPv4/IPv6 localhost (some BSD jails) by design, to avoid creating sockets on routable IP addresses. However, those systems likely have the AF_UNIX socketpair, which tor prefers.) Fixes bug #17638; bugfix on a very early tor version, earlier than 22dba27d8dd5 (23 Nov 2004) / svn:r2943. Patch by "teor".
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-11Fix windows compilationNick Mathewson
2015-08-10Merge remote-tracking branch 'public/feature16734'Nick Mathewson
2015-08-05Add a compat function to check how much disk space is free.Nick Mathewson
Closes ticket 16734.
2015-08-05Set the open file limit to the current value before changing itDavid Goulet
If setrlimit() failed, max_out wasn't set in set_max_file_descriptors() ending in a state where we don't use ULIMIT_BUFFER for things like tor private key files. Also fix the set_max_file_descriptors() documentation. Fixes #16274 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-30Add get_max_sockets() and remove dead codeDavid Goulet
The control port was using set_max_file_descriptors() with a limit set to 0 to query the number of maximum socket Tor can use. With the recent changes to that function, a check was introduced to make sure a user can not set a value below the amount we reserved for non socket. This commit adds get_max_sockets() that returns the value of max_sockets so we can stop using that "setter" function to get the current value. Finally, the dead code is removed that is the code that checked for limit equal to 0. From now on, set_max_file_descriptors() should never be used with a limit set to 0 for a valid use case. Fixes #16697 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-16Fix most check-spaces issuesNick Mathewson
2015-07-12Okay, this time it was my faultNick Mathewson
2015-07-12Fine, mingw! fine! are you happy now??Nick Mathewson
2015-07-12This should be the last SecureZeroMemory fixNick Mathewson
2015-07-12Dammit, autoconf!Nick Mathewson
2015-07-12Nth time is maybe the charm for fixing windows readpassword build errorsNick Mathewson
2015-07-11note some dead code in set_max_file_descriptorsNick Mathewson
2015-07-10Try one more one more time to get tor-ci-windows workingNick Mathewson
Apparently its mingw headers are missing some stuff.
2015-07-10Attempt yet again to make the tor-ci-windows builder happyNick Mathewson
2015-07-08Always use the sandbox in tor_open_cloexecteor
Use the sandbox in tor_open_cloexec, whether or not O_CLOEXEC is defined. Patch by "teor". Fix on 0.2.3.1-alpha.
2015-06-29Try a little harder to fix the tor-ci-windows builder, or figure out why it ↵Nick Mathewson
is broke
2015-06-27Fix some compilation issues.Nick Mathewson
2015-06-25Merge branch 'bug16288_027_03_squashed'Nick Mathewson
2015-06-25Validate the open file limit when creating a socketDavid Goulet
Fixes #16288 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-25Remove janky getpass implementationsNick Mathewson
2015-06-25Add a getpass implementation for windows that won't totally suckNick Mathewson
The logic here is inspired by Python's win_getpass(), which I'm assuming is better than nothing.
2015-06-17Add the openssh 6.8p1 readpassphrase implementationNick Mathewson
This way glibc users don't have to fall back to getpass. Windows users are still out of luck
2015-06-17Add a tor_getpass to read passphrases. Needs better backend.Nick Mathewson
2015-03-31Merge branch 'ticket14710_squashed'Nick Mathewson
2015-03-31Whitebox test for get_interface_address6_via_udp_socket_hack().rl1987
Also, fix some whitespace mishaps.
2015-02-19Quiet "caching debian-tor for debian-tor" noticeNick Mathewson
2015-02-09Merge remote-tracking branch 'sysrqb/bug14802_025'Nick Mathewson
2015-02-09Return 0 when detecting the amount of memory failsMatthew Finkel
Fixes bug 14802; bugfix on 0.2.5.4-alpha.
2015-01-14Fix windows compilation of condition codeNick Mathewson
2015-01-14Split threading-related code out of compat.cNick Mathewson
Also, re-enable the #if'd out condition-variable code. Work queues are going to make us hack on all of this stuff a bit more closely, so it might not be a terrible idea to make it easier to hack.
2015-01-10Merge branch 'master' of https://git.torproject.org/tor into ↵teor
bug13111-empty-key-files-fn-empty Conflicts: src/or/connection_edge.c Merged in favour of origin.
2015-01-10Merge branch 'bug14001-clang-warning' into bug13111-empty-key-files-fn-emptyteor
Conflicts: src/or/router.c Choose newer comment. Merge changes to comment and function invocation.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-29Merge branch 'resolvemyaddr_squashed'Nick Mathewson