aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-09-06 19:43:23 +0300
committerAris Adamantiadis <aris@0xbadc0de.be>2009-09-13 14:03:35 +0300
commit4b363928f6a29e9cf2f2f33b86cb860ef0ab4dec (patch)
treef73c87a650cda30c47b1b1195af64deeccd8f172 /libssh
parent929f5ca25b56ce46bf49e9a44d40bab3ef2d6076 (diff)
downloadlibssh-4b363928f6a29e9cf2f2f33b86cb860ef0ab4dec.tar.gz
libssh-4b363928f6a29e9cf2f2f33b86cb860ef0ab4dec.tar.xz
libssh-4b363928f6a29e9cf2f2f33b86cb860ef0ab4dec.zip
SCP warning request
Diffstat (limited to 'libssh')
-rw-r--r--libssh/scp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libssh/scp.c b/libssh/scp.c
index 4f74dc10..2f800efa 100644
--- a/libssh/scp.c
+++ b/libssh/scp.c
@@ -132,6 +132,7 @@ void ssh_scp_free(ssh_scp scp){
channel_free(scp->channel);
SAFE_FREE(scp->location);
SAFE_FREE(scp->request_name);
+ SAFE_FREE(scp->warning);
SAFE_FREE(scp);
}
@@ -429,6 +430,8 @@ int ssh_scp_pull_request(ssh_scp scp){
case 0x1:
ssh_set_error(scp->session,SSH_REQUEST_DENIED,"SCP: Warning: %s",&buffer[1]);
scp->request_type=SSH_SCP_REQUEST_WARNING;
+ SAFE_FREE(scp->warning);
+ scp->warning=strdup(&buffer[1]);
return scp->request_type;
case 0x2:
ssh_set_error(scp->session,SSH_FATAL,"SCP: Error: %s",&buffer[1]);
@@ -589,3 +592,11 @@ char *ssh_scp_string_mode(int mode){
snprintf(buffer,sizeof(buffer),"%.4o",mode);
return strdup(buffer);
}
+
+/** @brief Gets the warning string
+ * @returns Warning string. Should not be freed.
+ */
+
+const char *ssh_scp_request_get_warning(ssh_scp scp){
+ return scp->warning;
+}