mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
[master] enable windows python tools
3757. [port] Enable Python tools (dnssec-coverage, dnssec-checkds) to run on Windows. [RT #34355]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
3757. [port] Enable Python tools (dnssec-coverage,
|
||||||
|
dnssec-checkds) to run on Windows. [RT #34355]
|
||||||
|
|
||||||
3756. [bug] GSSAPI Kerberos realm checking was broken in
|
3756. [bug] GSSAPI Kerberos realm checking was broken in
|
||||||
check_config leading to spurious messages being
|
check_config leading to spurious messages being
|
||||||
logged. [RT #35443]
|
logged. [RT #35443]
|
||||||
|
@@ -71,14 +71,6 @@
|
|||||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
@IF PYTHON
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>cd ..\..\python
|
|
||||||
copy /Y dnssec-checkds.py ..\..\Build\$(Configuration)\dnssec-checkds.py
|
|
||||||
copy /Y dnssec-coverage.py ..\..\Build\$(Configuration)\dnssec-coverage.py
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
@END PYTHON
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -108,14 +100,6 @@ copy /Y dnssec-coverage.py ..\..\Build\$(Configuration)\dnssec-coverage.py
|
|||||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
@IF PYTHON
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>cd ..\..\python
|
|
||||||
copy /Y dnssec-checkds.py ..\..\Build\$(Configuration)\dnssec-checkds.py
|
|
||||||
copy /Y dnssec-coverage.py ..\..\Build\$(Configuration)\dnssec-coverage.py
|
|
||||||
</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
@END PYTHON
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\dnssec-importkey.c" />
|
<ClCompile Include="..\dnssec-importkey.c" />
|
||||||
|
@@ -15,15 +15,41 @@
|
|||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import pprint
|
import pprint
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
prog='dnssec-checkds'
|
||||||
|
|
||||||
|
# These routines permit platform-independent location of BIND 9 tools
|
||||||
|
if os.name == 'nt':
|
||||||
|
import win32con
|
||||||
|
import win32api
|
||||||
|
|
||||||
|
def prefix(bindir = ''):
|
||||||
|
if os.name != 'nt':
|
||||||
|
return os.path.join('@prefix@', bindir)
|
||||||
|
|
||||||
|
bind_subkey = "Software\\ISC\\BIND"
|
||||||
|
hKey = None
|
||||||
|
keyFound = True
|
||||||
|
try:
|
||||||
|
hKey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, bind_subkey)
|
||||||
|
except:
|
||||||
|
keyFound = False
|
||||||
|
if keyFound:
|
||||||
|
try:
|
||||||
|
(namedBase, _) = win32api.RegQueryValueEx(hKey, "InstallDir")
|
||||||
|
except:
|
||||||
|
keyFound = False
|
||||||
|
win32api.RegCloseKey(hKey)
|
||||||
|
if keyFound:
|
||||||
|
return os.path.join(namedBase, bindir)
|
||||||
|
return os.path.join(win32api.GetSystemDirectory(), bindir)
|
||||||
|
|
||||||
def shellquote(s):
|
def shellquote(s):
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
return s
|
return '"' + s.replace('"', '"\\"') + '"'
|
||||||
return "'" + s.replace("'", "'\\''") + "'"
|
return "'" + s.replace("'", "'\\''") + "'"
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
@@ -257,12 +283,13 @@ def checkdlv(zone, lookaside, masterfile = None):
|
|||||||
############################################################################
|
############################################################################
|
||||||
def parse_args():
|
def parse_args():
|
||||||
global args
|
global args
|
||||||
|
parser = argparse.ArgumentParser(description=prog + ': checks DS coverage')
|
||||||
|
|
||||||
bindir = 'bin'
|
bindir = 'bin'
|
||||||
if os.name != 'nt':
|
if os.name == 'nt':
|
||||||
sbindir = 'sbin'
|
|
||||||
else:
|
|
||||||
sbindir = 'bin'
|
sbindir = 'bin'
|
||||||
parser = argparse.ArgumentParser(description='checkds: checks DS coverage')
|
else:
|
||||||
|
sbindir = 'sbin'
|
||||||
|
|
||||||
parser.add_argument('zone', type=str, help='zone to check')
|
parser.add_argument('zone', type=str, help='zone to check')
|
||||||
parser.add_argument('-f', '--file', dest='masterfile', type=str,
|
parser.add_argument('-f', '--file', dest='masterfile', type=str,
|
||||||
@@ -270,10 +297,10 @@ def parse_args():
|
|||||||
parser.add_argument('-l', '--lookaside', dest='lookaside', type=str,
|
parser.add_argument('-l', '--lookaside', dest='lookaside', type=str,
|
||||||
help='DLV lookaside zone')
|
help='DLV lookaside zone')
|
||||||
parser.add_argument('-d', '--dig', dest='dig',
|
parser.add_argument('-d', '--dig', dest='dig',
|
||||||
default=os.path.join('@prefix@', bindir, 'dig'),
|
default=os.path.join(prefix(bindir), 'dig'),
|
||||||
type=str, help='path to \'dig\'')
|
type=str, help='path to \'dig\'')
|
||||||
parser.add_argument('-D', '--dsfromkey', dest='dsfromkey',
|
parser.add_argument('-D', '--dsfromkey', dest='dsfromkey',
|
||||||
default=os.path.join('@prefix@', sbindir,
|
default=os.path.join(prefix(sbindir),
|
||||||
'dnssec-dsfromkey'),
|
'dnssec-dsfromkey'),
|
||||||
type=str, help='path to \'dig\'')
|
type=str, help='path to \'dig\'')
|
||||||
parser.add_argument('-v', '--version', action='version', version='9.9.1')
|
parser.add_argument('-v', '--version', action='version', version='9.9.1')
|
||||||
|
@@ -15,10 +15,6 @@
|
|||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# changes 2014-01-08, Peter Palfrader:
|
|
||||||
# - support checking only X days into the future.
|
|
||||||
# - support checking only KSK keys or only ZSK keys.
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
@@ -31,6 +27,32 @@ import pprint
|
|||||||
|
|
||||||
prog='dnssec-coverage'
|
prog='dnssec-coverage'
|
||||||
|
|
||||||
|
# These routines permit platform-independent location of BIND 9 tools
|
||||||
|
if os.name == 'nt':
|
||||||
|
import win32con
|
||||||
|
import win32api
|
||||||
|
|
||||||
|
def prefix(bindir = ''):
|
||||||
|
if os.name != 'nt':
|
||||||
|
return os.path.join('@prefix@', bindir)
|
||||||
|
|
||||||
|
bind_subkey = "Software\\ISC\\BIND"
|
||||||
|
hKey = None
|
||||||
|
keyFound = True
|
||||||
|
try:
|
||||||
|
hKey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, bind_subkey)
|
||||||
|
except:
|
||||||
|
keyFound = False
|
||||||
|
if keyFound:
|
||||||
|
try:
|
||||||
|
(namedBase, _) = win32api.RegQueryValueEx(hKey, "InstallDir")
|
||||||
|
except:
|
||||||
|
keyFound = False
|
||||||
|
win32api.RegCloseKey(hKey)
|
||||||
|
if keyFound:
|
||||||
|
return os.path.join(namedBase, bindir)
|
||||||
|
return os.path.join(win32api.GetSystemDirectory(), bindir)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Class Event
|
# Class Event
|
||||||
########################################################################
|
########################################################################
|
||||||
@@ -633,11 +655,8 @@ def set_path(command, default=None):
|
|||||||
def parse_args():
|
def parse_args():
|
||||||
"""Read command line arguments, set global 'args' structure"""
|
"""Read command line arguments, set global 'args' structure"""
|
||||||
global args
|
global args
|
||||||
bindir = 'bin';
|
|
||||||
|
|
||||||
compilezone = set_path('named-compilezone',
|
compilezone = set_path('named-compilezone',
|
||||||
os.path.join('@prefix@', bindir,
|
os.path.join(prefix('bin'), 'named-compilezone'))
|
||||||
'named-compilezone'))
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description=prog + ': checks future ' +
|
parser = argparse.ArgumentParser(description=prog + ': checks future ' +
|
||||||
'DNSKEY coverage for a zone')
|
'DNSKEY coverage for a zone')
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
#!@PYTHON@
|
|
||||||
############################################################################
|
|
||||||
# Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
|
||||||
# copyright notice and this permission notice appear in all copies.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
||||||
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
||||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
# PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
# ntpath rewrote in Python
|
|
||||||
|
|
||||||
import win32con
|
|
||||||
import win32api
|
|
||||||
|
|
||||||
BIND_SUBKEY = "Software\\ISC\\BIND"
|
|
||||||
|
|
||||||
def base():
|
|
||||||
hKey = None
|
|
||||||
keyFound = True
|
|
||||||
try:
|
|
||||||
hKey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, BIND_SUBKEY)
|
|
||||||
except:
|
|
||||||
keyFound = False
|
|
||||||
if keyFound:
|
|
||||||
try:
|
|
||||||
(namedBase, _) = win32api.RegQueryValueEx(hKey, "InstallDir")
|
|
||||||
except:
|
|
||||||
keyFound = False
|
|
||||||
win32api.RegCloseKey(hKey)
|
|
||||||
if keyFound:
|
|
||||||
return namedBase
|
|
||||||
return win32api.GetSystemDirectory()
|
|
50
bin/tests/system/checkds/dig.pl
Normal file
50
bin/tests/system/checkds/dig.pl
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
|
# copyright notice and this permission notice appear in all copies.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||||
|
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
my $arg;
|
||||||
|
my $ext;
|
||||||
|
my $file;
|
||||||
|
|
||||||
|
foreach $arg (@ARGV) {
|
||||||
|
if ($arg =~ /^\+/) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($arg =~ /^-t/) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($arg =~ /^ds$/i) {
|
||||||
|
$ext = "ds";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($arg =~ /^dlv$/i) {
|
||||||
|
$ext = "dlv";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($arg =~ /^dnskey$/i) {
|
||||||
|
$ext = "dnskey";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
$file = $arg;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
open F, $file . "." . $ext . ".db" || die $!;
|
||||||
|
while (<F>) {
|
||||||
|
print;
|
||||||
|
}
|
||||||
|
close F;
|
@@ -192,6 +192,10 @@ copy ..\bin\dnssec\dnssec-settime.html ..\Build\Release
|
|||||||
copy ..\bin\dnssec\dnssec-revoke.html ..\Build\Release
|
copy ..\bin\dnssec\dnssec-revoke.html ..\Build\Release
|
||||||
copy ..\bin\dnssec\dnssec-verify.html ..\Build\Release
|
copy ..\bin\dnssec\dnssec-verify.html ..\Build\Release
|
||||||
copy ..\bin\dnssec\dnssec-importkey.html ..\Build\Release
|
copy ..\bin\dnssec\dnssec-importkey.html ..\Build\Release
|
||||||
|
@IF PYTHON
|
||||||
|
copy ..\bin\python\dnssec-checkds.html ..\Build\Release
|
||||||
|
copy ..\bin\python\dnssec-coverage.html ..\Build\Release
|
||||||
|
@END PYTHON
|
||||||
@IF PKCS11
|
@IF PKCS11
|
||||||
copy ..\bin\pkcs11\pkcs11-keygen.html ..\Build\Release
|
copy ..\bin\pkcs11\pkcs11-keygen.html ..\Build\Release
|
||||||
copy ..\bin\pkcs11\pkcs11-list.html ..\Build\Release
|
copy ..\bin\pkcs11\pkcs11-list.html ..\Build\Release
|
||||||
|
@@ -66,6 +66,10 @@ copy ..\..\bin\dnssec\dnssec-settime.html ..\..\Build\Release
|
|||||||
copy ..\..\bin\dnssec\dnssec-revoke.html ..\..\Build\Release
|
copy ..\..\bin\dnssec\dnssec-revoke.html ..\..\Build\Release
|
||||||
copy ..\..\bin\dnssec\dnssec-verify.html ..\..\Build\Release
|
copy ..\..\bin\dnssec\dnssec-verify.html ..\..\Build\Release
|
||||||
copy ..\..\bin\dnssec\dnssec-importkey.html ..\..\Build\Release
|
copy ..\..\bin\dnssec\dnssec-importkey.html ..\..\Build\Release
|
||||||
|
@IF PYTHON
|
||||||
|
copy ..\..\bin\python\dnssec-checkds.html ..\..\Build\Release
|
||||||
|
copy ..\..\bin\python\dnssec-coverage.html ..\..\Build\Release
|
||||||
|
@END PYTHON
|
||||||
@IF PKCS11
|
@IF PKCS11
|
||||||
copy ..\..\bin\pkcs11\pkcs11-keygen.html ..\..\Build\Release
|
copy ..\..\bin\pkcs11\pkcs11-keygen.html ..\..\Build\Release
|
||||||
copy ..\..\bin\pkcs11\pkcs11-list.html ..\..\Build\Release
|
copy ..\..\bin\pkcs11\pkcs11-list.html ..\..\Build\Release
|
||||||
|
Reference in New Issue
Block a user