Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package resolv_wrapper for openSUSE:Factory checked in at 2022-12-20 20:21:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/resolv_wrapper (Old) and /work/SRC/openSUSE:Factory/.resolv_wrapper.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "resolv_wrapper" Tue Dec 20 20:21:22 2022 rev:7 rq:1043945 version:1.1.8 Changes: -------- --- /work/SRC/openSUSE:Factory/resolv_wrapper/resolv_wrapper.changes 2021-11-03 17:26:57.721360066 +0100 +++ /work/SRC/openSUSE:Factory/.resolv_wrapper.new.1835/resolv_wrapper.changes 2022-12-20 20:22:01.226382430 +0100 @@ -1,0 +2,8 @@ +Tue Dec 20 15:37:01 UTC 2022 - Andreas Schneider <a...@cryptomilk.org> + +- Update to version 1.1.8 + * Fix issues with glibc >= 2.34 + * Move debug messages from error to warning +- Removed resolv_wrapper_fix_glibc.patch + +------------------------------------------------------------------- Old: ---- resolv_wrapper-1.1.6.tar.gz resolv_wrapper-1.1.6.tar.gz.asc resolv_wrapper_fix_glibc.patch New: ---- resolv_wrapper-1.1.8.tar.gz resolv_wrapper-1.1.8.tar.gz.asc resolv_wrapper.keyring ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ resolv_wrapper.spec ++++++ --- /var/tmp/diff_new_pack.d9Onzr/_old 2022-12-20 20:22:01.714385104 +0100 +++ /var/tmp/diff_new_pack.d9Onzr/_new 2022-12-20 20:22:01.722385148 +0100 @@ -1,7 +1,7 @@ # # spec file for package resolv_wrapper # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ ############################# NOTE ################################## Name: resolv_wrapper -Version: 1.1.6 +Version: 1.1.8 Release: 0 Summary: A wrapper for DNS name resolving or DNS faking @@ -34,11 +34,8 @@ Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc -Source2: %{name}-rpmlintrc - -%if 0%{?suse_version} >= 1550 -Patch0: resolv_wrapper_fix_glibc.patch -%endif +Source2: resolv_wrapper.keyring +Source3: %{name}-rpmlintrc BuildRequires: cmake BuildRequires: glibc-devel @@ -59,11 +56,7 @@ development/testing. %prep -%setup -q - -%if 0%{?suse_version} >= 1550 -%patch0 -p1 -%endif +%autosetup -p1 %build %cmake \ ++++++ resolv_wrapper-1.1.6.tar.gz -> resolv_wrapper-1.1.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/.gitlab-ci.yml new/resolv_wrapper-1.1.8/.gitlab-ci.yml --- old/resolv_wrapper-1.1.6/.gitlab-ci.yml 2020-03-23 10:19:30.000000000 +0100 +++ new/resolv_wrapper-1.1.8/.gitlab-ci.yml 2020-08-24 16:45:53.000000000 +0200 @@ -5,7 +5,7 @@ CENTOS7_BUILD: buildenv-centos7 TUMBLEWEED_BUILD: buildenv-tumbleweed MINGW_BUILD: buildenv-mingw - DEBIAN_CROSS_BUILD: buildenv-debian-cross + UBUNTU_BUILD: buildenv-ubuntu centos7/x86_64: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS7_BUILD @@ -135,30 +135,6 @@ paths: - obj/ -.Debian.cross.template: &Debian_cross_template - stage: test - image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_CROSS_BUILD - script: - - build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) - - host="${CI_JOB_NAME#*.cross.}" - - mkdir -p obj && cd obj && cmake - -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-Debian-mips.cmake - -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DUNIT_TESTING=ON .. && make -j$(nproc) && - ctest --output-on-failure - tags: - - shared - except: - - tags - artifacts: - expire_in: 1 week - when: on_failure - paths: - - obj/ - -Debian.cross.mips-linux-gnu: - <<: *Debian_cross_template - tumbleweed/x86_64/gcc: image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD script: @@ -235,3 +211,21 @@ when: on_failure paths: - obj/scan + +ubuntu/x86_64: + image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$UBUNTU_BUILD + script: + - mkdir -p obj && cd obj && cmake + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DPICKY_DEVELOPER=ON + -DUNIT_TESTING=ON .. && + make -j$(nproc) && ctest --output-on-failure + tags: + - shared + except: + - tags + artifacts: + expire_in: 1 week + when: on_failure + paths: + - obj/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/CHANGELOG new/resolv_wrapper-1.1.8/CHANGELOG --- old/resolv_wrapper-1.1.6/CHANGELOG 2020-03-23 10:21:57.000000000 +0100 +++ new/resolv_wrapper-1.1.8/CHANGELOG 2022-12-20 16:10:18.000000000 +0100 @@ -1,6 +1,12 @@ CHANGELOG ========= +version 1.1.8 (released 2022-12-20) + * Fix issues with glibc >= 2.34 + +version 1.1.7 (released 2020-08-25) + * Move debug messages from error to warning + version 1.1.6 (released 2020-03-23) * Added support for running with Sanitizers * Added fake resolving of TXT records diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/CMakeLists.txt new/resolv_wrapper-1.1.8/CMakeLists.txt --- old/resolv_wrapper-1.1.6/CMakeLists.txt 2020-03-23 10:21:57.000000000 +0100 +++ new/resolv_wrapper-1.1.8/CMakeLists.txt 2022-12-20 16:10:18.000000000 +0100 @@ -11,7 +11,7 @@ include(DefineCMakeDefaults) include(DefineCompilerFlags) -project(resolv_wrapper VERSION 1.1.6 LANGUAGES C) +project(resolv_wrapper VERSION 1.1.8 LANGUAGES C) # global needed variables set(APPLICATION_NAME ${PROJECT_NAME}) @@ -25,7 +25,7 @@ # Increment PATCH. set(LIBRARY_VERSION_MAJOR 0) set(LIBRARY_VERSION_MINOR 0) -set(LIBRARY_VERSION_PATCH 6) +set(LIBRARY_VERSION_PATCH 8) set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/ConfigureChecks.cmake new/resolv_wrapper-1.1.8/ConfigureChecks.cmake --- old/resolv_wrapper-1.1.6/ConfigureChecks.cmake 2020-03-23 10:19:30.000000000 +0100 +++ new/resolv_wrapper-1.1.8/ConfigureChecks.cmake 2022-12-20 16:10:14.000000000 +0100 @@ -57,12 +57,23 @@ find_library(RESOLV_LIRBRARY resolv) if (RESOLV_LIRBRARY) - set(HAVE_LIBRESOLV TRUE) + check_function_exists(res_nquery HAVE_LIBC_RES_INIT) + check_function_exists(__res_query HAVE_LIBC__RES_INIT) + + if (NOT HAVE_LIBC_RES_INIT AND NOT HAVE_LIBC__RES_INIT) + set(CMAKE_REQUIRED_LIBRARIES ${RESOLV_LIRBRARY}) + check_function_exists(res_query HAVE_RES_QUERY) + check_function_exists(__res_query HAVE___RES_QUERY) + unset(CMAKE_REQUIRED_LIBRARIES) + + if (HAVE_RES_QUERY OR HAVE___RES_QUERY) + set(HAVE_LIBRESOLV 1) + + endif() + endif() # If we have a libresolv, we need to check functions linking the library list(APPEND _REQUIRED_LIBRARIES ${RESOLV_LIRBRARY}) -else() - message(STATUS "libresolv not found on ${CMAKE_SYSTEM_NAME}: Only dns faking will be available") endif() set(CMAKE_REQUIRED_LIBRARIES ${RESOLV_LIRBRARY}) @@ -205,4 +216,8 @@ # ENDIAN test_big_endian(WORDS_BIGENDIAN) +if (NOT HAVE_LIBRESOLV) + message(STATUS "Limited features: Only dns faking will be available") +endif() + set(RWRAP_REQUIRED_LIBRARIES ${_REQUIRED_LIBRARIES} CACHE INTERNAL "resolv_wrapper required system libraries") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/doc/README new/resolv_wrapper-1.1.8/doc/README --- old/resolv_wrapper-1.1.6/doc/README 2014-10-21 14:33:48.000000000 +0200 +++ new/resolv_wrapper-1.1.8/doc/README 2022-12-20 16:10:14.000000000 +0100 @@ -1,3 +1,7 @@ The manpage is written with asciidoc. To generate the manpage use: -a2x --doctype manpage --format manpage doc/resolv_wrapper.1.txt + asciidoctor -b manpage doc/resolv_wrapper.1.adoc + +or + + a2x --doctype manpage --format manpage doc/resolv_wrapper.1.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1 new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1 --- old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1 2020-03-23 10:19:30.000000000 +0100 +++ new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1 2022-12-20 16:10:14.000000000 +0100 @@ -1,50 +1,54 @@ '\" t .\" Title: resolv_wrapper .\" Author: The Samba Team -.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 2020-01-31 +.\" Generator: Asciidoctor 2.0.15 +.\" Date: 2021-11-03 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "RESOLV_WRAPPER" "1" "2020\-01\-31" "\ \&" "\ \&" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.TH "RESOLV_WRAPPER" "1" "2021-11-03" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation +.ss \n[.ss] 0 .nh -.\" disable justification (adjust text to left margin only) .ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- +.de URL +\fI\\$2\fP <\\$1>\\$3 +.. +.als MTO URL +.if \n[.g] \{\ +. mso www.tmac +. am URL +. ad l +. . +. am MTO +. ad l +. . +. LINKSTYLE blue R < > +.\} .SH "NAME" -resolv_wrapper \- A wrapper for dns name resolving or dns faking\&. +resolv_wrapper \- A wrapper for dns name resolving or dns faking. .SH "SYNOPSIS" .sp -LD_PRELOAD=libresolv_wrapper\&.so RESOLV_WRAPPER_CONF="/path/to/resolv\&.conf" \fB\&./myapplication\fR +LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" \fB./myapplication\fP .SH "DESCRIPTION" .sp -resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS implementation in your test environment\&. It requires socket_wrapper to be able to contact it\&. If it doesn\(cqt work on a special platform the wrapper is able to fake DNS queries and return valid responses to your application\&. +resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS +implementation in your test environment. It requires socket_wrapper to be able +to contact it. +If it doesn\(cqt work on a special platform the wrapper is able to fake DNS queries +and return valid responses to your application. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} -Redirects name queries to the nameservers specified in your resolv\&.conf +Redirects name queries to the nameservers specified in your resolv.conf .RE .sp .RS 4 @@ -52,64 +56,67 @@ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} -Can fake DNS queries using a simple formatted DNS hosts file\&. +Can fake DNS queries using a simple formatted DNS hosts file. .RE .SH "ENVIRONMENT VARIABLES" -.PP -\fBRESOLV_WRAPPER_CONF\fR +.sp +\fBRESOLV_WRAPPER_CONF\fP .RS 4 -This is used to specify the resolv\&.conf to use\&. The format of the resolv\&.conf file is defined in the manpage -\fIresolv\&.conf(5)\fR\&. Currently only the -\fBnamserver\fR -directive is supported\&. +This is used to specify the resolv.conf to use. The format of the resolv.conf +file is defined in the manpage \fIresolv.conf(5)\fP. Currently only the \fBnamserver\fP +directive is supported. .RE -.PP -\fBRESOLV_WRAPPER_HOSTS\fR -.RS 4 -This environment variable is used for faking DNS queries\&. It must point to a hosts\-like text file that specifies fake records for custom queries\&. The format of the file looks like this: .sp -.if n \{\ +In order that this works with socket_wrapper. The res_* symbols need to be in +a separate libresolv library. If they are part of libc this wont work. This is +the case with glibc >= 2.34. +.sp +\fBRESOLV_WRAPPER_HOSTS\fP .RS 4 -.\} +This environment variable is used for faking DNS queries. It must point to a +hosts\-like text file that specifies fake records for custom queries. The +format of the file looks like this: +.sp +.if n .RS 4 .nf +.fam C TYPE RECORD_NAME RECORD_VALUE +.fam .fi -.if n \{\ -.RE -.\} +.if n .RE .RE .sp For example: .sp -.if n \{\ -.RS 4 -.\} +.if n .RS 4 .nf -A dc\&.cwrap\&.org 127\&.0\&.0\&.10 -AAAA dc\&.cwrap\&.org fd00::5357:5f0a -CNAME kerberos\&.cwrap\&.org dc\&.cwrap\&.org -SRV _kerberos\&._tcp\&.cwrap\&.org kerberos\&.cwrap\&.org 88 -URI _vpn\&.cwrap\&.org https://vpn\&.cwrap\&.org/VPN -TXT cwrap\&.org v=spf1 mx +.fam C +A dc.cwrap.org 127.0.0.10 +AAAA dc.cwrap.org fd00::5357:5f0a +CNAME kerberos.cwrap.org dc.cwrap.org +SRV _kerberos._tcp.cwrap.org kerberos.cwrap.org 88 +URI _vpn.cwrap.org https://vpn.cwrap.org/VPN +TXT cwrap.org v=spf1 mx +.fam .fi -.if n \{\ -.RE -.\} -.PP -\fBRESOLV_WRAPPER_DEBUGLEVEL\fR +.if n .RE +.sp +\fBRESOLV_WRAPPER_DEBUGLEVEL\fP .RS 4 -If you need to see what is going on in resolv_wrapper itself or try to find a bug, you can enable logging support in resolv_wrapper if you built it with debug symbols\&. +If you need to see what is going on in resolv_wrapper itself or try to find a +bug, you can enable logging support in resolv_wrapper if you built it with +debug symbols. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} 0 = ERROR .RE @@ -119,8 +126,8 @@ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} 1 = WARNING .RE @@ -130,8 +137,8 @@ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} 2 = DEBUG .RE @@ -141,33 +148,30 @@ \h'-04'\(bu\h'+03'\c .\} .el \{\ -.sp -1 -.IP \(bu 2.3 +. sp -1 +. IP \(bu 2.3 .\} 3 = TRACE .RE .RE -.PP -\fBRESOLV_WRAPPER_DISABLE_DEEPBIND\fR +.sp +\fBRESOLV_WRAPPER_DISABLE_DEEPBIND\fP .RS 4 -This allows you to disable deep binding in resolv_wrapper\&. This is useful for running valgrind tools or sanitizers like (address, undefined, thread)\&. +This allows you to disable deep binding in resolv_wrapper. This is useful for +running valgrind tools or sanitizers like (address, undefined, thread). .RE .SH "EXAMPLE" .sp -The following command would trick \fIkinit(1)\fR into using DNS servers from "\&./resolv\&.conf" for Kerberos service resolution: +The following command would trick \fIkinit(1)\fP into using DNS servers from "./resolv.conf" +for Kerberos service resolution: .sp -.if n \{\ -.RS 4 -.\} +.if n .RS 4 .nf -$ LD_PRELOAD=libresolv_wrapper\&.so RESOLV_WRAPPER_CONF="\&./resolv\&.conf" kinit user@EXAMPLE\&.COM +.fam C +$ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit u...@example.com +.fam .fi -.if n \{\ -.RE -.\} +.if n .RE .SH "AUTHOR" -.PP -\fBThe Samba Team\fR -.RS 4 -Author. -.RE +.sp +The Samba Team \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1.adoc new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1.adoc --- old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1.adoc 1970-01-01 01:00:00.000000000 +0100 +++ new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1.adoc 2022-12-20 16:10:14.000000000 +0100 @@ -0,0 +1,80 @@ +resolv_wrapper(1) +================= +:author: The Samba Team +:revdate: 2020-01-31 + +NAME +---- + +resolv_wrapper - A wrapper for dns name resolving or dns faking. + +SYNOPSIS +-------- + +LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" *./myapplication* + +DESCRIPTION +----------- + +resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS +implementation in your test environment. It requires socket_wrapper to be able +to contact it. +If it doesn't work on a special platform the wrapper is able to fake DNS queries +and return valid responses to your application. + +- Redirects name queries to the nameservers specified in your resolv.conf +- Can fake DNS queries using a simple formatted DNS hosts file. + +ENVIRONMENT VARIABLES +--------------------- + +*RESOLV_WRAPPER_CONF*:: + +This is used to specify the resolv.conf to use. The format of the resolv.conf +file is defined in the manpage 'resolv.conf(5)'. Currently only the *namserver* +directive is supported. + +In order that this works with socket_wrapper. The res_* symbols need to be in +a separate libresolv library. If they are part of libc this wont work. This is +the case with glibc >= 2.34. + +*RESOLV_WRAPPER_HOSTS*:: + +This environment variable is used for faking DNS queries. It must point to a +hosts-like text file that specifies fake records for custom queries. The +format of the file looks like this: + + TYPE RECORD_NAME RECORD_VALUE + +For example: + + A dc.cwrap.org 127.0.0.10 + AAAA dc.cwrap.org fd00::5357:5f0a + CNAME kerberos.cwrap.org dc.cwrap.org + SRV _kerberos._tcp.cwrap.org kerberos.cwrap.org 88 + URI _vpn.cwrap.org https://vpn.cwrap.org/VPN + TXT cwrap.org v=spf1 mx + +*RESOLV_WRAPPER_DEBUGLEVEL*:: + +If you need to see what is going on in resolv_wrapper itself or try to find a +bug, you can enable logging support in resolv_wrapper if you built it with +debug symbols. + +- 0 = ERROR +- 1 = WARNING +- 2 = DEBUG +- 3 = TRACE + +*RESOLV_WRAPPER_DISABLE_DEEPBIND*:: + +This allows you to disable deep binding in resolv_wrapper. This is useful for +running valgrind tools or sanitizers like (address, undefined, thread). + +EXAMPLE +------- + +The following command would trick 'kinit(1)' into using DNS servers from "./resolv.conf" +for Kerberos service resolution: + + $ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit u...@example.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1.txt new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1.txt --- old/resolv_wrapper-1.1.6/doc/resolv_wrapper.1.txt 2020-03-23 10:19:30.000000000 +0100 +++ new/resolv_wrapper-1.1.8/doc/resolv_wrapper.1.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,76 +0,0 @@ -resolv_wrapper(1) -================= -:author: The Samba Team -:revdate: 2020-01-31 - -NAME ----- - -resolv_wrapper - A wrapper for dns name resolving or dns faking. - -SYNOPSIS --------- - -LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="/path/to/resolv.conf" *./myapplication* - -DESCRIPTION ------------ - -resolv_wrapper makes it possible on most UNIX platforms to contact your own DNS -implementation in your test environment. It requires socket_wrapper to be able -to contact it. -If it doesn't work on a special platform the wrapper is able to fake DNS queries -and return valid responses to your application. - -- Redirects name queries to the nameservers specified in your resolv.conf -- Can fake DNS queries using a simple formatted DNS hosts file. - -ENVIRONMENT VARIABLES ---------------------- - -*RESOLV_WRAPPER_CONF*:: - -This is used to specify the resolv.conf to use. The format of the resolv.conf -file is defined in the manpage 'resolv.conf(5)'. Currently only the *namserver* -directive is supported. - -*RESOLV_WRAPPER_HOSTS*:: - -This environment variable is used for faking DNS queries. It must point to a -hosts-like text file that specifies fake records for custom queries. The -format of the file looks like this: - - TYPE RECORD_NAME RECORD_VALUE - -For example: - - A dc.cwrap.org 127.0.0.10 - AAAA dc.cwrap.org fd00::5357:5f0a - CNAME kerberos.cwrap.org dc.cwrap.org - SRV _kerberos._tcp.cwrap.org kerberos.cwrap.org 88 - URI _vpn.cwrap.org https://vpn.cwrap.org/VPN - TXT cwrap.org v=spf1 mx - -*RESOLV_WRAPPER_DEBUGLEVEL*:: - -If you need to see what is going on in resolv_wrapper itself or try to find a -bug, you can enable logging support in resolv_wrapper if you built it with -debug symbols. - -- 0 = ERROR -- 1 = WARNING -- 2 = DEBUG -- 3 = TRACE - -*RESOLV_WRAPPER_DISABLE_DEEPBIND*:: - -This allows you to disable deep binding in resolv_wrapper. This is useful for -running valgrind tools or sanitizers like (address, undefined, thread). - -EXAMPLE -------- - -The following command would trick 'kinit(1)' into using DNS servers from "./resolv.conf" -for Kerberos service resolution: - - $ LD_PRELOAD=libresolv_wrapper.so RESOLV_WRAPPER_CONF="./resolv.conf" kinit u...@example.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/src/resolv_wrapper.c new/resolv_wrapper-1.1.8/src/resolv_wrapper.c --- old/resolv_wrapper-1.1.6/src/resolv_wrapper.c 2020-03-23 10:19:43.000000000 +0100 +++ new/resolv_wrapper-1.1.8/src/resolv_wrapper.c 2022-12-20 16:10:14.000000000 +0100 @@ -434,6 +434,8 @@ return 0; } +#define rwrap_randomid() 0xffff & getpid() + /* Prepares a fake header with a single response. Advances header_blob */ static ssize_t rwrap_fake_header(uint8_t **header_blob, size_t remaining, size_t ancount, size_t arcount) @@ -451,7 +453,7 @@ h.blob = *header_blob; memset(h.blob, 0, NS_HFIXEDSZ); - h.header->id = res_randomid(); /* random query ID */ + h.header->id = rwrap_randomid(); /* random query ID */ h.header->qr = 1; /* response flag */ h.header->rd = 1; /* recursion desired */ h.header->ra = 1; /* recursion available */ @@ -1844,7 +1846,7 @@ fp = fopen(resolv_conf, "r"); if (fp == NULL) { - RWRAP_LOG(RWRAP_LOG_ERROR, + RWRAP_LOG(RWRAP_LOG_WARN, "Opening %s failed: %s", resolv_conf, strerror(errno)); return -1; @@ -1930,7 +1932,7 @@ fclose(fp); if (nserv == 0) { - RWRAP_LOG(RWRAP_LOG_ERROR, + RWRAP_LOG(RWRAP_LOG_WARN, "No usable nameservers found in %s", resolv_conf); errno = ESRCH; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resolv_wrapper-1.1.6/tests/test_dns_fake.c new/resolv_wrapper-1.1.8/tests/test_dns_fake.c --- old/resolv_wrapper-1.1.6/tests/test_dns_fake.c 2020-03-23 10:19:30.000000000 +0100 +++ new/resolv_wrapper-1.1.8/tests/test_dns_fake.c 2022-12-20 16:10:14.000000000 +0100 @@ -749,6 +749,65 @@ assert_string_equal(rrdata, "v=spf1 mx"); } +static void test_res_fake_uri_nsearch(void **state) +{ + int rv; + struct __res_state dnsstate; + unsigned char answer[ANSIZE] = {0}; + ns_msg handle; + ns_rr rr; /* expanded resource record */ + const uint8_t *rrdata; + int prio; + int weight; + + (void) state; /* unused */ + + memset(&dnsstate, 0, sizeof(struct __res_state)); + rv = res_ninit(&dnsstate); + assert_int_equal(rv, 0); + + rv = res_nsearch(&dnsstate, + "_vpn.cwrap.org", + 1, + 256, + answer, + sizeof(answer)); + assert_int_equal(rv, 208); + + ns_initparse(answer, sizeof(answer), &handle); + + assert_int_equal(ns_msg_getflag(handle, ns_f_rcode), ns_r_noerror); + assert_int_equal(ns_msg_count(handle, ns_s_an), 3); + + assert_int_equal(ns_parserr(&handle, ns_s_an, 0, &rr), 0); + assert_int_equal(ns_rr_type(rr), ns_t_uri); + assert_string_equal(ns_rr_name(rr), "_vpn.cwrap.org"); + rrdata = ns_rr_rdata(rr); + NS_GET16(prio, rrdata); + NS_GET16(weight, rrdata); + assert_int_equal(prio, 2); + assert_int_equal(weight, 5); + assert_string_equal(rrdata, "https://vpn.cwrap.org/VPN"); + + assert_int_equal(ns_parserr(&handle, ns_s_an, 1, &rr), 0); + assert_int_equal(ns_rr_type(rr), ns_t_uri); + rrdata = ns_rr_rdata(rr); + NS_GET16(prio, rrdata); + NS_GET16(weight, rrdata); + assert_int_equal(prio, 2); + assert_int_equal(weight, 10); + assert_string_equal(rrdata, "https://vpn2.cwrap.org/VPN"); + + assert_int_equal(ns_parserr(&handle, ns_s_an, 2, &rr), 0); + assert_int_equal(ns_rr_type(rr), ns_t_uri); + rrdata = ns_rr_rdata(rr); + NS_GET16(prio, rrdata); + NS_GET16(weight, rrdata); + assert_int_equal(prio, 2); + assert_int_equal(weight, 20); + assert_string_equal(rrdata, "https://vpn3.cwrap.org/VPN"); +} + int main(void) { int rc; @@ -769,6 +828,7 @@ cmocka_unit_test(test_res_fake_a_via_cname), cmocka_unit_test(test_res_fake_ptr_query), cmocka_unit_test(test_res_fake_txt_query), + cmocka_unit_test(test_res_fake_uri_nsearch), }; rc = cmocka_run_group_tests(fake_tests, NULL, NULL);