Page MenuHomePhabricator
Paste P1041

nuke.diff
ActivePublic

Authored by epriestley on Jan 5 2014, 10:29 PM.
Tags
None
Referenced Files
F98584: nuke.diff
Jan 5 2014, 10:29 PM
Subscribers
None
diff --git a/scripts/ssh/ssh-connect.php b/scripts/ssh/ssh-connect.php
index 8a14209..12fee70 100755
--- a/scripts/ssh/ssh-connect.php
+++ b/scripts/ssh/ssh-connect.php
@@ -65,4 +65,8 @@ array_unshift($arguments, $pattern);
$err = newv('PhutilExecPassthru', $arguments)
->execute();
+if (isset($key)) {
+ $key->nuke();
+}
+
exit($err);
diff --git a/src/applications/passphrase/keys/PassphraseSSHKey.php b/src/applications/passphrase/keys/PassphraseSSHKey.php
index 4ba5025..ee9f92b 100644
--- a/src/applications/passphrase/keys/PassphraseSSHKey.php
+++ b/src/applications/passphrase/keys/PassphraseSSHKey.php
@@ -37,4 +37,10 @@ final class PassphraseSSHKey extends PassphraseAbstractKey {
return $credential->getSecret();
}
+ public function nuke() {
+ if ($this->keyFile) {
+ $this->keyFile->__destruct();
+ }
+ }
+
}

Event Timeline

epriestley changed the title of this paste from untitled to nuke.diff.
epriestley updated the paste's language from autodetect to autodetect.