~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to lib/urldata.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-12 15:04:52 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051212150452-2ymlra67b2p7kjyy
Tags: 7.15.1-1ubuntu1
Resynchronise with Debian to get URL parser overflow fix from 7.15.1
(CVE-2005-4077).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
21
 * KIND, either express or implied.
22
22
 *
23
 
 * $Id: urldata.h,v 1.267 2005/04/25 21:39:48 bagder Exp $
 
23
 * $Id: urldata.h,v 1.275 2005/11/28 23:06:00 bagder Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
/* This file is for lib internal stuff */
35
35
#define PORT_HTTPS 443
36
36
#define PORT_DICT 2628
37
37
#define PORT_LDAP 389
 
38
#define PORT_TFTP 69
38
39
 
39
40
#define DICT_MATCH "/MATCH:"
40
41
#define DICT_MATCH2 "/M:"
98
99
#include "hash.h"
99
100
 
100
101
#ifdef HAVE_GSSAPI
101
 
#ifdef HAVE_GSSMIT
102
 
#include <gssapi/gssapi.h>
103
 
#include <gssapi/gssapi_generic.h>
104
 
#else
105
 
#include <gssapi.h>
106
 
#endif
 
102
# ifdef HAVE_GSSGNU
 
103
#  include <gss.h>
 
104
# elif defined HAVE_GSSMIT
 
105
#  include <gssapi/gssapi.h>
 
106
#  include <gssapi/gssapi_generic.h>
 
107
# else
 
108
#  include <gssapi.h>
 
109
# endif
107
110
#endif
108
111
 
109
112
/* Download buffer size, keep it fairly big for speed reasons */
307
310
  FTP_LAST  /* never used */
308
311
} ftpstate;
309
312
 
 
313
typedef enum {
 
314
  FTPFILE_MULTICWD  = 1, /* as defined by RFC1738 */
 
315
  FTPFILE_NOCWD     = 2, /* use SIZE / RETR / STOR on the full path */
 
316
  FTPFILE_SINGLECWD = 3  /* make one CWD, then SIZE / RETR / STOR on the file */
 
317
} curl_ftpfile;
 
318
 
310
319
struct FTP {
311
320
  curl_off_t *bytecountp;
312
321
  char *user;    /* user name string */
421
430
                         LPRT doesn't work we disable it for the forthcoming
422
431
                         requests */
423
432
  bool netrc;         /* name+password provided by netrc */
 
433
 
 
434
  bool trailerHdrPresent; /* Set when Trailer: header found in HTTP response.
 
435
                             Required to determine whether to look for trailers
 
436
                             in case of Transfer-Encoding: chunking */
424
437
};
425
438
 
426
439
struct hostname {
534
547
#define PROT_DICT    (1<<6)
535
548
#define PROT_LDAP    (1<<7)
536
549
#define PROT_FILE    (1<<8)
 
550
#define PROT_TFTP    (1<<11)
537
551
#define PROT_FTPS    (1<<9)
538
552
#define PROT_SSL     (1<<10) /* protocol requires SSL */
539
553
 
554
568
  char *ip_addr_str;
555
569
 
556
570
  char protostr[16];  /* store the protocol string in this buffer */
 
571
  int socktype;  /* SOCK_STREAM or SOCK_DGRAM */
557
572
 
558
573
  struct hostname host;
559
574
  struct hostname proxy;
689
704
    struct HTTP *gopher; /* alias, just for the sake of being more readable */
690
705
    struct HTTP *https;  /* alias, just for the sake of being more readable */
691
706
    struct FTP *ftp;
 
707
    void *tftp;        /* private for tftp.c-eyes only */
692
708
    struct FILEPROTO *file;
693
709
    void *telnet;        /* private for telnet.c-eyes only */
694
710
    void *generic;
726
742
                                     transfer */
727
743
 
728
744
  enum { NORMAL, SOURCE3RD, TARGET3RD } xfertype;
 
745
 
 
746
  /* These three are used for chunked-encoding trailer support */
 
747
  char *trailer; /* allocated buffer to store trailer in */
 
748
  int trlMax;    /* allocated buffer size */
 
749
  int trlPos;    /* index of where to store data */
 
750
 
729
751
};
730
752
 
731
753
/* The end of connectdata. */
940
962
  char *set_range;   /* range, if used. See README for detailed specification
941
963
                        on this syntax. */
942
964
  long followlocation; /* as in HTTP Location: */
943
 
  long maxredirs;    /* maximum no. of http(s) redirects to follow */
 
965
  long maxredirs;    /* maximum no. of http(s) redirects to follow, set to -1
 
966
                        for infinity */
944
967
  char *set_referer; /* custom string */
945
968
  bool free_referer; /* set TRUE if 'referer' points to a string we
946
969
                        allocated */
1018
1041
  char *source_url;     /* for 3rd party transfer */
1019
1042
  char *source_userpwd;  /* for 3rd party transfer */
1020
1043
 
 
1044
  curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used  */
 
1045
 
1021
1046
/* Here follows boolean settings that define how to behave during
1022
1047
   this session. They are STATIC, set by libcurl users or at least initially
1023
1048
   and they don't change during operations. */
1057
1082
  bool no_signal;        /* do not use any signal/alarm handler */
1058
1083
  bool global_dns_cache; /* subject for future removal */
1059
1084
  bool tcp_nodelay;      /* whether to enable TCP_NODELAY or not */
1060
 
 
 
1085
  bool ignorecl;         /* ignore content length */
 
1086
  bool ftp_skip_ip;      /* skip the IP address the FTP server passes on to
 
1087
                            us */
1061
1088
};
1062
1089
 
1063
1090
/*