Remove debian directory and replace with a git submodule.

This commit is contained in:
Simon Kelley
2024-02-22 22:45:37 +00:00
parent 9adbf009a6
commit b8ff4bb762
67 changed files with 5 additions and 3152 deletions

13
.gitignore vendored
View File

@@ -7,15 +7,4 @@ src/.copts_*
contrib/lease-tools/dhcp_lease_time
contrib/lease-tools/dhcp_release
contrib/lease-tools/dhcp_release6
debian/.debhelper
debian/auto-build
debian/debhelper-build-stamp
debian/files
debian/*.substvars
debian/*.debhelper
debian/*.log
debian/dnsmasq-base-lua/
debian/dnsmasq-base/
debian/dnsmasq-utils/
debian/dnsmasq/
debian/tmp

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "debian"]
path = debian
url = git://thekelleys.org.uk/dnsmasq-debian.git

1
debian Submodule

Submodule debian added at 83e05da879

1560
debian/changelog vendored

File diff suppressed because it is too large Load Diff

68
debian/control vendored
View File

@@ -1,68 +0,0 @@
Source: dnsmasq
Section: net
Priority: optional
Build-Depends: dh-exec, gettext, libnetfilter-conntrack-dev [linux-any],
libidn2-dev, libdbus-1-dev (>=0.61), libgmp-dev,
nettle-dev (>=2.4-3), libbsd-dev [kfreebsd-any],
liblua5.4-dev, dh-runit, debhelper-compat (= 13),
pkg-config, libnftables-dev
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
Homepage: https://www.thekelleys.org.uk/dnsmasq/doc.html
Vcs-Git: https://thekelleys.org.uk/git/dnsmasq.git
Vcs-Browser: https://thekelleys.org.uk/gitweb/?p=dnsmasq.git
Standards-Version: 4.6.2
Rules-Requires-Root: no
Package: dnsmasq
Architecture: all
Pre-Depends: ${misc:Pre-Depends}
Depends: netbase, dnsmasq-base,
${misc:Depends}
Suggests: resolvconf
Breaks: ${runit:Breaks}
Conflicts: resolvconf (<<1.15), ${runit:Conflicts}
Description: Small caching DNS proxy and DHCP/TFTP server - system daemon
Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP
server. It is designed to provide DNS and optionally, DHCP, to a
small network. It can serve the names of local machines which are
not in the global DNS. The DHCP server integrates with the DNS
server and allows machines with DHCP-allocated addresses
to appear in the DNS with names configured either in each host or
in a central configuration file. Dnsmasq supports static and dynamic
DHCP leases and BOOTP/TFTP for network booting of diskless machines.
Package: dnsmasq-base
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Breaks: dnsmasq (<< 2.63-1~)
Replaces: dnsmasq (<< 2.63-1~), dnsmasq-base
Recommends: dns-root-data
Provides: dnsmasq-base
Conflicts: dnsmasq-base-lua
Description: Small caching DNS proxy and DHCP/TFTP server - executable
This package contains the dnsmasq executable and documentation, but
not the infrastructure required to run it as a system daemon. For
that, install the dnsmasq package.
Package: dnsmasq-base-lua
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Breaks: dnsmasq (<< 2.63-1~)
Replaces: dnsmasq (<< 2.63-1~), dnsmasq-base
Recommends: dns-root-data
Provides: dnsmasq-base
Conflicts: dnsmasq-base
Description: Small caching DNS proxy and DHCP/TFTP server - executable, Lua-enabled
This package contains the dnsmasq executable and documentation, but
not the infrastructure required to run it as a system daemon. For
that, install the dnsmasq package. This package is an alternative
to dnsmasq-base which includes the Lua interpreter.
Package: dnsmasq-utils
Architecture: linux-any
Depends: ${misc:Depends}, ${shlibs:Depends}
Conflicts: dnsmasq (<<2.40)
Description: Utilities for manipulating DHCP leases
Small utilities to query a DHCP server's lease database and
remove leases from it. These programs are distributed with dnsmasq
and may not work correctly with other DHCP servers.

58
debian/copyright vendored
View File

@@ -1,58 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dnsmasq
Upstream-Contact: Simon Kelley <simon@thekelleys.org.uk>
Source: https://thekelleys.org.uk/dnsmasq/
Files: *
Copyright: 2000-2024 Simon Kelley <simon@thekelleys.org.uk>
License: GPL-2 or GPL-3
Files: src/dnssec.c
Copyright: 2012-2024 Simon Kelley <simon@thekelleys.org.uk>
2012 Giovanni Bajo <rasky@develer.com>
Files: debian/*
Copyright: 2004-2024 Simon Kelley <simon@thekelleys.org.uk>
2012 Lars Bahner <bahner@debian.org>
2024 Sven Geuer <debmaint@g-e-u-e-r.de>
License: GPL-2 or GPL-3
License: GPL-2
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation;
version 2 dated June, 1991.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
You should have received a copy of the GNU General Public
License along with this program. If not, see
<https://www.gnu.org/licenses/gpl-2.0>.
.
On Debian systems, the full text of the GNU General Public
License can be found in the file
`/usr/share/common-licenses/GPL-2'.
License: GPL-3
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation;
version 3 dated 29 June, 2007.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
You should have received a copy of the GNU General Public
License along with this program. If not, see
<https://www.gnu.org/licenses/gpl-3.0>.
.
On Debian systems, the full text of the GNU General Public
License can be found in the file
`/usr/share/common-licenses/GPL-3'.

18
debian/dbus.conf vendored
View File

@@ -1,18 +0,0 @@
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="uk.org.thekelleys.dnsmasq"/>
<allow send_destination="uk.org.thekelleys.dnsmasq"/>
</policy>
<policy user="dnsmasq">
<allow own="uk.org.thekelleys.dnsmasq"/>
<allow send_destination="uk.org.thekelleys.dnsmasq"/>
</policy>
<policy context="default">
<deny own="uk.org.thekelleys.dnsmasq"/>
<deny send_destination="uk.org.thekelleys.dnsmasq"/>
</policy>
</busconfig>

View File

@@ -1 +0,0 @@
dnsmasq-base.dirs

View File

@@ -1 +0,0 @@
dnsmasq-base.docs

View File

@@ -1,3 +0,0 @@
#!/usr/bin/dh-exec
debian/dbus.conf => /usr/share/dbus-1/system.d/dnsmasq.conf
trust-anchors.conf /usr/share/dnsmasq-base-lua

View File

@@ -1,2 +0,0 @@
usr/share/dnsmasq-base-lua usr/share/dnsmasq-base
usr/share/doc/dnsmasq-base-lua usr/share/doc/dnsmasq-base

View File

@@ -1,9 +0,0 @@
# With the use of debhelper /usr/share/doc/dnsmasq-base-lua has become a
# directory as required in
# https://www.debian.org/doc/debian-policy/ch-docs.html#additional-documentation
# thus /usr/share/doc/dnsmasq-base will be a link from now onwards.
symlink_to_dir /usr/share/doc/dnsmasq-base-lua /usr/share/doc/dnsmasq-base 2.89-1.1~ dnsmasq-base-lua
dir_to_symlink /usr/share/doc/dnsmasq-base /usr/share/doc/dnsmasq-base-lua 2.89-1.1~ dnsmasq-base-lua
# Due to lintian warning dbus-policy-in-etc this file has been moved to
# /usr/share/dbus-1/system.d/dnsmasq.conf and thus is not a conffile any more.
rm_conffile /etc/dbus-1/system.d/dnsmasq.conf 2.89-1.1~ dnsmasq-base-lua

View File

@@ -1 +0,0 @@
dnsmasq-base.postinst

View File

@@ -1 +0,0 @@
dnsmasq-base.postrm

View File

@@ -1 +0,0 @@
/var/lib/misc

View File

@@ -1,8 +0,0 @@
doc.html
setup.html
dnsmasq.conf.example
FAQ
CHANGELOG.archive
dbus/DBus-interface
debian/systemd_howto
debian/readme

View File

@@ -1,3 +0,0 @@
#!/usr/bin/dh-exec
debian/dbus.conf => /usr/share/dbus-1/system.d/dnsmasq.conf
trust-anchors.conf /usr/share/dnsmasq-base

View File

@@ -1,3 +0,0 @@
# Due to lintian warning dbus-policy-in-etc this file has been moved to
# /usr/share/dbus-1/system.d/dnsmasq.conf and thus is not a conffile any more.
rm_conffile /etc/dbus-1/system.d/dnsmasq.conf 2.89-1.1~ dnsmasq-base

View File

@@ -1,30 +0,0 @@
#!/bin/sh
set -e
# Create the dnsmasq user in dnsmasq-base, so that Dbus doesn't complain.
if [ "$1" = "configure" ]; then
# Create the user to run as.
if [ -z "`id -u dnsmasq 2> /dev/null`" ]; then
useradd --system \
--gid nogroup \
--comment dnsmasq \
--home-dir /var/lib/misc --no-create-home \
--shell /usr/sbin/nologin \
dnsmasq
fi
# Make the directory where we keep the pid file - this
# has to be owned by "dnsmasq" so that the file can be unlinked.
# This is only actually used by the dnsmasq binary package, not
# dnsmasq-base, but it's much easier to create it here so that
# we don't have synchronisation issues with the creation of the
# dnsmasq user.
if [ ! -d /run/dnsmasq ]; then
mkdir /run/dnsmasq
chown dnsmasq:nogroup /run/dnsmasq
fi
fi
#DEBHELPER#

View File

@@ -1,10 +0,0 @@
#!/bin/sh
set -e
if [ purge = "$1" ]; then
userdel dnsmasq
rm -rf /run/dnsmasq
fi
#DEBHELPER#

View File

@@ -1,3 +0,0 @@
dhcp_lease_time /usr/bin
dhcp_release /usr/bin
dhcp_release6 /usr/bin

View File

@@ -1,3 +0,0 @@
dhcp_lease_time.1
dhcp_release.1
dhcp_release6.1

View File

@@ -1,42 +0,0 @@
# This file has six functions:
# 1) to completely disable starting this dnsmasq instance
# 2) to set DOMAIN_SUFFIX by running `dnsdomainname`
# 3) to select an alternative config file
# by setting DNSMASQ_OPTS to --conf-file=<file>
# 4) to tell dnsmasq to read the files in /etc/dnsmasq.d for
# more configuration variables.
# 5) to stop the resolvconf package from controlling dnsmasq's
# idea of which upstream nameservers to use.
# 6) to avoid using this dnsmasq instance as the system's default resolver
# by setting DNSMASQ_EXCEPT="lo"
# For upgraders from very old versions, all the shell variables set
# here in previous versions are still honored by the init script
# so if you just keep your old version of this file nothing will break.
#DOMAIN_SUFFIX=`dnsdomainname`
#DNSMASQ_OPTS="--conf-file=/etc/dnsmasq.alt"
# The dnsmasq daemon is run by default conforming to the Debian Policy.
# To disable the service,
# for SYSV init, use "update-rc.d dnsmasq disable",
# for systemd, use "systemctl disable dnsmasq".
# By default search this drop directory for configuration options.
# Libvirt leaves a file here to make the system dnsmasq play nice.
# Comment out this line if you don't want this. The dpkg-* are file
# endings which cause dnsmasq to skip that file. This avoids pulling
# in backups made by dpkg.
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
# If the resolvconf package is installed, dnsmasq will use its output
# rather than the contents of /etc/resolv.conf to find upstream
# nameservers. Uncommenting this line inhibits this behaviour.
# Note that including a "resolv-file=<filename>" line in
# /etc/dnsmasq.conf is not enough to override resolvconf if it is
# installed: the line below must be uncommented.
#IGNORE_RESOLVCONF=yes
# If the resolvconf package is installed, dnsmasq will tell resolvconf
# to use dnsmasq under 127.0.0.1 as the system's default resolver.
# Uncommenting this line inhibits this behaviour.
#DNSMASQ_EXCEPT="lo"

170
debian/dnsmasq.init vendored
View File

@@ -1,170 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: dnsmasq
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: DHCP and DNS server
### END INIT INFO
# Don't exit on error status
set +e
# The following test ensures the dnsmasq service is not started, when the
# package 'dnsmasq' is removed but not purged, even if the dnsmasq-base
# package is still in place.
if [ -r /usr/share/dnsmasq/init-system-common ]; then
# 'dnsmasq' is installed: source initial code used also with systemd.
. /usr/share/dnsmasq/init-system-common
else
# 'dnsmasq' is removed but not purged, or damaged: do nothing.
exit 0
fi
# Double-check 'dnsmasq-base' or 'dnsmasq-base-lua' is installed.
test -x ${DAEMON} || exit 0
# Source the SysV init-functions which should always be available.
. /lib/lsb/init-functions || exit 0
start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
# /run may be volatile, so we need to ensure that
# /run/dnsmasq exists here as well as in postinst
if [ ! -d /run/dnsmasq ]; then
mkdir /run/dnsmasq || { [ -d /run/dnsmasq ] || return 2 ; }
chown dnsmasq:nogroup /run/dnsmasq || return 2
fi
[ -x /sbin/restorecon ] && /sbin/restorecon /run/dnsmasq
start-stop-daemon --start --quiet --pidfile /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} --test > /dev/null || return 1
start-stop-daemon --start --quiet --pidfile /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} -- \
-x /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid \
${MAILHOSTNAME:+ -m ${MAILHOSTNAME}} \
${MAILTARGET:+ -t ${MAILTARGET}} \
${DNSMASQ_USER:+ -u ${DNSMASQ_USER}} \
${DNSMASQ_INTERFACES:+ ${DNSMASQ_INTERFACES}} \
${DHCP_LEASE:+ -l ${DHCP_LEASE}} \
${DOMAIN_SUFFIX:+ -s ${DOMAIN_SUFFIX}} \
${RESOLV_CONF:+ -r ${RESOLV_CONF}} \
${CACHESIZE:+ -c ${CACHESIZE}} \
${CONFIG_DIR:+ -7 ${CONFIG_DIR}} \
${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}} \
|| return 2
}
stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --name ${NAME}
}
status()
{
# Return
# 0 if daemon is running
# 1 if daemon is dead and pid file exists
# 3 if daemon is not running
# 4 if daemon status is unknown
start-stop-daemon --start --quiet --pidfile /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} --test > /dev/null
case "${?}" in
0) [ -e "/run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid" ] && return 1 ; return 3 ;;
1) return 0 ;;
*) return 4 ;;
esac
}
case "${1}" in
start)
log_daemon_msg "Starting ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}"
start
case "${?}" in
0)
log_end_msg 0
start_resolvconf
exit 0
;;
1)
log_success_msg "(already running)"
exit 0
;;
*)
log_end_msg 1
exit 1
;;
esac
;;
stop)
stop_resolvconf
log_daemon_msg "Stopping ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}"
stop
RETVAL="${?}"
case "${RETVAL}" in
0) log_end_msg 0 ; exit 0 ;;
1) log_warning_msg "(not running)" ; exit 0 ;;
*) log_end_msg 1; exit 1 ;;
esac
;;
restart|force-reload)
checkconfig
if [ ${?} -ne 0 ]; then
NAME="configuration syntax check"
RETVAL="2"
else
stop_resolvconf
stop
RETVAL="${?}"
fi
log_daemon_msg "Restarting ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}"
case "${RETVAL}" in
0|1)
sleep 2
start
case "${?}" in
0)
log_end_msg 0
start_resolvconf
exit 0
;;
*)
log_end_msg 1
exit 1
;;
esac
;;
*)
log_end_msg 1
exit 1
;;
esac
;;
status)
log_daemon_msg "Checking ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}"
status
case "${?}" in
0) log_success_msg "(running)" ; exit 0 ;;
1) log_success_msg "(dead, pid file exists)" ; exit 1 ;;
3) log_success_msg "(not running)" ; exit 3 ;;
*) log_success_msg "(unknown)" ; exit 4 ;;
esac
;;
dump-stats)
kill -s USR1 `cat /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid`
;;
*)
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload|dump-stats|status}" >&2
exit 3
;;
esac
exit 0

View File

@@ -1,8 +0,0 @@
#!/usr/bin/dh-exec
debian/resolvconf => /etc/resolvconf/update.d/dnsmasq
debian/resolvconf-package => /usr/lib/resolvconf/dpkg-event.d/dnsmasq
debian/init-system-common => /usr/share/dnsmasq/init-system-common
debian/systemd-helper => /usr/share/dnsmasq/systemd-helper
dnsmasq.conf.example => /etc/dnsmasq.conf
debian/readme.dnsmasq.d => /etc/dnsmasq.d/README
debian/insserv => /etc/insserv.conf.d/dnsmasq

View File

@@ -1 +0,0 @@
usr/share/dnsmasq-base/trust-anchors.conf usr/share/dnsmasq/trust-anchors.conf

View File

@@ -1,2 +0,0 @@
# /usr/share/doc/dnsmasq was a symlink in versions < 2.81-1 (see #985282)
symlink_to_dir /usr/share/doc/dnsmasq dnsmasq-base 2.84-1.2~ dnsmasq

View File

@@ -1 +0,0 @@
debian/dnsmasq.runscript name=dnsmasq,logscript,presubj

View File

@@ -1,5 +0,0 @@
#!/bin/sh -eu
if [ -x /sbin/resolvconf ] ; then
/sbin/resolvconf -d lo.dnsmasq
fi

View File

@@ -1,43 +0,0 @@
#!/lib/runit/invoke-run
readonly name=dnsmasq
readonly daemon=/usr/sbin/dnsmasq
readonly marker=/usr/share/dnsmasq/installed-marker
test -e "${marker}" || exec sv down "${name}"
test -x "${daemon}" || exec sv down "${name}"
if [ ! "${RESOLV_CONF:-}" ] &&
[ "${IGNORE_RESOLVCONF:-}" != "yes" ] &&
[ -x /sbin/resolvconf ]
then
RESOLV_CONF=/run/dnsmasq/resolv.conf
fi
# This tells dnsmasq to ignore DNS requests that don't come from a local network.
# It's automatically ignored if --interface --except-interface, --listen-address
# or --auth-server exist in the configuration, so for most installations, it will
# have no effect, but for otherwise-unconfigured installations, it stops dnsmasq
# from being vulnerable to DNS-reflection attacks.
DNSMASQ_OPTS="${DNSMASQ_OPTS:-} --local-service"
# If the dns-root-data package is installed, then the trust anchors will be
# available in $ROOT_DS, in BIND zone-file format. Reformat as dnsmasq
# --trust-anchor options.
ROOT_DS="/usr/share/dns/root.ds"
if [ -f $ROOT_DS ]; then
DNSMASQ_OPTS="$DNSMASQ_OPTS `env LC_ALL=C sed -rne "s/^([.a-zA-Z0-9]+)([[:space:]]+[0-9]+)*([[:space:]]+IN)*[[:space:]]+DS[[:space:]]+/--trust-anchor=\1,/;s/[[:space:]]+/,/gp" $ROOT_DS | tr '\n' ' '`"
fi
mkdir -p /run/dnsmasq
chown dnsmasq:nogroup /run/dnsmasq
[ -x /sbin/restorecon ] && /sbin/restorecon /run/dnsmasq
exec "${daemon}" \
--keep-in-foreground \
--log-facility=/dev/stdout \
${RESOLV_CONF:+ -r $RESOLV_CONF} \
${DNSMASQ_OPTS} \
-u dnsmasq

View File

@@ -1,31 +0,0 @@
[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Requires=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
[Service]
Type=forking
PIDFile=/run/dnsmasq/dnsmasq.pid
# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/share/dnsmasq/systemd-helper checkconfig
# We run dnsmasq via the /usr/share/dnsmasq/systemd-helper script which acts
# as a wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "exec" function.
ExecStart=/usr/share/dnsmasq/systemd-helper exec
# The *-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called like
# this to get correct error handling (ie don't start-resolvconf if the
# dnsmasq daemon fails to start).
ExecStartPost=/usr/share/dnsmasq/systemd-helper start-resolvconf
ExecStop=/usr/share/dnsmasq/systemd-helper stop-resolvconf
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -1 +0,0 @@
d /run/dnsmasq 755 dnsmasq nogroup

View File

@@ -1,31 +0,0 @@
[Unit]
Description=dnsmasq (%i) - A lightweight DHCP and caching DNS server
Requires=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
[Service]
Type=forking
PIDFile=/run/dnsmasq/dnsmasq.%i.pid
# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/share/dnsmasq/systemd-helper checkconfig "%i"
# We run dnsmasq via the /usr/share/dnsmasq/systemd-helper script which acts
# as a wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "exec" function.
ExecStart=/usr/share/dnsmasq/systemd-helper exec "%i"
# The *-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called like
# this to get correct error handling (ie don't start-resolvconf if the
# dnsmasq daemon fails to start).
ExecStartPost=/usr/share/dnsmasq/systemd-helper start-resolvconf "%i"
ExecStop=/usr/share/dnsmasq/systemd-helper stop-resolvconf "%i"
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -1,102 +0,0 @@
# -*- shell-script -*-
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dnsmasq
NAME=dnsmasq
DESC="DNS forwarder and DHCP server"
INSTANCE="${2}"
# Most configuration options in /etc/default/dnsmasq are deprecated
# but still honoured.
if [ -r /etc/default/${NAME}${INSTANCE:+.${INSTANCE}} ]; then
. /etc/default/${NAME}${INSTANCE:+.${INSTANCE}}
fi
# Get the system locale, so that messages are in the correct language, and the
# charset for IDN is correct
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG
fi
# RESOLV_CONF:
# If the resolvconf package is installed then use the resolv conf file
# that it provides as the default. Otherwise use /etc/resolv.conf as
# the default.
#
# If IGNORE_RESOLVCONF is set in /etc/default/dnsmasq or an explicit
# filename is set there then this inhibits the use of the resolvconf-provided
# information.
#
# Note that if the resolvconf package is installed it is not possible to
# override it just by configuration in /etc/dnsmasq.conf, it is necessary
# to set IGNORE_RESOLVCONF=yes in /etc/default/dnsmasq.
if [ ! "${RESOLV_CONF}" ] &&
[ "${IGNORE_RESOLVCONF}" != "yes" ] &&
[ -x /sbin/resolvconf ]
then
RESOLV_CONF=/run/dnsmasq/resolv.conf
fi
for INTERFACE in ${DNSMASQ_INTERFACE}; do
DNSMASQ_INTERFACES="${DNSMASQ_INTERFACES} -i ${INTERFACE}"
done
for INTERFACE in ${DNSMASQ_EXCEPT}; do
DNSMASQ_INTERFACES="${DNSMASQ_INTERFACES} -I ${INTERFACE}"
done
if [ ! "${DNSMASQ_USER}" ]; then
DNSMASQ_USER="dnsmasq"
fi
# This tells dnsmasq to ignore DNS requests that don't come from a local network.
# It's automatically ignored if --interface --except-interface, --listen-address
# or --auth-server exist in the configuration, so for most installations, it will
# have no effect, but for otherwise-unconfigured installations, it stops dnsmasq
# from being vulnerable to DNS-reflection attacks.
DNSMASQ_OPTS="${DNSMASQ_OPTS} --local-service"
# If the dns-root-data package is installed, then the trust anchors will be
# available in ROOT_DS, in BIND zone-file format. Reformat as dnsmasq
# --trust-anchor options.
ROOT_DS="/usr/share/dns/root.ds"
if [ -f ${ROOT_DS} ]; then
DNSMASQ_OPTS="$DNSMASQ_OPTS `env LC_ALL=C sed -rne "s/^([.a-zA-Z0-9]+)([[:space:]]+[0-9]+)*([[:space:]]+IN)*[[:space:]]+DS[[:space:]]+/--trust-anchor=\1,/;s/[[:space:]]+/,/gp" $ROOT_DS | tr '\n' ' '`"
fi
checkconfig()
{
${DAEMON} --test ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} ${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}} >/dev/null 2>&1
}
start_resolvconf()
{
# If interface "lo" is explicitly disabled in /etc/default/dnsmasq
# Then dnsmasq won't be providing local DNS, so don't add it to
# the resolvconf server set.
for interface in ${DNSMASQ_EXCEPT}; do
[ ${interface} = lo ] && return
done
# Also skip this if DNS functionality is disabled in /etc/dnsmasq.conf
if grep -qs '^port=0' /etc/dnsmasq.conf; then
return
fi
if [ -x /sbin/resolvconf ] ; then
echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.${NAME}${INSTANCE:+.${INSTANCE}}
fi
return 0
}
stop_resolvconf()
{
if [ -x /sbin/resolvconf ] ; then
/sbin/resolvconf -d lo.${NAME}${INSTANCE:+.${INSTANCE}}
fi
return 0
}

1
debian/insserv vendored
View File

@@ -1 +0,0 @@
$named dnsmasq

View File

@@ -1,40 +0,0 @@
Description: Remove or replace privacy breaching logos and forms
Lintian complains about these by issuing the tags privacy-breach-logo and
privacy-breach-donation.
Forwarded: not-needed
Author: Sven Geuer <debmaint@g-e-u-e-r.de>
Last-Update: 2023-11-18
--- a/doc.html
+++ b/doc.html
@@ -1,14 +1,11 @@
<HTML>
<HEAD>
<TITLE> Dnsmasq - network services for small networks.</TITLE>
-<link rel="icon" href="http://www.thekelleys.org.uk/dnsmasq/images/favicon.ico">
</HEAD>
<BODY BGCOLOR="WHITE">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
-<td align="left" valign="middle"><img border="0" src="http://www.thekelleys.org.uk/dnsmasq/images/icon.png" /></td>
<td align="middle" valign="middle"><h1>Dnsmasq</h1></td>
-<td align="right" valign="middle"><img border="0" src="http://www.thekelleys.org.uk/dnsmasq/images/icon.png" /></td></tr>
</table>
Dnsmasq provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot. It is designed to be
lightweight and have a small footprint, suitable for resource constrained routers and firewalls. It has also been widely used
@@ -88,14 +85,6 @@
Dnsmasq is mainly written and maintained by Simon Kelley. For most of its life, dnsmasq has been a spare-time project.
These days I'm working on it as my main activity.
I don't have an employer or anyone who pays me regularly to work on dnsmasq. If you'd like to make
-a contribution towards my expenses, please use the donation button below.
-<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="hidden" name="hosted_button_id" value="V3X9GVW5GX6DA">
-<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal The safer, easier way to pay online.">
-<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
-</form>
-
-
+a contribution towards my expenses, please use the donation button at <A HREF="https://www.thekelleys.org.uk/dnsmasq/doc.html">the project's home page</A>.
</BODY>

View File

@@ -1 +0,0 @@
eliminate-privacy-breaches.patch

80
debian/readme vendored
View File

@@ -1,80 +0,0 @@
Notes on configuring dnsmasq as packaged for Debian.
(1) To configure dnsmasq edit /etc/dnsmasq.conf. The file is well
commented; see also the dnsmasq.8 man page for explanation of
the options. The file /etc/default/dnsmasq also exists but it
shouldn't need to be touched in most cases. To set up DHCP
options you might need to refer to a copy of RFC 2132. This is
available on Debian systems in the package doc-rfc-std as the file
/usr/share/doc/RFC/draft-standard/rfc2132.txt.gz .
(2) Installing the dnsmasq package also creates the directory
/etc/dnsmasq.d which is searched by dnsmasq for configuration file
fragments. This behaviour can be disabled by editing
/etc/default/dnsmasq.
(3) If the Debian resolvconf package is installed then, regardless
of what interface configuration daemons are employed, the list of
nameservers to which dnsmasq should forward queries can be found
in /var/run/dnsmasq/resolv.conf; also, 127.0.0.1 is listed as the
first nameserver address in /etc/resolv.conf. This works using the
default configurations of resolvconf and dnsmasq.
(4) In the absence of resolvconf, if you are using dhcpcd then
dnsmasq should read the list of nameservers from the automatically
generated file /etc/dhcpc/resolv.conf. You should list 127.0.0.1
as the first nameserver address in /etc/resolv.conf.
(5) In the absence of resolvconf, if you are using pppd then
dnsmasq should read the list of nameservers from the automatically
generated file /etc/ppp/resolv.conf. You should list 127.0.0.1
as the first nameserver address in /etc/resolv.conf.
(6) In the absence of resolvconf, dns-nameservers lines in
/etc/network/interfaces are ignored. If you do not use
resolvconf, list 127.0.0.1 as the first nameserver address
in /etc/resolv.conf and configure your nameservers using
"server=<IP-address>" lines in /etc/dnsmasq.conf.
(7) If you run multiple DNS servers on a single machine, each
listening on a different interface, then it is necessary to use
the bind-interfaces option by uncommenting "bind-interfaces" in
/etc/dnsmasq.conf. This option stops dnsmasq from binding the
wildcard address and allows servers listening on port 53 on
interfaces not in use by dnsmasq to work. The Debian
libvirt package will add a configuration file in /etc/dnsmasq.d
which does this so that the "system" dnsmasq and "private" dnsmasq
instances started by libvirt do not clash.
(8) The following options are supported in DEB_BUILD_OPTIONS
noopt : compile without optimisation.
nostrip : don't remove symbols from binary.
nodocs : omit documentation.
notftp : omit TFTP support.
nodhcp : omit DHCP support.
nodhcp6 : omit DHCPv6 support.
noscript : omit lease-change script support.
uselua : provide support for lease-change scripts written
in Lua.
noipv6 : omit IPv6 support.
nodbus : omit DBus support.
noconntrack : omit connection tracking support.
noipset : omit IPset support.
nonftset : omit nftset support.
nortc : compile alternate mode suitable for systems without an RTC.
noi18n : omit translations and internationalisation support.
noidn : omit international domain name support, must be
combined with noi18n to be effective.
gitversion : set the version of the produced packages from the
git-derived versioning information on the source,
rather than the debian changelog.
(9) Dnsmasq comes as three packages - dnsmasq-utils, dnsmasq-base and
dnsmasq. Dnsmasq-base provides the dnsmasq executable and
documentation (including this file). Dnsmasq, which depends on
dnsmasq-base, provides the init script and configuration
infrastructure. This file assumes that both are installed. It is
possible to install only dnsmasq-base and use dnsmasq as a
non-"system" daemon. Libvirt, for instance, does this.
Dnsmasq-utils provides the utilities dhcp_release and
dhcp_lease_time.

View File

@@ -1,7 +0,0 @@
# All files in this directory will be read by dnsmasq as
# configuration files, except if their names end in
# ".dpkg-dist",".dpkg-old" or ".dpkg-new"
#
# This can be changed by editing /etc/default/dnsmasq

84
debian/resolvconf vendored
View File

@@ -1,84 +0,0 @@
#!/bin/sh
#
# Script to update the resolver list for dnsmasq
#
# N.B. Resolvconf may run us even if dnsmasq is not (yet) running.
# If dnsmasq is installed then we go ahead and update the resolver list
# in case dnsmasq is started later.
#
# Assumption: On entry, PWD contains the resolv.conf-type files.
#
# This file is part of the dnsmasq package.
#
set -e
RUN_DIR="/run/dnsmasq"
RSLVRLIST_FILE="${RUN_DIR}/resolv.conf"
TMP_FILE="${RSLVRLIST_FILE}_new.$$"
MY_NAME_FOR_RESOLVCONF="dnsmasq"
[ -x /usr/sbin/dnsmasq ] || exit 0
[ -x /lib/resolvconf/list-records ] || exit 1
PATH=/bin:/sbin
report_err() { echo "$0: Error: $*" >&2 ; }
# Stores arguments (minus duplicates) in RSLT, separated by spaces
# Doesn't work properly if an argument itself contains whitespace
uniquify()
{
RSLT=""
while [ "$1" ] ; do
for E in $RSLT ; do
[ "$1" = "$E" ] && { shift ; continue 2 ; }
done
RSLT="${RSLT:+$RSLT }$1"
shift
done
}
if [ ! -d "$RUN_DIR" ] && ! mkdir --parents --mode=0755 "$RUN_DIR" ; then
report_err "Failed trying to create directory $RUN_DIR"
exit 1
fi
RSLVCNFFILES=""
for F in $(/lib/resolvconf/list-records --after "lo.$MY_NAME_FOR_RESOLVCONF") ; do
case "$F" in
"lo.$MY_NAME_FOR_RESOLVCONF")
# Omit own record
;;
lo.*)
# Include no more records after one for a local nameserver
RSLVCNFFILES="${RSLVCNFFILES:+$RSLVCNFFILES }$F"
break
;;
*)
RSLVCNFFILES="${RSLVCNFFILES:+$RSLVCNFFILES }$F"
;;
esac
done
NMSRVRS=""
if [ "$RSLVCNFFILES" ] ; then
uniquify $(sed -n -e 's/^[[:space:]]*nameserver[[:space:]]\+//p' $RSLVCNFFILES)
NMSRVRS="$RSLT"
fi
# Dnsmasq uses the mtime of $RSLVRLIST_FILE, with a resolution of one second,
# to detect changes in the file. This means that if a resolvconf update occurs
# within one second of the previous one then dnsmasq may fail to notice the
# more recent change. To work around this problem we sleep one second here
# if necessary in order to ensure that the new mtime is different.
if [ -f "$RSLVRLIST_FILE" ] && [ "$(ls -go --time-style='+%s' "$RSLVRLIST_FILE" | { read p h s t n ; echo "$t" ; })" = "$(date +%s)" ] ; then
sleep 1
fi
clean_up() { rm -f "$TMP_FILE" ; }
trap clean_up EXIT
: >| "$TMP_FILE"
for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMP_FILE" ; done
mv -f "$TMP_FILE" "$RSLVRLIST_FILE"

View File

@@ -1,13 +0,0 @@
#!/bin/sh
# Resolvconf packaging event hook script for the dnsmasq package
restart_dnsmasq() {
if which invoke-rc.d >/dev/null 2>&1 ; then
invoke-rc.d dnsmasq restart
elif [ -x /etc/init.d/dnsmasq ] ; then
/etc/init.d/dnsmasq restart
fi
}
case "$1" in
install) restart_dnsmasq ;;
esac

127
debian/rules vendored
View File

@@ -1,127 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# Make sure lintian does not complain about missing hardenings.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/architecture.mk
PREFIX = /usr
# Upstream does not handle CPPFLAGS, so we add it to CFLAGS here.
CFLAGS += $(CPPFLAGS)
COPTS =
ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS)))
COPTS += -DHAVE_DBUS
endif
ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS)))
COPTS += -DHAVE_LIBIDN2
endif
ifeq (,$(filter nonftset, $(DEB_BUILD_OPTIONS)))
COPTS += -DHAVE_NFTSET
endif
ifeq (,$(filter noconntrack,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_HOST_ARCH_OS),linux)
COPTS += -DHAVE_CONNTRACK
endif
endif
ifneq (,$(filter noipset,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_IPSET
endif
ifneq (,$(filter nodhcp6,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_DHCP6
endif
ifneq (,$(filter noipv6,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_IPV6
endif
ifneq (,$(filter notftp,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_TFTP
endif
ifneq (,$(filter nodhcp,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_DHCP
endif
ifneq (,$(filter noscript,$(DEB_BUILD_OPTIONS)))
COPTS += -DNO_SCRIPT
endif
ifneq (,$(filter nortc,$(DEB_BUILD_OPTIONS)))
COPTS += -DHAVE_BROKEN_RTC
endif
ifeq (,$(filter nodnssec,$(DEB_BUILD_OPTIONS)))
COPTS += -DHAVE_DNSSEC
endif
%:
# Ubuntu and derivates do not support runit, see
# https://bugs.debian.org/960401 for details.
if dpkg-vendor --derives-from Ubuntu; then \
dh $@; \
else \
dh $@ --with runit; \
fi
# Upstream builds and installs in one go, so do we.
override_dh_auto_build:
override_dh_auto_install:
dh_auto_build -p dnsmasq-base --no-parallel -- install-i18n \
BUILDDIR=debian/auto-build/dnsmasq-base \
DESTDIR=$(CURDIR)/debian/dnsmasq-base \
PREFIX=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
COPTS="$(COPTS)"
dh_auto_build -p dnsmasq-base-lua --no-parallel -- install-i18n \
BUILDDIR=debian/auto-build/dnsmasq-base-lua \
DESTDIR=$(CURDIR)/debian/dnsmasq-base-lua \
PREFIX=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
LUA=lua5.4 COPTS="$(COPTS) -DHAVE_LUASCRIPT"
dh_auto_build -p dnsmasq-utils -D contrib/lease-tools
override_dh_auto_clean:
dh_auto_clean -p dnsmasq-base -- \
BUILDDIR=debian/auto-build/dnsmasq-base
dh_auto_clean -p dnsmasq-base-lua -- \
BUILDDIR=debian/auto-build/dnsmasq-base-lua
rm -rf debian/auto-build
dh_auto_clean -p dnsmasq-utils -D contrib/lease-tools
override_dh_install:
dh_install -p dnsmasq-utils --sourcedir=contrib/lease-tools
dh_install --remaining-packages
# If 'nodoc' is absent from DEB_BUILD_OPTIONS, Correct name or location of
# some doc files.
# We would prefer do this via dh-exec if it would support dh_installdocs.
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
execute_after_dh_installdocs:
for d in $(CURDIR)/debian/dnsmasq-base*/usr/share/doc/dnsmasq-base*; do \
cd $$d; \
mv readme README.Debian; \
mv CHANGELOG.archive changelog.archive; \
mkdir examples; \
mv dnsmasq.conf.example examples/; \
done
endif
# If 'nodoc' is present in DEB_BUILD_OPTIONS, drop the man pages already
# installed by the upstream build script. Then, let dh_installman do what
# else needs doing.
override_dh_installman:
ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
rm -rf debian/dnsmasq-base*/usr/share/man
endif
dh_installman -p dnsmasq-utils --sourcedir=contrib/lease-tools
dh_installman --remaining-packages

