~ubuntu-branches/ubuntu/saucy/dovecot/saucy-security

« back to all changes in this revision

Viewing changes to pigeonhole/src/lib-sieve/sieve-lexer.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-04-04 14:56:38 UTC
  • mfrom: (1.15.1) (4.1.26 sid)
  • Revision ID: package-import@ubuntu.com-20120404145638-qmvdul6vwpcqparv
Tags: 1:2.0.19-0ubuntu1
* New upstream release (LP: #970782).
* Merge from Debian testing, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst:
      Convert init script to upstart.
  + d/patches/fix-racey-restart.patch: Backported patch from current
    development release which ensures all child processes terminate prior
    to the main dovecot process.
  + debian/patches/CVE-2011-4318.patch: Dropped - applied upstream
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
* d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2011 Pigeonhole authors, see the included COPYING file
 
1
/* Copyright (c) 2002-2012 Pigeonhole authors, see the included COPYING file 
2
2
 */
3
3
 
4
4
#ifndef __SIEVE_LEXER_H
13
13
        STT_NONE,
14
14
        STT_WHITESPACE,
15
15
        STT_EOF,
16
 
 
 
16
  
17
17
        STT_NUMBER,
18
18
        STT_IDENTIFIER,
19
19
        STT_TAG,
20
20
        STT_STRING,
21
 
 
 
21
  
22
22
        STT_RBRACKET,
23
23
        STT_LBRACKET,
24
24
        STT_RCURLY,
27
27
        STT_LSQUARE,
28
28
        STT_SEMICOLON,
29
29
        STT_COMMA,
30
 
 
 
30
  
31
31
        /* These are currently not used in the lexical specification, but a token
32
32
         * is assigned to these to generate proper error messages (these are
33
33
         * technically not garbage and possibly part of mistyped but otherwise
34
34
         * valid tokens).
35
35
         */
36
 
        STT_SLASH,
37
 
        STT_COLON,
38
 
 
 
36
        STT_SLASH, 
 
37
        STT_COLON, 
 
38
  
39
39
        /* Error tokens */
40
 
        STT_GARBAGE, /* Error reporting deferred to parser */
41
 
        STT_ERROR    /* Lexer is responsible for error, parser won't report additional
 
40
        STT_GARBAGE, /* Error reporting deferred to parser */ 
 
41
        STT_ERROR    /* Lexer is responsible for error, parser won't report additional 
42
42
                        errors */
43
43
};
44
44
 
50
50
 
51
51
struct sieve_lexer {
52
52
        struct sieve_lexical_scanner *scanner;
53
 
 
 
53
        
54
54
        enum sieve_token_type token_type;
55
55
        string_t *token_str_value;
56
56
        int token_int_value;
59
59
};
60
60
 
61
61
const struct sieve_lexer *sieve_lexer_create
62
 
        (struct sieve_script *script, struct sieve_error_handler *ehandler,
 
62
        (struct sieve_script *script, struct sieve_error_handler *ehandler, 
63
63
                enum sieve_error *error_r);
64
64
void sieve_lexer_free(const struct sieve_lexer **lexer);
65
65
 
66
 
/*
67
 
 * Scanning
 
66
/* 
 
67
 * Scanning 
68
68
 */
69
69
 
70
70
bool sieve_lexer_skip_token(const struct sieve_lexer *lexer);
71
71
 
72
72
/*
73
73
 * Token access
74
 
 */
 
74
 */ 
75
75
 
76
76
static inline enum sieve_token_type sieve_lexer_token_type
77
 
(const struct sieve_lexer *lexer)
 
77
(const struct sieve_lexer *lexer) 
78
78
{
79
79
        return lexer->token_type;
80
80
}
81
81
 
82
82
static inline const string_t *sieve_lexer_token_str
83
 
(const struct sieve_lexer *lexer)
 
83
(const struct sieve_lexer *lexer) 
84
84
{
85
85
        i_assert(       lexer->token_type == STT_STRING );
86
 
 
 
86
                
87
87
        return lexer->token_str_value;
88
88
}
89
89
 
90
90
static inline const char *sieve_lexer_token_ident
91
 
(const struct sieve_lexer *lexer)
 
91
(const struct sieve_lexer *lexer) 
92
92
{
93
93
        i_assert(
94
94
                lexer->token_type == STT_TAG ||
95
95
                lexer->token_type == STT_IDENTIFIER);
96
 
 
 
96
                
97
97
        return str_c(lexer->token_str_value);
98
98
}
99
99
 
100
100
static inline int sieve_lexer_token_int
101
 
(const struct sieve_lexer *lexer)
 
101
(const struct sieve_lexer *lexer) 
102
102
{
103
103
        i_assert(lexer->token_type == STT_NUMBER);
104
 
 
 
104
                
105
105
        return lexer->token_int_value;
106
106
}
107
107
 
108
108
static inline bool sieve_lexer_eof
109
 
(const struct sieve_lexer *lexer)
 
109
(const struct sieve_lexer *lexer) 
110
110
{
111
111
        return lexer->token_type == STT_EOF;
112
112
}
113
113
 
114
114
static inline int sieve_lexer_token_line
115
 
(const struct sieve_lexer *lexer)
 
115
(const struct sieve_lexer *lexer) 
116
116
{
117
117
        return lexer->token_line;
118
118
}