aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
Commit message (Expand)AuthorAge
* Fix assertion failure in tor_timegm.•••Fixes bug 6811. Nick Mathewson2012-09-11
* Add __attribute__(format)s for our varargs printf/scanf wrappers•••It turns out that if you set the third argument of __attribute__(format) to 0, GCC and Clang will check the format argument without expecting to find variadic arguments. This is the correct behavior for vsnprintf, vasprintf, and vscanf. I'm hoping this will fix bug 5969 (a clang warning) by telling clang that the format argument to tor_vasprintf is indeed a format string. Nick Mathewson2012-05-30
* Make ControlSocketsGroupWritable work with User.•••Original message from bug3393: check_private_dir() to ensure that ControlSocketsGroupWritable is safe to use. Unfortunately, check_private_dir() only checks against the currently running user… which can be root until privileges are dropped to the user and group configured by the User config option. The attached patch fixes the issue by adding a new effective_user argument to check_private_dir() and updating the callers. It might not be the best way to fix the issue, but it did in my tests. (Code by lunar; changelog by nickm) Jérémy Bobbio2011-06-14
* whitespace fixesNick Mathewson2011-05-30
* Use a 64-bit type to hold sockets on win64.•••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. Nick Mathewson2011-05-23
* Add a new flag to check_private_dir to make it _not_ change permissions•••We'll need this for checking permissions on the directories that hold control sockets: if somebody says "ControlSocket ~/foo", it would be pretty rude to do a chmod 700 on their homedir. Nick Mathewson2011-05-15
* Make check_private_dir accept g+rx dirs if told to do so.Nick Mathewson2011-05-15
* Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcm...•••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 Nick Mathewson2011-05-11
|\
| * Hand-conversion and audit phase of memcmp transition•••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. Nick Mathewson2011-05-11
| * Add a "di_ops.h" include to util.hNick Mathewson2011-05-11
* | Remove the "fuzzy time" code•••It was the start of a neat idea, but it only got used in 3 places, none of which really needed it. Nick Mathewson2011-03-25
* | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2•••Conflicts: src/common/test.h src/or/test.c Nick Mathewson2011-01-03
|\|
| * Bump copyright statements to 2011Nick Mathewson2011-01-03
* | New function to load windows system libraries•••This function uses GetSystemDirectory() to make sure we load the version of the library from c:\windows\system32 (or local equivalent) rather than whatever version lives in the cwd. Nick Mathewson2010-09-21
* | Add a simple integer-ceiling-division macro before we get it wrongNick Mathewson2010-09-14
* | Fix some issues in rate-limiting noticed by SebastianNick Mathewson2010-08-31
* | Add a generic rate-limited log mechanism, and use it in a few places•••Incidentally fixes bug 1042. Nick Mathewson2010-08-18
* | Merge remote branch 'origin/maint-0.2.1'•••Conflicts: src/common/test.h src/or/test.c Nick Mathewson2010-02-27
|\|
| * Update Tor Project copyright yearsNick Mathewson2010-02-27
* | Refactor out the 'find string at start of any line' logic.•••We do this in too many places throughout the code; it's time to start clamping down. Also, refactor Karsten's patch to use strchr-then-strndup, rather than malloc-then-strlcpy-then-strchr-then-clear. Nick Mathewson2009-12-17
* | Refactor a bit so that it is safe to include math.h, and mostly not needed.Nick Mathewson2009-12-15
* | Code to generate, store, and parse microdescriptors and consensuses.•••The consensus documents are not signed properly, not served, and not exchanged yet. Nick Mathewson2009-10-15
* | Add a couple of time helper functions.•••Also add rounding support to tv_mdiff(). Mike Perry2009-09-20
* | Revise parsing of time and memory units to handle spaces.•••When we added support for fractional units (like 1.5 MB) I broke support for giving units with no space (like 2MB). This patch should fix that. It also adds a propoer tor_parse_double(). Fix for bug 1076. Bugfix on 0.2.2.1-alpha. Nick Mathewson2009-08-31
* | Fix dirreq and cell stats on 32-bit architectures.•••When determining how long directory requests take or how long cells spend in queues, we were comparing timestamps on microsecond detail only to convert results to second or millisecond detail later on. But on 32-bit architectures this means that 2^31 microseconds only cover time differences of up to 36 minutes. Instead, compare timestamps on millisecond detail. Karsten Loesing2009-07-27
* | Two tweaks to exit-port statistics.•••Add two functions for round_to_next_multiple_of() for uint32_t and uint64_t. Avoid division in every step of the loop over all ports. Karsten Loesing2009-07-13
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-05-27
|\|
| * Spell-check Tor.Nick Mathewson2009-05-27
| * Update copyright to 2009.Karsten Loesing2009-05-04
* | Update copyright to 2009.Karsten Loesing2009-05-02
* | Command-line option to dump SHA1 digests of all source files.•••Now, when you call tor --digests, it dumps the SHA1 digest of each source file that Tor was built with. We support both 'sha1sum' and 'openssl sha1'. If the user is building from a tarball and they haven't edited anything, they don't need any program that calculates SHA1. If they _have_ modified a file but they don't have a program to calculate SHA1, we try to build so we do not output digests. Nick Mathewson2009-04-29
|/
* Add a simple locale-independent no-surprises sscanf replacement.•••tor_sscanf() only handles %u and %s for now, which will make it adequate to replace sscanf() for date/time/IP parsing. We want this to prevent attackers from constructing weirdly formed descriptors, cells, addresses, HTTP responses, etc, that validate under some locales but not others. svn:r18760 Nick Mathewson2009-03-03
* Remove svn $Id$s from our source, and remove tor --version --version.•••The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867 Nick Mathewson2009-01-04
* Use a consistent naming standard for header file guard macros, taking care no...•••svn:r17805 Nick Mathewson2008-12-29
* Expose hex_decode_digit from util.c•••svn:r17706 Nick Mathewson2008-12-19
* Replace calls to time(NULL) that occur on the order of once per read, one per...•••svn:r17690 Nick Mathewson2008-12-18
* Remove some cargo-cult gcc hacks around tor_assert and predict_unlikely; inst...•••svn:r17597 Nick Mathewson2008-12-11
* make read_all and write_all return ssize_t.•••svn:r17194 Nick Mathewson2008-11-05
* Add a new memcmpstart to use instead of strcmpstart when the thing we are com...•••svn:r17187 Nick Mathewson2008-11-03
* Document some dmalloc stuff and some stupid C tricks.•••svn:r17161 Nick Mathewson2008-10-27
* r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200••• Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much. svn:r16208 Nick Mathewson2008-07-25
* r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200••• Make generic address manipulation functions work better. Switch address policy code to use tor_addr_t, so it can handle IPv6. That is a good place to start. svn:r16178 Nick Mathewson2008-07-24
* r14373@tombo: nickm | 2008-02-21 16:29:18 -0500••• Apply warnings about implicit 64-to-32 conversions; some from Sebastian Hahn; some not. svn:r13664 Nick Mathewson2008-02-21
* r18336@catbus: nickm | 2008-02-21 09:33:15 -0500••• Patch from Sebastian Hahn: remove obsolete timeval manipulation functions. svn:r13653 Nick Mathewson2008-02-21
* r14185@tombo: nickm | 2008-02-15 18:05:54 -0500••• Replace the hefty tor_strpartition with a simple function to replace its only (trivial) use. svn:r13532 Nick Mathewson2008-02-15
* Update some copyright notices: it is now 2008.•••svn:r13412 Nick Mathewson2008-02-07
* r17472@catbus: nickm | 2008-01-05 22:10:19 -0500••• Another test for the increasingly bad check-spaces style checker to check: #else\n#if is almost a sure sign of a failure to use #elif. Fortunately, we only did that 3 times. svn:r13039 Nick Mathewson2008-01-06
* r15786@tombo: nickm | 2008-01-02 01:11:51 -0500••• Push the strdups used for parsing configuration lines into parse_line_from_string(). This will make it easier to parse more complex value formats, which in turn will help fix bug 557 svn:r13020 Nick Mathewson2008-01-02
* r15691@tombo: nickm | 2007-12-25 18:13:54 -0500••• New, slightly esoteric function, tor_malloc_roundup(). While tor_malloc(x) allocates x bytes, tor_malloc_roundup(&x) allocates the same size of chunk it would use to store x bytes, and sets x to the usable size of that chunk. svn:r12981 Nick Mathewson2007-12-26
* clean up copyrights, and assign 2007 copyrights to The Tor Project, Inc•••svn:r12786 Roger Dingledine2007-12-12