| Commit message (Collapse) | Author | Age |
... | |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/common/compat.c
The getfilesize change conflicted with the removal of file_handle
from the windows tor_mmap_t.
|
| |
| |
| |
| |
| | |
(Use its second parameter to find the high 32 bits of the file size;
check its return value for error conditions.)
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | | |
|
| |/
| |
| |
| | |
I did the changes file; the rest came pseudonymously
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Make sure that the "path_length *= 2" statement can't overflow.
Move the "malloc and getcwd" loop into its own function.
|
| | |
| | |
| | |
| | | |
This broke compilation on Hurd
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 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
|
| | |
| | |
| | |
| | |
| | | |
i assume if nickm maintained "libeven" this would never have been
introduced. :)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | | |
This would cause a redundant redeclaration warning on some versions of
Linux otherwise.
|
|/ /
| |
| |
| |
| | |
OS X would otherwise crash with a segfault when linked statically to
some libraries.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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;
}
|
| |
| |
| |
| |
| |
| | |
Checking for "WINDOWS" is wrong; our magic macro is MS_WINDOWS
Fixes bug 4973; bugfix on 0.2.3.11-alpha.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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;
|
| | |
|
| |
| |
| |
| |
| |
| | |
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET.
Partial work for bug4533.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.)
|
| |
| |
| |
| |
| | |
Also, have tor_disable_debugger_attach() return a tristate of
success/failure/don't-know-how , and only log appropriately.
|
| |
| |
| |
| | |
Also fix a comment typo
|
| |
| |
| |
| |
| | |
Modifies filenames which do not start with '/' or '.' on non-Windows
platforms; uses _fullpath on Windows.
|
|\| |
|
| |
| |
| |
| | |
Fixes bug 4535; bugfix on 0.2.2.28-beta; found by "troll_un"
|
| | |
|
| |
| |
| |
| | |
This slipped through into 0.2.3.8-alpha unfortunately.
|
| |
| |
| |
| |
| |
| |
| | |
In particular:
* Disallow "0x10::"
* Don't blow up on ":"
* Disallow "::10000"
|
| |
| |
| |
| | |
The of-by-one error could lead to 1 byte buffer over runs IPv6 for addresses.
|
|\| |
|
| |
| |
| |
| | |
Thanks to funkstar for the report
|
|\| |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I'm not one to insist on C's miserly stack limits, but allocating a
256K array on the stack is too much even for me.
Bugfix on 0.2.1.7-alpha. Found by coverity. Fixes CID # 450.
|
|\| | |
|