Commit Graph

1205 Commits

Author SHA1 Message Date
Alexander Færøy 78aa037c41 Merge remote-tracking branch 'tor-gitlab/mr/161' 2020-10-13 13:50:14 +00:00
Daniel Pinto 304ae473ca Fix %include bug with pattern with */ on glibc < 2.19 #40141
Fix bug where %including a pattern ending in */ would include
files and folders (instead of folders only) in versions of
glibc < 2.19.
2020-10-03 04:10:52 +01:00
Roger Dingledine 4f114f59e6 fix typos
no actual changes
2020-10-01 19:32:32 -04:00
Nick Mathewson 5c9b4a0060 Remove support for old android "logcat" API
This is apparently obsolete; syslog is modern instead.  If users
have an android log configured, given them a syslog if we can.

Closes #32181.
2020-09-23 12:33:58 -04:00
Alexander Færøy 1c4b140427 Check if glob() is available at build-time.
This patch disables the glob() support in the path library if glob() is
unavailable at build-time. This currently happens with the Android NDK
used for Tor Browser.

See: https://bugs.torproject.org/tpo/core/tor/40114
2020-09-10 10:51:57 -04:00
George Kadianakis 4b9ed14d9b Merge remote-tracking branch 'tor-gitlab/mr/108' 2020-08-25 15:02:04 +03:00
Nick Mathewson 563f8610fd Revise trac.torproject.org urls to refer to gitlab replacements.
Closes #40101.
2020-08-14 09:21:28 -04:00
Nick Mathewson 9ef991dbe3 Use correct type for gl_closedir to avoid a compiler warning 2020-08-12 14:42:30 -04:00
Nick Mathewson e151442037 Merge remote-tracking branch 'tor-gitlab/mr/62' 2020-08-12 14:37:21 -04:00
Daniel Pinto 0b633b1f6d Improved documentation and comments #25140 2020-08-11 18:26:41 +01:00
George Kadianakis b8003fbe99 Merge branch 'maint-0.4.4' 2020-08-11 14:54:26 +03:00
George Kadianakis ab9c35f043 Merge remote-tracking branch 'tor-gitlab/mr/102' into maint-0.4.4 2020-08-11 14:53:03 +03:00
George Kadianakis afd88ee87f Merge remote-tracking branch 'tor-gitlab/mr/88' 2020-08-05 14:57:20 +03:00
Nick Mathewson 1d0695fe7e Improve ratelimit message to list true interval.
Previous message would say "N messages in the last T seconds", but
would give an inaccurate number for N.

We now give an accurate number, rounded up to the nearest 60 seconds.

Closes #19431.
2020-08-04 13:56:28 -04:00
Nick Mathewson 5b9508c9a5 Add a tor_str_wipe_and_free() function.
Frequently we want to do

    if (s) {
      memwipe(s, 0, sizeof(s));
      tor_free(s);
    }

and it's good to have a way to do this concisely.
2020-08-03 10:11:03 -04:00
Nick Mathewson 4c810a6abe Merge branch 'bug40076_044' 2020-07-30 14:35:06 -04:00
Nick Mathewson b4400e2093 Merge branch 'bug40076_043' into bug40076_044 2020-07-30 14:28:11 -04:00
Nick Mathewson 69d7752937 Merge branch 'bug40076_042' into bug40076_043 2020-07-30 14:27:29 -04:00
Nick Mathewson c2d5ec5e43 Merge branch 'maint-0.4.2' into bug40076_042 2020-07-30 14:27:29 -04:00
Nick Mathewson c4742b89b2 Fix a bug in buf_move_all() when the input buffer is empty.
We found this in #40076, after we started using buf_move_all() in
more places.  Fixes bug #40076; bugfix on 0.3.3.1-alpha.  As far as
I know, the crash only affects master, but I think this warrants a
backport, "just in case".
2020-07-30 14:24:25 -04:00
Neel Chauhan c212578bf0 Introduce write_str_if_not_equal() 2020-07-30 10:46:15 -04:00
Nick Mathewson 9164d7c75e Merge branch 'maint-0.4.4' 2020-07-29 12:37:08 -04:00
Nick Mathewson 3b8bf743ae Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-29 12:37:07 -04:00
Nick Mathewson cdb0e6c252 Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-29 12:37:07 -04:00
Nick Mathewson 8c92d44622 Merge remote-tracking branch 'tor-gitlab/mr/68' into maint-0.4.4 2020-07-29 12:35:57 -04:00
Alexander Færøy eba2870d18 Merge branch 'maint-0.4.4' 2020-07-29 13:58:14 +00:00
Alexander Færøy 8e690ce736 Merge remote-tracking branch 'tor-gitlab/mr/85' into maint-0.4.4 2020-07-29 13:57:47 +00:00
Alexander Færøy 109063185b Merge branch 'tor-gitlab/mr/73_squashed' 2020-07-29 13:34:24 +00:00
Nick Mathewson 3cb9a9b8ce Remove the connection_t.outbuf_flushlen field
This was once used for rate-limiting, but now it's only for
accounting.  It hasn't served a useful purpose in a long time.

