~ubuntu-branches/ubuntu/trusty/checkpolicy/trusty

« back to all changes in this revision

Viewing changes to policy_scan.l

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2005-09-30 14:41:04 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20050930144104-mxvxypbz4tdsf2r0
Tags: 1.27.4-1
New upstream CVS point release, required for the latest SELinux policy
package. Various bug fixes, and retooled for  the new avtab format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *
8
8
 *      Added conditional policy language extensions
9
9
 *
10
 
 * Copyright (C) 2003 Tresys Technology, LLC
 
10
 *          Jason Tang    <jtang@tresys.com>
 
11
 *
 
12
 *      Added support for binary policy modules
 
13
 *
 
14
 * Copyright (C) 2003-5 Tresys Technology, LLC
11
15
 *      This program is free software; you can redistribute it and/or modify
12
16
 *      it under the terms of the GNU General Public License as published by
13
17
 *      the Free Software Foundation, version 2.
20
24
#include <stdint.h>
21
25
#include <string.h>
22
26
 
 
27
typedef int (* require_func_t)();
 
28
 
23
29
#include "y.tab.h"
24
30
 
25
31
static char linebuf[2][255];
38
44
letter  [A-Za-z]
39
45
digit   [0-9]
40
46
hexval  [0-9A-Fa-f]
 
47
version [0-9]+(\.[A-Za-z0-9_.]*)?
 
48
 
41
49
%%
42
50
\n.*                            { strncpy(linebuf[lno], yytext+1, 255);
43
51
                                  linebuf[lno][254] = 0;
123
131
target                          { return(TARGET); }
124
132
SAMEUSER |
125
133
sameuser                        { return(SAMEUSER);}
 
134
module|MODULE                   { return(MODULE); }
 
135
require|REQUIRE                 { return(REQUIRE); }
 
136
optional|OPTIONAL               { return(OPTIONAL); }
126
137
OR |
127
138
or                              { return(OR);}
128
139
AND |
194
205
{letter}({letter}|{digit}|_|"."|"-")*   { return(USER_IDENTIFIER); }
195
206
{digit}{digit}*                 { return(NUMBER); }
196
207
{hexval}{0,4}":"{hexval}{0,4}":"({hexval}|":"|".")*     { return(IPV6_ADDR); }
 
208
{version}/([ \t\f]*;)           { return(VERSION_IDENTIFIER); }
197
209
#line[ ]1[ ]\"[^\n]*\"          { source_lineno = 1; strncpy(source_file, yytext+9, 255); source_file[strlen(source_file)-1] = '\0'; }
198
210
#line[ ]{digit}{digit}*         { source_lineno = atoi(yytext+6)-1; }
199
211
#[^\n]*                         { /* delete comments */ }