aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
Commit message (Collapse)AuthorAge
* fixed long -> int implicit cast warning line 3453Nick Hopper2014-02-20
|
* Set CREATE_NO_WINDOW in tor_spawn_background.David Fifield2013-12-05
| | | | | | | | | | | | | | | | | | | | | This flag prevents the creation of a console window popup on Windows. We need it for pluggable transport executables--otherwise you get blank console windows when you launch the 3.x browser bundle with transports enabled. http://msdn.microsoft.com/en-us/library/ms684863.aspx#CREATE_NO_WINDOW The browser bundles that used Vidalia used to set this flag when launching tor itself; it was apparently inherited by the pluggable transports launched by tor. In the 3.x bundles, tor is launched by some JavaScript code, which doesn't have the ability to set CREATE_NO_WINDOW. tor itself is now being compiled with the -mwindows option, so that it is a GUI application, not a console application, and doesn't show a console window in any case. This workaround doesn't work for pluggable transports, because they need to be able to write control messages to stdout. https://trac.torproject.org/projects/tor/ticket/9444#comment:30
* Avoid warning about impossible check for flags & 0Nick Mathewson2013-11-22
| | | | Fixes CID 743381
* Fix whitespaceNick Mathewson2013-11-18
|
* Merge branch 'backtrace_squashed'Nick Mathewson2013-11-18
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/common/sandbox.c src/common/sandbox.h src/common/util.c src/or/main.c src/test/include.am src/test/test.c
| * Refactor format_*_number_sigsafe to have a common implementationNick Mathewson2013-11-18
| |
| * Make backtrace handler handle signals correctly.Nick Mathewson2013-11-18
| | | | | | | | | | This meant moving a fair bit of code around, and writing a signal cleanup function. Still pretty nice from what I can tell, though.
| * Basic backtrace abilityNick Mathewson2013-11-18
| | | | | | | | | | | | On platforms with the backtrace/backtrace_symbols_fd interface, Tor can now dump stack traces on assertion failure. By default, I log them to DataDir/stack_dump and to stderr.
| * Refactor the assertion-failure code into a functionNick Mathewson2013-07-19
| |
| * Add a signal-safe decimal formatting functionNick Mathewson2013-07-19
| |
* | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-11-15
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/or/relay.c Conflict changes were easy; compilation fixes required were using using TOR_SIMPLEQ_FIRST to get head of cell queue.
| * \ Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson2013-11-15
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/or/or.h src/or/relay.c Conflicts were simple to resolve. More fixes were needed for compilation, including: reinstating the tv_to_msec function, and renaming *_conn_cells to *_chan_cells.
* | \ \ Merge branch 'bug1376'Nick Mathewson2013-10-11
|\ \ \ \
| * | | | Fix some whitespace; tighten the tests.Nick Mathewson2013-10-11
| | | | |
| * | | | Added test for new write_chunks_to_file behaviour in #1376.Kevin Butler2013-09-04
| | | | |
| * | | | Added no_tempfile parameter to write_chunks_to_file to do non-atomic writes. ↵Kevin Butler2013-09-01
| | | | | | | | | | | | | | | | | | | | Implements #1376.
* | | | | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-10-10
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson2013-10-10
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Fix unit test for format_helper_exit_statusNick Mathewson2013-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | Fix format_helper_exit_status to allow full HEX_ERRNO_SIZE answers, *and* increase the buffer length again.
* | | | | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-10-10
|\| | | |
| * | | | Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson2013-10-10
| |\| | |
| | * | | Raise buffer size, fix checks for format_exit_helper_status.Nick Mathewson2013-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is probably not an exploitable bug, since you would need to have errno be a large negative value in the unix pluggable-transport launcher case. Still, best avoided. Fixes bug 9928; bugfix on 0.2.3.18-rc.
* | | | | Fix a windows compilation warning from sandboxing branchNick Mathewson2013-09-13
| | | | |
* | | | | Merge remote-tracking branch 'ctoader/gsoc-cap-stage2'Nick Mathewson2013-09-13
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | Conflicts: src/common/sandbox.c
| * | | | attempt to add stat64 filename filters; failed due to getaddrinfo..Cristian Toader2013-08-12
| | | | |
| * | | | added openat parameter filterCristian Toader2013-07-29
| | | | |
* | | | | Merge branch 'bug5040_4773_rebase_3'Nick Mathewson2013-08-15
|\ \ \ \ \
| * | | | | Test ExtORPort cookie initialization when file writing is broken.George Kadianakis2013-08-15
| | |_|_|/ | |/| | |
* | | | | Fix tor_get_lines_from_handle() for make check-spacesAndrea Shepard2013-08-02
| | | | |
* | | | | Fix compilation on WindowsNick Mathewson2013-07-31
| | | | | | | | | | | | | | | | | | | | (Bugfix on tests for #9288 fix; bug not in any released Tor)
* | | | | Merge branch 'bug9288_rebased'Nick Mathewson2013-07-31
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | Conflicts: src/test/test_pt.c
| * | | | Prepare some mock functions to test #9288.George Kadianakis2013-07-31
| | | | |
* | | | | Document what "escape" means in tor_escape_str_for_pt_argsNick Mathewson2013-07-18
| | | | |
* | | | | Rename tor_escape_str_for_socks_arg() to something more generic.George Kadianakis2013-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | Since we are going to be using that function to also escape parameters passed to transport proxies using environment variables.
* | | | | Pass characters to be escaped to tor_escape_str_for_socks_arg().George Kadianakis2013-07-18
|/ / / / | | | | | | | | | | | | | | | | This is in preparation for using tor_escape_str_for_socks_arg() to escape server-side pluggable transport parameters.
* | | | Lightly refactor and test format_hex_number_sigsafeNick Mathewson2013-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better tests for upper bounds, and for failing cases. Also, change the function's interface to take a buffer length rather than a maximum length, and then NUL-terminate: functions that don't NUL-terminate are trouble waiting to happen.
* | | | Expose format_hex_number_..., and rename it to ..._sigsafe().Nick Mathewson2013-07-15
| | | | | | | | | | | | | | | | | | | | There are some other places in the code that will want a signal-safe way to format numbers, so it shouldn't be static to util.c.
* | | | Don't build format_helper_exit_status on win32Nick Mathewson2013-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only thing that used format_helper_exit_status on win32 was the unit tests. This caused an error when we tried to leave a static format_helper_exit_status lying around in a production object file. The easiest solution is to admit that this way of dealing with process exit status is Unix-only.
* | | | Completely refactor how FILENAME_PRIVATE worksNick Mathewson2013-07-10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
* | | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-04-17
|\| |
| * | Merge branch 'bug8037_squashed' into maint-0.2.4Nick Mathewson2013-04-17
| |\ \
| | * | Correctly copy microdescs/extrinfos with internal NUL bytesNick Mathewson2013-01-26
| | | | | | | | | | | | | | | | Fixes bug 8037; bugfix on 0.2.0.1-alpha; reported by cypherpunks.
* | | | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-03-19
|\| | |
| * | | Merge remote-tracking branch 'public/bug7950' into maint-0.2.4Nick Mathewson2013-03-19
| |\ \ \
| | * | | Make a parse_config_line_from_str variant that gives error messagesNick Mathewson2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, there's no way to know what went wrong when we fail to parse a torrc line entirely (that is, we can't turn it into a K,V pair.) This patch introduces a new function that yields an error message on failure, so we can at least tell the user what to look for in their nonfunctional torrc. (Actually, it's the same function as before with a new name: parse_config_line_from_str is now a wrapper macro that the unit tests use.) Fixes bug 7950; fix on 0.2.0.16-alpha (58de695f9062576f) which first introduced the possibility of a torrc value not parsing correctly.
* | | | | Merge remote-tracking branch 'asn/bug3594_rebased_and_fixed'Nick Mathewson2013-03-19
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | Conflicts: src/common/util.c src/or/entrynodes.h
| * | | | Refactoring to make parse_bridge_line() unittestable.George Kadianakis2013-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make parse_bridge_line() return a struct. - Make bridge_add_from_config() accept a struct. - Make string_is_key_value() less hysterical.
| * | | | Fix various issues pointed out by Nick and Andrea.George Kadianakis2013-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Document the key=value format. - Constify equal_sign_pos. - Pass some strings that are about to be logged to escape(). - Update documentation and fix some bugs in tor_escape_str_for_socks_arg(). - Use string_is_key_value() in parse_bridge_line(). - Parenthesize a forgotten #define - Add some more comments. - Add some more unit test cases.
| * | | | Add utility functions needed for SOCKS argument parsing.George Kadianakis2013-02-09
| | | | |
* | | | | Remove some functions which were unused except for their testsNick Mathewson2013-02-23
| | | | |