View File

@@ -1 +0,0 @@
3.0 (quilt)

34
debian/systemd-helper vendored
View File

@@ -1,34 +0,0 @@
#!/bin/sh
. /usr/share/dnsmasq/init-system-common
case "$1" in
checkconfig)
checkconfig
;;
start-resolvconf)
start_resolvconf
;;
stop-resolvconf)
stop_resolvconf
;;
exec)
# /run may be volatile, so we need to ensure that
# /run/dnsmasq exists here as well as in postinst
if [ ! -d /run/dnsmasq ]; then
mkdir /run/dnsmasq || { [ -d /run/dnsmasq ] || exit 2 ; }
chown dnsmasq:nogroup /run/dnsmasq || exit 2
fi
exec ${DAEMON} -x /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid \
${MAILHOSTNAME:+ -m ${MAILHOSTNAME}} \
${MAILTARGET:+ -t ${MAILTARGET}} \
${DNSMASQ_USER:+ -u ${DNSMASQ_USER}} \
${DNSMASQ_INTERFACES:+ ${DNSMASQ_INTERFACES}} \
${DHCP_LEASE:+ -l ${DHCP_LEASE}} \
${DOMAIN_SUFFIX:+ -s ${DOMAIN_SUFFIX}} \
${RESOLV_CONF:+ -r ${RESOLV_CONF}} \
${CACHESIZE:+ -c ${CACHESIZE}} \
${CONFIG_DIR:+ -7 ${CONFIG_DIR}} \
${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}}
;;
esac

41
debian/systemd_howto vendored
View File

@@ -1,41 +0,0 @@
HOWTO
=====
dnsmasq comes with the possibility to run multiple systemd service instances on the same machine.
There is the main service which is enabled by default via `systemctl enable dnsmasq.service` and uses the configuration from `/etc/default/dnsmasq`.
Additional service instances can be enabled via `systemctl enable dnsmasq@<instance name>.service` that use the configuration from `/etc/default/dnsmasq.<instance name>`.
It is recommended to use a separate configuration file and directory for each instance.
Additionally make sure that all instances use either different ports and/or ip addresses to avoid binding collisions.
Example setup for an instance called "alt"
#1 File `/etc/dnsmasq.alt.conf` copied from `/etc/dnsmasq.conf`
#2 Directory `/etc/dnsmasq.alt.d`
#3 File `/etc/default/dnsmasq.alt` copied from `/etc/default/dnsmasq` with following adaptions:
* The options DNSMASQ_OPTS and CONFIG_DIR point to the correct configuration file and directory.
DNSMASQ_OPTS="... --conf-file=/etc/dnsmasq.alt.conf ..."
CONFIG_DIR=/etc/dnsmasq.alt.d,.dpkg-dist,.dpkg-old,.dpkg-new
* The option DNSMASQ_EXCEPT must contain "lo" to avoid that an instance becomes the machine's DNS resolver.
DNSMASQ_EXCEPT="lo"
* If the additional instance should bind to all IP addresses of a specific interface, e.g. "dnsalt01", then the following addition could be used:
DNSMASQ_OPTS="... --bind-dynamic --interface=dnsalt01 ..."
Additionally the main instance must be stopped from binding to interfaces that are used by other instances:
DNSMASQ_OPTS="... --bind-dynamic --except-interface=dnsalt* ..."
* If the additional instance should not use the machine's DNS resolver, normally that's the dnsmasq main instance, as upstream server, then the following addition could be used:
IGNORE_RESOLVCONF=yes
#4 Enable additional instance via `systemctl enable dnsmasq@alt.service`
#5 Start additional instance without reboot via `systemctl start dnsmasq@alt.service`
TODO
====
#1 - Found shortcoming on 2019-03-10
Only the option DNSMASQ_EXCEPT="lo" avoids that an DNS instance will be set as the machine's DNS resolver.
This may interfere with the wish to run an additional instance on a different port on the localhost addresses.
My suggestion in the initial Debian report [1] was to specify an explicit variable for this.
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914305#5
#2 - Preferred configuration way
Should the variables DNSMASQ_INTERFACE and DNSMASQ_EXCEPT be used instead of --interface and --except-interface? (while "lo" still has to be in DNSMASQ_EXCEPT as of now)

