Using ctrl-c in interactive mode leaves temporary files on disk

Issue #24 resolved
George Lester created an issue

Repro:

  1. Open a terminal anywhere
  2. use "ssh-deploy-key" (no parameters)
  3. Enter any password
  4. Hit ctrl-c

Result:

Program quits, throws a stack trace (pasted below) but two files are left in the current direction; "ssh-delpoy-key.smart-append" (not a typo, the file does have "delpoy" in it), and "ssh-deploy-key.overwrite".

If the program is quit by entering "quit", these files are cleaned up as expected. But sending a SIGTERM to the process doesn't clean up as expected.

Resolutions:

  1. Handle SIGNTERM explicitly
  2. Write these files to /tmp, so that they get auto-cleaned by the OS.

Traceback (most recent call last): File "/usr/local/bin/ssh-deploy-key", line 239, in <module> line = sys.stdin.readline() KeyboardInterrupt

Comments (2)

  1. Log in to comment