acl.tab.cpp 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. # line 8 "acltext.y"
  7. #include <string.h>
  8. #include <netsite.h>
  9. #include <base/util.h>
  10. #include <base/plist.h>
  11. #include <libaccess/acl.h>
  12. #include "aclpriv.h"
  13. #include <libaccess/aclproto.h>
  14. #include <libaccess/nserror.h>
  15. #include "parse.h"
  16. #include "aclscan.h"
  17. #define MAX_LIST_SIZE 255
  18. static ACLListHandle_t *curr_acl_list; /* current acl list */
  19. static ACLHandle_t *curr_acl; /* current acl */
  20. static ACLExprHandle_t *curr_expr; /* current expression */
  21. static PFlags_t pflags; /* current authorization flags */
  22. static char *curr_args_list[MAX_LIST_SIZE]; /* current args */
  23. static char *curr_user_list[MAX_LIST_SIZE]; /* current users v2 */
  24. static char *curr_ip_dns_list[MAX_LIST_SIZE]; /* current ip/dns v2 */
  25. static PList_t curr_auth_info; /* current authorization method */
  26. static int use_generic_rights; /* use generic rights for conversion */
  27. int acl_PushListHandle(ACLListHandle_t *handle)
  28. {
  29. curr_acl_list = handle;
  30. return(0);
  31. }
  32. static void
  33. acl_string_lower(char *s)
  34. {
  35. int ii;
  36. int len;
  37. len = strlen(s);
  38. for (ii = 0; ii < len; ii++)
  39. s[ii] = tolower(s[ii]);
  40. return;
  41. }
  42. static void
  43. acl_clear_args(char **args_list)
  44. {
  45. args_list[0] = NULL;
  46. }
  47. static void
  48. acl_add_arg(char **args_list, char *arg)
  49. {
  50. static int args_index;
  51. if ( args_list[0] == NULL ) {
  52. args_index = 0;
  53. }
  54. args_list[args_index] = arg;
  55. args_index++;
  56. args_list[args_index] = NULL;
  57. }
  58. static void
  59. acl_free_args(char **args_list)
  60. {
  61. int ii;
  62. for (ii = 0; ii < MAX_LIST_SIZE; ii++) {
  63. if ( args_list[ii] )
  64. PERM_FREE(args_list[ii]);
  65. else
  66. break;
  67. }
  68. }
  69. static int
  70. acl_set_args(ACLExprHandle_t *expr, char **args_list)
  71. {
  72. int ii;
  73. if (expr == NULL)
  74. return(-1);
  75. for (ii = 0; ii < MAX_LIST_SIZE; ii++) {
  76. if ( args_list[ii] ) {
  77. if ( ACL_ExprAddArg(NULL, expr, args_list[ii]) < 0 ) {
  78. aclerror("ACL_ExprAddArg() failed");
  79. return(-1);
  80. }
  81. } else
  82. break;
  83. }
  84. return(0);
  85. }
  86. static int
  87. acl_set_users_or_groups(ACLExprHandle_t *expr, char **user_list)
  88. {
  89. int ii;
  90. int jj;
  91. if (expr == NULL)
  92. return(-1);
  93. for (ii = 0; ii < MAX_LIST_SIZE; ii++) {
  94. if ( user_list[ii] ) {
  95. if ( ACL_ExprTerm(NULL, expr, "user", CMP_OP_EQ,
  96. user_list[ii]) < 0 ) {
  97. aclerror("ACL_ExprTerm() failed");
  98. acl_free_args(user_list);
  99. return(-1);
  100. }
  101. if ( ACL_ExprTerm(NULL, expr, "group", CMP_OP_EQ,
  102. user_list[ii]) < 0 ) {
  103. aclerror("ACL_ExprTerm() failed");
  104. acl_free_args(user_list);
  105. return(-1);
  106. }
  107. } else
  108. break;
  109. }
  110. acl_free_args(user_list);
  111. for (jj = 0; jj < (ii * 2) - 1; jj++) {
  112. if ( ACL_ExprOr(NULL, expr) < 0 ) {
  113. aclerror("ACL_ExprOr() failed");
  114. return(-1);
  115. }
  116. }
  117. return(0);
  118. }
  119. static int
  120. acl_set_ip_dns(ACLExprHandle_t *expr, char **ip_dns)
  121. {
  122. int ii;
  123. int jj;
  124. int len;
  125. char *attr;
  126. char *val;
  127. if (expr == NULL)
  128. return(-1);
  129. for (ii = 0; ii < MAX_LIST_SIZE; ii++) {
  130. if ( ip_dns[ii] ) {
  131. attr = "ip";
  132. val = ip_dns[ii];
  133. len = strlen(val);
  134. for (jj = 0; jj < len; jj++) {
  135. if ( strchr("0123456789.*", val[jj]) == 0 ) {
  136. attr = "dns";
  137. break;
  138. }
  139. }
  140. if ( ACL_ExprTerm(NULL, expr, attr, CMP_OP_EQ,
  141. val) < 0 ) {
  142. aclerror("ACL_ExprTerm() failed");
  143. acl_free_args(ip_dns);
  144. return(-1);
  145. }
  146. } else
  147. break;
  148. }
  149. acl_free_args(ip_dns);
  150. for (jj = 0; jj < ii - 1; jj++) {
  151. if ( ACL_ExprOr(NULL, expr) < 0 ) {
  152. aclerror("ACL_ExprOr() failed");
  153. return(-1);
  154. }
  155. }
  156. return(0);
  157. }
  158. # line 223 "acltext.y"
  159. typedef union
  160. #ifdef __cplusplus
  161. ACLSTYPE
  162. #endif
  163. {
  164. char *string;
  165. int ival;
  166. } ACLSTYPE;
  167. # define ACL_ABSOLUTE_TOK 257
  168. # define ACL_ACL_TOK 258
  169. # define ACL_ALLOW_TOK 259
  170. # define ACL_ALWAYS_TOK 260
  171. # define ACL_AND_TOK 261
  172. # define ACL_AT_TOK 262
  173. # define ACL_AUTHENTICATE_TOK 263
  174. # define ACL_CONTENT_TOK 264
  175. # define ACL_DEFAULT_TOK 265
  176. # define ACL_DENY_TOK 266
  177. # define ACL_GROUP_TOK 267
  178. # define ACL_IN_TOK 268
  179. # define ACL_INHERIT_TOK 269
  180. # define ACL_NOT_TOK 270
  181. # define ACL_NULL_TOK 271
  182. # define ACL_OR_TOK 272
  183. # define ACL_QSTRING_TOK 273
  184. # define ACL_READ_TOK 274
  185. # define ACL_TERMINAL_TOK 275
  186. # define ACL_VARIABLE_TOK 276
  187. # define ACL_VERSION_TOK 277
  188. # define ACL_WRITE_TOK 278
  189. # define ACL_WITH_TOK 279
  190. # define ACL_EQ_TOK 280
  191. # define ACL_GE_TOK 281
  192. # define ACL_GT_TOK 282
  193. # define ACL_LE_TOK 283
  194. # define ACL_LT_TOK 284
  195. # define ACL_NE_TOK 285
  196. #ifdef __STDC__
  197. #include <stdlib.h>
  198. #include <string.h>
  199. #else
  200. #include <netsite.h>
  201. #include <memory.h>
  202. #endif
  203. #ifdef __cplusplus
  204. #ifndef aclerror
  205. void aclerror(const char *);
  206. #endif
  207. #ifndef acllex
  208. #ifdef __EXTERN_C__
  209. extern "C" { int acllex(void); }
  210. #else
  211. int acllex(void);
  212. #endif
  213. #endif
  214. int acl_Parse(void);
  215. #endif
  216. #define aclclearin aclchar = -1
  217. #define aclerrok aclerrflag = 0
  218. extern int aclchar;
  219. extern int aclerrflag;
  220. ACLSTYPE acllval;
  221. ACLSTYPE aclval;
  222. typedef int acltabelem;
  223. #ifndef ACLMAXDEPTH
  224. #define ACLMAXDEPTH 150
  225. #endif
  226. #if ACLMAXDEPTH > 0
  227. int acl_acls[ACLMAXDEPTH], *acls = acl_acls;
  228. ACLSTYPE acl_aclv[ACLMAXDEPTH], *aclv = acl_aclv;
  229. #else /* user does initial allocation */
  230. int *acls;
  231. ACLSTYPE *aclv;
  232. #endif
  233. static int aclmaxdepth = ACLMAXDEPTH;
  234. # define ACLERRCODE 256
  235. # line 952 "acltext.y"
  236. acltabelem aclexca[] ={
  237. -1, 1,
  238. 0, -1,
  239. -2, 0,
  240. };
  241. # define ACLNPROD 120
  242. # define ACLLAST 251
  243. acltabelem aclact[]={
  244. 176, 177, 178, 180, 179, 181, 156, 109, 69, 53,
  245. 160, 116, 76, 6, 185, 169, 118, 186, 170, 117,
  246. 150, 78, 85, 149, 77, 18, 144, 29, 17, 86,
  247. 28, 11, 3, 126, 10, 136, 140, 82, 89, 104,
  248. 87, 101, 7, 129, 127, 171, 133, 79, 72, 40,
  249. 132, 38, 102, 55, 108, 37, 172, 105, 39, 60,
  250. 60, 107, 128, 63, 59, 45, 61, 61, 93, 23,
  251. 46, 6, 131, 130, 158, 142, 137, 157, 125, 134,
  252. 154, 147, 56, 122, 112, 30, 75, 94, 81, 111,
  253. 139, 138, 88, 73, 165, 164, 155, 57, 50, 49,
  254. 48, 27, 14, 41, 65, 58, 145, 97, 153, 146,
  255. 98, 152, 120, 25, 184, 151, 119, 24, 99, 64,
  256. 13, 32, 15, 21, 5, 175, 159, 106, 103, 8,
  257. 100, 124, 84, 83, 66, 54, 52, 143, 80, 51,
  258. 67, 90, 36, 35, 26, 34, 33, 22, 31, 20,
  259. 135, 113, 62, 74, 96, 47, 92, 71, 44, 68,
  260. 43, 70, 42, 95, 16, 91, 9, 4, 19, 12,
  261. 2, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  262. 0, 0, 0, 110, 115, 114, 121, 123, 0, 0,
  263. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  264. 0, 0, 0, 0, 0, 0, 0, 95, 141, 0,
  265. 0, 0, 0, 0, 0, 148, 0, 0, 0, 0,
  266. 0, 0, 0, 0, 0, 163, 0, 0, 0, 166,
  267. 167, 168, 0, 0, 0, 0, 174, 0, 173, 0,
  268. 161, 0, 0, 0, 118, 78, 162, 117, 77, 182,
  269. 183 };
  270. acltabelem aclpact[]={
  271. -245,-10000000,-10000000, -234, -187,-10000000, -242,-10000000,-10000000, 80,
  272. -10000000,-10000000, 43, -248, -189, 76, 69,-10000000,-10000000,-10000000,
  273. -189,-10000000, 42, -246, -38, -248,-10000000, -208,-10000000,-10000000,
  274. -195,-10000000,-10000000, -208, 41, 40, 39,-10000000,-10000000, -270,
  275. -213, -43, 38,-10000000,-10000000, -199, -200,-10000000,-10000000,-10000000,
  276. -10000000, 79,-10000000,-10000000,-10000000, -271,-10000000, -195,-10000000, -220,
  277. -10000000,-10000000, -28, -221, -239,-10000000, -235, -238,-10000000,-10000000,
  278. -10000000, -28,-10000000,-10000000, -194,-10000000, -252,-10000000,-10000000,-10000000,
  279. 66,-10000000,-10000000,-10000000, 78, -223, -218, -203,-10000000, -273,
  280. -238,-10000000, -39, -29, 75, 68, -39, -40, -239, -243,
  281. -10000000, -231, -202,-10000000, -232, -184,-10000000, -185, -214, -227,
  282. -10000000,-10000000, -241,-10000000,-10000000,-10000000, -257, -240,-10000000,-10000000,
  283. -252,-10000000, -250,-10000000, 65,-10000000,-10000000,-10000000,-10000000,-10000000,
  284. -10000000,-10000000,-10000000,-10000000, -44, -241, -253, 74, 67, 64,
  285. -10000000,-10000000, -45, 37, -274, -30, -243,-10000000,-10000000, 36,
  286. 35,-10000000, -257, -257,-10000000, -250, -258,-10000000, -216,-10000000,
  287. -30, -30, -280,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  288. -10000000, -30, -30, 73,-10000000, -259,-10000000,-10000000,-10000000,-10000000,
  289. -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000 };
  290. acltabelem aclpgo[]={
  291. 0, 171, 170, 169, 168, 167, 124, 166, 122, 103,
  292. 164, 162, 160, 158, 105, 157, 93, 156, 89, 154,
  293. 153, 151, 86, 87, 91, 90, 76, 79, 150, 149,
  294. 123, 147, 121, 146, 145, 143, 142, 141, 92, 140,
  295. 139, 138, 75, 88, 137, 136, 104, 135, 134, 133,
  296. 132, 131, 77, 130, 128, 127, 78, 74, 126, 125 };
  297. acltabelem aclr1[]={
  298. 0, 1, 1, 3, 1, 2, 5, 5, 6, 7,
  299. 7, 8, 8, 10, 10, 9, 9, 11, 11, 15,
  300. 13, 13, 14, 14, 17, 12, 19, 12, 16, 16,
  301. 20, 20, 23, 23, 22, 22, 21, 21, 21, 24,
  302. 24, 25, 26, 26, 26, 26, 18, 28, 28, 27,
  303. 27, 4, 29, 29, 30, 30, 31, 31, 32, 32,
  304. 33, 33, 33, 37, 36, 39, 36, 38, 40, 34,
  305. 41, 41, 43, 42, 42, 44, 44, 45, 35, 47,
  306. 35, 48, 46, 49, 50, 50, 50, 50, 50, 50,
  307. 50, 55, 55, 55, 55, 53, 53, 53, 53, 54,
  308. 54, 54, 54, 51, 51, 56, 52, 52, 52, 57,
  309. 57, 57, 58, 58, 59, 59, 59, 59, 59, 59 };
  310. acltabelem aclr2[]={
  311. 0, 0, 2, 1, 10, 2, 2, 4, 17, 3,
  312. 3, 2, 6, 3, 3, 4, 6, 2, 2, 1,
  313. 8, 6, 3, 3, 1, 10, 1, 10, 7, 3,
  314. 2, 6, 2, 6, 3, 3, 2, 2, 6, 3,
  315. 3, 5, 2, 2, 6, 6, 7, 7, 7, 2,
  316. 4, 2, 2, 4, 6, 4, 5, 5, 2, 4,
  317. 4, 4, 4, 1, 10, 1, 8, 7, 1, 17,
  318. 2, 6, 3, 4, 6, 7, 7, 1, 6, 1,
  319. 6, 1, 5, 10, 0, 3, 5, 3, 5, 3,
  320. 5, 3, 3, 5, 5, 3, 3, 5, 5, 3,
  321. 3, 5, 5, 2, 6, 3, 2, 7, 7, 2,
  322. 6, 5, 7, 7, 2, 2, 2, 2, 2, 2 };
  323. acltabelem aclchk[]={
  324. -10000000, -1, -2, 277, -5, -6, 258, 276, -6, -7,
  325. 276, 273, -3, 40, 59, -8, -10, 276, 273, -4,
  326. -29, -30, -31, 258, 41, 44, -30, 59, 276, 273,
  327. 123, -8, -32, -33, -34, -35, -36, 263, 259, 266,
  328. 257, -9, -11, -12, -13, 260, 265, -32, 59, 59,
  329. 59, -40, -45, 279, -47, 266, 125, 59, -14, 263,
  330. 259, 266, -14, 263, 40, -46, -48, -39, -46, 279,
  331. -9, -15, 268, -16, -20, -22, 40, 276, 273, 268,
  332. -41, -43, 276, -49, -50, 257, 264, 275, -38, 276,
  333. -37, -16, -17, 262, -23, -22, -19, 41, 44, 40,
  334. -53, 264, 275, -54, 257, 275, -55, 264, 257, 280,
  335. -38, -18, 123, -21, -24, -25, 40, 276, 273, 41,
  336. 44, -18, 123, -43, -51, -56, 276, 275, 264, 275,
  337. 257, 257, 264, 273, -27, -28, 276, -26, -24, -25,
  338. 276, -23, -42, -44, 276, 41, 44, 125, -27, 276,
  339. 273, 41, 44, 44, 125, 59, 280, -52, -57, -58,
  340. 40, 270, 276, -56, 59, 59, -26, -26, -42, 273,
  341. 276, 261, 272, -52, -57, -59, 280, 281, 282, 284,
  342. 283, 285, -52, -52, 41, 273, 276 };
  343. acltabelem acldef[]={
  344. 1, -2, 2, 0, 5, 6, 0, 3, 7, 0,
  345. 9, 10, 0, 0, 0, 0, 11, 13, 14, 4,
  346. 51, 52, 0, 0, 0, 0, 53, 55, 56, 57,
  347. 0, 12, 54, 58, 0, 0, 0, 68, 77, 79,
  348. 0, 0, 0, 17, 18, 0, 0, 59, 60, 61,
  349. 62, 0, 81, 65, 81, 0, 8, 15, 19, 0,
  350. 22, 23, 0, 0, 0, 78, 84, 0, 80, 63,
  351. 16, 0, 24, 21, 29, 30, 0, 34, 35, 26,
  352. 0, 70, 72, 82, 0, 85, 87, 89, 66, 0,
  353. 0, 20, 0, 0, 0, 32, 0, 0, 0, 0,
  354. 86, 95, 96, 88, 99, 100, 90, 91, 92, 0,
  355. 64, 25, 0, 28, 36, 37, 0, 39, 40, 31,
  356. 0, 27, 0, 71, 0, 103, 105, 97, 98, 101,
  357. 102, 93, 94, 67, 0, 49, 0, 0, 42, 43,
  358. 41, 33, 0, 0, 0, 0, 0, 46, 50, 0,
  359. 0, 38, 0, 0, 69, 73, 0, 83, 106, 109,
  360. 0, 0, 0, 104, 47, 48, 44, 45, 74, 75,
  361. 76, 0, 0, 0, 111, 0, 114, 115, 116, 117,
  362. 118, 119, 107, 108, 110, 112, 113 };
  363. typedef struct
  364. #ifdef __cplusplus
  365. acltoktype
  366. #endif
  367. { char *t_name; int t_val; } acltoktype;
  368. #ifndef ACLDEBUG
  369. # define ACLDEBUG 0 /* don't allow debugging */
  370. #endif
  371. #if ACLDEBUG
  372. acltoktype acltoks[] =
  373. {
  374. "ACL_ABSOLUTE_TOK", 257,
  375. "ACL_ACL_TOK", 258,
  376. "ACL_ALLOW_TOK", 259,
  377. "ACL_ALWAYS_TOK", 260,
  378. "ACL_AND_TOK", 261,
  379. "ACL_AT_TOK", 262,
  380. "ACL_AUTHENTICATE_TOK", 263,
  381. "ACL_CONTENT_TOK", 264,
  382. "ACL_DEFAULT_TOK", 265,
  383. "ACL_DENY_TOK", 266,
  384. "ACL_GROUP_TOK", 267,
  385. "ACL_IN_TOK", 268,
  386. "ACL_INHERIT_TOK", 269,
  387. "ACL_NOT_TOK", 270,
  388. "ACL_NULL_TOK", 271,
  389. "ACL_OR_TOK", 272,
  390. "ACL_QSTRING_TOK", 273,
  391. "ACL_READ_TOK", 274,
  392. "ACL_TERMINAL_TOK", 275,
  393. "ACL_VARIABLE_TOK", 276,
  394. "ACL_VERSION_TOK", 277,
  395. "ACL_WRITE_TOK", 278,
  396. "ACL_WITH_TOK", 279,
  397. "ACL_EQ_TOK", 280,
  398. "ACL_GE_TOK", 281,
  399. "ACL_GT_TOK", 282,
  400. "ACL_LE_TOK", 283,
  401. "ACL_LT_TOK", 284,
  402. "ACL_NE_TOK", 285,
  403. "-unknown-", -1 /* ends search */
  404. };
  405. char * aclreds[] =
  406. {
  407. "-no such reduction-",
  408. "start : /* empty */",
  409. "start : start_acl_v2",
  410. "start : ACL_VERSION_TOK ACL_VARIABLE_TOK",
  411. "start : ACL_VERSION_TOK ACL_VARIABLE_TOK ';' start_acl_v3",
  412. "start_acl_v2 : acl_list_v2",
  413. "acl_list_v2 : acl_v2",
  414. "acl_list_v2 : acl_list_v2 acl_v2",
  415. "acl_v2 : ACL_ACL_TOK acl_name_v2 '(' arg_list_v2 ')' '{' directive_list_v2 '}'",
  416. "acl_name_v2 : ACL_VARIABLE_TOK",
  417. "acl_name_v2 : ACL_QSTRING_TOK",
  418. "arg_list_v2 : arg_v2",
  419. "arg_list_v2 : arg_v2 ',' arg_list_v2",
  420. "arg_v2 : ACL_VARIABLE_TOK",
  421. "arg_v2 : ACL_QSTRING_TOK",
  422. "directive_list_v2 : directive_v2 ';'",
  423. "directive_list_v2 : directive_v2 ';' directive_list_v2",
  424. "directive_v2 : auth_method_v2",
  425. "directive_v2 : auth_statement_v2",
  426. "auth_statement_v2 : ACL_ALWAYS_TOK auth_type_v2",
  427. "auth_statement_v2 : ACL_ALWAYS_TOK auth_type_v2 host_spec_list_action_v2",
  428. "auth_statement_v2 : ACL_DEFAULT_TOK auth_type_v2 host_spec_list_action_v2",
  429. "auth_type_v2 : ACL_ALLOW_TOK",
  430. "auth_type_v2 : ACL_DENY_TOK",
  431. "auth_method_v2 : ACL_ALWAYS_TOK ACL_AUTHENTICATE_TOK ACL_IN_TOK",
  432. "auth_method_v2 : ACL_ALWAYS_TOK ACL_AUTHENTICATE_TOK ACL_IN_TOK realm_definition_v2",
  433. "auth_method_v2 : ACL_DEFAULT_TOK ACL_AUTHENTICATE_TOK ACL_IN_TOK",
  434. "auth_method_v2 : ACL_DEFAULT_TOK ACL_AUTHENTICATE_TOK ACL_IN_TOK realm_definition_v2",
  435. "host_spec_list_action_v2 : user_expr_v2 ACL_AT_TOK host_spec_list_v2",
  436. "host_spec_list_action_v2 : user_expr_v2",
  437. "user_expr_v2 : user_v2",
  438. "user_expr_v2 : '(' user_list_v2 ')'",
  439. "user_list_v2 : user_v2",
  440. "user_list_v2 : user_v2 ',' user_list_v2",
  441. "user_v2 : ACL_VARIABLE_TOK",
  442. "user_v2 : ACL_QSTRING_TOK",
  443. "host_spec_list_v2 : dns_spec_v2",
  444. "host_spec_list_v2 : ip_spec_v2",
  445. "host_spec_list_v2 : '(' dns_ip_spec_list_v2 ')'",
  446. "dns_spec_v2 : ACL_VARIABLE_TOK",
  447. "dns_spec_v2 : ACL_QSTRING_TOK",
  448. "ip_spec_v2 : ACL_VARIABLE_TOK ACL_VARIABLE_TOK",
  449. "dns_ip_spec_list_v2 : dns_spec_v2",
  450. "dns_ip_spec_list_v2 : ip_spec_v2",
  451. "dns_ip_spec_list_v2 : dns_spec_v2 ',' dns_ip_spec_list_v2",
  452. "dns_ip_spec_list_v2 : ip_spec_v2 ',' dns_ip_spec_list_v2",
  453. "realm_definition_v2 : '{' methods_list_v2 '}'",
  454. "method_v2 : ACL_VARIABLE_TOK ACL_VARIABLE_TOK ';'",
  455. "method_v2 : ACL_VARIABLE_TOK ACL_QSTRING_TOK ';'",
  456. "methods_list_v2 : method_v2",
  457. "methods_list_v2 : method_v2 methods_list_v2",
  458. "start_acl_v3 : acl_list",
  459. "acl_list : acl",
  460. "acl_list : acl_list acl",
  461. "acl : named_acl ';' body_list",
  462. "acl : named_acl ';'",
  463. "named_acl : ACL_ACL_TOK ACL_VARIABLE_TOK",
  464. "named_acl : ACL_ACL_TOK ACL_QSTRING_TOK",
  465. "body_list : body",
  466. "body_list : body body_list",
  467. "body : authenticate_statement ';'",
  468. "body : authorization_statement ';'",
  469. "body : deny_statement ';'",
  470. "deny_statement : ACL_ABSOLUTE_TOK ACL_DENY_TOK ACL_WITH_TOK",
  471. "deny_statement : ACL_ABSOLUTE_TOK ACL_DENY_TOK ACL_WITH_TOK deny_common",
  472. "deny_statement : ACL_DENY_TOK ACL_WITH_TOK",
  473. "deny_statement : ACL_DENY_TOK ACL_WITH_TOK deny_common",
  474. "deny_common : ACL_VARIABLE_TOK ACL_EQ_TOK ACL_QSTRING_TOK",
  475. "authenticate_statement : ACL_AUTHENTICATE_TOK",
  476. "authenticate_statement : ACL_AUTHENTICATE_TOK '(' attribute_list ')' '{' parameter_list '}'",
  477. "attribute_list : attribute",
  478. "attribute_list : attribute_list ',' attribute",
  479. "attribute : ACL_VARIABLE_TOK",
  480. "parameter_list : parameter ';'",
  481. "parameter_list : parameter ';' parameter_list",
  482. "parameter : ACL_VARIABLE_TOK ACL_EQ_TOK ACL_QSTRING_TOK",
  483. "parameter : ACL_VARIABLE_TOK ACL_EQ_TOK ACL_VARIABLE_TOK",
  484. "authorization_statement : ACL_ALLOW_TOK",
  485. "authorization_statement : ACL_ALLOW_TOK auth_common_action",
  486. "authorization_statement : ACL_DENY_TOK",
  487. "authorization_statement : ACL_DENY_TOK auth_common_action",
  488. "auth_common_action : /* empty */",
  489. "auth_common_action : auth_common",
  490. "auth_common : flag_list '(' args_list ')' expression",
  491. "flag_list : /* empty */",
  492. "flag_list : ACL_ABSOLUTE_TOK",
  493. "flag_list : ACL_ABSOLUTE_TOK content_static",
  494. "flag_list : ACL_CONTENT_TOK",
  495. "flag_list : ACL_CONTENT_TOK absolute_static",
  496. "flag_list : ACL_TERMINAL_TOK",
  497. "flag_list : ACL_TERMINAL_TOK content_absolute",
  498. "content_absolute : ACL_CONTENT_TOK",
  499. "content_absolute : ACL_ABSOLUTE_TOK",
  500. "content_absolute : ACL_CONTENT_TOK ACL_ABSOLUTE_TOK",
  501. "content_absolute : ACL_ABSOLUTE_TOK ACL_CONTENT_TOK",
  502. "content_static : ACL_CONTENT_TOK",
  503. "content_static : ACL_TERMINAL_TOK",
  504. "content_static : ACL_CONTENT_TOK ACL_TERMINAL_TOK",
  505. "content_static : ACL_TERMINAL_TOK ACL_CONTENT_TOK",
  506. "absolute_static : ACL_ABSOLUTE_TOK",
  507. "absolute_static : ACL_TERMINAL_TOK",
  508. "absolute_static : ACL_ABSOLUTE_TOK ACL_TERMINAL_TOK",
  509. "absolute_static : ACL_TERMINAL_TOK ACL_ABSOLUTE_TOK",
  510. "args_list : arg",
  511. "args_list : args_list ',' arg",
  512. "arg : ACL_VARIABLE_TOK",
  513. "expression : factor",
  514. "expression : factor ACL_AND_TOK expression",
  515. "expression : factor ACL_OR_TOK expression",
  516. "factor : base_expr",
  517. "factor : '(' expression ')'",
  518. "factor : ACL_NOT_TOK factor",
  519. "base_expr : ACL_VARIABLE_TOK relop ACL_QSTRING_TOK",
  520. "base_expr : ACL_VARIABLE_TOK relop ACL_VARIABLE_TOK",
  521. "relop : ACL_EQ_TOK",
  522. "relop : ACL_GE_TOK",
  523. "relop : ACL_GT_TOK",
  524. "relop : ACL_LT_TOK",
  525. "relop : ACL_LE_TOK",
  526. "relop : ACL_NE_TOK",
  527. };
  528. #endif /* ACLDEBUG */
  529. /*
  530. ** Skeleton parser driver for yacc output
  531. */
  532. /*
  533. ** yacc user known macros and defines
  534. */
  535. #define ACLERROR goto aclerrlab
  536. #define ACLACCEPT return(0)
  537. #define ACLABORT return(1)
  538. #define ACLBACKUP( newtoken, newvalue )\
  539. {\
  540. if ( aclchar >= 0 || ( aclr2[ acltmp ] >> 1 ) != 1 )\
  541. {\
  542. aclerror( "syntax error - cannot backup" );\
  543. goto aclerrlab;\
  544. }\
  545. aclchar = newtoken;\
  546. aclstate = *aclps;\
  547. acllval = newvalue;\
  548. goto aclnewstate;\
  549. }
  550. #define ACLRECOVERING() (!!aclerrflag)
  551. #define ACLNEW(type) PERM_MALLOC(sizeof(type) * aclnewmax)
  552. #define ACLCOPY(to, from, type) \
  553. (type *) memcpy(to, (char *) from, aclnewmax * sizeof(type))
  554. #define ACLENLARGE( from, type) \
  555. (type *) PERM_REALLOC((char *) from, aclnewmax * sizeof(type))
  556. #ifndef ACLDEBUG
  557. # define ACLDEBUG 1 /* make debugging available */
  558. #endif
  559. /*
  560. ** user known globals
  561. */
  562. int acldebug; /* set to 1 to get debugging */
  563. /*
  564. ** driver internal defines
  565. */
  566. #define ACLFLAG (-10000000)
  567. /*
  568. ** global variables used by the parser
  569. */
  570. ACLSTYPE *aclpv; /* top of value stack */
  571. int *aclps; /* top of state stack */
  572. int aclstate; /* current state */
  573. int acltmp; /* extra var (lasts between blocks) */
  574. int aclnerrs; /* number of errors */
  575. int aclerrflag; /* error recovery flag */
  576. int aclchar; /* current input token number */
  577. #ifdef ACLNMBCHARS
  578. #define ACLLEX() aclcvtok(acllex())
  579. /*
  580. ** aclcvtok - return a token if i is a wchar_t value that exceeds 255.
  581. ** If i<255, i itself is the token. If i>255 but the neither
  582. ** of the 30th or 31st bit is on, i is already a token.
  583. */
  584. #if defined(__STDC__) || defined(__cplusplus)
  585. int aclcvtok(int i)
  586. #else
  587. int aclcvtok(i) int i;
  588. #endif
  589. {
  590. int first = 0;
  591. int last = ACLNMBCHARS - 1;
  592. int mid;
  593. wchar_t j;
  594. if(i&0x60000000){/*Must convert to a token. */
  595. if( aclmbchars[last].character < i ){
  596. return i;/*Giving up*/
  597. }
  598. while ((last>=first)&&(first>=0)) {/*Binary search loop*/
  599. mid = (first+last)/2;
  600. j = aclmbchars[mid].character;
  601. if( j==i ){/*Found*/
  602. return aclmbchars[mid].tvalue;
  603. }else if( j<i ){
  604. first = mid + 1;
  605. }else{
  606. last = mid -1;
  607. }
  608. }
  609. /*No entry in the table.*/
  610. return i;/* Giving up.*/
  611. }else{/* i is already a token. */
  612. return i;
  613. }
  614. }
  615. #else/*!ACLNMBCHARS*/
  616. #define ACLLEX() acllex()
  617. #endif/*!ACLNMBCHARS*/
  618. /*
  619. ** acl_Parse - return 0 if worked, 1 if syntax error not recovered from
  620. */
  621. #if defined(__STDC__) || defined(__cplusplus)
  622. int acl_Parse(void)
  623. #else
  624. int acl_Parse()
  625. #endif
  626. {
  627. register ACLSTYPE *aclpvt; /* top of value stack for $vars */
  628. #if defined(__cplusplus) || defined(lint)
  629. /*
  630. hacks to please C++ and lint - goto's inside switch should never be
  631. executed; aclpvt is set to 0 to avoid "used before set" warning.
  632. */
  633. static int __yaccpar_lint_hack__ = 0;
  634. switch (__yaccpar_lint_hack__)
  635. {
  636. case 1: goto aclerrlab;
  637. case 2: goto aclnewstate;
  638. }
  639. aclpvt = 0;
  640. #endif
  641. /*
  642. ** Initialize externals - acl_Parse may be called more than once
  643. */
  644. aclpv = &aclv[-1];
  645. aclps = &acls[-1];
  646. aclstate = 0;
  647. acltmp = 0;
  648. aclnerrs = 0;
  649. aclerrflag = 0;
  650. aclchar = -1;
  651. #if ACLMAXDEPTH <= 0
  652. if (aclmaxdepth <= 0)
  653. {
  654. if ((aclmaxdepth = ACLEXPAND(0)) <= 0)
  655. {
  656. aclerror("yacc initialization error");
  657. ACLABORT;
  658. }
  659. }
  660. #endif
  661. {
  662. register ACLSTYPE *acl_pv; /* top of value stack */
  663. register int *acl_ps; /* top of state stack */
  664. register int acl_state; /* current state */
  665. register int acl_n; /* internal state number info */
  666. goto aclstack; /* moved from 6 lines above to here to please C++ */
  667. /*
  668. ** get globals into registers.
  669. ** branch to here only if ACLBACKUP was called.
  670. */
  671. aclnewstate:
  672. acl_pv = aclpv;
  673. acl_ps = aclps;
  674. acl_state = aclstate;
  675. goto acl_newstate;
  676. /*
  677. ** get globals into registers.
  678. ** either we just started, or we just finished a reduction
  679. */
  680. aclstack:
  681. acl_pv = aclpv;
  682. acl_ps = aclps;
  683. acl_state = aclstate;
  684. /*
  685. ** top of for (;;) loop while no reductions done
  686. */
  687. acl_stack:
  688. /*
  689. ** put a state and value onto the stacks
  690. */
  691. #if ACLDEBUG
  692. /*
  693. ** if debugging, look up token value in list of value vs.
  694. ** name pairs. 0 and negative (-1) are special values.
  695. ** Note: linear search is used since time is not a real
  696. ** consideration while debugging.
  697. */
  698. if ( acldebug )
  699. {
  700. register int acl_i;
  701. printf( "State %d, token ", acl_state );
  702. if ( aclchar == 0 )
  703. printf( "end-of-file\n" );
  704. else if ( aclchar < 0 )
  705. printf( "-none-\n" );
  706. else
  707. {
  708. for ( acl_i = 0; acltoks[acl_i].t_val >= 0;
  709. acl_i++ )
  710. {
  711. if ( acltoks[acl_i].t_val == aclchar )
  712. break;
  713. }
  714. printf( "%s\n", acltoks[acl_i].t_name );
  715. }
  716. }
  717. #endif /* ACLDEBUG */
  718. if ( ++acl_ps >= &acls[ aclmaxdepth ] ) /* room on stack? */
  719. {
  720. /*
  721. ** reallocate and recover. Note that pointers
  722. ** have to be reset, or bad things will happen
  723. */
  724. int aclps_index = (acl_ps - acls);
  725. int aclpv_index = (acl_pv - aclv);
  726. int aclpvt_index = (aclpvt - aclv);
  727. int aclnewmax;
  728. #ifdef ACLEXPAND
  729. aclnewmax = ACLEXPAND(aclmaxdepth);
  730. #else
  731. aclnewmax = 2 * aclmaxdepth; /* double table size */
  732. if (aclmaxdepth == ACLMAXDEPTH) /* first time growth */
  733. {
  734. char *newacls = (char *)ACLNEW(int);
  735. char *newaclv = (char *)ACLNEW(ACLSTYPE);
  736. if (newacls != 0 && newaclv != 0)
  737. {
  738. acls = ACLCOPY(newacls, acls, int);
  739. aclv = ACLCOPY(newaclv, aclv, ACLSTYPE);
  740. }
  741. else
  742. aclnewmax = 0; /* failed */
  743. }
  744. else /* not first time */
  745. {
  746. acls = ACLENLARGE(acls, int);
  747. aclv = ACLENLARGE(aclv, ACLSTYPE);
  748. if (acls == 0 || aclv == 0)
  749. aclnewmax = 0; /* failed */
  750. }
  751. #endif
  752. if (aclnewmax <= aclmaxdepth) /* tables not expanded */
  753. {
  754. aclerror( "yacc stack overflow" );
  755. ACLABORT;
  756. }
  757. aclmaxdepth = aclnewmax;
  758. acl_ps = acls + aclps_index;
  759. acl_pv = aclv + aclpv_index;
  760. aclpvt = aclv + aclpvt_index;
  761. }
  762. *acl_ps = acl_state;
  763. *++acl_pv = aclval;
  764. /*
  765. ** we have a new state - find out what to do
  766. */
  767. acl_newstate:
  768. if ( ( acl_n = aclpact[ acl_state ] ) <= ACLFLAG )
  769. goto acldefault; /* simple state */
  770. #if ACLDEBUG
  771. /*
  772. ** if debugging, need to mark whether new token grabbed
  773. */
  774. acltmp = aclchar < 0;
  775. #endif
  776. if ( ( aclchar < 0 ) && ( ( aclchar = ACLLEX() ) < 0 ) )
  777. aclchar = 0; /* reached EOF */
  778. #if ACLDEBUG
  779. if ( acldebug && acltmp )
  780. {
  781. register int acl_i;
  782. printf( "Received token " );
  783. if ( aclchar == 0 )
  784. printf( "end-of-file\n" );
  785. else if ( aclchar < 0 )
  786. printf( "-none-\n" );
  787. else
  788. {
  789. for ( acl_i = 0; acltoks[acl_i].t_val >= 0;
  790. acl_i++ )
  791. {
  792. if ( acltoks[acl_i].t_val == aclchar )
  793. break;
  794. }
  795. printf( "%s\n", acltoks[acl_i].t_name );
  796. }
  797. }
  798. #endif /* ACLDEBUG */
  799. if ( ( ( acl_n += aclchar ) < 0 ) || ( acl_n >= ACLLAST ) )
  800. goto acldefault;
  801. if ( aclchk[ acl_n = aclact[ acl_n ] ] == aclchar ) /*valid shift*/
  802. {
  803. aclchar = -1;
  804. aclval = acllval;
  805. acl_state = acl_n;
  806. if ( aclerrflag > 0 )
  807. aclerrflag--;
  808. goto acl_stack;
  809. }
  810. acldefault:
  811. if ( ( acl_n = acldef[ acl_state ] ) == -2 )
  812. {
  813. #if ACLDEBUG
  814. acltmp = aclchar < 0;
  815. #endif
  816. if ( ( aclchar < 0 ) && ( ( aclchar = ACLLEX() ) < 0 ) )
  817. aclchar = 0; /* reached EOF */
  818. #if ACLDEBUG
  819. if ( acldebug && acltmp )
  820. {
  821. register int acl_i;
  822. printf( "Received token " );
  823. if ( aclchar == 0 )
  824. printf( "end-of-file\n" );
  825. else if ( aclchar < 0 )
  826. printf( "-none-\n" );
  827. else
  828. {
  829. for ( acl_i = 0;
  830. acltoks[acl_i].t_val >= 0;
  831. acl_i++ )
  832. {
  833. if ( acltoks[acl_i].t_val
  834. == aclchar )
  835. {
  836. break;
  837. }
  838. }
  839. printf( "%s\n", acltoks[acl_i].t_name );
  840. }
  841. }
  842. #endif /* ACLDEBUG */
  843. /*
  844. ** look through exception table
  845. */
  846. {
  847. register int *aclxi = aclexca;
  848. while ( ( *aclxi != -1 ) ||
  849. ( aclxi[1] != acl_state ) )
  850. {
  851. aclxi += 2;
  852. }
  853. while ( ( *(aclxi += 2) >= 0 ) &&
  854. ( *aclxi != aclchar ) )
  855. ;
  856. if ( ( acl_n = aclxi[1] ) < 0 )
  857. ACLACCEPT;
  858. }
  859. }
  860. /*
  861. ** check for syntax error
  862. */
  863. if ( acl_n == 0 ) /* have an error */
  864. {
  865. /* no worry about speed here! */
  866. switch ( aclerrflag )
  867. {
  868. case 0: /* new error */
  869. aclerror( "syntax error" );
  870. goto skip_init;
  871. aclerrlab:
  872. /*
  873. ** get globals into registers.
  874. ** we have a user generated syntax type error
  875. */
  876. acl_pv = aclpv;
  877. acl_ps = aclps;
  878. acl_state = aclstate;
  879. skip_init:
  880. aclnerrs++;
  881. /* FALLTHRU */
  882. case 1:
  883. case 2: /* incompletely recovered error */
  884. /* try again... */
  885. aclerrflag = 3;
  886. /*
  887. ** find state where "error" is a legal
  888. ** shift action
  889. */
  890. while ( acl_ps >= acls )
  891. {
  892. acl_n = aclpact[ *acl_ps ] + ACLERRCODE;
  893. if ( acl_n >= 0 && acl_n < ACLLAST &&
  894. aclchk[aclact[acl_n]] == ACLERRCODE) {
  895. /*
  896. ** simulate shift of "error"
  897. */
  898. acl_state = aclact[ acl_n ];
  899. goto acl_stack;
  900. }
  901. /*
  902. ** current state has no shift on
  903. ** "error", pop stack
  904. */
  905. #if ACLDEBUG
  906. # define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  907. if ( acldebug )
  908. printf( _POP_, *acl_ps,
  909. acl_ps[-1] );
  910. # undef _POP_
  911. #endif
  912. acl_ps--;
  913. acl_pv--;
  914. }
  915. /*
  916. ** there is no state on stack with "error" as
  917. ** a valid shift. give up.
  918. */
  919. ACLABORT;
  920. case 3: /* no shift yet; eat a token */
  921. #if ACLDEBUG
  922. /*
  923. ** if debugging, look up token in list of
  924. ** pairs. 0 and negative shouldn't occur,
  925. ** but since timing doesn't matter when
  926. ** debugging, it doesn't hurt to leave the
  927. ** tests here.
  928. */
  929. if ( acldebug )
  930. {
  931. register int acl_i;
  932. printf( "Error recovery discards " );
  933. if ( aclchar == 0 )
  934. printf( "token end-of-file\n" );
  935. else if ( aclchar < 0 )
  936. printf( "token -none-\n" );
  937. else
  938. {
  939. for ( acl_i = 0;
  940. acltoks[acl_i].t_val >= 0;
  941. acl_i++ )
  942. {
  943. if ( acltoks[acl_i].t_val
  944. == aclchar )
  945. {
  946. break;
  947. }
  948. }
  949. printf( "token %s\n",
  950. acltoks[acl_i].t_name );
  951. }
  952. }
  953. #endif /* ACLDEBUG */
  954. if ( aclchar == 0 ) /* reached EOF. quit */
  955. ACLABORT;
  956. aclchar = -1;
  957. goto acl_newstate;
  958. }
  959. }/* end if ( acl_n == 0 ) */
  960. /*
  961. ** reduction by production acl_n
  962. ** put stack tops, etc. so things right after switch
  963. */
  964. #if ACLDEBUG
  965. /*
  966. ** if debugging, print the string that is the user's
  967. ** specification of the reduction which is just about
  968. ** to be done.
  969. */
  970. if ( acldebug )
  971. printf( "Reduce by (%d) \"%s\"\n",
  972. acl_n, aclreds[ acl_n ] );
  973. #endif
  974. acltmp = acl_n; /* value to switch over */
  975. aclpvt = acl_pv; /* $vars top of value stack */
  976. /*
  977. ** Look in goto table for next state
  978. ** Sorry about using acl_state here as temporary
  979. ** register variable, but why not, if it works...
  980. ** If aclr2[ acl_n ] doesn't have the low order bit
  981. ** set, then there is no action to be done for
  982. ** this reduction. So, no saving & unsaving of
  983. ** registers done. The only difference between the
  984. ** code just after the if and the body of the if is
  985. ** the goto acl_stack in the body. This way the test
  986. ** can be made before the choice of what to do is needed.
  987. */
  988. {
  989. /* length of production doubled with extra bit */
  990. register int acl_len = aclr2[ acl_n ];
  991. if ( !( acl_len & 01 ) )
  992. {
  993. acl_len >>= 1;
  994. aclval = ( acl_pv -= acl_len )[1]; /* $$ = $1 */
  995. acl_state = aclpgo[ acl_n = aclr1[ acl_n ] ] +
  996. *( acl_ps -= acl_len ) + 1;
  997. if ( acl_state >= ACLLAST ||
  998. aclchk[ acl_state =
  999. aclact[ acl_state ] ] != -acl_n )
  1000. {
  1001. acl_state = aclact[ aclpgo[ acl_n ] ];
  1002. }
  1003. goto acl_stack;
  1004. }
  1005. acl_len >>= 1;
  1006. aclval = ( acl_pv -= acl_len )[1]; /* $$ = $1 */
  1007. acl_state = aclpgo[ acl_n = aclr1[ acl_n ] ] +
  1008. *( acl_ps -= acl_len ) + 1;
  1009. if ( acl_state >= ACLLAST ||
  1010. aclchk[ acl_state = aclact[ acl_state ] ] != -acl_n )
  1011. {
  1012. acl_state = aclact[ aclpgo[ acl_n ] ];
  1013. }
  1014. }
  1015. /* save until reenter driver code */
  1016. aclstate = acl_state;
  1017. aclps = acl_ps;
  1018. aclpv = acl_pv;
  1019. }
  1020. /*
  1021. ** code supplied by user is placed in this switch
  1022. */
  1023. switch( acltmp )
  1024. {
  1025. case 3:
  1026. # line 266 "acltext.y"
  1027. {
  1028. PERM_FREE(aclpvt[-0].string);
  1029. } break;
  1030. case 8:
  1031. # line 286 "acltext.y"
  1032. {
  1033. acl_free_args(curr_args_list);
  1034. } break;
  1035. case 9:
  1036. # line 292 "acltext.y"
  1037. {
  1038. curr_acl = ACL_AclNew(NULL, aclpvt[-0].string);
  1039. PERM_FREE(aclpvt[-0].string);
  1040. if ( ACL_ListAppend(NULL, curr_acl_list, curr_acl, 0) < 0 ) {
  1041. aclerror("Couldn't add ACL to list.");
  1042. return(-1);
  1043. }
  1044. acl_clear_args(curr_args_list);
  1045. use_generic_rights = 0;
  1046. if (strstr(curr_acl->tag, "READ")) {
  1047. use_generic_rights++;
  1048. acl_add_arg(curr_args_list, PERM_STRDUP("read"));
  1049. acl_add_arg(curr_args_list, PERM_STRDUP("execute"));
  1050. acl_add_arg(curr_args_list, PERM_STRDUP("list"));
  1051. acl_add_arg(curr_args_list, PERM_STRDUP("info"));
  1052. } if (strstr(curr_acl->tag, "WRITE")) {
  1053. use_generic_rights++;
  1054. acl_add_arg(curr_args_list, PERM_STRDUP("write"));
  1055. acl_add_arg(curr_args_list, PERM_STRDUP("delete"));
  1056. }
  1057. } break;
  1058. case 10:
  1059. # line 314 "acltext.y"
  1060. {
  1061. curr_acl = ACL_AclNew(NULL, aclpvt[-0].string);
  1062. PERM_FREE(aclpvt[-0].string);
  1063. if ( ACL_ListAppend(NULL, curr_acl_list, curr_acl, 0) < 0 ) {
  1064. aclerror("Couldn't add ACL to list.");
  1065. return(-1);
  1066. }
  1067. acl_clear_args(curr_args_list);
  1068. use_generic_rights = 0;
  1069. if (strstr(curr_acl->tag, "READ")) {
  1070. use_generic_rights++;
  1071. acl_add_arg(curr_args_list, PERM_STRDUP("read"));
  1072. acl_add_arg(curr_args_list, PERM_STRDUP("execute"));
  1073. acl_add_arg(curr_args_list, PERM_STRDUP("list"));
  1074. acl_add_arg(curr_args_list, PERM_STRDUP("info"));
  1075. } if (strstr(curr_acl->tag, "WRITE")) {
  1076. use_generic_rights++;
  1077. acl_add_arg(curr_args_list, PERM_STRDUP("write"));
  1078. acl_add_arg(curr_args_list, PERM_STRDUP("delete"));
  1079. }
  1080. } break;
  1081. case 13:
  1082. # line 342 "acltext.y"
  1083. {
  1084. char acl_tmp_arg[255];
  1085. char *acl_new_arg;
  1086. if (!use_generic_rights) {
  1087. acl_string_lower(aclpvt[-0].string);
  1088. strcpy(acl_tmp_arg, "http_");
  1089. strcat(acl_tmp_arg, aclpvt[-0].string);
  1090. PERM_FREE(aclpvt[-0].string);
  1091. acl_new_arg = PERM_STRDUP(acl_tmp_arg);
  1092. acl_add_arg(curr_args_list, acl_new_arg);
  1093. } else {
  1094. PERM_FREE(aclpvt[-0].string);
  1095. }
  1096. } break;
  1097. case 14:
  1098. # line 358 "acltext.y"
  1099. {
  1100. if (!use_generic_rights) {
  1101. acl_add_arg(curr_args_list, aclpvt[-0].string);
  1102. } else {
  1103. PERM_FREE(aclpvt[-0].string);
  1104. }
  1105. } break;
  1106. case 19:
  1107. # line 376 "acltext.y"
  1108. {
  1109. if ( ACL_ExprSetPFlags(NULL, curr_expr,
  1110. ACL_PFLAG_ABSOLUTE) < 0 ) {
  1111. aclerror("Could not set authorization processing flags");
  1112. return(-1);
  1113. }
  1114. } break;
  1115. case 22:
  1116. # line 388 "acltext.y"
  1117. {
  1118. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_ALLOW) ;
  1119. if ( curr_expr == NULL ) {
  1120. aclerror("ACL_ExprNew(allow) failed");
  1121. return(-1);
  1122. }
  1123. acl_clear_args(curr_user_list);
  1124. acl_clear_args(curr_ip_dns_list);
  1125. } break;
  1126. case 23:
  1127. # line 398 "acltext.y"
  1128. {
  1129. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_DENY) ;
  1130. if ( curr_expr == NULL ) {
  1131. aclerror("ACL_ExprNew(allow) failed");
  1132. return(-1);
  1133. }
  1134. acl_clear_args(curr_user_list);
  1135. acl_clear_args(curr_ip_dns_list);
  1136. } break;
  1137. case 24:
  1138. # line 411 "acltext.y"
  1139. {
  1140. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_AUTH) ;
  1141. if ( curr_expr == NULL ) {
  1142. aclerror("ACL_ExprNew(auth) failed");
  1143. return(-1);
  1144. }
  1145. if ( ACL_ExprSetPFlags(NULL, curr_expr,
  1146. ACL_PFLAG_ABSOLUTE) < 0 ) {
  1147. aclerror("Could not set authorization processing flags");
  1148. return(-1);
  1149. }
  1150. curr_auth_info = PListCreate(NULL, ACL_ATTR_INDEX_MAX, 0, 0);
  1151. if ( ACL_ExprAddAuthInfo(curr_expr, curr_auth_info) < 0 ) {
  1152. aclerror("Could not set authorization info");
  1153. return(-1);
  1154. }
  1155. } break;
  1156. case 26:
  1157. # line 430 "acltext.y"
  1158. {
  1159. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_AUTH) ;
  1160. if ( curr_expr == NULL ) {
  1161. aclerror("ACL_ExprNew(auth) failed");
  1162. return(-1);
  1163. }
  1164. curr_auth_info = PListCreate(NULL, ACL_ATTR_INDEX_MAX, 0, 0);
  1165. if ( ACL_ExprAddAuthInfo(curr_expr, curr_auth_info) < 0 ) {
  1166. aclerror("Could not set authorization info");
  1167. return(-1);
  1168. }
  1169. } break;
  1170. case 28:
  1171. # line 446 "acltext.y"
  1172. {
  1173. if ( acl_set_users_or_groups(curr_expr, curr_user_list) < 0 ) {
  1174. aclerror("acl_set_users_or_groups() failed");
  1175. return(-1);
  1176. }
  1177. if ( acl_set_ip_dns(curr_expr, curr_ip_dns_list) < 0 ) {
  1178. aclerror("acl_set_ip_dns() failed");
  1179. return(-1);
  1180. }
  1181. if ( ACL_ExprAnd(NULL, curr_expr) < 0 ) {
  1182. aclerror("ACL_ExprAnd() failed");
  1183. return(-1);
  1184. }
  1185. if ( acl_set_args(curr_expr, curr_args_list) < 0 ) {
  1186. aclerror("acl_set_args() failed");
  1187. return(-1);
  1188. }
  1189. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1190. aclerror("Could not add authorization");
  1191. return(-1);
  1192. }
  1193. } break;
  1194. case 29:
  1195. # line 473 "acltext.y"
  1196. {
  1197. if ( acl_set_users_or_groups(curr_expr, curr_user_list) < 0 ) {
  1198. aclerror("acl_set_users_or_groups() failed");
  1199. return(-1);
  1200. }
  1201. if ( acl_set_args(curr_expr, curr_args_list) < 0 ) {
  1202. aclerror("acl_set_args() failed");
  1203. return(-1);
  1204. }
  1205. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1206. aclerror("Could not add authorization");
  1207. return(-1);
  1208. }
  1209. } break;
  1210. case 34:
  1211. # line 500 "acltext.y"
  1212. {
  1213. acl_add_arg(curr_user_list, aclpvt[-0].string);
  1214. } break;
  1215. case 35:
  1216. # line 504 "acltext.y"
  1217. {
  1218. acl_add_arg(curr_user_list, aclpvt[-0].string);
  1219. } break;
  1220. case 39:
  1221. # line 516 "acltext.y"
  1222. {
  1223. acl_add_arg(curr_ip_dns_list, aclpvt[-0].string);
  1224. } break;
  1225. case 40:
  1226. # line 520 "acltext.y"
  1227. {
  1228. acl_add_arg(curr_ip_dns_list, aclpvt[-0].string);
  1229. } break;
  1230. case 41:
  1231. # line 526 "acltext.y"
  1232. {
  1233. char tmp_str[255];
  1234. util_sprintf(tmp_str, "%s+%s", aclpvt[-1].string, aclpvt[-0].string);
  1235. PERM_FREE(aclpvt[-1].string);
  1236. PERM_FREE(aclpvt[-0].string);
  1237. acl_add_arg(curr_ip_dns_list, PERM_STRDUP(tmp_str));
  1238. } break;
  1239. case 46:
  1240. # line 543 "acltext.y"
  1241. {
  1242. if ( ACL_ExprAddArg(NULL, curr_expr, "user") < 0 ) {
  1243. aclerror("ACL_ExprAddArg() failed");
  1244. return(-1);
  1245. }
  1246. if ( ACL_ExprAddArg(NULL, curr_expr, "group") < 0 ) {
  1247. aclerror("ACL_ExprAddArg() failed");
  1248. return(-1);
  1249. }
  1250. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1251. aclerror("Could not add authorization");
  1252. return(-1);
  1253. }
  1254. } break;
  1255. case 47:
  1256. # line 562 "acltext.y"
  1257. {
  1258. acl_string_lower(aclpvt[-2].string);
  1259. if (strcmp(aclpvt[-2].string, "database") == 0) {
  1260. PERM_FREE(aclpvt[-2].string);
  1261. PERM_FREE(aclpvt[-1].string);
  1262. } else {
  1263. if ( PListInitProp(curr_auth_info,
  1264. ACL_Attr2Index(aclpvt[-2].string), aclpvt[-2].string, aclpvt[-1].string, NULL) < 0 ) {
  1265. }
  1266. PERM_FREE(aclpvt[-2].string);
  1267. }
  1268. } break;
  1269. case 48:
  1270. # line 575 "acltext.y"
  1271. {
  1272. acl_string_lower(aclpvt[-2].string);
  1273. if (strcmp(aclpvt[-2].string, "database") == 0) {
  1274. PERM_FREE(aclpvt[-2].string);
  1275. PERM_FREE(aclpvt[-1].string);
  1276. } else {
  1277. if ( PListInitProp(curr_auth_info,
  1278. ACL_Attr2Index(aclpvt[-2].string), aclpvt[-2].string, aclpvt[-1].string, NULL) < 0 ) {
  1279. }
  1280. PERM_FREE(aclpvt[-2].string);
  1281. }
  1282. } break;
  1283. case 56:
  1284. # line 611 "acltext.y"
  1285. {
  1286. curr_acl = ACL_AclNew(NULL, aclpvt[-0].string);
  1287. PERM_FREE(aclpvt[-0].string);
  1288. if ( ACL_ListAppend(NULL, curr_acl_list, curr_acl, 0) < 0 ) {
  1289. aclerror("Couldn't add ACL to list.");
  1290. return(-1);
  1291. }
  1292. } break;
  1293. case 57:
  1294. # line 620 "acltext.y"
  1295. {
  1296. curr_acl = ACL_AclNew(NULL, aclpvt[-0].string);
  1297. PERM_FREE(aclpvt[-0].string);
  1298. if ( ACL_ListAppend(NULL, curr_acl_list, curr_acl, 0) < 0 ) {
  1299. aclerror("Couldn't add ACL to list.");
  1300. return(-1);
  1301. }
  1302. } break;
  1303. case 63:
  1304. # line 641 "acltext.y"
  1305. {
  1306. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_RESPONSE) ;
  1307. if ( curr_expr == NULL ) {
  1308. aclerror("ACL_ExprNew(deny) failed");
  1309. return(-1);
  1310. }
  1311. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1312. aclerror("Could not add authorization");
  1313. return(-1);
  1314. }
  1315. if ( ACL_ExprSetPFlags(NULL, curr_expr,
  1316. ACL_PFLAG_ABSOLUTE) < 0 ) {
  1317. aclerror("Could not set deny processing flags");
  1318. return(-1);
  1319. }
  1320. } break;
  1321. case 65:
  1322. # line 659 "acltext.y"
  1323. {
  1324. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_RESPONSE) ;
  1325. if ( curr_expr == NULL ) {
  1326. aclerror("ACL_ExprNew(deny) failed");
  1327. return(-1);
  1328. }
  1329. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1330. aclerror("Could not add authorization");
  1331. return(-1);
  1332. }
  1333. } break;
  1334. case 67:
  1335. # line 674 "acltext.y"
  1336. {
  1337. acl_string_lower(aclpvt[-2].string);
  1338. if ( ACL_ExprSetDenyWith(NULL, curr_expr,
  1339. aclpvt[-2].string, aclpvt[-0].string) < 0 ) {
  1340. aclerror("ACL_ExprSetDenyWith() failed");
  1341. return(-1);
  1342. }
  1343. PERM_FREE(aclpvt[-2].string);
  1344. PERM_FREE(aclpvt[-0].string);
  1345. } break;
  1346. case 68:
  1347. # line 687 "acltext.y"
  1348. {
  1349. pflags = 0;
  1350. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_AUTH) ;
  1351. if ( curr_expr == NULL ) {
  1352. aclerror("ACL_ExprNew(allow) failed");
  1353. return(-1);
  1354. }
  1355. curr_auth_info = PListCreate(NULL, ACL_ATTR_INDEX_MAX, 0, 0);
  1356. if ( ACL_ExprAddAuthInfo(curr_expr, curr_auth_info) < 0 ) {
  1357. aclerror("Could not set authorization info");
  1358. return(-1);
  1359. }
  1360. } break;
  1361. case 69:
  1362. # line 701 "acltext.y"
  1363. {
  1364. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1365. aclerror("Could not add authorization");
  1366. return(-1);
  1367. }
  1368. } break;
  1369. case 72:
  1370. # line 713 "acltext.y"
  1371. {
  1372. acl_string_lower(aclpvt[-0].string);
  1373. if ( ACL_ExprAddArg(NULL, curr_expr, aclpvt[-0].string) < 0 ) {
  1374. aclerror("ACL_ExprAddArg() failed");
  1375. return(-1);
  1376. }
  1377. PERM_FREE(aclpvt[-0].string);
  1378. } break;
  1379. case 75:
  1380. # line 728 "acltext.y"
  1381. {
  1382. acl_string_lower(aclpvt[-2].string);
  1383. if ( PListInitProp(curr_auth_info,
  1384. ACL_Attr2Index(aclpvt[-2].string), aclpvt[-2].string, aclpvt[-0].string, NULL) < 0 ) {
  1385. }
  1386. PERM_FREE(aclpvt[-2].string);
  1387. } break;
  1388. case 76:
  1389. # line 736 "acltext.y"
  1390. {
  1391. acl_string_lower(aclpvt[-2].string);
  1392. if ( PListInitProp(curr_auth_info,
  1393. ACL_Attr2Index(aclpvt[-2].string), aclpvt[-2].string, aclpvt[-0].string, NULL) < 0 ) {
  1394. }
  1395. PERM_FREE(aclpvt[-2].string);
  1396. } break;
  1397. case 77:
  1398. # line 746 "acltext.y"
  1399. {
  1400. pflags = 0;
  1401. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_ALLOW) ;
  1402. if ( curr_expr == NULL ) {
  1403. aclerror("ACL_ExprNew(allow) failed");
  1404. return(-1);
  1405. }
  1406. } break;
  1407. case 79:
  1408. # line 756 "acltext.y"
  1409. {
  1410. pflags = 0;
  1411. curr_expr = ACL_ExprNew(ACL_EXPR_TYPE_DENY) ;
  1412. if ( curr_expr == NULL ) {
  1413. aclerror("ACL_ExprNew(deny) failed");
  1414. return(-1);
  1415. }
  1416. } break;
  1417. case 81:
  1418. # line 768 "acltext.y"
  1419. {
  1420. if ( ACL_ExprAppend(NULL, curr_acl, curr_expr) < 0 ) {
  1421. aclerror("Could not add authorization");
  1422. return(-1);
  1423. }
  1424. } break;
  1425. case 82:
  1426. # line 775 "acltext.y"
  1427. {
  1428. if ( ACL_ExprSetPFlags (NULL, curr_expr, pflags) < 0 ) {
  1429. aclerror("Could not set authorization processing flags");
  1430. return(-1);
  1431. }
  1432. #ifdef DEBUG
  1433. if ( ACL_ExprDisplay(curr_expr) < 0 ) {
  1434. aclerror("ACL_ExprDisplay() failed");
  1435. return(-1);
  1436. }
  1437. printf("Parsed authorization.\n");
  1438. #endif
  1439. } break;
  1440. case 85:
  1441. # line 795 "acltext.y"
  1442. {
  1443. pflags = ACL_PFLAG_ABSOLUTE;
  1444. } break;
  1445. case 86:
  1446. # line 799 "acltext.y"
  1447. {
  1448. pflags = ACL_PFLAG_ABSOLUTE;
  1449. } break;
  1450. case 87:
  1451. # line 803 "acltext.y"
  1452. {
  1453. pflags = ACL_PFLAG_CONTENT;
  1454. } break;
  1455. case 88:
  1456. # line 807 "acltext.y"
  1457. {
  1458. pflags = ACL_PFLAG_CONTENT;
  1459. } break;
  1460. case 89:
  1461. # line 811 "acltext.y"
  1462. {
  1463. pflags = ACL_PFLAG_TERMINAL;
  1464. } break;
  1465. case 90:
  1466. # line 815 "acltext.y"
  1467. {
  1468. pflags = ACL_PFLAG_TERMINAL;
  1469. } break;
  1470. case 91:
  1471. # line 821 "acltext.y"
  1472. {
  1473. pflags |= ACL_PFLAG_CONTENT;
  1474. } break;
  1475. case 92:
  1476. # line 825 "acltext.y"
  1477. {
  1478. pflags |= ACL_PFLAG_ABSOLUTE;
  1479. } break;
  1480. case 93:
  1481. # line 829 "acltext.y"
  1482. {
  1483. pflags |= ACL_PFLAG_ABSOLUTE | ACL_PFLAG_CONTENT;
  1484. } break;
  1485. case 94:
  1486. # line 833 "acltext.y"
  1487. {
  1488. pflags |= ACL_PFLAG_ABSOLUTE | ACL_PFLAG_CONTENT;
  1489. } break;
  1490. case 95:
  1491. # line 839 "acltext.y"
  1492. {
  1493. pflags |= ACL_PFLAG_CONTENT;
  1494. } break;
  1495. case 96:
  1496. # line 843 "acltext.y"
  1497. {
  1498. pflags |= ACL_PFLAG_TERMINAL;
  1499. } break;
  1500. case 97:
  1501. # line 847 "acltext.y"
  1502. {
  1503. pflags |= ACL_PFLAG_TERMINAL | ACL_PFLAG_CONTENT;
  1504. } break;
  1505. case 98:
  1506. # line 851 "acltext.y"
  1507. {
  1508. pflags |= ACL_PFLAG_TERMINAL | ACL_PFLAG_CONTENT;
  1509. } break;
  1510. case 99:
  1511. # line 857 "acltext.y"
  1512. {
  1513. pflags |= ACL_PFLAG_ABSOLUTE;
  1514. } break;
  1515. case 100:
  1516. # line 861 "acltext.y"
  1517. {
  1518. pflags |= ACL_PFLAG_TERMINAL;
  1519. } break;
  1520. case 101:
  1521. # line 865 "acltext.y"
  1522. {
  1523. pflags |= ACL_PFLAG_TERMINAL | ACL_PFLAG_ABSOLUTE;
  1524. } break;
  1525. case 102:
  1526. # line 869 "acltext.y"
  1527. {
  1528. pflags |= ACL_PFLAG_TERMINAL | ACL_PFLAG_ABSOLUTE;
  1529. } break;
  1530. case 105:
  1531. # line 879 "acltext.y"
  1532. {
  1533. acl_string_lower(aclpvt[-0].string);
  1534. if ( ACL_ExprAddArg(NULL, curr_expr, aclpvt[-0].string) < 0 ) {
  1535. aclerror("ACL_ExprAddArg() failed");
  1536. return(-1);
  1537. }
  1538. PERM_FREE( aclpvt[-0].string );
  1539. } break;
  1540. case 107:
  1541. # line 891 "acltext.y"
  1542. {
  1543. if ( ACL_ExprAnd(NULL, curr_expr) < 0 ) {
  1544. aclerror("ACL_ExprAnd() failed");
  1545. return(-1);
  1546. }
  1547. } break;
  1548. case 108:
  1549. # line 898 "acltext.y"
  1550. {
  1551. if ( ACL_ExprOr(NULL, curr_expr) < 0 ) {
  1552. aclerror("ACL_ExprOr() failed");
  1553. return(-1);
  1554. }
  1555. } break;
  1556. case 111:
  1557. # line 909 "acltext.y"
  1558. {
  1559. if ( ACL_ExprNot(NULL, curr_expr) < 0 ) {
  1560. aclerror("ACL_ExprNot() failed");
  1561. return(-1);
  1562. }
  1563. } break;
  1564. case 112:
  1565. # line 918 "acltext.y"
  1566. {
  1567. acl_string_lower(aclpvt[-2].string);
  1568. if ( ACL_ExprTerm(NULL, curr_expr,
  1569. aclpvt[-2].string, (CmpOp_t) aclpvt[-1].ival, aclpvt[-0].string) < 0 ) {
  1570. aclerror("ACL_ExprTerm() failed");
  1571. PERM_FREE(aclpvt[-2].string);
  1572. PERM_FREE(aclpvt[-0].string);
  1573. return(-1);
  1574. }
  1575. PERM_FREE(aclpvt[-2].string);
  1576. PERM_FREE(aclpvt[-0].string);
  1577. } break;
  1578. case 113:
  1579. # line 931 "acltext.y"
  1580. {
  1581. acl_string_lower(aclpvt[-2].string);
  1582. if ( ACL_ExprTerm(NULL, curr_expr,
  1583. aclpvt[-2].string, (CmpOp_t) aclpvt[-1].ival, aclpvt[-0].string) < 0 ) {
  1584. aclerror("ACL_ExprTerm() failed");
  1585. PERM_FREE(aclpvt[-2].string);
  1586. PERM_FREE(aclpvt[-0].string);
  1587. return(-1);
  1588. }
  1589. PERM_FREE(aclpvt[-2].string);
  1590. PERM_FREE(aclpvt[-0].string);
  1591. } break;
  1592. }
  1593. goto aclstack; /* reset registers in driver code */
  1594. }