View File

@@ -1,7 +0,0 @@
#!/bin/sh
set -e
. debian/tests/functions
check_compile_time_options

View File

@@ -1,7 +0,0 @@
#!/bin/sh
set -e
. debian/tests/functions
check_compile_time_options +lua

39
debian/tests/control vendored
View File

@@ -1,39 +0,0 @@
Tests: compile-time-options
Depends: dnsmasq,
dnsmasq-base,
Restrictions: needs-root,
isolation-container,
Tests: compile-time-options+lua
Depends: dnsmasq,
dnsmasq-base-lua,
Restrictions: needs-root,
isolation-container,
Tests: get-address+query-dns+check-utils
Depends: bind9,
bind9-dnsutils,
dnsmasq,
dnsmasq-base,
dnsmasq-utils,
Restrictions: needs-root,
allow-stderr,
isolation-container,
Tests: get-address+query-dns+lua+alt
Depends: bind9,
bind9-dnsutils,
dnsmasq,
dnsmasq-base-lua,
Restrictions: needs-root,
allow-stderr,
isolation-container,
Tests: get-address+query-dns+sysv+alt
Depends: bind9,
bind9-dnsutils,
dnsmasq,
dnsmasq-base,
Restrictions: needs-root,
allow-stderr,
isolation-container,

