Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dehesselle committed Apr 12, 2020
1 parent cf5ac3c commit 6ff9281
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
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.

0 comments on commit 6ff9281

Please sign in to comment.