This repository was archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.l
More file actions
126 lines (113 loc) · 3.73 KB
/
config.l
File metadata and controls
126 lines (113 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%{
/*
* $Id$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* For alternative licensing terms, contact licensing@tri-dsystems.com.
*
* Copyright 2006-2008 TRI-D Systems, Inc.
*/
#include "ident.h"
RCSID("$Id$")
#include "y.tab.h"
#include "extern.h"
#include <syslog.h>
#ifndef LOG_AUTHPRIV
#define LOG_AUTHPRIV LOG_AUTH
#endif
#ifndef LOG_FTP
#define LOG_FTP LOG_DAEMON
#endif
#ifndef LOG_AUDIT
#define LOG_AUDIT LOG_AUTH
#endif
%}
%option yylineno
%x UWORD
%x UWORD2
%x SQUOTE
%x DQUOTE
%%
otpd return OTPD;
\{ return '{';
\} return '}';
= return '=';
yes { yylval.ival = 1; return YES; }
no { yylval.ival = 0; return NO; }
user { BEGIN UWORD; return USER; }
log_facility { BEGIN UWORD; return LOG_FACILITY; }
log_level { BEGIN UWORD; return LOG_LEVEL; }
plugin_rp { BEGIN UWORD; return PLUGIN_RP; }
backend { BEGIN UWORD; return BACKEND; }
timeout return TIMEOUT;
prepend_pin return PREPEND_PIN;
hardfail return HARDFAIL;
softfail return SOFTFAIL;
ewindow_size return EWINDOW_SIZE;
rwindow_size return RWINDOW_SIZE;
site_transform return SITE_TRANSFORM;
file return USER_FILE;
passwd { BEGIN UWORD; return PASSWD; }
encrypt return ENCRYPT;
state_server { BEGIN UWORD; return STATE_SERVER; }
clear return CLEAR;
pin return PIN;
pin-md5 return PINMD5;
ldap return USER_LDAP;
host { BEGIN UWORD; return HOST; }
port return PORT;
binddn { BEGIN UWORD; return BINDDN; }
bindpw { BEGIN UWORD; return BINDPW; }
basedn { BEGIN UWORD; return BASEDN; }
filter { BEGIN UWORD; return FILTER; }
scope { BEGIN UWORD; return SCOPE; }
tls return LDAP_TLS;
mode { BEGIN UWORD; return MODE; }
verify_cert { BEGIN UWORD; return VERIFY_CERT; }
cacertfile { BEGIN UWORD; return CACERTFILE; }
cacertdir { BEGIN UWORD; return CACERTDIR; }
certfile { BEGIN UWORD; return CERTFILE; }
keyfile { BEGIN UWORD; return KEYFILE; }
passwdkey return PASSWDKEY;
id return KEYID;
key { BEGIN UWORD; return KEY; }
state return STATE;
statedir { BEGIN UWORD; return STATEDIR; }
filemode { BEGIN UWORD; return FILEMODE; }
gsmd_port return GPORT;
server return SERVER;
name { BEGIN UWORD; return NAME; }
primary { BEGIN UWORD; return PRIMARY; }
backup { BEGIN UWORD; return BACKUP; }
[[:digit:]]+ { yylval.ival = atoi(yytext); return INTEGER; }
[ \t]+ /* ignore whitespace */;
\#.* /* ignore comments */;
\n /* ignore newlines */;
. yyerror("syntax error");
<UWORD>[ \t]*=[ \t]* { BEGIN UWORD2; return '='; }
<UWORD2>\' BEGIN SQUOTE;
<UWORD2>\" BEGIN DQUOTE;
<UWORD2>[^'"][^ \t\n]* { yylval.sval = xstrdup(yytext);
BEGIN INITIAL; return WORD; }
<SQUOTE>\' { yytext[yyleng - 1] = '\0'; /* remove trailing quote */
yylval.sval = xstrdup(yytext); BEGIN INITIAL; return WORD; }
<SQUOTE>\n { yylineno--; (void) yyerror("unterminated quoted string"); }
<SQUOTE>. yymore();
<DQUOTE>\" { yytext[yyleng - 1] = '\0'; /* remove trailing quote */
yylval.sval = xstrdup(yytext); BEGIN INITIAL; return WORD; }
<DQUOTE>\n { yylineno--; (void) yyerror("unterminated quoted string"); }
<DQUOTE>. yymore();
%%