From 3d17b6ad32ccc13fb218e6b30097e28148200ba7 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 11 Apr 2009 18:19:29 -0400 Subject: [PATCH] If pwmd_connect_url() doesn't match ssh:// or socket://, then assume the url is a socket:// rather than returning GPG_ERR_UNSUPPORTED_PROTOCOL. --- doc/libpwmd.3 | 4 ++-- src/libpwmd.c | 5 +++++ src/libpwmd.h.in | 8 +++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/libpwmd.3 b/doc/libpwmd.3 index 9a298c77..94e94851 100644 --- a/doc/libpwmd.3 +++ b/doc/libpwmd.3 @@ -692,7 +692,7 @@ This allows for connecting to a pwmd server by parsing the given URL string. Whe .fi .PP .PP -The parameters in square brackets are optional and if not specified then defaults will be used. +The parameters in square brackets are optional and if not specified then defaults will be used. If neither socket specification is matched, the \fIurl\fP is assumed to be a socket://. .PP \fBParameters:\fP .RS 4 @@ -728,7 +728,7 @@ This allows for connecting to a pwmd server by parsing the given URL string. Whe .fi .PP .PP -The parameters in square brackets are optional and if not specified the defaults will be used. +The parameters in square brackets are optional and if not specified then defaults will be used. If neither socket specification is matched, the \fIurl\fP is assumed to be a socket://. .PP \fBpwmd_process()\fP should be called until the command completes. .PP diff --git a/src/libpwmd.c b/src/libpwmd.c index cb2050b2..95a31d15 100644 --- a/src/libpwmd.c +++ b/src/libpwmd.c @@ -986,6 +986,11 @@ static gpg_error_t _pwmd_connect_url(pwm_t *pwm, const char *url, int async) return rc; #endif } + else { + rc = pwmd_connect(pwm, url); + pwm->state = ASYNC_DONE; + return rc; + } return GPG_ERR_UNSUPPORTED_PROTOCOL; } diff --git a/src/libpwmd.h.in b/src/libpwmd.h.in index 7a04dbaf..98d67e71 100644 --- a/src/libpwmd.h.in +++ b/src/libpwmd.h.in @@ -507,7 +507,8 @@ gpg_error_t pwmd_ssh_connect_async(pwm_t *pwm, const char *host, int port, * \endcode * * The parameters in square brackets are optional and if not specified then - * defaults will be used. + * defaults will be used. If neither socket specification is matched, the + * \a url is assumed to be a socket://. * * \param pwm A handle. * \param url The string to parse. @@ -531,8 +532,9 @@ gpg_error_t pwmd_connect_url(pwm_t *pwm, const char *url) * ssh[46]://[username@]hostname[:port],identity,known_hosts * \endcode * - * The parameters in square brackets are optional and if not specified the - * defaults will be used. + * The parameters in square brackets are optional and if not specified then + * defaults will be used. If neither socket specification is matched, the + * \a url is assumed to be a socket://. * * \process * -- 2.11.4.GIT