Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2019-01-22 05:51:31 +0300
committerCasey Deccio <casey@deccio.net>2019-01-22 05:51:31 +0300
commit8d716ea3a8d90b66f419cbfef550afc64353f563 (patch)
tree00edd39446ffcee6b7f2c07bb16e3580dbaf1d3b
parentfe5c72a79f3bc5550025d86f239bb4eb8cbd0b65 (diff)
Add /usr:/usr/sbin:/usr/local/sbin to PATH explicitly
This makes it easier on the user when using local zone files.
-rw-r--r--dnsviz/commands/probe.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/dnsviz/commands/probe.py b/dnsviz/commands/probe.py
index 8c3def6..039cdf6 100644
--- a/dnsviz/commands/probe.py
+++ b/dnsviz/commands/probe.py
@@ -567,6 +567,7 @@ def _serve_zone(zone, zone_file, port):
tmpdir = tempfile.mkdtemp(prefix='DNS_dnsviz', dir='/var/tmp/')
except OSError:
tmpdir = tempfile.mkdtemp(prefix='DNS_dnsviz')
+ env = { 'PATH': '%s:/sbin:/usr/sbin:/usr/local/sbin' % (os.environ.get('PATH', '')) }
pid = None
io.open('%s/named.conf' % tmpdir, 'w', encoding='utf-8').write('''
@@ -591,7 +592,7 @@ logging {
''' % (tmpdir, port, port, lb2s(zone.to_text()), os.path.abspath(zone_file), tmpdir))
try:
- p = subprocess.Popen(['named-checkconf', '-z', '%s/named.conf' % tmpdir], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ p = subprocess.Popen(['named-checkconf', '-z', '%s/named.conf' % tmpdir], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
except OSError as e:
usage('This option requires executing named-checkconf. Please ensure that it is installed and in PATH (%s).' % e)
_cleanup_process(tmpdir, pid)
@@ -604,7 +605,7 @@ logging {
sys.exit(1)
try:
- p = subprocess.Popen(['named', '-c', '%s/named.conf' % tmpdir], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ p = subprocess.Popen(['named', '-c', '%s/named.conf' % tmpdir], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
except OSError as e:
usage('This option requires executing named. Please ensure that it is installed and in PATH (%s).' % e)
_cleanup_process(tmpdir, pid)