151
debian/tests/functions vendored
View File

@@ -1,151 +0,0 @@
# -*- shell-script -*-
FUNCTIONS_DIR="debian/tests/functions.d"
match_or_exit () {
file_to_match="$1"
pattern_file="$2"
while read line_to_match <&3 && read pattern_line <&4 ; do
if [ "${line_to_match##$pattern_line}" ]; then
echo '!!! MISMATCH !!!' >&2
echo "Line: ${line_to_match}" >&2
echo "Pattern: ${pattern_line}" >&2
exit 1
fi;
done 3<"${file_to_match}" 4<"${pattern_file}"
}
linecount () {
wc -l $1 | cut -d' ' -f1
}
error_exit () {
echo "ERROR: $1"
exit 1
}
stop_dnsmasq_bind_networking () {
systemctl stop dnsmasq.service
systemctl stop named.service
systemctl stop networking.service
}
configure_and_start_networking () {
#Add interfaces needed for the test
cat ${FUNCTIONS_DIR}/add-to.interfaces >> /etc/network/interfaces
systemctl start networking.service
}
configure_and_start_bind () {
cp ${FUNCTIONS_DIR}/db.autopkg.test /etc/bind/
cat ${FUNCTIONS_DIR}/add-to.named.conf.local >> /etc/bind/named.conf.local
cp ${FUNCTIONS_DIR}/named.conf.options /etc/bind/named.conf.options
systemctl start named.service
}
configure_and_start_dnsmasq () {
alt_mode=0
lua_mode=0
sysv_mode=0
service='dnsmasq.service'
sysv_param2=''
conf_dir='/etc/dnsmasq.d'
while [ -n "$1" ]; do
case "$1" in
alt|lua|sysv) eval ${1}_mode=1 ;;
*) error_exit "configure_and_start_dnsmasq(): invalid flag '$1'"
esac
shift
done
if [ ${alt_mode} -eq 1 ]; then
cp ${FUNCTIONS_DIR}/dnsmasq.alt-autopkgtest.default /etc/default/dnsmasq.alt
cp /etc/dnsmasq.conf /etc/dnsmasq.alt.conf
mkdir /etc/dnsmasq.alt.d
service='dnsmasq@alt.service'
sysv_param2='alt'
conf_dir='/etc/dnsmasq.alt.d'
fi
cp ${FUNCTIONS_DIR}/dnsmasq-autopkgtest.conf "${conf_dir}"
if [ ${lua_mode} -eq 1 ]; then
mkdir -p /usr/local/share/dnsmasq
cp ${FUNCTIONS_DIR}/log.lua /usr/local/share/dnsmasq/
echo "dhcp-luascript=/usr/local/share/dnsmasq/log.lua\n" \
>>"${conf_dir}"/dnsmasq-autopkgtest.conf
fi
if [ ${sysv_mode} -eq 1 ]; then
SYSTEMCTL_SKIP_REDIRECT=1 /etc/init.d/dnsmasq start "${sysv_param2}"
else
systemctl enable "${service}"
systemctl start "${service}"
fi
}
check_compile_time_options () {
journalctl -b -u dnsmasq
echo ~~~ Check compile time options...
journalctl -b -u dnsmasq -g '[a-z]+: ' --output cat >options.msg
cat options.msg
match_or_exit options.msg ${FUNCTIONS_DIR}/options${1}.patterns
}
get_address_on_veth1_and_check_the_result () {
echo ~~~ Get an address on veth1 and check the result...
ip netns exec clientnet ifup veth1
ip netns exec clientnet ip addr show dev veth1 >ip-addr.out 2>&1
cat ip-addr.out
match_or_exit ip-addr.out ${FUNCTIONS_DIR}/ip-addr.patterns
}
query_test_zone_records_and_check_the_result () {
echo ~~~ Query some test zone records and check the result...
ip netns exec clientnet dig +short SOA autopkg.test >dig.out 2>&1
ip netns exec clientnet dig +short NS autopkg.test >>dig.out 2>&1
ip netns exec clientnet dig +short A ns.autopkg.test >>dig.out 2>&1
ip netns exec clientnet dig +short A dhcp3.autopkg.test >>dig.out 2>&1
cat dig.out
if [ `linecount dig.out` -ne `linecount ${FUNCTIONS_DIR}/dig.patterns` ] ; then
error_exit 'empty or unexpected output'
fi
match_or_exit dig.out ${FUNCTIONS_DIR}/dig.patterns
}
check_utils () {
#Test dhcp_lease_time and dhcp_release
leases_file='/var/lib/misc/dnsmasq.leases'
client_ip_address=`cut -d' ' -f3 $leases_file`
client_mac_address=`cut -d' ' -f2 $leases_file`
echo ~~~ Test dhcp_lease_time...
if ! dhcp_lease_time $client_ip_address; then
error_exit "'dhcp_lease_time $client_ip_address' failed with return code $?"
else
#Add \n to dhcp_lease_time's output
echo ''
fi
echo ~~~ Test dhcp_release...
cat $leases_file
if ! dhcp_release veth0 $client_ip_address 1-$client_mac_address; then
error_exit "'dhcp_release veth0 $client_ip_address 1-$client_mac_address' failed with return code $?0"
fi
if [ -n "`cat $leases_file`" ]; then
cat $leases_file
error_exit "$leases_file is not empty"
fi
}
check_lua_log () {
log_file='/var/log/dnsmasq-lua.log'
echo ~~~ Check log file generated by lua script
ls -l ${log_file}
if [ -s ${log_file} ]; then
cat ${log_file}
match_or_exit ${log_file} ${FUNCTIONS_DIR}/log.patterns
else
error_exit "${log_file} is empty"
fi
}

