summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-12 15:46:08 +1100
committerDamien Miller <djm@mindrot.org>1999-11-12 15:46:08 +1100
commit3d1b22c150bfacb300d6d58b1f71f13cef46ef22 (patch)
treea9d424e7535ce8eb3cb348826122815d6223620f /ssh-add.c
parent6d7b2cd1a32efa2a40c97361065d357a2e60b716 (diff)
- Make ssh-askpass support optional through autoconf
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ssh-add.c b/ssh-add.c
index fb237ce2..9ec34180 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity.
*/
#include "includes.h"
-RCSID("$Id: ssh-add.c,v 1.5 1999/11/08 23:28:04 damien Exp $");
+RCSID("$Id: ssh-add.c,v 1.6 1999/11/12 04:46:08 damien Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -60,12 +60,14 @@ add_file(AuthenticationConnection *ac, const char *filename)
RSA *public_key;
char *saved_comment, *comment, *pass;
int first;
+#ifndef DISABLE_EXTERNAL_ASKPASS
int pipes[2];
char buf[BUFSIZE];
int tmp;
pid_t child;
FILE *pipef;
-
+#endif /* !DISABLE_EXTERNAL_ASKPASS */
+
key = RSA_new();
public_key = RSA_new();
if (!load_public_key(filename, public_key, &saved_comment))
@@ -86,6 +88,7 @@ add_file(AuthenticationConnection *ac, const char *filename)
/* Ask for a passphrase. */
if (getenv("DISPLAY") && !isatty(fileno(stdin)))
{
+#ifndef DISABLE_EXTERNAL_ASKPASS
if (pipe(pipes) ==-1)
{
fprintf(stderr, "Creating pipes failed: %s\n", strerror(errno));
@@ -152,6 +155,10 @@ add_file(AuthenticationConnection *ac, const char *filename)
return;
}
}
+#else /* !DISABLE_EXTERNAL_ASKPASS */
+ xfree(saved_comment);
+ return;
+#endif /* !DISABLE_EXTERNAL_ASKPASS */
}
else
{