Nmap Development mailing list archives

Re: make install error - nselib/data/psexec


From: David Fifield <david () bamsoftware com>
Date: Thu, 12 Nov 2009 15:31:17 -0700

On Thu, Nov 12, 2009 at 12:20:51PM -0700, David Fifield wrote:
On Wed, Nov 11, 2009 at 09:47:24AM -0600, Ron wrote:
Tom Sellers wrote:
I am seeing an error when running make install on my Ubuntu machine:

/usr/bin/install -c -c -m 644 nse_main.lua /usr/local/share/nmap/
/usr/bin/install -c -d /usr/local/share/nmap/scripts
/usr/bin/install -c -c -m 644 scripts/script.db scripts/*.nse
/usr/local/share/nmap/scripts
/usr/bin/install -c -d /usr/local/share/nmap/nselib
/usr/bin/install -c -c -m 644 nselib/*.lua /usr/local/share/nmap/nselib
/usr/bin/install -c -d /usr/local/share/nmap/nselib/data
/usr/bin/install -c -c -m 644 nselib/data/*
/usr/local/share/nmap/nselib/data
/usr/bin/install: omitting directory `nselib/data/psexec'
make: *** [install-nse] Error 1

Hmm, this error is caused by code I added, but I don't know the proper
way to fix it.

The problem is that the install command is being asked to copy a
directory instead of a regular file. The makefile rule is this:

      $(INSTALL) -d $(DESTDIR)$(nmapdatadir)/nselib/data
      $(INSTALL) -c -m 644 $(NSE_LIB_DATA_FILES) $(DESTDIR)$(nmapdatadir)/nsellib/data

You have to find a way to list the files you want to install. I can't
think of an elegant way to do it. You might try this:

      $(INSTALL) -d $(DESTDIR)$(nmapdatadir)/nselib/data
      $(INSTALL) -d $(DESTDIR)$(nmapdatadir)/nselib/data/psexec
      for f in `find nselib/data -name .svn -prune -o -print`; do \
              $(INSTALL) -c -m 644 $$f $(DESTDIR)$(nmapdatadir)/$$f; \
      done

I made a mistake in the above commands. That still try to install
directories, but it happens to work because the for loop isolates the
error from make. This is better:

        $(INSTALL) -d $(DESTDIR)$(nmapdatadir)/nselib/data
        $(INSTALL) -d $(DESTDIR)$(nmapdatadir)/nselib/data/psexec
        for f in `find nselib/data -name .svn -prune -o -type f -print`; do \
                $(INSTALL) -c -m 644 $$f $(DESTDIR)$(nmapdatadir)/$$f; \
        done

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: