aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-26 19:14:50 -0700
committerJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-28 22:05:24 -0700
commitfc9f3698291d0ba59494207feed674e8d29d9c77 (patch)
treeb5865db5d088677707beea7ad95535ad09a31f5f
parentbfbc4c7e00303ca8ddcb6245a23b5768adb8f1c0 (diff)
security.c: Fix Curl_sec_login after rewrite.
Curl_sec_login was returning the opposite result that the code in ftp.c was expecting. Simplified the return code (using a CURLcode) so to see more clearly what is going on.
-rw-r--r--lib/ftp.c2
-rw-r--r--lib/krb4.h2
-rw-r--r--lib/security.c5
3 files changed, 4 insertions, 5 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 3ea1dd31d..e3f93870f 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2424,7 +2424,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
set a valid level */
Curl_sec_request_prot(conn, data->set.str[STRING_KRB_LEVEL]);
- if(Curl_sec_login(conn) != 0)
+ if(Curl_sec_login(conn) != CURLE_OK)
infof(data, "Logging in with password in cleartext!\n");
else
infof(data, "Authentication successful\n");
diff --git a/lib/krb4.h b/lib/krb4.h
index 29a2578e4..5dc3971e4 100644
--- a/lib/krb4.h
+++ b/lib/krb4.h
@@ -58,7 +58,7 @@ int Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...);
int Curl_sec_vfprintf2(struct connectdata *conn, FILE *, const char *, va_list);
void Curl_sec_end (struct connectdata *);
-int Curl_sec_login (struct connectdata *);
+CURLcode Curl_sec_login (struct connectdata *);
void Curl_sec_prot (int, char **);
int Curl_sec_request_prot (struct connectdata *conn, const char *level);
int Curl_sec_set_protection_level(struct connectdata *conn);
diff --git a/lib/security.c b/lib/security.c
index 25cd483c1..9e74eb277 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -566,11 +566,10 @@ static CURLcode choose_mech(struct connectdata *conn)
return mech != NULL ? CURLE_OK : CURLE_FAILED_INIT;
}
-int
+CURLcode
Curl_sec_login(struct connectdata *conn)
{
- CURLcode code = choose_mech(conn);
- return code == CURLE_OK;
+ return choose_mech(conn);
}