aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-31 15:06:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-31 15:06:38 +0000
commit4118c68df18b505483e073b56c8450ad1642f691 (patch)
tree9b55778c6a89b08c5f55ac02baaa25e6ed2da53b /lib
parent69d5d88259e1542ac2a9da8f17e67c59602159cf (diff)
check Curl_ftpsendf return codes
Diffstat (limited to 'lib')
-rw-r--r--lib/krb4.c10
-rw-r--r--lib/security.c11
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/krb4.c b/lib/krb4.c
index fd7934e52..96cc4520d 100644
--- a/lib/krb4.c
+++ b/lib/krb4.c
@@ -245,7 +245,8 @@ krb4_auth(void *app_data, struct connectdata *conn)
return AUTH_CONTINUE;
}
- Curl_ftpsendf(conn, "ADAT %s", p);
+ if(Curl_ftpsendf(conn, "ADAT %s", p))
+ return -2;
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL);
if(nread < 0)
@@ -312,7 +313,8 @@ void Curl_krb_kauth(struct connectdata *conn)
save = Curl_set_command_prot(conn, prot_private);
- Curl_ftpsendf(conn, "SITE KAUTH %s", conn->data->state.user);
+ if(Curl_ftpsendf(conn, "SITE KAUTH %s", conn->data->state.user))
+ return;
nread = Curl_GetFTPResponse(conn->data->state.buffer,
conn, NULL);
@@ -378,8 +380,8 @@ void Curl_krb_kauth(struct connectdata *conn)
}
memset (tktcopy.dat, 0, tktcopy.length);
- Curl_ftpsendf(conn,
- "SITE KAUTH %s %s", name, p);
+ if(Curl_ftpsendf(conn, "SITE KAUTH %s %s", name, p))
+ return;
nread = Curl_GetFTPResponse(conn->data->state.buffer,
conn, NULL);
diff --git a/lib/security.c b/lib/security.c
index c39f2a0b6..2a92d0bc9 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -413,7 +413,9 @@ sec_prot_internal(struct connectdata *conn, int level)
}
if(level){
- Curl_ftpsendf(conn, "PBSZ %u", s);
+ if(Curl_ftpsendf(conn, "PBSZ %u", s))
+ return -1;
+
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL);
if(nread < 0)
return -1;
@@ -431,7 +433,9 @@ sec_prot_internal(struct connectdata *conn, int level)
conn->buffer_size = s;
}
- Curl_ftpsendf(conn, "PROT %c", level["CSEP"]);
+ if(Curl_ftpsendf(conn, "PROT %c", level["CSEP"]))
+ return -1;
+
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, NULL);
if(nread < 0)
return -1;
@@ -488,7 +492,8 @@ Curl_sec_login(struct connectdata *conn)
}
infof(data, "Trying %s...\n", (*m)->name);
- Curl_ftpsendf(conn, "AUTH %s", (*m)->name);
+ if(Curl_ftpsendf(conn, "AUTH %s", (*m)->name))
+ return -1;
nread = Curl_GetFTPResponse(conn->data->state.buffer, conn, &ftpcode);
if(nread < 0)