Closes ticket 33097.
2020-07-29 13:33:35 +00:00
Daniel Pinto eab8e7af52 Fix startup crash with seccomp sandbox enabled #40072
Fix crash introduced in #40020. On startup, tor calls
check_private_dir on the data and key directories. This function
uses open instead of opendir on the received directory. Data and
key directoryes are only opened here, so the seccomp rule added
should be for open instead of opendir, despite the fact that they
are directories.
2020-07-29 00:34:08 +01:00
Nick Mathewson dcc60294ad Use _lseeki64() on windows.
Fixes bug 31036; bugfix on 0.2.1.8-alpha when we moved the logging
system to use posix fds.
2020-07-28 11:30:47 -04:00
Nick Mathewson b3112a6d26 Merge branch 'remove-padding-fix-7869-v2' 2020-07-23 08:26:44 -04:00
Nick Mathewson 7d0e64016e Merge branch 'maint-0.4.4' 2020-07-21 09:29:13 -04:00
Nick Mathewson 5cd85feaa7 Merge remote-tracking branch 'tor-gitlab/mr/68' into maint-0.4.4 2020-07-21 09:29:03 -04:00
Nick Mathewson 2ee33765ae Merge branch 'maint-0.4.4' 2020-07-21 09:24:27 -04:00
Nick Mathewson 95d4bff784 Merge remote-tracking branch 'tor-gitlab/mr/67' into maint-0.4.4 2020-07-21 09:24:15 -04:00
Daniel Pinto d75e7daaab Fix seccomp sandbox rules for openat #27315
The need for casting negative syscall arguments depends on the
glibc version. This affects the rules for the openat syscall which
uses the constant AT_FDCWD that is defined as a negative number.
This commit adds logic to only apply the cast when necessary, on
glibc versions from 2.27 onwards.
2020-07-20 22:35:05 +01:00
Daniel Pinto d28bfb2cd5 Fix seccomp sandbox rules for opening directories #40020
Different versions of glibc use either open or openat for the
opendir function. This commit adds logic to use the correct rule
for each glibc version, namely:
- Until 2.14 open is used
- From 2.15 to to 2.21 openat is used
- From 2.22 to 2.26 open is used
- From 2.27 onwards openat is used
2020-07-20 22:30:13 +01:00
Daniel Pinto c79b4397d3 Fix seccomp sandbox rules for openat #27315
The need for casting negative syscall arguments depends on the
glibc version. This affects the rules for the openat syscall which
uses the constant AT_FDCWD that is defined as a negative number.
This commit adds logic to only apply the cast when necessary, on
glibc versions from 2.27 onwards.
2020-07-20 22:30:00 +01:00
Nick Mathewson d6570eaf5d Merge remote-tracking branch 'tor-gitlab/mr/59' 2020-07-20 16:37:11 -04:00
Daniel Pinto 29307c0625 Add running glibc version to the log. #40047
Also adds the compiled and running glibc version when using the
--library-versions flag.
2020-07-17 18:45:57 +01:00
Nick Mathewson 44da920670 Add a tor_addr_port_copy() function. 2020-07-17 11:42:49 -04:00
Daniel Pinto 34fa2c4d0d Add support for patterns on %include #25140
Also adds generic tor_glob function to expand globs.
2020-07-15 22:01:08 +01:00
Nick Mathewson a7226ca06e Merge remote-tracking branch 'tor-gitlab/mr/50' 2020-07-14 14:50:30 -04:00
Alexander Færøy 623af0155e Update docstring for read_file_to_str() on stripping of CR characters.
See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-14 17:41:59 +00:00
Alexander Færøy abe7196c53 Strip '\r' characters when reading text files on Unix.
This patch ensures that we strip "\r" characters on both Windows as well
as Unix when we read text files. This should prevent the issue where
some Tor state files have been moved from a Windows machine, and thus
contains CRLF line ending, to a Unix machine where only \n is needed.

We add a test-case to ensure that we handle this properly on all our
platforms.

See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-14 17:41:51 +00:00
Alexander Færøy aba0ff4cb5 Merge remote-tracking branch 'tor-gitlab/merge-requests/48' 2020-07-14 16:07:36 +00:00
Nick Mathewson 2b33e8037e Merge branch 'ticket40033_045_01_squashed' 2020-07-14 10:59:30 -04:00
David Goulet 268d01ada5 Rename blacklist and whitelist wording
Closes #40033

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 10:59:18 -04:00
Alexander Færøy 1d554e4baf Merge branch 'maint-0.4.4' 2020-07-14 14:48:21 +00:00