"
for doc in $2/*.3; do
fullpath=`pwd`/$doc
name=$(basename $doc)
if [ ! -e "$fullpath" ]; then
>&2 echo "No .3 files in $2!"
exit 1
fi
echo "$name
"
# suppress man's warnings "cannot break line" or "cannot adjust line"
MAN_KEEP_FORMATTING=1 COLUMNS=80 man "$fullpath" 2>/dev/null | ul -t xterm | "$AHA" --no-header
echo "
"
done
echo ""
mongo-c-driver-1.16.1/.evergreen/run-auth-tests.sh 0000664 0000000 0000000 00000013125 13616147712 0021741 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o errexit # Exit the script with error if any of the commands fail
set +o xtrace # Don't echo commands
# The following expansions are set in the evergreen project:
# AUTH_HOST=${auth_host} # Evergreen variable
# AUTH_PLAIN=${auth_plain} # Evergreen variable
# AUTH_MONGODBCR=${auth_mongodbcr} # Evergreen variable
# AUTH_GSSAPI=${auth_gssapi} # Evergreen variable
# AUTH_CROSSREALM=${auth_crossrealm} # Evergreen variable
# AUTH_GSSAPI_UTF8=${auth_gssapi_utf8} # Evergreen variable
# ATLAS_FREE=${atlas_free} # Evergreen variable
# ATLAS_FREE_SRV=${atlas_free_srv} # Evergreen variable
# ATLAS_REPLSET=${atlas_replset} # Evergreen variable
# ATLAS_REPLSET_SRV=${atlas_replset_srv} # Evergreen variable
# ATLAS_SHARD=${atlas_shard} # Evergreen variable
# ATLAS_SHARD_SRV=${atlas_shard_srv} # Evergreen variable
# ATLAS_TLS11=${atlas_tls11} # Evergreen variable
# ATLAS_TLS11_SRV=${atlas_tls11_srv} # Evergreen variable
# ATLAS_TLS12=${atlas_tls12} # Evergreen variable
# ATLAS_TLS12_SRV=${atlas_tls12_srv} # Evergreen variable
# REQUIRE_TLS12=${require_tls12} # libmongoc requires TLS 1.2+
# OBSOLETE_TLS=${obsolete_tls} # libmongoc was built with old TLS lib, don't try connecting to Atlas
# VALGRIND=${valgrind} # Whether to run with valgrind
C_TIMEOUT="connectTimeoutMS=30000&serverSelectionTryOnce=false"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
if grep -q "#define MONGOC_ENABLE_SASL 1" src/libmongoc/src/mongoc/mongoc-config.h; then
SASL=1
else
SASL=0
fi
if grep -q "#define MONGOC_ENABLE_SSL 1" src/libmongoc/src/mongoc/mongoc-config.h; then
SSL=1
else
SSL=0
fi
DIR=$(dirname $0)
. $DIR/add-build-dirs-to-paths.sh
case "$OS" in
cygwin*)
PING="./src/libmongoc/Debug/mongoc-ping.exe"
TEST_GSSAPI="./src/libmongoc/Debug/test-mongoc-gssapi.exe"
IP_ADDR=`getent hosts $AUTH_HOST | head -n 1 | awk '{print $1}'`
;;
darwin)
PING="./src/libmongoc/mongoc-ping"
TEST_GSSAPI="./src/libmongoc/test-mongoc-gssapi"
IP_ADDR=`dig $AUTH_HOST +short | tail -1`
;;
*)
PING="./src/libmongoc/mongoc-ping"
TEST_GSSAPI="./src/libmongoc/test-mongoc-gssapi"
IP_ADDR=`getent hosts $AUTH_HOST | head -n 1 | awk '{print $1}'`
esac
if [ "${valgrind}" = "true" ]; then
. $DIR/valgrind.sh
PING="run_valgrind $PING"
TEST_GSSAPI="run_valgrind $TEST_GSSAPI"
fi
if test -f /tmp/drivers.keytab; then
kinit -k -t /tmp/drivers.keytab -p drivers@LDAPTEST.10GEN.CC || true
fi
# Archlinux (which we use for testing various self-installed OpenSSL versions)
# Stores their trust list here. We need to copy it to our custom installed
# OpenSSL trust store.
# LibreSSL bundle their own trust store (in install-dir/etc/ssl/cert.pem)
cp /etc/ca-certificates/extracted/tls-ca-bundle.pem install-dir/ssl/cert.pem || true
# OpenSSL fips enabled path
cp /etc/ca-certificates/extracted/tls-ca-bundle.pem install-dir/cert.pem || true
export PATH=install-dir/bin:$PATH
openssl version || true
ulimit -c unlimited || true
if [ $SSL -eq 1 ]; then
# FIXME: CDRIVER-2008
if [ "${OS%_*}" != "cygwin" ]; then
echo "Authenticating using X.509"
$PING "mongodb://CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US@${AUTH_HOST}/?ssl=true&authMechanism=MONGODB-X509&sslClientCertificateKeyFile=src/libmongoc/tests/x509gen/legacy-x509.pem&sslCertificateAuthorityFile=src/libmongoc/tests/x509gen/legacy-ca.crt&sslAllowInvalidHostnames=true&${C_TIMEOUT}"
fi
if [ "${OBSOLETE_TLS}" != "true" ]; then
echo "Connecting to Atlas Free Tier"
$PING "$ATLAS_FREE&${C_TIMEOUT}"
echo "Connecting to Atlas Free Tier with SRV"
$PING "$ATLAS_FREE_SRV&${C_TIMEOUT}"
echo "Connecting to Atlas Replica Set"
$PING "$ATLAS_REPLSET&${C_TIMEOUT}"
echo "Connecting to Atlas Replica Set with SRV"
$PING "$ATLAS_REPLSET_SRV${C_TIMEOUT}"
echo "Connecting to Atlas Sharded Cluster"
$PING "$ATLAS_SHARD&${C_TIMEOUT}"
echo "Connecting to Atlas Sharded Cluster with SRV"
$PING "$ATLAS_SHARD_SRV${C_TIMEOUT}"
if [ -z "$REQUIRE_TLS12" ]; then
echo "Connecting to Atlas with only TLS 1.1 enabled"
$PING "$ATLAS_TLS11&${C_TIMEOUT}"
echo "Connecting to Atlas with only TLS 1.1 enabled with SRV"
$PING "$ATLAS_TLS11_SRV${C_TIMEOUT}"
fi
echo "Connecting to Atlas with only TLS 1.2 enabled"
$PING "$ATLAS_TLS12&${C_TIMEOUT}"
echo "Connecting to Atlas with only TLS 1.2 enabled with SRV"
$PING "$ATLAS_TLS12_SRV${C_TIMEOUT}"
fi
fi
echo "Authenticating using PLAIN"
$PING "mongodb://${AUTH_PLAIN}@${AUTH_HOST}/?authMechanism=PLAIN&${C_TIMEOUT}"
echo "Authenticating using default auth mechanism"
$PING "mongodb://${AUTH_MONGODBCR}@${AUTH_HOST}/mongodb-cr?${C_TIMEOUT}"
if [ $SASL -eq 1 ]; then
echo "Authenticating using GSSAPI"
$PING "mongodb://${AUTH_GSSAPI}@${AUTH_HOST}/?authMechanism=GSSAPI&${C_TIMEOUT}"
echo "Authenticating with CANONICALIZE_HOST_NAME"
$PING "mongodb://${AUTH_GSSAPI}@${IP_ADDR}/?authMechanism=GSSAPI&authMechanismProperties=CANONICALIZE_HOST_NAME:true&${C_TIMEOUT}"
echo "Test threaded GSSAPI auth"
MONGOC_TEST_GSSAPI_HOST="${AUTH_HOST}" MONGOC_TEST_GSSAPI_USER="${AUTH_GSSAPI}" $TEST_GSSAPI
echo "Threaded GSSAPI auth OK"
if [ "${OS%_*}" = "cygwin" ]; then
echo "Authenticating using GSSAPI (service realm: LDAPTEST.10GEN.CC)"
$PING "mongodb://${AUTH_CROSSREALM}@${AUTH_HOST}/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_REALM:LDAPTEST.10GEN.CC&${C_TIMEOUT}"
echo "Authenticating using GSSAPI (UTF-8 credentials)"
$PING "mongodb://${AUTH_GSSAPI_UTF8}@${AUTH_HOST}/?authMechanism=GSSAPI&${C_TIMEOUT}"
fi
fi
mongo-c-driver-1.16.1/.evergreen/run-mock-server-tests.sh 0000775 0000000 0000000 00000002132 13616147712 0023234 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
DNS=${DNS:-nodns}
echo "CC='${CC}' VALGRIND=${VALGRIND}"
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
TEST_ARGS="-d -F test-results.json"
# AddressSanitizer configuration
export ASAN_OPTIONS="detect_leaks=1 abort_on_error=1 symbolize=1"
export ASAN_SYMBOLIZER_PATH="/usr/lib/llvm-3.4/bin/llvm-symbolizer"
export MONGOC_TEST_FUTURE_TIMEOUT_MS=30000
export MONGOC_TEST_SERVER_LOG="json"
export MONGOC_TEST_SKIP_MOCK="off"
export MONGOC_TEST_SKIP_LIVE="on"
export MONGOC_TEST_SKIP_SLOW="on"
DIR=$(dirname $0)
. $DIR/add-build-dirs-to-paths.sh
case "$OS" in
cygwin*)
./src/libmongoc/test-libmongoc.exe $TEST_ARGS
;;
*)
ulimit -c unlimited || true
if [ "$VALGRIND" = "on" ]; then
. $DIR/valgrind.sh
run_valgrind ./src/libmongoc/test-libmongoc --no-fork $TEST_ARGS
else
./src/libmongoc/test-libmongoc --no-fork $TEST_ARGS
fi
;;
esac
mongo-c-driver-1.16.1/.evergreen/run-tests-bson.sh 0000775 0000000 0000000 00000001730 13616147712 0021743 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "CC='${CC}'"
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
TEST_ARGS="-d -F test-results.json"
if [ "$CC" = "mingw" ]; then
chmod +x src/libbson/test-libbson.exe
cmd.exe /c .evergreen\\run-tests-mingw-bson.bat
exit 0
fi
case "$OS" in
cygwin*)
export PATH=$PATH:`pwd`/src/libbson/Debug
chmod +x src/libmongoc/Debug/* src/libbson/Debug/* || true
;;
esac
cd src/libbson
case "$OS" in
cygwin*)
./Debug/test-libbson.exe $TEST_ARGS
;;
*)
ulimit -c unlimited || true
if [ "$VALGRIND" = "on" ]; then
DIR=$(dirname $0)
. $DIR/valgrind.sh
run_valgrind ./src/libmongoc/test-libmongoc --no-fork $TEST_ARGS
else
./.libs/test-libbson "--no-fork $TEST_ARGS"
fi
;;
esac
mongo-c-driver-1.16.1/.evergreen/run-tests-mingw-bson.bat 0000664 0000000 0000000 00000001402 13616147712 0023207 0 ustar 00root root 0000000 0000000 set PATH=C:\Windows\system32;C:\Windows;C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin;C:\mongo-c-driver\bin
rem "make install" would work, except we run tests on different Evergreen hosts,
rem in different working directories, than where the driver was built. This
rem causes errors in "make install" like:
rem CMake Error at cmake_install cannot find
rem "C:/data/mci/d3ba3391950aca9119e841818a8884bc/mongoc/src/libbson/libbson-1.0.dll"
rem
rem So just copy files manually
rmdir /Q /S C:\mongo-c-driver
md C:\mongo-c-driver
md C:\mongo-c-driver\bin
copy /Y libmongoc-1.0.dll C:\mongo-c-driver\bin
copy /Y src\libbson\libbson-1.0.dll C:\mongo-c-driver\bin
src\libbson\test-libbson.exe --no-fork -d -F test-results-bson.json
rmdir /Q /S C:\mongo-c-driver
mongo-c-driver-1.16.1/.evergreen/run-tests-mingw.bat 0000664 0000000 0000000 00000001403 13616147712 0022251 0 ustar 00root root 0000000 0000000 set PATH=C:\Windows\system32;C:\Windows;C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin;C:\mongo-c-driver\bin
rem "make install" would work, except we run tests on different Evergreen hosts,
rem in different working directories, than where the driver was built. This
rem causes errors in "make install" like:
rem CMake Error at cmake_install cannot find
rem "C:/data/mci/d3ba3391950aca9119e841818a8884bc/mongoc/src/libbson/libbson-1.0.dll"
rem
rem So just copy files manually
rmdir /Q /S C:\mongo-c-driver
md C:\mongo-c-driver
md C:\mongo-c-driver\bin
copy /Y libmongoc-1.0.dll C:\mongo-c-driver\bin
copy /Y src\libbson\libbson-1.0.dll C:\mongo-c-driver\bin
.\src\libmongoc\test-libmongoc.exe --no-fork -d -F test-results.json
rmdir /Q /S C:\mongo-c-driver
mongo-c-driver-1.16.1/.evergreen/run-tests.sh 0000775 0000000 0000000 00000007256 13616147712 0021015 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
COMPRESSORS=${COMPRESSORS:-nocompressors}
AUTH=${AUTH:-noauth}
SSL=${SSL:-nossl}
URI=${URI:-}
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
DNS=${DNS:-nodns}
# AddressSanitizer configuration
export ASAN_OPTIONS="detect_leaks=1 abort_on_error=1 symbolize=1"
export ASAN_SYMBOLIZER_PATH="/opt/mongodbtoolchain/v3/bin/llvm-symbolizer"
echo "COMPRESSORS='${COMPRESSORS}' CC='${CC}' AUTH=${AUTH} SSL=${SSL} URI=${URI} IPV4_ONLY=${IPV4_ONLY} VALGRIND=${VALGRIND} MONGOC_TEST_URI=${MONGOC_TEST_URI}"
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
TEST_ARGS="-d -F test-results.json"
if [ "$COMPRESSORS" != "nocompressors" ]; then
export MONGOC_TEST_COMPRESSORS="$COMPRESSORS"
fi
if [ "$AUTH" != "noauth" ]; then
export MONGOC_TEST_USER="bob"
export MONGOC_TEST_PASSWORD="pwd123"
fi
if [ "$SSL" != "nossl" ]; then
export MONGOC_TEST_SSL_WEAK_CERT_VALIDATION="on"
export MONGOC_TEST_SSL_PEM_FILE="src/libmongoc/tests/x509gen/client.pem"
sudo cp src/libmongoc/tests/x509gen/ca.pem /usr/local/share/ca-certificates/cdriver.crt || true
if [ -f /usr/local/share/ca-certificates/cdriver.crt ]; then
sudo update-ca-certificates
else
export MONGOC_TEST_SSL_CA_FILE="src/libmongoc/tests/x509gen/ca.pem"
fi
fi
export MONGOC_ENABLE_MAJORITY_READ_CONCERN=on
export MONGOC_TEST_FUTURE_TIMEOUT_MS=30000
export MONGOC_TEST_URI="$URI"
export MONGOC_TEST_SERVER_LOG="json"
export MONGOC_TEST_SKIP_MOCK="on"
export MONGOC_TEST_IPV4_AND_IPV6_HOST="ipv4_and_ipv6.test.build.10gen.cc"
if [ "$IPV4_ONLY" != "on" ]; then
export MONGOC_CHECK_IPV6="on"
fi
if [ "$DNS" = "dns-auth" ]; then
export MONGOC_TEST_DNS=on
TEST_ARGS="$TEST_ARGS -l /initial_dns_auth/*"
elif [ "$DNS" != "nodns" ]; then
export MONGOC_TEST_DNS=on
TEST_ARGS="$TEST_ARGS -l /initial_dns_seedlist_discovery*"
fi
if [ "$CC" = "mingw" ]; then
if [ "$DNS" != "nodns" ]; then
echo "ERROR - DNS tests not implemented for MinGW yet"
exit 1
fi
chmod +x ./src/libmongoc/test-libmongoc.exe
cmd.exe /c .evergreen\\run-tests-mingw.bat
exit 0
fi
DIR=$(dirname $0)
. $DIR/add-build-dirs-to-paths.sh
. $DIR/valgrind.sh
check_mongocryptd() {
if [ "$CLIENT_SIDE_ENCRYPTION" = "on" -a "$ASAN" = "on" ]; then
# ASAN does not play well with spawned processes. In addition to --no-fork, do not spawn mongocryptd
# for client-side encryption tests.
export "MONGOC_TEST_MONGOCRYPTD_BYPASS_SPAWN=on"
mongocryptd --logpath ./mongocryptd.logs --fork --pidfilepath="$(pwd)/mongocryptd.pid"
# ASAN reports an unhelpful leak of "unknown module" when linking against libmongocrypt
# (without even calling any functions)
# See https://github.com/google/sanitizers/issues/89 for an explanation behind this
# workaround.
echo "int dlclose(void *handle) { return 0; }" > bypass_dlclose.c
"$CC" -o bypass_dlclose.so -shared bypass_dlclose.c
export LD_PRELOAD="$(pwd)/bypass_dlclose.so:$LD_PRELOAD"
fi
}
case "$OS" in
cygwin*)
export PATH=$PATH:/cygdrive/c/mongodb/bin:/cygdrive/c/libmongocrypt/bin
check_mongocryptd
chmod +x src/libmongoc/Debug/test-libmongoc.exe
./src/libmongoc/Debug/test-libmongoc.exe $TEST_ARGS
;;
*)
ulimit -c unlimited || true
# Need mongocryptd on the path.
export PATH=$PATH:$(pwd)/mongodb/bin
check_mongocryptd
if [ "$VALGRIND" = "on" ]; then
. $DIR/valgrind.sh
run_valgrind ./src/libmongoc/test-libmongoc --no-fork $TEST_ARGS
else
./src/libmongoc/test-libmongoc --no-fork $TEST_ARGS
fi
;;
esac
mongo-c-driver-1.16.1/.evergreen/spec.patch 0000664 0000000 0000000 00000001052 13616147712 0020451 0 ustar 00root root 0000000 0000000 --- mongo-c-driver.spec.orig 2019-08-27 21:43:20.721612865 +0000
+++ mongo-c-driver.spec 2019-08-27 22:28:57.276867708 +0000
@@ -38,7 +38,6 @@ BuildRequires: pkgconfig(libzstd)
BuildRequires: mongodb-server
BuildRequires: openssl
%endif
-BuildRequires: cmake(mongocrypt)
BuildRequires: perl-interpreter
# From man pages
BuildRequires: python3
@@ -124,7 +123,6 @@ Documentation: http://mongoc.org/libbson/%{version}/
%endif
-DENABLE_EXAMPLES:BOOL=OFF \
-DENABLE_UNINSTALL:BOOL=OFF \
- -DENABLE_CLIENT_SIDE_ENCRYPTION:BOOL=ON \
.
mongo-c-driver-1.16.1/.evergreen/valgrind.sh 0000664 0000000 0000000 00000001054 13616147712 0020642 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
run_valgrind ()
{
# Set MONGOC_TEST_VALGRIND to disable asserts that may fail in valgrind
# Do not do leak detection, as ASAN tests are set to detect leaks, and
# leak detection on valgrind is slower.
MONGOC_TEST_SKIP_SLOW=on MONGOC_TEST_VALGRIND=on valgrind \
--error-exitcode=1 --leak-check=no --gen-suppressions=all \
--keep-stacktraces=none --suppressions=valgrind.suppressions \
$@
}
mongo-c-driver-1.16.1/.gdbinit 0000664 0000000 0000000 00000010640 13616147712 0016062 0 ustar 00root root 0000000 0000000 define printbson
set $bson = $arg0
if $bson->flags & BSON_FLAG_INLINE
print ((bson_impl_inline_t*) $bson)->data
set $data = &(((bson_impl_inline_t*) $bson)->data)
printf "INLINE"
__printbson $data
else
set $impl = (bson_impl_alloc_t*) $bson
printf "ALLOC [%p + %d]", $impl->buf, $impl->offset
__printbson (*$impl->buf) + $impl->data
end
end
define __printbson
set $bson = ((uint32_t*)$arg0)
printf " (len=%d)\n", $bson[0]
printf "{\n"
__printElements ($bson+1) 0 1
printf "\n}\n"
end
define __printElements
set $data = ((uint8_t*)$arg0)
set $isDocument = $arg1
set $depth = $arg2
set $addComma = 0
while $data != 0
set $type = (uint8_t)($data[0])
if $type == 0
loop_break
end
if $addComma == 1
printf ",\n"
end
set $addComma = 1
__printSpaces $depth
printf "'%s' : ", (char*) ($data+1)
# skip through C String
while $data[0] != '\0'
set $data = $data + 1
end
set $data = $data + 1
if $type == 0x01
__printDouble $data
end
if $type == 0x02
__printString $data
end
if $type == 0x03
__printDocument $data $depth
end
if $type == 0x04
__printArray $data $depth
end
if $type == 0x05
__printBinary $data
end
if $type == 0x07
__printObjectID $data
end
if $type == 0x08
__printBool $data
end
if $type == 0x09
__printUtcDateTime $data
end
if $type == 0x0a
__printNull
end
if $type == 0x0b
__printRegex $data
end
if $type == 0x0d
__printJavascript $data
end
if $type == 0x0e
__printSymbol $data
end
if $type == 0x0f
__printJavascriptWScope $data
end
if $type == 0x10
__printInt32 $data
end
if $type == 0x11
__printTimestamp $data
end
if $type == 0x12
__printInt64 $data
end
end
end
define __printSpaces
set $i = 0
while $i < (4 * $arg0)
printf " "
set $i = $i + 1
end
end
define __printDocument
set $value = ((uint8_t*) $arg0)
set $depth = $arg1
printf "{\n"
__printElements ($value+4) 1 ($depth+1)
printf "\n"
__printSpaces ($depth-1)
printf "}"
set $depth = $depth-1
set $data = $data + 1
end
define __printArray
set $value = ((uint8_t*) $arg0)
set $depth = $arg1
printf "[\n"
__printElements ($value+4) (0) ($depth+1)
printf "\n"
__printSpaces ($depth-1)
printf "]"
set $depth = $depth-1
set $data = $data + 1
end
define __printDouble
set $value = ((double*) $arg0)
printf "%f", $value[0]
set $data = $data + 8
end
define __printString
set $value = ((char*) $arg0) + 4
printf "\"%s\"", $value
set $data = $data + 4 + ((uint32_t*)$data)[0]
end
define __printBinary
set $value = ((uint8_t*) $arg0)
set $length = ((int32_t*) $arg0)[0]
printf "Binary(\"%02X\", \"", $value[4]
set $i = 4
while $i < $length
printf "%02X", $value[$i+5]
set $i = $i + 1
end
printf "\")"
set $data = $data + 5 + ((uint32_t*)$data)[0]
end
define __printObjectID
set $value = ((uint8_t*) $arg0)
set $i = 0
printf "ObjectID(\""
while $i < 12
printf "%02X", $value[$i]
set $i = $i + 1
end
printf "\")"
set $data = $data + 12
end
define __printBool
set $value = ((uint8_t*) $arg0)
printf "%s", $value[0] ? "true" : "false"
set $data = $data + 1
end
define __printUtcDateTime
set $value = ((uint64_t*) $arg0)
printf "UTCDateTime(%ld)", $value[0]
set $data = $data + 8
end
define __printNull
printf "null"
end
define __printRegex
printf "Regex(\"%s\", \"", (char*) $data
# skip through C String
while $data[0] != '\0'
set $data = $data + 1
end
set $data = $data + 1
printf "%s\")", (char*) $data
# skip through C String
while $data[0] != '\0'
set $data = $data + 1
end
set $data = $data + 1
end
define __printJavascript
set $value = ((char*) $arg0) + 4
printf "JavaScript(\"%s\")", $value
set $data = $data + 4 + ((uint32_t*)$data)[0]
end
define __printSymbol
set $value = ((char*) $arg0) + 4
printf "Symbol(\"%s\")", $value
set $data = $data + 4 + ((uint32_t*)$data)[0]
end
define __printJavascriptWScope
set $value = ((char*) $arg0) + 8
printf "JavaScript(\"%s\") with scope: ", $value
set $data = $data + 8 + ((uint32_t*)$data)[1]
__printDocument $data $depth
end
define __printInt32
set $value = ((uint32_t*) $arg0)
printf "NumberInt(\"%d\")", $value[0]
set $data = $data + 4
end
define __printTimestamp
set $value = ((uint32_t*) $arg0)
printf "Timestamp(%u, %u)", $value[0], $value[1]
set $data = $data + 8
end
define __printInt64
set $value = ((uint64_t*) $arg0)
printf "NumberLong(\"%ld\")", $value[0]
set $data = $data + 8
end
mongo-c-driver-1.16.1/.gitattributes 0000664 0000000 0000000 00000000033 13616147712 0017327 0 ustar 00root root 0000000 0000000 tests/binary/* text eol=lf
mongo-c-driver-1.16.1/.gitignore 0000664 0000000 0000000 00000000520 13616147712 0016425 0 ustar 00root root 0000000 0000000 *.a
*.dylib
*.gcda
*.gcno
*.gz
*.o
*.pc
*.so
*.so.*
.githooks
cmake-build
cmake_install.cmake
CMakeCache.txt
CMakeFiles
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
dist_manifest.txt
Makefile
test-results.json
VERSION_CURRENT
VERSION_RELEASED
# Windows things
*.sdf
*.sln
*.vcxproj*
.vs
Debug
install_manifest.txt
x64
mongo-c-driver-1.16.1/.gitmodules 0000664 0000000 0000000 00000000000 13616147712 0016603 0 ustar 00root root 0000000 0000000 mongo-c-driver-1.16.1/.lsan-suppressions 0000664 0000000 0000000 00000000153 13616147712 0020150 0 ustar 00root root 0000000 0000000 leak:ccrng_cryptographic_init_once
leak:ccrng_cryptographic_generate
leak:res_9_ninit
leak:SSLCreateContext mongo-c-driver-1.16.1/.travis.scripts/ 0000775 0000000 0000000 00000000000 13616147712 0017514 5 ustar 00root root 0000000 0000000 mongo-c-driver-1.16.1/.travis.scripts/debug-core.sh 0000775 0000000 0000000 00000000123 13616147712 0022063 0 ustar 00root root 0000000 0000000 #!/bin/sh
echo "backtrace full" | ./libtool --mode execute gdb test-libmongoc $1
mongo-c-driver-1.16.1/.travis.yml 0000664 0000000 0000000 00000002635 13616147712 0016557 0 ustar 00root root 0000000 0000000 language: c
compiler:
- gcc
- clang
os:
- linux
- osx
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
# https://github.com/Homebrew/homebrew-core/issues/26358
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew unlink python; fi
# "brew install" can succeed but return 1 if it has "caveats".
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap mongodb/brew && brew install mongodb-community || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start mongodb-community; fi
before_script:
# Add an IPv6 config - see the corresponding Travis issue
# https://github.com/travis-ci/travis-ci/issues/8361
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
fi
services: mongodb
env:
- CFLAGS="$CFLAGS -Werror -Wno-cast-align"
addons:
apt:
packages:
- gdb
script:
- sudo sh -c 'echo "\n::1 localhost\n" >> /etc/hosts'
- ulimit -a
- ulimit -c unlimited || true
- cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_MAINTAINER_FLAGS=ON -ENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .
- make -j 8
- make check
after_failure:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gdb; fi
- find /cores . -name \*core\* -exec ./.travis.scripts/debug-core.sh {} \;
# Exclude gcc on osx since it's just an alias for clang.
matrix:
exclude:
- compiler: gcc
os: osx
git:
depth: 20
mongo-c-driver-1.16.1/CMakeLists.txt 0000664 0000000 0000000 00000034665 13616147712 0017216 0 ustar 00root root 0000000 0000000 cmake_minimum_required (VERSION 3.1)
# Used in MaintainerFlags.cmake to silence errors while testing configs.
set (MESSAGES_ENABLED 1)
function (message)
list (GET ARGV 0 MessageType)
if (MESSAGES_ENABLED)
list (REMOVE_AT ARGV 0)
_message (${MessageType} "${ARGV}")
endif ()
endfunction ()
set (ENABLE_SSL AUTO CACHE STRING
"Enable TLS connections and SCRAM-SHA-1 authentication. Options are
\"DARWIN\" to use Apple's Secure Transport, \"WINDOWS\" to use Windows
Secure Channel, \"OPENSSL\", \"LIBRESSL\", \"AUTO\",\ or \"OFF\". These options are
case-sensitive. The default is \"AUTO\". Note\ that SCRAM-SHA-1 is
required for authenticating to MongoDB 3.0 and later.")
set_property(CACHE ENABLE_SSL PROPERTY STRINGS "DARWIN;WINDOWS;OPENSSL;LIBRESSL;AUTO;OFF")
set (ENABLE_SASL AUTO CACHE STRING
"Enable SASL authentication (Kerberos). Options are \"CYRUS\" to use Cyrus
SASL, \"SSPI\" to use Windows Native SSPI, \"AUTO\",\ or \"OFF\". These options are case-sensitive.")
set_property(CACHE ENABLE_SASL PROPERTY STRINGS "CYRUS|SSPI|AUTO|OFF")
set (ENABLE_STATIC AUTO CACHE STRING "Build static libmongoc. Set to ON/AUTO/OFF, default AUTO.")
option (ENABLE_TESTS "Build MongoDB C Driver tests." ON)
option (ENABLE_EXAMPLES "Build MongoDB C Driver examples." ON)
set (ENABLE_SRV AUTO CACHE STRING "Support mongodb+srv URIs. Set to ON/AUTO/OFF, default AUTO.")
option (ENABLE_MAINTAINER_FLAGS "Use strict compiler checks" OFF)
option (ENABLE_AUTOMATIC_INIT_AND_CLEANUP "Enable automatic init and cleanup (GCC only)" ON)
option (ENABLE_CRYPTO_SYSTEM_PROFILE "Use system crypto profile (OpenSSL only)" OFF)
option (ENABLE_TRACING "Turn on verbose debug output" OFF)
option (ENABLE_COVERAGE "Turn on compile options for lcov" OFF)
set (ENABLE_SHM_COUNTERS AUTO CACHE STRING "Enable memory performance counters that use shared memory on Linux. Set to ON/AUTO/OFF, default AUTO.")
set (ENABLE_MONGOC ON CACHE STRING "Whether to build libmongoc. Set to ON/OFF, default ON.")
set (ENABLE_BSON AUTO CACHE STRING "Whether to build libbson. Set to ON/AUTO/SYSTEM, default AUTO.")
set (ENABLE_SNAPPY AUTO CACHE STRING "Enable snappy support. Set to ON/AUTO/OFF, default AUTO.")
set (ENABLE_ZLIB AUTO CACHE STRING "Enable zlib support")
set (ENABLE_ZSTD AUTO CACHE STRING "Enable zstd support. Set to ON/AUTO/OFF, default AUTO.")
option (ENABLE_MAN_PAGES "Build MongoDB C Driver manual pages." OFF)
option (ENABLE_HTML_DOCS "Build MongoDB C Driver HTML documentation." OFF)
option (ENABLE_EXTRA_ALIGNMENT
"Turn on extra alignment of libbson types. Set to ON/OFF, default ON.\
Required for the 1.0 ABI but better disabled."
ON
)
option (ENABLE_RDTSCP
"Fast performance counters on Intel using the RDTSCP instruction"
OFF
)
option (ENABLE_APPLE_FRAMEWORK "Build libraries as frameworks on darwin platforms" OFF)
set (ENABLE_ICU AUTO CACHE STRING "Enable ICU support, necessary to use non-ASCII usernames or passwords, default AUTO.")
option (ENABLE_UNINSTALL "Enable creation of uninstall script and associated uninstall build target." ON)
set (ENABLE_CLIENT_SIDE_ENCRYPTION AUTO CACHE STRING "Enable Client-Side Field Level Encryption support. Requires libmongocrypt. Set to ON/AUTO/OFF, default AUTO.")
project (mongo-c-driver C)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "RelWithDebInfo")
message (
STATUS "No CMAKE_BUILD_TYPE selected, defaulting to ${CMAKE_BUILD_TYPE}"
)
endif ()
set (CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/build/cmake
${PROJECT_SOURCE_DIR}/build/cmake/make_dist
)
include (InstallRequiredSystemLibraries)
include (GNUInstallDirs)
set (BUILD_VERSION "0.0.0" CACHE STRING "Library version (for both libbson and libmongoc)")
include (ParseVersion)
# Set MONGOC_MAJOR_VERSION, MONGOC_MINOR_VERSION, etc.
if (BUILD_VERSION STREQUAL "0.0.0")
if (EXISTS ${PROJECT_SOURCE_DIR}/VERSION_CURRENT)
file (STRINGS ${PROJECT_SOURCE_DIR}/VERSION_CURRENT BUILD_VERSION)
message ("file VERSION_CURRENT contained BUILD_VERSION ${BUILD_VERSION}")
else ()
find_package (PythonInterp)
if (PYTHONINTERP_FOUND)
execute_process (
COMMAND ${PYTHON_EXECUTABLE} build/calc_release_version.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE CALC_RELEASE_VERSION
RESULT_VARIABLE CALC_RELEASE_VERSION_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT CALC_RELEASE_VERSION_RESULT STREQUAL 0)
# If python failed above, stderr would tell the user about it
message (FATAL_ERROR
"BUILD_VERSION not specified and could not be calculated\
(script invocation failed); specify in CMake command, -DBUILD_VERSION=
{{ text }}
mongo-c-driver-1.16.1/build/sphinx/basic/changes/versionchanges.html 0000775 0000000 0000000 00000002432 13616147712 0025451 0 ustar 00root root 0000000 0000000 {% macro entries(changes) %}
{{ _('Welcome! This is') }} {% block description %}{{ _('the documentation for') }} {{ project|e }} {{ release|e }}{% if last_updated %}, {{ _('last updated') }} {{ last_updated|e }}{% endif %}{% endblock %}.
{% block tables %}{{ _('Indices and tables:') }}
|
{{ _('Complete Table of Contents') }} {{ _('Search Page') }} |
{{ _('Global Module Index') }} {{ _('General Index') }} |
| {{ letter }} | ||
| {% if grouptype == 1 -%} {%- endif %} | {% if grouptype == 2 %} {% endif %}
{% if page %}{% endif -%}
{{ name|e }}
{%- if page %}{% endif %}
{%- if extra %} ({{ extra|e }}){% endif -%}
| {% if qualifier %}{{ qualifier|e }}:{% endif %} {{ description|e }} |
|
{%- endfor %}
{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}
{{ _('Full index on one page') }}
{{ super() }} {% endblock %} mongo-c-driver-1.16.1/build/sphinx/basic/genindex-split.html 0000775 0000000 0000000 00000002272 13616147712 0023757 0 ustar 00root root 0000000 0000000 {# basic/genindex-split.html ~~~~~~~~~~~~~~~~~~~~~~~~~ Template for a "split" index overview page. :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- extends "layout.html" %} {% set title = _('Index') %} {% block body %}{{ _('Index pages by letter') }}:
{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}
{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}
{{ _('Full index on one page') }}
{% endif %} {{ super() }} {% endblock %} mongo-c-driver-1.16.1/build/sphinx/basic/genindex.html 0000775 0000000 0000000 00000004024 13616147712 0022623 0 ustar 00root root 0000000 0000000 {# basic/genindex.html ~~~~~~~~~~~~~~~~~~~ Template for an "all-in-one" index. :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% macro indexentries(firstname, links) %} {%- if links -%} {%- if links[0][0] %}{% endif -%} {{ firstname|e }} {%- if links[0][0] %}{% endif -%} {%- for ismain, link in links[1:] -%} , {% if ismain %}{% endif -%} [{{ loop.index }}] {%- if ismain %}{% endif -%} {%- endfor %} {%- else %} {{ firstname|e }} {%- endif %} {% endmacro %} {%- extends "layout.html" %} {% set title = _('Index') %} {% block body %}
|
{%- endfor %}
{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}
{{ _('Full index on one page') }}
{% endif %} {{ super() }} {% endblock %} mongo-c-driver-1.16.1/build/sphinx/basic/globaltoc.html 0000775 0000000 0000000 00000000477 13616147712 0023000 0 ustar 00root root 0000000 0000000 {# basic/globaltoc.html ~~~~~~~~~~~~~~~~~~~~ Sphinx sidebar template: global table of contents. :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #}{% trans %}Please activate JavaScript to enable the search functionality.{% endtrans %}
{% trans %}From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.{% endtrans %}
{% if search_performed %}{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}
{% endif %} {% endif %}From here you can search these documents. Enter your search words into the box below and click "search".
{%- if search_performed %}{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}
{%- endif %} {%- endif %}