-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf5ac3c
commit 6ff9281
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# modified pageant | ||
|
||
This fork exists because I needed a slightly modified version of PuTTY's `pageant.exe` for a special use case. | ||
|
||
## What it does | ||
|
||
If you use `pageant.exe` with the `-c` option to have it run a command after it processed the key, you'll notice that the command is executed regardless of the key being successfully added or not. For example, if the key is password protected and you cancel the password prompt, the key is not added but the command will still be executed. If that command requires that key, it'll run into an error. | ||
|
||
This modified version of `pageant.exe` will append an extra argument to the command that indicates success (argument will be the number `0`) or failure (argument will be the number of failures, e.g. with one key it'll be `1`). | ||
|
||
### Example | ||
|
||
1. Create a password protected key `mykey.ppk`. | ||
|
||
2. Run the following command | ||
|
||
```bat | ||
pageant.exe mykey.ppk -c cmd.exe /K echo hello | ||
``` | ||
|
||
and cancel the password dialog. A new window will open and show the message | ||
|
||
```text | ||
hello 1 | ||
``` | ||
|
||
3. Run the above command again, but enter the correct password this time. A new window will open and show the message | ||
|
||
```text | ||
hello 0 | ||
``` | ||
|
||
## License | ||
|
||
See the original [LICENCE](LICENCE) file. |