aboutsummaryrefslogtreecommitdiffstats
path: root/src/stroke/stroke.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stroke/stroke.c')
-rw-r--r--src/stroke/stroke.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/stroke/stroke.c b/src/stroke/stroke.c
index c27a8ca3e..186e480d1 100644
--- a/src/stroke/stroke.c
+++ b/src/stroke/stroke.c
@@ -55,7 +55,7 @@ static int send_stroke_msg (stroke_msg_t *msg)
{
struct sockaddr_un ctl_addr;
int sock;
- char buffer[64];
+ char buffer[512];
int byte_count;
ctl_addr.sun_family = AF_UNIX;
@@ -89,6 +89,16 @@ static int send_stroke_msg (stroke_msg_t *msg)
{
buffer[byte_count] = '\0';
printf("%s", buffer);
+
+ /* we prompt if we receive the "Passphrase:" magic keyword */
+ if (byte_count >= 12 &&
+ strcmp(buffer + byte_count - 12, "Passphrase:\n") == 0)
+ {
+ if (fgets(buffer, sizeof(buffer), stdin))
+ {
+ if (write(sock, buffer, strlen(buffer)));
+ }
+ }
}
if (byte_count < 0)
{