View File

@@ -1,18 +0,0 @@
auto dummy0
iface dummy0 inet static
pre-up ip link add dummy0 type dummy
address 192.168.141.1
netmask 255.255.255.248
post-down ip link del dummy0
auto veth0
iface veth0 inet static
pre-up ip netns add clientnet
pre-up ip link add veth0 type veth peer veth1 netns clientnet
address 192.168.142.1
netmask 255.255.255.248
post-down ip link del veth0
post-down ip netns del clientnet
iface veth1 inet dhcp

View File

@@ -1,2 +0,0 @@
zone "autopkg.test" { type master; file "/etc/bind/db.autopkg.test"; };

View File

@@ -1,18 +0,0 @@
$TTL 604800
@ IN SOA ns.autopkg.test. hostmaster.autopkg.test. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
300 ) ; Negative Cache TTL
;
@ IN NS ns
ns IN A 192.168.141.1
host IN A 192.168.142.1
dhcp0 IN A 192.168.142.2
dhcp1 IN A 192.168.142.3
dhcp2 IN A 192.168.142.4
dhcp3 IN A 192.168.142.5
dhcp4 IN A 192.168.142.6
brdcst IN A 192.168.142.7

View File

@@ -1,4 +0,0 @@
ns.autopkg.test. hostmaster.autopkg.test. 2 604800 86400 2419200 300
ns.autopkg.test.
192.168.141.1
192.168.142.5

View File

@@ -1,6 +0,0 @@
no-resolv
server=/autopkg.test/192.168.141.1
listen-address=192.168.142.1,127.0.0.1
bind-interfaces
dhcp-range=192.168.142.2,192.168.142.6
dhcp-authoritative

View File

@@ -1,42 +0,0 @@
# This file has six functions:
# 1) to completely disable starting this dnsmasq instance
# 2) to set DOMAIN_SUFFIX by running `dnsdomainname`
# 3) to select an alternative config file
# by setting DNSMASQ_OPTS to --conf-file=<file>
# 4) to tell dnsmasq to read the files in /etc/dnsmasq.d for
# more configuration variables.
# 5) to stop the resolvconf package from controlling dnsmasq's
# idea of which upstream nameservers to use.
# 6) to avoid using this dnsmasq instance as the system's default resolver
# by setting DNSMASQ_EXCEPT="lo"
# For upgraders from very old versions, all the shell variables set
# here in previous versions are still honored by the init script
# so if you just keep your old version of this file nothing will break.
#DOMAIN_SUFFIX=`dnsdomainname`
DNSMASQ_OPTS="--conf-file=/etc/dnsmasq.alt.conf"
# The dnsmasq daemon is run by default conforming to the Debian Policy.
# To disable the service,
# for SYSV init, use "update-rc.d dnsmasq disable",
# for systemd, use "systemctl disable dnsmasq".
# By default search this drop directory for configuration options.
# Libvirt leaves a file here to make the system dnsmasq play nice.
# Comment out this line if you don't want this. The dpkg-* are file
# endings which cause dnsmasq to skip that file. This avoids pulling
# in backups made by dpkg.
CONFIG_DIR=/etc/dnsmasq.alt.d,.dpkg-dist,.dpkg-old,.dpkg-new
# If the resolvconf package is installed, dnsmasq will use its output
# rather than the contents of /etc/resolv.conf to find upstream
# nameservers. Uncommenting this line inhibits this behaviour.
# Note that including a "resolv-file=<filename>" line in
# /etc/dnsmasq.conf is not enough to override resolvconf if it is
# installed: the line below must be uncommented.
#IGNORE_RESOLVCONF=yes
# If the resolvconf package is installed, dnsmasq will tell resolvconf
# to use dnsmasq under 127.0.0.1 as the system's default resolver.
# Uncommenting this line inhibits this behaviour.
#DNSMASQ_EXCEPT="lo"

