~vanhoof/+junk/znc

« back to all changes in this revision

Viewing changes to ZNCString.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2009-07-24 13:46:00 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090724134600-uaxedj9f92i72ru1
Tags: 0.074-1
* New upstream release.
  - Bump urgency to high. This release fixes an high-impact directory
    traversal buf, where unpriviliged users can save about DCC SEND files on
    the server with the rights of the znc process. The attacker could also
    use the exploit to get a shell on the server.
    Closes: #537977
  - Use c-ares for DNS resolving, add libc-ares-dev and pkg-config as
    build-dependency.
* Merge 0.058-2+lenny2, 0.058-2+lenny3, 0.070-1~bpo40+1 and 0.070-1~bpo50+1
  changelog.
* Bump Standards-Version to 3.8.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include <set>
14
14
#include <string>
15
15
#include <vector>
 
16
#include <list>
16
17
#include <sys/types.h>
17
18
 
18
19
using std::map;
19
20
using std::set;
20
21
using std::string;
21
22
using std::vector;
 
23
using std::list;
22
24
 
23
25
#define _SQL(s) CString("'" + CString(s).Escape_n(CString::ESQL) + "'")
24
26
#define _URL(s) CString("'" + CString(s).Escape_n(CString::EURL) + "'")
29
31
 
30
32
typedef set<CString>                            SCString;
31
33
typedef vector<CString>                         VCString;
 
34
typedef list<CString>                           LCString;
32
35
 
33
36
static const unsigned char XX = 0xff;
34
37
static const unsigned char base64_table[256] = {
70
73
        explicit CString(unsigned long i);
71
74
        explicit CString(long long i);
72
75
        explicit CString(unsigned long long i);
73
 
        explicit CString(double i);
74
 
        explicit CString(float i);
 
76
        explicit CString(double i, int precision = 2);
 
77
        explicit CString(float i, int precision = 2);
75
78
 
76
79
        CString() : string() {}
77
80
        CString(const char* c) : string(c) {}
105
108
        CString Right(unsigned int uCount) const;
106
109
 
107
110
        CString FirstLine() const { return Token(0, false, "\n"); }
108
 
        CString Token(unsigned int uPos, bool bRest = false, const CString& sSep = " ") const;
 
111
        CString Token(unsigned int uPos, bool bRest = false, const CString& sSep = " ", bool bAllowEmpty = false, const CString& sLeft = "", const CString& sRight = "", bool bTrimQuotes = true) const;
 
112
 
109
113
        unsigned int URLSplit(MCString& msRet) const;
110
 
        unsigned int Split(const CString& sDelim, VCString& vsRet, bool bAllowEmpty = true, const CString& sLeft = "", const CString& sRight = "") const;
111
 
        unsigned int Split(const CString& sDelim, SCString& ssRet, bool bAllowEmpty = true, const CString& sLeft = "", const CString& sRight = "") const;
 
114
        unsigned int OptionSplit(MCString& msRet, bool bUpperKeys = false) const;
 
115
        unsigned int QuoteSplit(VCString& vsRet) const;
 
116
 
 
117
        unsigned int Split(const CString& sDelim, VCString& vsRet, bool bAllowEmpty = true,
 
118
                                           const CString& sLeft = "", const CString& sRight = "", bool bTrimQuotes = true,
 
119
                                           bool bTrimWhiteSpace = false) const;
 
120
 
 
121
        unsigned int Split(const CString& sDelim, SCString& ssRet, bool bAllowEmpty = true,
 
122
                                           const CString& sLeft = "", const CString& sRight = "", bool bTrimQuotes = true,
 
123
                                           bool bTrimWhiteSpace = false) const;
112
124
 
113
125
        static CString RandomString(unsigned int uLength);
114
126