aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
Commit message (Collapse)AuthorAge
...
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2012-05-16
|\|
| * Fix month check in parse_http_time, add testSebastian Hahn2012-05-16
| |
| * Remove more dubiosity in struct tm handling. related to bug5346Nick Mathewson2012-05-16
| |
| * Reject an additional type of bad date in parse_http_timeNick Mathewson2012-05-16
| |
| * Fix parse_http_time and add testsEsteban Manchado Velázquez2012-05-16
| | | | | | | | | | | | | | | | * It seems parse_http_time wasn't parsing correctly any date with commas (RFCs 1123 and 850). Fix that. * It seems parse_http_time was reporting the wrong month (they start at 0, not 1). Fix that. * Add some tests for parse_http_time, covering all three formats.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2012-05-10
|\| | | | | | | | | | | Conflicts: src/common/util.c src/test/test_util.c
| * Handle out-of-range values in tor_parse_* integer functionsNick Mathewson2012-05-07
| | | | | | | | | | | | | | | | | | | | | | The underlying strtoX functions handle overflow by saturating and setting errno to ERANGE. If the min/max arguments to the tor_parse_* functions are equal to the minimum/maximum of the underlying type, then with the old approach, we wouldn't treat a too-large value as genuinely broken. Found this while looking at bug 5786; bugfix on 19da1f36 (in Tor 0.0.9), which introduced these functions.
* | Several mingw/msvc/cross-compilation fixesNick Mathewson2012-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | They boil down to: - MS_WINDOWS is dead and replaced with _WIN32, but we let a few instances creep in when we merged Esteban's tests. - Capitalizing windows header names confuses mingw. - #ifdef 0 ain't C. - One unit test wasn't compiled on windows, but was being listed anyway. - One unit test was checking for the wrong value. Gisle Vanem found and fixed the latter 3 issues.
* | tor_vsscanf(): Don't return -1 if '%%' doesn't match.George Kadianakis2012-04-03
| | | | | | | | | | tor_vsscanf() is supposed to return the current number of matches on match failure.
* | Have tor_parse_*long functions check for negative basesNick Mathewson2012-03-30
| | | | | | | | | | | | | | | | One of our unit tests checks that they behave correctly (giving an error) when the base is negative. But there isn't a guarantee that strtol and friends actually handle negative bases correctly. Found by Coverity Scan; fix for CID 504.
* | Close fds on pipe() error in tor_spawn_background().George Kadianakis2012-03-12
| |
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2012-03-09
|\|
| * Correctly handle broken escape sequences in torrc valuesNick Mathewson2012-03-09
| | | | | | | | | | | | Previously, malformatted torrc values could crash us. Patch by Esteban Manchado. Fixes bug 5090; fix on 0.2.0.16-alpha.
| * Get rid of an unused parameter warning on winSebastian Hahn2011-11-20
| | | | | | | | | | This is a backport of bed79c47f4ec0ee72b19e2b81c54131d516d07ef which accidentally only went into master
* | Small fix in tor_sscanf documentationEsteban Manchado Velázquez2012-03-08
| |
* | Fix typo in config parser documentationEsteban Manchado Velázquez2012-03-08
| |
* | Don't leak the env_vars_sorted smartlist in process_environment_makeNick Mathewson2012-02-29
| | | | | | | | | | | | Found by Coverity. No changes/ file, because this bug has not been in a release yet.
* | Use get_environment(), not environ.Nick Mathewson2012-02-17
| |
* | Heap-allocate strings returned by get_current_process_environment_variablesRobert Ransom2012-02-17
| |
* | Pass process_environment_t * to tor_spawn_backgroundRobert Ransom2012-02-17
| | | | | | | | Now tor_spawn_background's prototype is OS-independent.
* | Remove (void)envp from tor_spawn_backgroundRobert Ransom2012-02-17
| | | | | | | | The envp argument is used on Windows.
* | Add set_environment_variable_in_smartlistRobert Ransom2012-02-17
| |
* | Add get_current_process_environment_variablesRobert Ransom2012-02-17
| |
* | Add process_environment_make and related utilitiesRobert Ransom2012-02-17
| |
* | Add tor_callocRobert Ransom2012-02-17
| |
* | Fix straggling MS_WINDOWS issues; add a changes fileNick Mathewson2012-01-31
| | | | | | | | | | | | | | There was one MS_WINDOWS that remained because it wasn't on a macro line; a few remaining uses (and the definition!) in configure.in; and a now-nonsensical stanza of eventdns_tor.h that previously defined 'WIN32' if it didn't exist.
* | Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson2012-01-31
| | | | | | | | | | | | | | | | | | | | | | 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; }
* | Rename nonconformant identifiers.Nick Mathewson2012-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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;
* | Convert instances of tor_malloc+tor_snprintf into tor_asprintfNick Mathewson2012-01-16
| | | | | | | | | | | | | | | | | | | | 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.)
* | Rename smartlist_{v,}asprintf_add to smartlist_add_{v,}asprintfNick Mathewson2012-01-16
| |
* | Merge branch 'feature3457-v4-nm-squashed'Nick Mathewson2012-01-11
|\ \ | | | | | | | | | | | | Conflicts: src/or/rendclient.c
| * | Use spaceless ISO8601 time format, not sec,usec.Nick Mathewson2012-01-11
| | |
* | | Some more check-spaces stuffSebastian Hahn2011-12-08
| | | | | | | | | | | | | | | | | | This re-applies a check-spaces fix that was part of 7920ea55b8d994268d2b07f27316b0f34d8f27e5 and got reverted along with the rest of that commit in df1f72329acf5f555618a5309f2621e584c0d763.
* | | Revert "Refactor tor_event_base_once to do what we actually want"Nick Mathewson2011-12-06
| | | | | | | | | | | | This reverts commit 7920ea55b8d994268d2b07f27316b0f34d8f27e5.
* | | Merge remote-tracking branch 'asn-mytor/bug4548_take2'Nick Mathewson2011-11-29
|\ \ \
| * | | Introduce write_bytes_to_new_file().George Kadianakis2011-11-26
| |/ / | | | | | | | | | | | | Introduce write_bytes_to_new_file(), a function which writes bytes to a file only if that file did not exist.
* | | Refactor tor_event_base_once to do what we actually wantNick Mathewson2011-11-25
| | | | | | | | | | | | | | | This version avoids the timeout system entirely, gives a nicer interface, and lets us manage allocation explicitly.
* | | Make process_handle_t private and fix some unit testsNick Mathewson2011-11-25
| | | | | | | | | | | | | | | | | | | | | | | | Let's *not* expose more cross-platform-compatibility structures, or expect code to use them right. Also, don't fclose() stdout_handle and stdin_handle until we do tor_process_handle_destroy, or we risk a double-fclose.
* | | Merge remote-tracking branch 'asn/bug3472_act2'Nick Mathewson2011-11-25
|\ \ \ | |/ / |/| |
| * | Rename tor_process_destroy() to tor_process_handle_destroy().George Kadianakis2011-10-24
| | |
| * | Improve general code quality.George Kadianakis2011-10-24
| | | | | | | | | | | | | | | | | | | | | | | | - Add a tor_process_get_pid() function that returns the PID of a process_handle_t. - Conform to make check-spaces. - Add some more documentation. - Improve some log messages.
| * | Prepare util.[ch] to use the new process_handle_t API.George Kadianakis2011-10-24
| | | | | | | | | | | | Also, create tor_process_destroy() which destroys a process_handle_t.
* | | Fix compile warnings on windowsSebastian Hahn2011-11-15
|/ /
* | Fix a compile warning on OS X 10.6 and upSebastian Hahn2011-10-11
| |
* | Add a missing comma in tor_check_port_forwardingNick Mathewson2011-10-10
| | | | | | | | My fault; fix for bug 4213.
* | Merge remote-tracking branch 'asn2/bug3656'Nick Mathewson2011-10-07
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/common/util.c src/common/util.h src/or/config.h src/or/main.c src/test/test_util.c
| * | Make it compile on Windows™.George Kadianakis2011-10-07
| | |
| * | Put some sense into our logging.George Kadianakis2011-09-12
| | | | | | | | | | | | | | | Transform our logging severities to something more sensible. Remove sneaky printf()s.
| * | Make check-spaces happy.George Kadianakis2011-09-11
| | |
| * | Enforce transport names being C identifiers.George Kadianakis2011-09-11
| | | | | | | | | | | | | | | Introduce string_is_C_identifier() and use it to enforce transport names according to the 180 spec.