aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2014-08-03 22:29:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-12-15 12:00:49 +0100
commitf818e63f8f3efaea3daf737d280450209c806541 (patch)
tree4b0067b810f9c67d4d4f88f80f18a35a72acb55d /src/misc.c
parent094aa5eb024582d23b8e0cd5ebfea3cb29ed188d (diff)
downloadlibssh-f818e63f8f3efaea3daf737d280450209c806541.tar.gz
libssh-f818e63f8f3efaea3daf737d280450209c806541.tar.xz
libssh-f818e63f8f3efaea3daf737d280450209c806541.zip
Add new options
Pair-Programmed-With: Jakub Jelen <jjelen@redhat.com> Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index 5b260b15..fad33294 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -681,6 +681,17 @@ char *ssh_path_expand_tilde(const char *d) {
return r;
}
+/** @internal
+ * @brief expands a string in function of session options
+ * @param[in] s Format string to expand. Known parameters:
+ * %d SSH configuration directory (~/.ssh)
+ * %h target host name
+ * %u local username
+ * %l local hostname
+ * %r remote username
+ * %p remote port
+ * @returns Expanded string.
+ */
char *ssh_path_expand_escape(ssh_session session, const char *s) {
char host[NI_MAXHOST];
char buf[MAX_BUF_SIZE];
@@ -971,7 +982,7 @@ int ssh_timeout_elapsed(struct ssh_timestamp *ts, int timeout) {
* -2 means user-defined timeout as available in
* session->timeout, session->timeout_usec.
*/
- fprintf(stderr, "ssh_timeout_elapsed called with -2. this needs to "
+ SSH_LOG(SSH_LOG_WARN, "ssh_timeout_elapsed called with -2. this needs to "
"be fixed. please set a breakpoint on %s:%d and "
"fix the caller\n", __FILE__, __LINE__);
return 0;