View File

@@ -1,6 +0,0 @@
*: veth1@if*: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ??:??:??:??:??:?? brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.142.?/29 brd 192.168.142.7 scope global dynamic veth1
valid_lft 3[56][0-9][0-9]sec preferred_lft 3[56][0-9][0-9]sec
inet6 fe80::*:*:*:*/64 scope link*
valid_lft forever preferred_lft forever

View File

@@ -1,40 +0,0 @@
-- Lua script logging calls from dnsmasq
-- Open the log file in append mode
logfile = assert(io.open("/var/log/dnsmasq-lua.log", "a"))
-- Prepend date and time to a string and write the result to the log file
function __log(str)
logfile:write(os.date("!%FT%TZ ")..str.."\n")
end
-- flush the log file
function __flush_log()
logfile:flush()
end
-- Log a call to init()
function init()
__log("initialising")
__flush_log()
end
-- Log a call to shutdown()
function shutdown()
__log("shutting down")
__flush_log()
end
-- Log a call to lease() including all arguments
function lease(operation, params)
local lines = {}
__log(operation.." lease")
for key,value in pairs(params) do
table.insert(lines, key..": "..value)
end
table.sort(lines)
for index,line in ipairs(lines) do
__log("\t"..line)
end
__flush_log()
end

View File

@@ -1,10 +0,0 @@
????-??-??T??:??:??Z initialising
????-??-??T??:??:??Z add lease
????-??-??T??:??:??Z client_id: ??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:??
????-??-??T??:??:??Z data_missing: 1.0
????-??-??T??:??:??Z hostname: ?*
????-??-??T??:??:??Z interface: veth0
????-??-??T??:??:??Z ip_address: 192.168.142.[2-6]
????-??-??T??:??:??Z lease_expires: [1-9]*
????-??-??T??:??:??Z mac_address: ??:??:??:??:??:??
????-??-??T??:??:??Z time_remaining: 3600.0

View File

@@ -1,6 +0,0 @@
options {
directory "/var/cache/bind";
listen-on { 192.168.141.1; };
recursion no;
};

View File

@@ -1 +0,0 @@
*: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inotify dumpfile

View File

@@ -1 +0,0 @@
*: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inotify dumpfile

View File

@@ -1,19 +0,0 @@
#!/bin/sh
set -e
. debian/tests/functions
stop_dnsmasq_bind_networking
configure_and_start_networking
configure_and_start_bind
configure_and_start_dnsmasq
get_address_on_veth1_and_check_the_result
query_test_zone_records_and_check_the_result
check_utils
#Done
echo Looks good.

View File

@@ -1,19 +0,0 @@
#!/bin/sh
set -e
. debian/tests/functions
stop_dnsmasq_bind_networking
configure_and_start_networking
configure_and_start_bind
configure_and_start_dnsmasq lua alt
get_address_on_veth1_and_check_the_result
query_test_zone_records_and_check_the_result
check_lua_log
#Done
echo Looks good.

View File

@@ -1,18 +0,0 @@
#!/bin/sh
set -e
. debian/tests/functions
stop_dnsmasq_bind_networking
configure_and_start_networking
configure_and_start_bind
configure_and_start_dnsmasq sysv alt
get_address_on_veth1_and_check_the_result
query_test_zone_records_and_check_the_result
#Done
echo Looks good.
SYSTEMCTL_SKIP_REDIRECT=1 /etc/init.d/dnsmasq stop alt

View File

@@ -1,9 +0,0 @@
Cite-As: dnsmasq
Contact: simon@thekelleys.org.uk
Security-Contact: https://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Repository: https://thekelleys.org.uk/git/dnsmasq.git
Repository-Browse: https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=summary
Changelog: https://thekelleys.org.uk/dnsmasq/CHANGELOG
Documentation: https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
FAQ: https://thekelleys.org.uk/dnsmasq/docs/FAQ
Bug-Submit: https://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

View File

@@ -1,63 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFMbjUMBEACsU1Xk8+uu/EsGVJTh9Tn31C2e0ycd0voBVT7cTdtXpzeiNR+o
/zUAi95ds7FiecpZJp1nRO4vNzvaaAPZhFsFVLzZYyIVABgTXsskT88xbZvzb4W5
KKRWVhoTQxVDgj1+dXLUXULTB6rg02WEhqnix/qf/zFdM9I4/3pRHJn9k+3XKygR
on+nYtljfn3AKBelCo1y28istC6wCncoH11b/qdQtlfxVXaJY4HF27V0MqFFmDMg
cuhOHR7DnhymeDh7GmLfTHJ4LUFG+TecqCjiYhyWcuv2wuSb0EPXUKHJQVViQ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QEBdOTNLbggHk3/mScF8U1KcJhjAF
f7Ne+Z0feG/8GgKl5aj3ucl821+dfpzB79lLo+kmd1qkDyDiUR5yN6P8l8k6IAUJ
z2KUe0BjtO6VFFw0xni05dkrXdfo7IO79ictHmEn+g3QO8ZLUGRwdtZ1cMhTkm7F
hH8Bdby0y4SoqluvHbri++cC91i1I3a92kHi/8O45rnLhVt+sOfxY1QnSIYh5OFw
GMqMCNDTEL7ESiFaFhSXkmzzVntlyvOBMlgz3IGh2hA=
=otES
-----END PGP PUBLIC KEY BLOCK-----

5
debian/watch vendored
View File

@@ -1,5 +0,0 @@
version=4
opts=\
pgpmode=auto \
https://thekelleys.org.uk/dnsmasq/ \
dnsmasq-([\d.]+)@ARCHIVE_EXT@