mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Merge remote-tracking branch 'dgoulet/bug20980_030_01'
This commit is contained in:
commit
1ec429d07d
12 changed files with 16 additions and 16 deletions
4
changes/bug20980
Normal file
4
changes/bug20980
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfix (OpenBSD):
|
||||||
|
- Use "OpenBSD" pre-defined compiler macro instead of "OPENBSD" or
|
||||||
|
"__OpenBSD__". It is supported by OpenBSD itself and also most OpenBSD
|
||||||
|
variants like Bitrig. Fixes bug 20980.
|
|
@ -1150,10 +1150,6 @@ if test "x$linux_netfilter_ipv6_ip6_tables" = "x1"; then
|
||||||
fi
|
fi
|
||||||
if test "x$transparent_ok" = "x1"; then
|
if test "x$transparent_ok" = "x1"; then
|
||||||
AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support")
|
AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support")
|
||||||
case "$host" in
|
|
||||||
*-*-openbsd* | *-*-bitrig*)
|
|
||||||
AC_DEFINE(OPENBSD, 1, "Define to handle pf on OpenBSD properly") ;;
|
|
||||||
esac
|
|
||||||
else
|
else
|
||||||
AC_MSG_NOTICE([Transparent proxy support enabled, but missing headers.])
|
AC_MSG_NOTICE([Transparent proxy support enabled, but missing headers.])
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -76,7 +76,7 @@ clean_backtrace(void **stack, size_t depth, const ucontext_t *ctx)
|
||||||
#ifdef PC_FROM_UCONTEXT
|
#ifdef PC_FROM_UCONTEXT
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
const size_t n = 1;
|
const size_t n = 1;
|
||||||
#elif defined(__darwin__) || defined(__APPLE__) || defined(__OpenBSD__) \
|
#elif defined(__darwin__) || defined(__APPLE__) || defined(OpenBSD) \
|
||||||
|| defined(__FreeBSD__)
|
|| defined(__FreeBSD__)
|
||||||
const size_t n = 2;
|
const size_t n = 2;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -206,7 +206,7 @@ tor_gzip_compress(char **out, size_t *out_len,
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
*out_len = stream->total_out;
|
*out_len = stream->total_out;
|
||||||
#ifdef OPENBSD
|
#if defined(OpenBSD)
|
||||||
/* "Hey Rocky! Watch me change an unsigned field to a signed field in a
|
/* "Hey Rocky! Watch me change an unsigned field to a signed field in a
|
||||||
* third-party API!"
|
* third-party API!"
|
||||||
* "Oh, that trick will just make people do unsafe casts to the unsigned
|
* "Oh, that trick will just make people do unsafe casts to the unsigned
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
#include <malloc/malloc.h>
|
#include <malloc/malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#if !defined(OPENBSD) && !defined(__FreeBSD__)
|
#if !defined(OpenBSD) && !defined(__FreeBSD__)
|
||||||
/* OpenBSD has a malloc.h, but for our purposes, it only exists in order to
|
/* OpenBSD has a malloc.h, but for our purposes, it only exists in order to
|
||||||
* scold us for being so stupid as to autodetect its presence. To be fair,
|
* scold us for being so stupid as to autodetect its presence. To be fair,
|
||||||
* they've done this since 1996, when autoconf was only 5 years old. */
|
* they've done this since 1996, when autoconf was only 5 years old. */
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */
|
/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(OpenBSD)
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
# else
|
# else
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
__BYTE_ORDER == __LITTLE_ENDIAN
|
__BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
# define _le64toh(x) ((uint64_t)(x))
|
# define _le64toh(x) ((uint64_t)(x))
|
||||||
# else
|
# else
|
||||||
# if defined(__OpenBSD__)
|
# if defined(OpenBSD)
|
||||||
# define _le64toh(x) letoh64(x)
|
# define _le64toh(x) letoh64(x)
|
||||||
# else
|
# else
|
||||||
# define _le64toh(x) le64toh(x)
|
# define _le64toh(x) le64toh(x)
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
# define IS_LITTLE_ENDIAN
|
# define IS_LITTLE_ENDIAN
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(OpenBSD)
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
# else
|
# else
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
|
|
|
@ -3086,7 +3086,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||||
if (!strcasecmp(options->TransProxyType, "default")) {
|
if (!strcasecmp(options->TransProxyType, "default")) {
|
||||||
options->TransProxyType_parsed = TPT_DEFAULT;
|
options->TransProxyType_parsed = TPT_DEFAULT;
|
||||||
} else if (!strcasecmp(options->TransProxyType, "pf-divert")) {
|
} else if (!strcasecmp(options->TransProxyType, "pf-divert")) {
|
||||||
#if !defined(__OpenBSD__) && !defined( DARWIN )
|
#if !defined(OpenBSD) && !defined( DARWIN )
|
||||||
/* Later versions of OS X have pf */
|
/* Later versions of OS X have pf */
|
||||||
REJECT("pf-divert is a OpenBSD-specific "
|
REJECT("pf-divert is a OpenBSD-specific "
|
||||||
"and OS X/Darwin-specific feature.");
|
"and OS X/Darwin-specific feature.");
|
||||||
|
|
|
@ -1959,7 +1959,7 @@ get_pf_socket(void)
|
||||||
if (pf_socket >= 0)
|
if (pf_socket >= 0)
|
||||||
return pf_socket;
|
return pf_socket;
|
||||||
|
|
||||||
#ifdef OPENBSD
|
#if defined(OpenBSD)
|
||||||
/* only works on OpenBSD */
|
/* only works on OpenBSD */
|
||||||
pf = tor_open_cloexec("/dev/pf", O_RDONLY, 0);
|
pf = tor_open_cloexec("/dev/pf", O_RDONLY, 0);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "shared_random.h"
|
#include "shared_random.h"
|
||||||
|
|
||||||
#if defined(EXPORTMALLINFO) && defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
#if defined(EXPORTMALLINFO) && defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||||
#ifndef OPENBSD
|
#if !defined(OpenBSD)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,7 @@ const char *s = NULL;
|
||||||
sum += (unsigned char)buf[i]; \
|
sum += (unsigned char)buf[i]; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef OpenBSD
|
||||||
/* Disable some of OpenBSD's malloc protections for this test. This helps
|
/* Disable some of OpenBSD's malloc protections for this test. This helps
|
||||||
* us do bad things, such as access freed buffers, without crashing. */
|
* us do bad things, such as access freed buffers, without crashing. */
|
||||||
const char *malloc_options="sufjj";
|
const char *malloc_options="sufjj";
|
||||||
|
|
|
@ -1022,7 +1022,7 @@ test_options_validate__transproxy(void *ignored)
|
||||||
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
|
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
|
||||||
tt_int_op(ret, OP_EQ, -1);
|
tt_int_op(ret, OP_EQ, -1);
|
||||||
|
|
||||||
#if !defined(__OpenBSD__) && !defined( DARWIN )
|
#if !defined(OpenBSD) && !defined( DARWIN )
|
||||||
tt_str_op(msg, OP_EQ,
|
tt_str_op(msg, OP_EQ,
|
||||||
"pf-divert is a OpenBSD-specific and OS X/Darwin-specific feature.");
|
"pf-divert is a OpenBSD-specific and OS X/Darwin-specific feature.");
|
||||||
#else
|
#else
|
||||||
|
@ -1091,7 +1091,7 @@ test_options_validate__transproxy(void *ignored)
|
||||||
if (msg) {
|
if (msg) {
|
||||||
TT_DIE(("Expected NULL but got '%s'", msg));
|
TT_DIE(("Expected NULL but got '%s'", msg));
|
||||||
}
|
}
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(OpenBSD)
|
||||||
tdata = get_options_test_data("TransProxyType pf-divert\n"
|
tdata = get_options_test_data("TransProxyType pf-divert\n"
|
||||||
"TransPort 127.0.0.1:123\n");
|
"TransPort 127.0.0.1:123\n");
|
||||||
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
|
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue