summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-10-26 10:32:04 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-10-26 10:32:04 +0000
commit02037971ed5a97ad78c062e753b53c7a1542bcc5 (patch)
tree4020e90be001313e9f3d54c898910d0d5d67aa15 /lib/url.c
parenta5b01cf4e833089ea469e32ba30ad624de3aa279 (diff)
downloadcurl-02037971ed5a97ad78c062e753b53c7a1542bcc5.tar.gz
renamed getpass() to my_getpass() and it is now thread-safe and should
disable passwd-echoing on win32 (supplied by Björn Stenberg)
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/url.c b/lib/url.c
index 753222124..32faa3423 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -780,16 +780,16 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
if(*data->userpwd != ':') {
/* the name is given, get user+password */
- sscanf(data->userpwd, "%127[^:]:%127[^@]",
+ sscanf(data->userpwd, "%127[^:]:%127[^\n]",
data->user, data->passwd);
}
else
/* no name given, get the password only */
- sscanf(data->userpwd+1, "%127[^@]", data->passwd);
+ sscanf(data->userpwd+1, "%127[^\n]", data->passwd);
/* check for password, if no ask for one */
if( !data->passwd[0] ) {
- strncpy(data->passwd, getpass("password: "), sizeof(data->passwd));
+ my_getpass("password:", data->passwd, sizeof(data->passwd));
}
}
@@ -799,16 +799,18 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
if(*data->proxyuserpwd != ':') {
/* the name is given, get user+password */
- sscanf(data->proxyuserpwd, "%127[^:]:%127[^@]",
+ sscanf(data->proxyuserpwd, "%127[^:]:%127[^\n]",
data->proxyuser, data->proxypasswd);
}
else
/* no name given, get the password only */
- sscanf(data->proxyuserpwd+1, "%127[^@]", data->proxypasswd);
+ sscanf(data->proxyuserpwd+1, "%127[^\n]", data->proxypasswd);
/* check for password, if no ask for one */
if( !data->proxypasswd[0] ) {
- strncpy(data->proxypasswd, getpass("proxy password: "), sizeof(data->proxypasswd));
+ my_getpass("proxy password:",
+ data->proxypasswd,
+ sizeof(data->proxypasswd));
}
}
@@ -1117,7 +1119,7 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
/* check for password, if no ask for one */
if( !data->passwd[0] ) {
- strncpy(data->passwd, getpass("password: "), sizeof(data->passwd));
+ my_getpass("password:",data->passwd,sizeof(data->passwd));
}
conn->name = ++ptr;