~ubuntu-branches/ubuntu/hardy/curl/hardy-updates

« back to all changes in this revision

Viewing changes to lib/ftp.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-10-30 10:56:48 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061030105648-uo8q8w9xklb40b4k
Tags: 7.15.5-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control: Drop libdb4.2 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: ftp.c,v 1.360 2006-05-04 22:39:47 bagder Exp $
 
21
 * $Id: ftp.c,v 1.362 2006-07-25 22:45:22 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
699
699
  NBFTPSENDF(conn, "USER %s", ftp->user?ftp->user:"");
700
700
 
701
701
  state(conn, FTP_USER);
 
702
  conn->data->state.ftp_trying_alternative = FALSE;
702
703
 
703
704
  return CURLE_OK;
704
705
}
808
809
  int error;
809
810
  char *host=NULL;
810
811
  struct Curl_dns_entry *h=NULL;
811
 
  unsigned short port;
 
812
  unsigned short port = 0;
812
813
 
813
814
  /* Step 1, figure out what address that is requested */
814
815
 
2302
2303
 
2303
2304
    530 User ... access denied
2304
2305
    (the server denies to log the specified user) */
2305
 
    failf(data, "Access denied: %03d", ftpcode);
2306
 
    result = CURLE_LOGIN_DENIED;
 
2306
 
 
2307
    if (conn->data->set.ftp_alternative_to_user &&
 
2308
        !conn->data->state.ftp_trying_alternative) {
 
2309
      /* Ok, USER failed.  Let's try the supplied command. */
 
2310
      NBFTPSENDF(conn, "%s", conn->data->set.ftp_alternative_to_user);
 
2311
      conn->data->state.ftp_trying_alternative = TRUE;
 
2312
      state(conn, FTP_USER);
 
2313
      result = CURLE_OK;
 
2314
    }
 
2315
    else {
 
2316
      failf(data, "Access denied: %03d", ftpcode);
 
2317
      result = CURLE_LOGIN_DENIED;
 
2318
    }
2307
2319
  }
2308
2320
  return result;
2309
2321
}