Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
48493329
Commit
48493329
authored
May 28, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Debian resolvconf script for dnscrypt-proxy integration.
parent
76dd75de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
13 deletions
+34
-13
debian/changelog
debian/changelog
+7
-1
debian/resolvconf
debian/resolvconf
+27
-12
No files found.
debian/changelog
View file @
48493329
...
@@ -2,7 +2,13 @@ dnsmasq (2.67-1) unstable; urgency=low
...
@@ -2,7 +2,13 @@ dnsmasq (2.67-1) unstable; urgency=low
* New upstream.
* New upstream.
-- Simon Kelley <simon@thekelleys.org.uk> Mon, 20 May 2013 11:50:22 +0000
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 28 May 2013 14:50:22 +0000
dnsmasq (2.66-3) unstable; urgency=low
* Update resolvconf script for dnscrypt-proxy integration. (closes: #709179)
-- Simon Kelley <simon@thekelleys.org.uk> Tue, 28 May 2013 14:39:51 +0000
dnsmasq (2.66-2) unstable; urgency=low
dnsmasq (2.66-2) unstable; urgency=low
...
...
debian/resolvconf
View file @
48493329
#!/bin/
ba
sh
#!/bin/sh
#
#
# Script to update the resolver list for dnsmasq
# Script to update the resolver list for dnsmasq
#
#
# N.B. Resolvconf may run us even if dnsmasq is not running.
# N.B. Resolvconf may run us even if dnsmasq is not
(yet)
running.
# If dnsmasq is installed then we go ahead and update
# If dnsmasq is installed then we go ahead and update
the resolver list
#
the resolver list
in case dnsmasq is started later.
# in case dnsmasq is started later.
#
#
# Assumption: On entry, PWD contains the resolv.conf-type files
# Assumption: On entry, PWD contains the resolv.conf-type files
.
#
#
# Requires bash because it uses a non-POSIX printf extension.
# This file is part of the dnsmasq package.
#
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
#
#
set
-e
set
-e
...
@@ -18,6 +16,8 @@ set -e
...
@@ -18,6 +16,8 @@ set -e
RUN_DIR
=
"/var/run/dnsmasq"
RUN_DIR
=
"/var/run/dnsmasq"
RSLVRLIST_FILE
=
"
${
RUN_DIR
}
/resolv.conf"
RSLVRLIST_FILE
=
"
${
RUN_DIR
}
/resolv.conf"
TMP_FILE
=
"
${
RSLVRLIST_FILE
}
_new.
$$
"
TMP_FILE
=
"
${
RSLVRLIST_FILE
}
_new.
$$
"
MY_RECORD_NAME
=
"lo.dnsmasq"
DNSCRYPT_RECORD_NAME
=
"lo.dnscrypt"
[
-x
/usr/sbin/dnsmasq
]
||
exit
0
[
-x
/usr/sbin/dnsmasq
]
||
exit
0
[
-x
/lib/resolvconf/list-records
]
||
exit
1
[
-x
/lib/resolvconf/list-records
]
||
exit
1
...
@@ -27,7 +27,7 @@ PATH=/bin:/sbin
...
@@ -27,7 +27,7 @@ PATH=/bin:/sbin
report_err
()
{
echo
"
$0
: Error:
$*
"
>
&2
;
}
report_err
()
{
echo
"
$0
: Error:
$*
"
>
&2
;
}
# Stores arguments (minus duplicates) in RSLT, separated by spaces
# Stores arguments (minus duplicates) in RSLT, separated by spaces
# Doesn't work properly if an argument itself contain whitespace
# Doesn't work properly if an argument itself contain
s
whitespace
uniquify
()
uniquify
()
{
{
RSLT
=
""
RSLT
=
""
...
@@ -45,7 +45,22 @@ if [ ! -d "$RUN_DIR" ] && ! mkdir --parents --mode=0755 "$RUN_DIR" ; then
...
@@ -45,7 +45,22 @@ if [ ! -d "$RUN_DIR" ] && ! mkdir --parents --mode=0755 "$RUN_DIR" ; then
exit
1
exit
1
fi
fi
RSLVCNFFILES
=
"
$(
/lib/resolvconf/list-records |
sed
-e
'/^lo.dnsmasq$/d'
)
"
RSLVCNFFILES
=
""
for
F
in
$(
/lib/resolvconf/list-records
)
;
do
case
"
$F
"
in
"
$MY_RECORD_NAME
"
)
# Omit
;;
"
$DNSCRYPT_RECORD_NAME
"
)
# Dnscrypt, I only have eyes for you
RSLVCNFFILES
=
"
$DNSCRYPT_RECORD_NAME
"
break
;;
*
)
RSLVCNFFILES
=
"
${
RSLVCNFFILES
:+
$RSLVCNFFILES
}
$F
"
;;
esac
done
NMSRVRS
=
""
NMSRVRS
=
""
if
[
"
$RSLVCNFFILES
"
]
;
then
if
[
"
$RSLVCNFFILES
"
]
;
then
...
@@ -56,8 +71,8 @@ fi
...
@@ -56,8 +71,8 @@ fi
# Dnsmasq uses the mtime of $RSLVRLIST_FILE, with a resolution of one second,
# 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
# 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
# within one second of the previous one then dnsmasq may fail to notice the
# more recent change.
To work around this problem we sleep here to ensu
re
# more recent change.
To work around this problem we sleep one second he
re
# that the new mtime is different.
#
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
if
[
-f
"
$RSLVRLIST_FILE
"
]
&&
[
"
$(
ls
-go
--time-style
=
'+%s'
"
$RSLVRLIST_FILE
"
|
{
read
p h s t n
;
echo
"
$t
"
;
}
)
"
=
"
$(
date
+%s
)
"
]
;
then
sleep
1
sleep
1
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment