~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to programs/pluto/lex.c

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
12
 * for more details.
13
13
 *
14
 
 * RCSID $Id: lex.c,v 1.1.36.1 2004/03/21 05:23:34 mcr Exp $
 
14
 * RCSID $Id: lex.c,v 1.3 2004/04/27 12:43:27 ken Exp $
15
15
 */
16
16
 
17
17
#include <stdio.h>
32
32
 
33
33
struct file_lex_position *flp = NULL;
34
34
 
35
 
/* Open a file for lexical processing.
36
 
 * new_flp and name must point into storage with will live
 
35
/** Open a file for lexical processing.
 
36
 * new_flp and name must point into storage and will live
37
37
 * at least until the file is closed.
 
38
 *
 
39
 * @param new_flp file position
 
40
 * @param name filename
 
41
 * @param bool optional
 
42
 * @return bool True if successful
38
43
 */
39
44
bool
40
45
lexopen(struct file_lex_position *new_flp, const char *name, bool optional)
64
69
    }
65
70
}
66
71
 
 
72
/** Close filehandle
 
73
 *
 
74
 */
67
75
void
68
76
lexclose(void)
69
77
{
71
79
    flp = flp->previous;
72
80
}
73
81
 
74
 
/* Token decoding: shift() loads the next token into tok.
75
 
 * Iff a token starts at the left margin, it is considered
 
82
/** Token decoding: shift() loads the next token into tok.
 
83
 * If a token starts at the left margin, it is considered
76
84
 * to be the first in a record.  We create a special condition,
77
85
 * Record Boundary (analogous to EOF), just before such a token.
78
86
 * We are unwilling to shift through a record boundary:
79
87
 * it must be overridden first.
80
 
 * Returns FALSE iff Record Boundary or EOF (i.e. no token);
 
88
 * Returns FALSE if Record Boundary or EOF (i.e. no token);
81
89
 * tok will then be NULL.
82
90
 */
83
 
 
84
91
char *tok;
85
92
#define tokeq(s) (streq(tok, (s)))
86
93
#define tokeqword(s) (strcasecmp(tok, (s)) == 0)
87
94
 
 
95
/** shift - load next token into tok
 
96
 *
 
97
 * @return bool True if successful
 
98
 */
88
99
bool
89
100
shift(void)
90
101
{
194
205
    }
195
206
}
196
207
 
197
 
/* ensures we are at a Record (or File) boundary, optionally warning if not */
198
 
 
 
208
/** ensures we are at a Record (or File) boundary, optionally warning if not 
 
209
 *
 
210
 * @param m string
 
211
 * @return bool True if everything is ok
 
212
 */
199
213
bool
200
214
flushline(const char *m)
201
215
{