|
Lines 117-123
Link Here
|
| 117 |
|
117 |
|
| 118 |
port = ul; |
118 |
port = ul; |
| 119 |
} else { |
119 |
} else { |
| 120 |
port = 21; |
120 |
port = DEFAULT_FTP_PORT; |
| 121 |
} |
121 |
} |
| 122 |
|
122 |
|
| 123 |
p = slash + 1; |
123 |
p = slash + 1; |
|
Lines 253-259
Link Here
|
| 253 |
hostname = getenv("FTP_PROXY"); |
253 |
hostname = getenv("FTP_PROXY"); |
| 254 |
port = strchr(hostname, ':'); |
254 |
port = strchr(hostname, ':'); |
| 255 |
if (port == 0) { |
255 |
if (port == 0) { |
| 256 |
portno = 21; |
256 |
portno = DEFAULT_FTP_PORT; |
| 257 |
} else { |
257 |
} else { |
| 258 |
unsigned long ul; |
258 |
unsigned long ul; |
| 259 |
char *ep; |
259 |
char *ep; |
|
Lines 289-300
Link Here
|
| 289 |
user = ftps->ftp_user ? ftps->ftp_user : "anonymous"; |
289 |
user = ftps->ftp_user ? ftps->ftp_user : "anonymous"; |
| 290 |
/* user @ hostname [ @port ] \0 */ |
290 |
/* user @ hostname [ @port ] \0 */ |
| 291 |
newuser = safe_malloc(strlen(user) + 1 + strlen(ftps->ftp_hostname) |
291 |
newuser = safe_malloc(strlen(user) + 1 + strlen(ftps->ftp_hostname) |
| 292 |
+ ((ftps->ftp_port != 21) ? 6 : 0) + 1); |
292 |
+ ((ftps->ftp_port != DEFAULT_FTP_PORT) ? 6 : 0) |
|
|
293 |
+ 1); |
| 293 |
|
294 |
|
| 294 |
strcpy(newuser, user); |
295 |
strcpy(newuser, user); |
| 295 |
strcat(newuser, "@"); |
296 |
strcat(newuser, "@"); |
| 296 |
strcat(newuser, ftps->ftp_hostname); |
297 |
strcat(newuser, ftps->ftp_hostname); |
| 297 |
if (ftps->ftp_port != 21) { |
298 |
if (ftps->ftp_port != DEFAULT_FTP_PORT) { |
| 298 |
char numbuf[6]; |
299 |
char numbuf[6]; |
| 299 |
|
300 |
|
| 300 |
snprintf(numbuf, sizeof(numbuf), "%d", ftps->ftp_port); |
301 |
snprintf(numbuf, sizeof(numbuf), "%d", ftps->ftp_port); |