Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zenmap: Check early whether temp directory is usable, and disable scanning #639

Closed
dmiller-nmap opened this issue Jan 11, 2017 · 2 comments

Comments

@dmiller-nmap
Copy link

We've gotten a few reports like this one where Zenmap crashes because it can't create a temp file to hold Nmap's output when scanning. We should try to avoid any unhandled exceptions like this, so we should probably check very early in the execution process to determine whether a temp file can be created (with mktemp). If it cannot, then we should disable scanning; Zenmap can still be used to view existing Nmap XML files, and even to create Nmap command lines. The only action to take would be to notify the user with a message box and to disable the Scan button, or link it to a different action that reminds the user that scanning is disabled because no suitable temp directory was found.

@Varunram
Copy link

@dmiller-nmap Modified the source such that it checks for the exception right before it executes the command

@dmiller-nmap
Copy link
Author

dmiller-nmap commented Jan 12, 2017

Both @Varunram and @sundhar010 have decent solutions. I'll be applying a combination of both and crediting both of you in the changelog:

I will add the try-catch around the actual execution and report the error directly to the user. This will resolve the crash, catch more potential errors than just the tempfile issue, and allow Zenmap to continue without crashing.

suraj51k pushed a commit to suraj51k/nmap that referenced this issue Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants