Skip to content

Commit

Permalink
Python3 port of ndiff
Browse files Browse the repository at this point in the history
Ported all python scrips in ndiff/ except setup.py

Some hints on cmp taken from nmap#1484

Minor tweaks to Makefile to support python3, but unsure if
there is a better way to do that.

Seperated .travis.yml commands for easier debugging where it breaks.

This closes the easy half of nmap#1176

Resolves: nmap#1484
  • Loading branch information
Bryan Quigley committed Jan 24, 2020
1 parent 707a8aa commit f5a4989
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 319 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ compiler:
- clang
# Change this to your needs
sudo: false
script: mkdir /tmp/n && ./configure $SSL_FLAG $LUA_FLAG --prefix=/tmp/n && make && make check && make install && /tmp/n/bin/nmap -A localhost
script:
- "mkdir /tmp/n"
- "./configure $SSL_FLAG $LUA_FLAG --prefix=/tmp/n"
- "make"
- "make check"
- "make install"
- "/tmp/n/bin/nmap -A localhost"

env:
- SSL_FLAG="--without-openssl" LUA_FLAG="--without-liblua"
Expand Down
6 changes: 4 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ZENMAPDIR = @ZENMAPDIR@
NDIFFDIR = @NDIFFDIR@
NPINGDIR = @NPINGDIR@
PYTHON = @PYTHON@
PYTHON3 = /usr/bin/env python3
DEFS = @DEFS@ -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
# With GCC, add extra security checks to source code.
# http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
Expand Down Expand Up @@ -368,6 +369,7 @@ tests/check_dns: $(OBJS)
# this as the location of the interpreter whenever we're not doing a
# local installation.
DEFAULT_PYTHON_PATH = /usr/bin/env python
DEFAULT_PYTHON3_PATH = /usr/bin/env python3

build-zenmap: $(ZENMAPDIR)/setup.py $(ZENMAPDIR)/zenmapCore/Version.py
# When DESTDIR is defined, assume we're building an executable
Expand All @@ -388,7 +390,7 @@ install-zenmap: $(ZENMAPDIR)/setup.py
ln -sf zenmap $(DESTDIR)$(bindir)/xnmap

build-ndiff:
cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)")
cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON3_PATH)")

build-nping: $(NPINGDIR)/Makefile build-nbase build-nsock build-netutil $(NPINGDIR)/nping.h @DNET_BUILD@ @PCAP_BUILD@
@cd $(NPINGDIR) && $(MAKE)
Expand Down Expand Up @@ -458,7 +460,7 @@ check-ncat:
@cd $(NCATDIR) && $(MAKE) check

check-ndiff:
@cd $(NDIFFDIR) && $(PYTHON) ndifftest.py
@cd $(NDIFFDIR) && $(PYTHON3) ndifftest.py

check-nsock:
@cd $(NSOCKDIR)/src && $(MAKE) check
Expand Down
Loading

0 comments on commit f5a4989

Please sign in to comment.