Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1312 lines
42 KiB

  1. #ifndef lint
  2. static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
  3. #endif
  4. #define YYBYACC 1
  5. #define YYMAJOR 1
  6. #define YYMINOR 9
  7. #define yyclearin (yychar=(-1))
  8. #define yyerrok (yyerrflag=0)
  9. #define YYRECOVERING (yyerrflag!=0)
  10. #define YYPREFIX "yy"
  11. #line 14 "tnadmin.y"
  12. #include <stdio.h>
  13. #include "telnet.h"
  14. #include "common.h"
  15. #include "resource.h"
  16. #include "admutils.h"
  17. #include <string.h>
  18. #include <ctype.h>
  19. #include <windows.h>
  20. #include <locale.h>
  21. #pragma warning(disable:4102)
  22. #define alloca malloc
  23. #define strdup _strdup
  24. #define L_TNADMIN_TEXT L"tnadmin"
  25. #define BAIL_ON_SNWPRINTF_ERR() if ( nTmpWrite < 0 ) \
  26. { \
  27. ShowError(IDR_LONG_COMMAND_LINE); \
  28. goto End; \
  29. } \
  30. extern int yy_scan_string (char *input_buffer);
  31. extern int yyparse();
  32. extern char *yytext;
  33. SCODE sc;
  34. /*functions of yacc and lex.*/
  35. int yyerror(char *s);
  36. int yylex();
  37. /*between yacc and lex*/
  38. extern int g_fMessage;
  39. extern int g_fComp;
  40. extern int g_fNormal;
  41. extern char * szCompname;
  42. /*global variables....*/
  43. int g_nError=0; /*Error indicator, initialsed to no error.:-)*/
  44. wchar_t* g_arVALOF[_MAX_PROPS_];
  45. int g_nPrimaryOption=-1;
  46. /*option indicator.*/
  47. int g_nConfigOptions=0;
  48. int g_nTimeoutFlag=0; /*o means in hh:mm:ss 1 means ss format.*/
  49. ConfigProperty g_arPROP[_MAX_PROPS_][_MAX_NUMOF_PROPNAMES_];
  50. /*array of structures of properties.*/
  51. int g_nSesid=-1;
  52. WCHAR wzMessageString[MAX_COMMAND_LINE];
  53. BSTR g_bstrMessage=NULL;
  54. WCHAR szMsg[MAX_BUFFER_SIZE] = {0};
  55. int g_nSecOn=0;
  56. int g_nSecOff=0;
  57. int g_nAuditOn=0;
  58. int g_nAuditOff=0;
  59. int minus=0;
  60. char *szYesno=NULL;
  61. wchar_t* wzTemp=NULL;
  62. extern nMoccur;
  63. #line 81 "tnadmin.y"
  64. typedef union
  65. {
  66. char* str;
  67. int token;
  68. } YYSTYPE;
  69. #line 85 "tnadminy.c"
  70. #define _TNADMIN 257
  71. #define _HELP 258
  72. #define _COMPNAME 259
  73. #define _START 260
  74. #define _STOP 261
  75. #define _PAUSE 262
  76. #define _CONTINUE 263
  77. #define _S 264
  78. #define _K 265
  79. #define _M 266
  80. #define _CONFIG 267
  81. #define _INTEGER 268
  82. #define _SESID 269
  83. #define _DOM 270
  84. #define _CTRLKEYMAP 271
  85. #define _Y 272
  86. #define _N 273
  87. #define _tU 274
  88. #define _tP 275
  89. #define _TIMEOUT 276
  90. #define _TIME 277
  91. #define _TIMEOUTACTIVE 278
  92. #define _MAXFAIL 279
  93. #define _MAXCONN 280
  94. #define _PORT 281
  95. #define _KILLALL 282
  96. #define _SEC 283
  97. #define _SECVAL 284
  98. #define _FNAME 285
  99. #define _FSIZE 286
  100. #define _MODE 287
  101. #define _CONSOLE 288
  102. #define _EQ 289
  103. #define _STREAM 290
  104. #define _AUDITLOCATION 291
  105. #define _AUDIT 292
  106. #define _AUDITVAL 293
  107. #define _EVENTLOG 294
  108. #define _DONE 295
  109. #define _ANYTHING 296
  110. #define _FILENAME 297
  111. #define _ERROR 298
  112. #define _FILEN 299
  113. #define _BOTH 300
  114. #define _MINUSNTLM 301
  115. #define _MINUSPASSWD 302
  116. #define _MINUSUSER 303
  117. #define _MINUSFAIL 304
  118. #define _MINUSADMIN 305
  119. #define _PLUSNTLM 306
  120. #define _PLUSPASSWD 307
  121. #define _PLUSUSER 308
  122. #define _PLUSFAIL 309
  123. #define _PLUSADMIN 310
  124. #define _ENDINPUT 311
  125. #define _DUNNO 312
  126. #define YYERRCODE 256
  127. short yylhs[] = { -1,
  128. 0, 0, 0, 1, 1, 2, 2, 2, 3, 3,
  129. 3, 3, 3, 5, 3, 7, 3, 9, 3, 3,
  130. 3, 6, 6, 6, 8, 8, 10, 4, 4, 4,
  131. 12, 12, 13, 13, 14, 14, 15, 15, 15, 16,
  132. 16, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  133. 11, 11, 11, 11, 11, 11, 17, 11, 11, 11,
  134. 11, 11, 11, 19, 11, 11, 18, 18, 18, 18,
  135. 18, 20, 20, 20, 20, 20, 20, 20,
  136. };
  137. short yylen[] = { 2,
  138. 3, 5, 6, 2, 1, 2, 2, 0, 1, 1,
  139. 1, 1, 2, 0, 3, 0, 3, 0, 3, 1,
  140. 1, 1, 1, 1, 3, 1, 1, 1, 1, 0,
  141. 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
  142. 1, 2, 4, 4, 4, 4, 4, 4, 4, 4,
  143. 4, 4, 4, 4, 4, 4, 0, 5, 2, 4,
  144. 4, 4, 4, 0, 5, 0, 2, 2, 2, 2,
  145. 0, 2, 2, 2, 2, 2, 2, 0,
  146. };
  147. short yydefred[] = { 0,
  148. 0, 0, 8, 4, 0, 21, 27, 9, 10, 11,
  149. 12, 0, 14, 16, 18, 6, 7, 1, 8, 20,
  150. 29, 28, 13, 0, 0, 66, 0, 15, 24, 22,
  151. 23, 17, 0, 0, 2, 8, 66, 42, 0, 0,
  152. 0, 0, 0, 0, 0, 57, 59, 0, 0, 0,
  153. 64, 0, 0, 31, 0, 0, 0, 0, 0, 0,
  154. 0, 0, 0, 0, 0, 0, 44, 33, 34, 43,
  155. 46, 41, 40, 45, 48, 47, 50, 49, 52, 51,
  156. 54, 53, 56, 55, 71, 61, 60, 35, 36, 62,
  157. 37, 38, 39, 63, 78, 0, 0, 68, 70, 67,
  158. 69, 73, 75, 77, 72, 74, 76,
  159. };
  160. short yydgoto[] = { 2,
  161. 3, 5, 19, 23, 24, 32, 25, 33, 26, 20,
  162. 34, 55, 70, 90, 94, 74, 62, 96, 66, 97,
  163. };
  164. short yysindex[] = { -244,
  165. -238, 0, 0, 0, -256, 0, 0, 0, 0, 0,
  166. 0, -155, 0, 0, 0, 0, 0, 0, 0, 0,
  167. 0, 0, 0, -155, -185, 0, -236, 0, 0, 0,
  168. 0, 0, -224, -180, 0, 0, 0, 0, -235, -235,
  169. -235, -235, -235, -235, -235, 0, 0, -235, -235, -235,
  170. 0, -144, -180, 0, -240, -190, -220, -253, -233, -176,
  171. -200, -235, -171, -276, -167, -235, 0, 0, 0, 0,
  172. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  173. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  174. 0, 0, 0, 0, 0, -181, -186, 0, 0, 0,
  175. 0, 0, 0, 0, 0, 0, 0,
  176. };
  177. short yyrindex[] = { 0,
  178. -216, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  179. 0, 185, 0, 0, 0, 0, 0, 0, 0, 0,
  180. 0, 0, 0, 185, 0, 0, 0, 0, 0, 0,
  181. 0, 0, 245, 205, 0, 0, 0, 0, -179, -189,
  182. -179, -152, -152, -152, -179, 0, 0, -152, -214, -165,
  183. 0, 81, 225, 0, 0, 0, 0, 0, 0, 0,
  184. 0, 57, 0, 0, 0, 1, 0, 0, 0, 0,
  185. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  186. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  187. 0, 0, 0, 0, 0, 109, 147, 0, 0, 0,
  188. 0, 0, 0, 0, 0, 0, 0,
  189. };
  190. short yygindex[] = { 0,
  191. 0, -2, 62, 84, 0, 0, 0, 0, 0, 0,
  192. 73, 20, -20, 0, 0, 0, 0, 0, 0, 0,
  193. };
  194. #define YYTABLESIZE 556
  195. short yytable[] = { 6,
  196. 32, 7, 77, 8, 9, 10, 11, 12, 13, 14,
  197. 15, 88, 1, 89, 78, 67, 27, 16, 17, 6,
  198. 4, 7, 79, 8, 9, 10, 11, 12, 13, 14,
  199. 15, 68, 69, 52, 80, 75, 76, 16, 17, 5,
  200. 84, 5, 37, 5, 5, 5, 5, 5, 5, 5,
  201. 5, 68, 69, 54, 18, 83, 32, 5, 5, 56,
  202. 57, 58, 59, 60, 61, 71, 32, 63, 64, 65,
  203. 29, 68, 69, 32, 35, 32, 32, 72, 32, 81,
  204. 3, 85, 30, 31, 86, 95, 73, 32, 36, 38,
  205. 39, 82, 32, 32, 5, 40, 87, 41, 42, 43,
  206. 44, 45, 46, 32, 47, 48, 49, 28, 58, 53,
  207. 50, 51, 21, 22, 0, 32, 102, 103, 104, 98,
  208. 99, 105, 106, 107, 100, 101, 91, 0, 32, 16,
  209. 17, 92, 93, 32, 32, 0, 0, 0, 0, 0,
  210. 0, 0, 0, 0, 0, 0, 65, 0, 0, 0,
  211. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  212. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  213. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  214. 0, 0, 0, 0, 30, 0, 0, 0, 0, 0,
  215. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  216. 0, 0, 0, 0, 26, 0, 0, 0, 0, 0,
  217. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  218. 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,
  219. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  220. 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
  221. 0, 0, 0, 0, 0, 0, 32, 0, 32, 0,
  222. 32, 32, 32, 32, 32, 32, 32, 32, 0, 0,
  223. 32, 32, 0, 0, 32, 32, 32, 0, 32, 32,
  224. 32, 32, 32, 32, 0, 32, 32, 32, 0, 0,
  225. 0, 32, 32, 0, 0, 0, 0, 0, 0, 0,
  226. 0, 0, 0, 32, 32, 32, 0, 0, 32, 32,
  227. 32, 32, 32, 0, 32, 0, 32, 32, 32, 32,
  228. 32, 32, 32, 32, 0, 0, 32, 32, 0, 0,
  229. 32, 32, 32, 0, 32, 32, 32, 32, 32, 32,
  230. 0, 32, 32, 32, 0, 0, 0, 32, 32, 0,
  231. 0, 0, 0, 0, 0, 0, 0, 32, 32, 0,
  232. 0, 0, 32, 32, 58, 0, 58, 32, 58, 58,
  233. 58, 58, 58, 58, 58, 58, 0, 0, 58, 58,
  234. 0, 0, 58, 58, 58, 0, 58, 58, 58, 58,
  235. 58, 58, 0, 58, 58, 58, 0, 0, 0, 58,
  236. 58, 0, 65, 0, 65, 0, 65, 65, 65, 65,
  237. 65, 65, 65, 65, 0, 0, 65, 65, 0, 58,
  238. 65, 65, 65, 0, 65, 65, 65, 65, 65, 65,
  239. 0, 65, 65, 65, 0, 0, 0, 65, 65, 0,
  240. 30, 0, 30, 0, 30, 30, 30, 30, 30, 30,
  241. 30, 30, 0, 0, 0, 0, 0, 65, 30, 30,
  242. 26, 0, 26, 0, 26, 26, 26, 26, 26, 26,
  243. 26, 26, 0, 0, 0, 0, 0, 0, 26, 26,
  244. 25, 0, 25, 0, 25, 25, 25, 25, 25, 25,
  245. 25, 25, 0, 0, 0, 30, 0, 0, 25, 25,
  246. 19, 0, 19, 0, 19, 19, 19, 19, 19, 19,
  247. 19, 0, 0, 0, 0, 26, 0, 0, 19, 19,
  248. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  249. 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,
  250. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  251. 0, 0, 0, 0, 0, 19,
  252. };
  253. short yycheck[] = { 256,
  254. 0, 258, 256, 260, 261, 262, 263, 264, 265, 266,
  255. 267, 288, 257, 290, 268, 256, 19, 274, 275, 256,
  256. 259, 258, 256, 260, 261, 262, 263, 264, 265, 266,
  257. 267, 272, 273, 36, 268, 256, 57, 274, 275, 256,
  258. 61, 258, 267, 260, 261, 262, 263, 264, 265, 266,
  259. 267, 272, 273, 289, 311, 256, 0, 274, 275, 40,
  260. 41, 42, 43, 44, 45, 256, 256, 48, 49, 50,
  261. 256, 272, 273, 288, 311, 290, 256, 268, 268, 256,
  262. 0, 62, 268, 269, 256, 66, 277, 277, 27, 270,
  263. 271, 268, 272, 273, 311, 276, 268, 278, 279, 280,
  264. 281, 282, 283, 256, 285, 286, 287, 24, 0, 37,
  265. 291, 292, 268, 269, -1, 268, 303, 304, 305, 301,
  266. 302, 308, 309, 310, 306, 307, 294, -1, 294, 274,
  267. 275, 299, 300, 299, 300, -1, -1, -1, -1, -1,
  268. -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
  269. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  270. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  271. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  272. -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
  273. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  274. -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
  275. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  276. -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
  277. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  278. -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
  279. -1, -1, -1, -1, -1, -1, 256, -1, 258, -1,
  280. 260, 261, 262, 263, 264, 265, 266, 267, -1, -1,
  281. 270, 271, -1, -1, 274, 275, 276, -1, 278, 279,
  282. 280, 281, 282, 283, -1, 285, 286, 287, -1, -1,
  283. -1, 291, 292, -1, -1, -1, -1, -1, -1, -1,
  284. -1, -1, -1, 303, 304, 305, -1, -1, 308, 309,
  285. 310, 311, 256, -1, 258, -1, 260, 261, 262, 263,
  286. 264, 265, 266, 267, -1, -1, 270, 271, -1, -1,
  287. 274, 275, 276, -1, 278, 279, 280, 281, 282, 283,
  288. -1, 285, 286, 287, -1, -1, -1, 291, 292, -1,
  289. -1, -1, -1, -1, -1, -1, -1, 301, 302, -1,
  290. -1, -1, 306, 307, 256, -1, 258, 311, 260, 261,
  291. 262, 263, 264, 265, 266, 267, -1, -1, 270, 271,
  292. -1, -1, 274, 275, 276, -1, 278, 279, 280, 281,
  293. 282, 283, -1, 285, 286, 287, -1, -1, -1, 291,
  294. 292, -1, 256, -1, 258, -1, 260, 261, 262, 263,
  295. 264, 265, 266, 267, -1, -1, 270, 271, -1, 311,
  296. 274, 275, 276, -1, 278, 279, 280, 281, 282, 283,
  297. -1, 285, 286, 287, -1, -1, -1, 291, 292, -1,
  298. 256, -1, 258, -1, 260, 261, 262, 263, 264, 265,
  299. 266, 267, -1, -1, -1, -1, -1, 311, 274, 275,
  300. 256, -1, 258, -1, 260, 261, 262, 263, 264, 265,
  301. 266, 267, -1, -1, -1, -1, -1, -1, 274, 275,
  302. 256, -1, 258, -1, 260, 261, 262, 263, 264, 265,
  303. 266, 267, -1, -1, -1, 311, -1, -1, 274, 275,
  304. 256, -1, 258, -1, 260, 261, 262, 263, 264, 265,
  305. 266, -1, -1, -1, -1, 311, -1, -1, 274, 275,
  306. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  307. -1, -1, -1, -1, -1, 311, -1, -1, -1, -1,
  308. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  309. -1, -1, -1, -1, -1, 311,
  310. };
  311. #define YYFINAL 2
  312. #ifndef YYDEBUG
  313. #define YYDEBUG 0
  314. #endif
  315. #define YYMAXTOKEN 312
  316. #if YYDEBUG
  317. char *yyname[] = {
  318. "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  319. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  320. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  321. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  322. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  323. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  324. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"_TNADMIN","_HELP","_COMPNAME",
  325. "_START","_STOP","_PAUSE","_CONTINUE","_S","_K","_M","_CONFIG","_INTEGER",
  326. "_SESID","_DOM","_CTRLKEYMAP","_Y","_N","_tU","_tP","_TIMEOUT","_TIME",
  327. "_TIMEOUTACTIVE","_MAXFAIL","_MAXCONN","_PORT","_KILLALL","_SEC","_SECVAL",
  328. "_FNAME","_FSIZE","_MODE","_CONSOLE","_EQ","_STREAM","_AUDITLOCATION","_AUDIT",
  329. "_AUDITVAL","_EVENTLOG","_DONE","_ANYTHING","_FILENAME","_ERROR","_FILEN",
  330. "_BOTH","_MINUSNTLM","_MINUSPASSWD","_MINUSUSER","_MINUSFAIL","_MINUSADMIN",
  331. "_PLUSNTLM","_PLUSPASSWD","_PLUSUSER","_PLUSFAIL","_PLUSADMIN","_ENDINPUT",
  332. "_DUNNO",
  333. };
  334. char *yyrule[] = {
  335. "$accept : tncmd",
  336. "tncmd : tnadmin commonOptions _ENDINPUT",
  337. "tncmd : tnadmin commonOptions op1 commonOptions _ENDINPUT",
  338. "tncmd : tnadmin commonOptions op1 commonOptions op1 commonOptions",
  339. "tnadmin : _TNADMIN _COMPNAME",
  340. "tnadmin : _TNADMIN",
  341. "commonOptions : commonOptions _tU",
  342. "commonOptions : commonOptions _tP",
  343. "commonOptions :",
  344. "op1 : _START",
  345. "op1 : _STOP",
  346. "op1 : _PAUSE",
  347. "op1 : _CONTINUE",
  348. "op1 : _S sesid",
  349. "$$1 :",
  350. "op1 : _K $$1 sesid",
  351. "$$2 :",
  352. "op1 : _M $$2 messageoptions",
  353. "$$3 :",
  354. "op1 : _CONFIG $$3 configoptions",
  355. "op1 : help",
  356. "op1 : error",
  357. "messageoptions : _INTEGER",
  358. "messageoptions : _SESID",
  359. "messageoptions : error",
  360. "configoptions : configoptions _CONFIG configop",
  361. "configoptions : configop",
  362. "help : _HELP",
  363. "sesid : _SESID",
  364. "sesid : _INTEGER",
  365. "sesid :",
  366. "equals : _EQ",
  367. "equals :",
  368. "yn : _Y",
  369. "yn : _N",
  370. "cs : _CONSOLE",
  371. "cs : _STREAM",
  372. "efb : _EVENTLOG",
  373. "efb : _FILEN",
  374. "efb : _BOTH",
  375. "time : _TIME",
  376. "time : _INTEGER",
  377. "configop : configop _DOM",
  378. "configop : configop _CTRLKEYMAP equals yn",
  379. "configop : configop _CTRLKEYMAP equals error",
  380. "configop : configop _TIMEOUT equals time",
  381. "configop : configop _TIMEOUT equals error",
  382. "configop : configop _TIMEOUTACTIVE equals yn",
  383. "configop : configop _TIMEOUTACTIVE equals error",
  384. "configop : configop _MAXFAIL equals _INTEGER",
  385. "configop : configop _MAXFAIL equals error",
  386. "configop : configop _MAXCONN equals _INTEGER",
  387. "configop : configop _MAXCONN equals error",
  388. "configop : configop _PORT equals _INTEGER",
  389. "configop : configop _PORT equals error",
  390. "configop : configop _KILLALL equals yn",
  391. "configop : configop _KILLALL equals error",
  392. "$$4 :",
  393. "configop : configop _SEC $$4 equals secval",
  394. "configop : configop _FNAME",
  395. "configop : configop _FSIZE equals _INTEGER",
  396. "configop : configop _FSIZE equals error",
  397. "configop : configop _MODE equals cs",
  398. "configop : configop _AUDITLOCATION equals efb",
  399. "$$5 :",
  400. "configop : configop _AUDIT $$5 equals auditval",
  401. "configop :",
  402. "secval : secval _PLUSNTLM",
  403. "secval : secval _MINUSNTLM",
  404. "secval : secval _PLUSPASSWD",
  405. "secval : secval _MINUSPASSWD",
  406. "secval :",
  407. "auditval : auditval _PLUSUSER",
  408. "auditval : auditval _MINUSUSER",
  409. "auditval : auditval _PLUSFAIL",
  410. "auditval : auditval _MINUSFAIL",
  411. "auditval : auditval _PLUSADMIN",
  412. "auditval : auditval _MINUSADMIN",
  413. "auditval :",
  414. };
  415. #endif
  416. #ifdef YYSTACKSIZE
  417. #undef YYMAXDEPTH
  418. #define YYMAXDEPTH YYSTACKSIZE
  419. #else
  420. #ifdef YYMAXDEPTH
  421. #define YYSTACKSIZE YYMAXDEPTH
  422. #else
  423. #define YYSTACKSIZE 500
  424. #define YYMAXDEPTH 500
  425. #endif
  426. #endif
  427. int yydebug;
  428. int yynerrs;
  429. int yyerrflag;
  430. int yychar;
  431. short *yyssp;
  432. YYSTYPE *yyvsp;
  433. YYSTYPE yyval;
  434. YYSTYPE yylval;
  435. short yyss[YYSTACKSIZE];
  436. YYSTYPE yyvs[YYSTACKSIZE];
  437. #define yystacksize YYSTACKSIZE
  438. #line 425 "tnadmin.y"
  439. int
  440. yyerror(char *s)
  441. {
  442. g_nError=1;
  443. return 0;
  444. }
  445. int __cdecl
  446. wmain(int argc, wchar_t **argv)
  447. {
  448. wchar_t input_buffer[MAX_COMMAND_LINE+1]={0};
  449. int i, nWritten=0;
  450. int nTmpWrite = 0, nMsgWrite = 0;
  451. int nUoccur=0,nPoccur=0;
  452. int NextOp;
  453. int nIndex;
  454. DWORD dwErrorCode;
  455. BOOL fSuccess = FALSE;
  456. char szCodePage[MAX_LEN_FOR_CODEPAGE];
  457. HRESULT hRes=S_OK;
  458. switch (GetConsoleOutputCP())
  459. {
  460. case 932:
  461. case 949:
  462. setlocale(LC_ALL,"");
  463. SetThreadLocale(
  464. MAKELCID(
  465. MAKELANGID( PRIMARYLANGID(GetSystemDefaultLangID()),
  466. SUBLANG_ENGLISH_US),
  467. SORT_DEFAULT
  468. )
  469. );
  470. break;
  471. case 936:
  472. setlocale(LC_ALL,"");
  473. SetThreadLocale(
  474. MAKELCID(
  475. MAKELANGID( PRIMARYLANGID(GetSystemDefaultLangID()),
  476. SUBLANG_CHINESE_SIMPLIFIED),
  477. SORT_DEFAULT
  478. )
  479. );
  480. break;
  481. case 950:
  482. setlocale(LC_ALL,"");
  483. SetThreadLocale(
  484. MAKELCID(
  485. MAKELANGID( PRIMARYLANGID(GetSystemDefaultLangID()),
  486. SUBLANG_CHINESE_TRADITIONAL),
  487. SORT_DEFAULT
  488. )
  489. );
  490. break;
  491. default:
  492. sprintf(szCodePage,".%d",GetConsoleCP()); //a dot is added based on syntax of setlocale(), for defining a locale based on codepage.
  493. setlocale(LC_ALL, szCodePage);
  494. break;
  495. }
  496. Initialize();
  497. nTmpWrite = _snwprintf(input_buffer, ARRAYSIZE(input_buffer)-1, L_TNADMIN_TEXT);
  498. BAIL_ON_SNWPRINTF_ERR();
  499. nWritten+=nTmpWrite;
  500. for (i = 1; i < argc; i++)
  501. {
  502. fSuccess = FALSE;
  503. if(0==_wcsicmp(L"-u",argv[i]))
  504. {
  505. if(nUoccur)
  506. {
  507. ShowError(IDS_DUP_OPTION_ON_CL);
  508. fprintf(stdout,"'%s'.\n","u");
  509. goto End;
  510. }
  511. else
  512. nUoccur=1;
  513. i++;
  514. if(i<argc)
  515. g_arVALOF[_p_USER_]=_wcsdup(argv[i]);
  516. else
  517. {
  518. ShowErrorEx(IDS_MISSING_FILE_OR_ARGUMENT_EX,L"-u");
  519. goto End;
  520. }
  521. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" -u");
  522. BAIL_ON_SNWPRINTF_ERR();
  523. nWritten+=nTmpWrite;
  524. continue;
  525. }
  526. else if(0==_wcsicmp(L"-p",argv[i]))
  527. {
  528. if(nPoccur)
  529. {
  530. ShowError(IDS_DUP_OPTION_ON_CL);
  531. fprintf(stdout,"'%s'.\n","p");
  532. goto End;
  533. }
  534. else
  535. nPoccur=1;
  536. i++;
  537. if(i<argc)
  538. g_arVALOF[_p_PASSWD_]=_wcsdup(argv[i]);
  539. else
  540. {
  541. ShowErrorEx(IDS_MISSING_FILE_OR_ARGUMENT_EX,L"-p");
  542. goto End;
  543. }
  544. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" -p");
  545. BAIL_ON_SNWPRINTF_ERR();
  546. nWritten+=nTmpWrite;
  547. continue;
  548. }
  549. //Processing of -m option
  550. else if(0==_wcsicmp(L"-m",argv[i]))
  551. {
  552. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" -m");
  553. BAIL_ON_SNWPRINTF_ERR();
  554. nWritten+=nTmpWrite;
  555. i++;
  556. // The next argument should be the session id or all
  557. // So, copy that to the input_buffer and let that be
  558. // dealt by our lex
  559. if(i<argc)
  560. {
  561. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" %s", argv[i]);
  562. BAIL_ON_SNWPRINTF_ERR();
  563. nWritten+=nTmpWrite;
  564. }
  565. else
  566. goto MessageError;
  567. i++;
  568. if(i<argc)
  569. {
  570. // Then all the remaining command line arguments are
  571. // part of the message itself. So, copy them into the
  572. // global variable.
  573. nTmpWrite=_snwprintf(wzMessageString, ARRAYSIZE(wzMessageString)-1, L"%s ", argv[i]);
  574. BAIL_ON_SNWPRINTF_ERR();
  575. // Don't increment nWritten here as we are not writing in to input_buffer
  576. nMsgWrite=nTmpWrite;
  577. for(nIndex = i+1; nIndex < argc; nIndex++)
  578. {
  579. nTmpWrite=_snwprintf(wzMessageString+nMsgWrite, ARRAYSIZE(wzMessageString)-1-nMsgWrite, L"%s ", argv[nIndex]);
  580. BAIL_ON_SNWPRINTF_ERR();
  581. nMsgWrite+=nTmpWrite;
  582. }
  583. g_bstrMessage=SysAllocString(wzMessageString);
  584. break;
  585. }
  586. else
  587. {
  588. MessageError:
  589. ShowErrorEx(IDS_MISSING_FILE_OR_ARGUMENT_EX,L"-m");
  590. goto End;
  591. }
  592. }
  593. // Processing of actual filename is not given to Lexical analyser as
  594. // it may contail DBCS chars which our lexical analyser won't take
  595. // So, taking care of this analysis in pre-analysis part and giving
  596. // the actual analyser only the option and not the actual filename
  597. // This also holds good for domain name
  598. if(ERROR_SUCCESS!=(dwErrorCode = PreAnalyzer(argc,argv,_p_FNAME_,L"fname",i,&NextOp,&fSuccess,0)))
  599. {
  600. if(E_FAIL==dwErrorCode)
  601. ShowError(IDR_FILENAME_VALUES);
  602. else ShowError(dwErrorCode);
  603. goto End;
  604. }
  605. if(fSuccess)
  606. {
  607. // Some processing had take place in the PreAnalyzer
  608. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" fname");
  609. BAIL_ON_SNWPRINTF_ERR();
  610. nWritten+=nTmpWrite;
  611. i=NextOp;
  612. continue;
  613. }
  614. // Fall through for taking care of remaining options.
  615. // Similar treatment for Dom option
  616. if(ERROR_SUCCESS!=(dwErrorCode = PreAnalyzer(argc,argv,_p_DOM_,L"dom",i,&NextOp,&fSuccess,0)))
  617. {
  618. if(E_FAIL==dwErrorCode)
  619. ShowError(IDR_INVALID_NTDOMAIN);
  620. else ShowError(dwErrorCode);
  621. goto End;
  622. }
  623. if(fSuccess)
  624. {
  625. // Some processing had take place in the PreAnalyzer
  626. nTmpWrite=_snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" dom");
  627. BAIL_ON_SNWPRINTF_ERR();
  628. nWritten+=nTmpWrite;
  629. i=NextOp;
  630. continue;
  631. }
  632. Skip:
  633. if(MAX_COMMAND_LINE<nWritten+wcslen(argv[i]))
  634. {
  635. ShowError(IDR_LONG_COMMAND_LINE);
  636. goto End;
  637. }
  638. if(NULL==wcsstr(argv[i],L" "))
  639. nTmpWrite = _snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" %s", argv[i]);
  640. else
  641. nTmpWrite = _snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" \"%s\"", argv[i]);
  642. // the following statements are common for both if and else statements
  643. BAIL_ON_SNWPRINTF_ERR();
  644. nWritten+=nTmpWrite;
  645. }
  646. nTmpWrite = _snwprintf(input_buffer+nWritten, ARRAYSIZE(input_buffer)-nWritten-1, L" #\n\0");
  647. BAIL_ON_SNWPRINTF_ERR();
  648. nWritten+=nTmpWrite;
  649. yy_scan_string(DupCStr(input_buffer));
  650. yyparse ();
  651. if (g_nError)
  652. {
  653. ShowError(IDR_TELNET_ILLEGAL);
  654. goto End;
  655. }
  656. hRes = DoTnadmin();
  657. if (hRes != S_OK && !g_nError)
  658. g_nError = 1; //general error status
  659. End:
  660. Quit();
  661. return g_nError;
  662. }
  663. #line 717 "tnadminy.c"
  664. #define YYABORT goto yyabort
  665. #define YYREJECT goto yyabort
  666. #define YYACCEPT goto yyaccept
  667. #define YYERROR goto yyerrlab
  668. int
  669. yyparse()
  670. {
  671. register int yym, yyn; register short yystate;
  672. #if YYDEBUG
  673. register char *yys;
  674. extern char *getenv();
  675. if (yys = getenv("YYDEBUG"))
  676. {
  677. yyn = *yys;
  678. if (yyn >= '0' && yyn <= '9')
  679. yydebug = yyn - '0';
  680. }
  681. #endif
  682. yynerrs = 0;
  683. yyerrflag = 0;
  684. yychar = (-1);
  685. yyssp = yyss;
  686. yyvsp = yyvs;
  687. *yyssp = yystate = 0;
  688. yyloop:
  689. if (yyn = yydefred[yystate]) goto yyreduce;
  690. if (yychar < 0)
  691. {
  692. if ((yychar = yylex()) < 0) yychar = 0;
  693. #if YYDEBUG
  694. if (yydebug)
  695. {
  696. yys = 0;
  697. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  698. if (!yys) yys = "illegal-symbol";
  699. printf("%sdebug: state %d, reading %d (%s)\n",
  700. YYPREFIX, yystate, yychar, yys);
  701. }
  702. #endif
  703. }
  704. if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
  705. yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
  706. {
  707. #if YYDEBUG
  708. if (yydebug)
  709. printf("%sdebug: state %d, shifting to state %d\n",
  710. YYPREFIX, yystate, yytable[yyn]);
  711. #endif
  712. if (yyssp >= yyss + yystacksize - 1)
  713. {
  714. goto yyoverflow;
  715. }
  716. *++yyssp = yystate = yytable[yyn];
  717. *++yyvsp = yylval;
  718. yychar = (-1);
  719. if (yyerrflag > 0) --yyerrflag;
  720. goto yyloop;
  721. }
  722. if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
  723. yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
  724. {
  725. yyn = yytable[yyn];
  726. goto yyreduce;
  727. }
  728. if (yyerrflag) goto yyinrecovery;
  729. #ifdef lint
  730. goto yynewerror;
  731. #endif
  732. yyerror("syntax error");
  733. #ifdef lint
  734. goto yyerrlab;
  735. #endif
  736. ++yynerrs;
  737. yyinrecovery:
  738. if (yyerrflag < 3)
  739. {
  740. yyerrflag = 3;
  741. for (;;)
  742. {
  743. if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
  744. yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
  745. {
  746. #if YYDEBUG
  747. if (yydebug)
  748. printf("%sdebug: state %d, error recovery shifting\
  749. to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
  750. #endif
  751. if (yyssp >= yyss + yystacksize - 1)
  752. {
  753. goto yyoverflow;
  754. }
  755. *++yyssp = yystate = yytable[yyn];
  756. *++yyvsp = yylval;
  757. goto yyloop;
  758. }
  759. else
  760. {
  761. #if YYDEBUG
  762. if (yydebug)
  763. printf("%sdebug: error recovery discarding state %d\n",
  764. YYPREFIX, *yyssp);
  765. #endif
  766. if (yyssp <= yyss) goto yyabort;
  767. --yyssp;
  768. --yyvsp;
  769. }
  770. }
  771. }
  772. else
  773. {
  774. if (yychar == 0) goto yyabort;
  775. #if YYDEBUG
  776. if (yydebug)
  777. {
  778. yys = 0;
  779. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  780. if (!yys) yys = "illegal-symbol";
  781. printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
  782. YYPREFIX, yystate, yychar, yys);
  783. }
  784. #endif
  785. yychar = (-1);
  786. goto yyloop;
  787. }
  788. yyreduce:
  789. #if YYDEBUG
  790. if (yydebug)
  791. printf("%sdebug: state %d, reducing by rule %d (%s)\n",
  792. YYPREFIX, yystate, yyn, yyrule[yyn]);
  793. #endif
  794. yym = yylen[yyn];
  795. yyval = yyvsp[1-yym];
  796. switch (yyn)
  797. {
  798. case 3:
  799. #line 110 "tnadmin.y"
  800. { /* error production for more than one mutually exclusive options.*/
  801. ShowError(IDR_TELNET_MUTUALLY_EXCLUSIVE_OPTIONS);
  802. }
  803. break;
  804. case 4:
  805. #line 116 "tnadmin.y"
  806. {
  807. g_arVALOF[_p_CNAME_]=DupWStr(yytext);
  808. }
  809. break;
  810. case 9:
  811. #line 129 "tnadmin.y"
  812. {g_nPrimaryOption=_START;}
  813. break;
  814. case 10:
  815. #line 130 "tnadmin.y"
  816. {g_nPrimaryOption=_STOP;}
  817. break;
  818. case 11:
  819. #line 131 "tnadmin.y"
  820. {g_nPrimaryOption=_PAUSE;}
  821. break;
  822. case 12:
  823. #line 132 "tnadmin.y"
  824. {g_nPrimaryOption=_CONTINUE;}
  825. break;
  826. case 13:
  827. #line 133 "tnadmin.y"
  828. {g_nPrimaryOption=_S; }
  829. break;
  830. case 14:
  831. #line 134 "tnadmin.y"
  832. {g_nPrimaryOption=_K; }
  833. break;
  834. case 16:
  835. #line 135 "tnadmin.y"
  836. {g_nPrimaryOption=_M;}
  837. break;
  838. case 18:
  839. #line 136 "tnadmin.y"
  840. {g_nPrimaryOption=_CONFIG;}
  841. break;
  842. case 21:
  843. #line 139 "tnadmin.y"
  844. {
  845. fprintf(stdout,"%s:",yytext);
  846. ShowError(IDR_TELNET_CONTROL_VALUES);
  847. #ifdef WHISTLER_BUILD
  848. TnLoadString(IDR_NEW_TELNET_USAGE,szMsg,MAX_BUFFER_SIZE,TEXT("\nUsage: tlntadmn [computer name] [common_options] start | stop | pause | continue | -s | -k | -m | config config_options \n\tUse 'all' for all sessions.\n\t-s sessionid List information about the session.\n\t-k sessionid\t Terminate a session. \n\t-m sessionid\t Send message to a session. \n\n\tconfig\t Configure telnet server parameters.\n\ncommon_options are:\n\t-u user\t Identity of the user whose credentials are to be used\n\t-p password\t Password of the user\n\nconfig_options are:\n\tdom = domain\t Set the default domain for user names\n\tctrlakeymap = yes|no\t Set the mapping of the ALT key\n\ttimeout = hh:mm:ss\t Set the Idle Session Timeout\n\ttimeoutactive = yes|no Enable idle session timeout.\n\tmaxfail = attempts\t Set the maximum number of login failure attempts\n\tbefore disconnecting.\n\tmaxconn = connections\t Set the maximum number of connections.\n\tport = number\t Set the telnet port.\n\tsec = [+/-]NTLM [+/-]passwd\n\t Set the authentication mechanism\n\tmode = console|stream\t Specify the mode of operation.\n"));
  849. #else
  850. TnLoadString(IDR_NEW_TELNET_USAGE,szMsg,MAX_BUFFER_SIZE,TEXT("\nUsage: tnadmin [computer name] [common_options] start | stop | pause | continue | -s | -k | -m | config config_options \n\tUse 'all' for all sessions.\n\t-s sessionid List information about the session.\n\t-k sessionid\t Terminate a session. \n\t-m sessionid\t Send message to a session. \n\n\tconfig\t Configure telnet server parameters.\n\ncommon_options are:\n\t-u user\t Identity of the user whose credentials are to be used\n\t-p password\t Password of the user\n\nconfig_options are:\n\tdom = domain\t Set the default domain for user names\n\tctrlakeymap = yes|no\t Set the mapping of the ALT key\n\ttimeout = hh:mm:ss\t Set the Idle Session Timeout\n\ttimeoutactive = yes|no Enable idle session timeout.\n\tmaxfail = attempts\t Set the maximum number of login failure attempts\n\tbefore disconnecting.\n\tmaxconn = connections\t Set the maximum number of connections.\n\tport = number\t Set the telnet port.\n\tsec = [+/-]NTLM [+/-]passwd\n\t Set the authentication mechanism\n\tmode = console|stream\t Specify the mode of operation.\n"));
  851. #endif
  852. MyWriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),szMsg,wcslen(szMsg));
  853. return(1);
  854. }
  855. break;
  856. case 22:
  857. #line 154 "tnadmin.y"
  858. {g_nSesid=atoi(yytext);}
  859. break;
  860. case 23:
  861. #line 155 "tnadmin.y"
  862. {g_nSesid=-1;}
  863. break;
  864. case 24:
  865. #line 157 "tnadmin.y"
  866. {
  867. ShowError(IDR_SESSION);
  868. return(1);
  869. }
  870. break;
  871. case 27:
  872. #line 167 "tnadmin.y"
  873. {g_nPrimaryOption=_HELP;return 0;}
  874. break;
  875. case 28:
  876. #line 171 "tnadmin.y"
  877. {g_nSesid=-1;}
  878. break;
  879. case 29:
  880. #line 172 "tnadmin.y"
  881. {g_nSesid=atoi(yytext);}
  882. break;
  883. case 30:
  884. #line 173 "tnadmin.y"
  885. {if(g_nPrimaryOption == _K)
  886. {
  887. ShowError(IDR_SESSION);
  888. return(1);
  889. }
  890. g_nSesid=-1;}
  891. break;
  892. case 33:
  893. #line 186 "tnadmin.y"
  894. {szYesno="yes";}
  895. break;
  896. case 34:
  897. #line 187 "tnadmin.y"
  898. {szYesno="no";}
  899. break;
  900. case 40:
  901. #line 194 "tnadmin.y"
  902. {g_nTimeoutFlag=0;}
  903. break;
  904. case 41:
  905. #line 195 "tnadmin.y"
  906. {g_nTimeoutFlag=1;}
  907. break;
  908. case 42:
  909. #line 200 "tnadmin.y"
  910. {
  911. g_nConfigOptions=SetBit(g_nConfigOptions,_p_DOM_);
  912. /* g_arVALOF[_p_DOM_]=DupWStr(yytext);*/
  913. }
  914. break;
  915. case 43:
  916. #line 205 "tnadmin.y"
  917. {
  918. g_nConfigOptions=SetBit(g_nConfigOptions,_p_CTRLAKEYMAP_);
  919. g_arVALOF[_p_CTRLAKEYMAP_]=DupWStr(szYesno);
  920. }
  921. break;
  922. case 44:
  923. #line 210 "tnadmin.y"
  924. {
  925. ShowError(IDR_CTRLAKEYMAP_VALUES);
  926. return(1);
  927. /*Quit();*/
  928. }
  929. break;
  930. case 45:
  931. #line 216 "tnadmin.y"
  932. {
  933. g_nConfigOptions=SetBit(g_nConfigOptions,_p_TIMEOUT_);
  934. g_arVALOF[_p_TIMEOUT_]=DupWStr(yytext);
  935. }
  936. break;
  937. case 46:
  938. #line 221 "tnadmin.y"
  939. {
  940. ShowError(IDR_TIMEOUT_INTEGER_VALUES );
  941. return(1);
  942. }
  943. break;
  944. case 47:
  945. #line 226 "tnadmin.y"
  946. {
  947. g_nConfigOptions=SetBit(g_nConfigOptions,_p_TIMEOUTACTIVE_);
  948. g_arVALOF[_p_TIMEOUTACTIVE_]=DupWStr(szYesno);
  949. }
  950. break;
  951. case 48:
  952. #line 231 "tnadmin.y"
  953. {
  954. ShowError(IDR_TIMEOUTACTIVE_VALUES);
  955. return(1);
  956. }
  957. break;
  958. case 49:
  959. #line 236 "tnadmin.y"
  960. {
  961. g_nConfigOptions=SetBit(g_nConfigOptions,_p_MAXFAIL_);
  962. g_arVALOF[_p_MAXFAIL_]=DupWStr(yytext);
  963. }
  964. break;
  965. case 50:
  966. #line 241 "tnadmin.y"
  967. {
  968. ShowError(IDR_MAXFAIL_VALUES );
  969. return(1);
  970. }
  971. break;
  972. case 51:
  973. #line 246 "tnadmin.y"
  974. {
  975. g_nConfigOptions=SetBit(g_nConfigOptions,_p_MAXCONN_);
  976. g_arVALOF[_p_MAXCONN_]=DupWStr(yytext);
  977. }
  978. break;
  979. case 52:
  980. #line 251 "tnadmin.y"
  981. {
  982. /* Removing this check, as we have decided that we are not going to restrict*/
  983. /* max connections on Whistler.*/
  984. /*if(!IsMaxConnChangeAllowed())
  985. ShowError(IDR_MAXCONN_VALUES_WHISTLER);
  986. else*/
  987. ShowError(IDR_MAXCONN_VALUES );
  988. return(1);
  989. }
  990. break;
  991. case 53:
  992. #line 261 "tnadmin.y"
  993. {
  994. g_nConfigOptions=SetBit(g_nConfigOptions,_p_PORT_);
  995. g_arVALOF[_p_PORT_]=DupWStr(yytext);
  996. }
  997. break;
  998. case 54:
  999. #line 266 "tnadmin.y"
  1000. {
  1001. ShowError(IDR_TELNETPORT_VALUES );
  1002. return(1);
  1003. }
  1004. break;
  1005. case 55:
  1006. #line 271 "tnadmin.y"
  1007. {
  1008. g_nConfigOptions=SetBit(g_nConfigOptions,_p_KILLALL_);
  1009. g_arVALOF[_p_KILLALL_]=DupWStr(szYesno);
  1010. }
  1011. break;
  1012. case 56:
  1013. #line 276 "tnadmin.y"
  1014. {
  1015. ShowError(IDR_KILLALL_VALUES );
  1016. return(1);
  1017. }
  1018. break;
  1019. case 57:
  1020. #line 280 "tnadmin.y"
  1021. {g_fComp=0;}
  1022. break;
  1023. case 58:
  1024. #line 281 "tnadmin.y"
  1025. {
  1026. g_fComp=1;
  1027. if(g_nSecOff||g_nSecOn)
  1028. g_nConfigOptions=SetBit(g_nConfigOptions,_p_SEC_);
  1029. else
  1030. {
  1031. ShowError(IDR_TELNET_SECURITY_VALUES);
  1032. return(1);
  1033. }
  1034. }
  1035. break;
  1036. case 59:
  1037. #line 292 "tnadmin.y"
  1038. {
  1039. g_nConfigOptions=SetBit(g_nConfigOptions,_p_FNAME_);
  1040. /* g_arVALOF[_p_FNAME_]=DupWStr(yytext);*/
  1041. }
  1042. break;
  1043. case 60:
  1044. #line 298 "tnadmin.y"
  1045. {
  1046. g_arVALOF[_p_FSIZE_]=DupWStr(yytext);
  1047. g_nConfigOptions=SetBit(g_nConfigOptions,_p_FSIZE_);
  1048. }
  1049. break;
  1050. case 61:
  1051. #line 303 "tnadmin.y"
  1052. {
  1053. ShowError(IDR_FILESIZE_VALUES );
  1054. return(1);
  1055. }
  1056. break;
  1057. case 62:
  1058. #line 308 "tnadmin.y"
  1059. {
  1060. g_arVALOF[_p_MODE_]=DupWStr(yytext);
  1061. g_nConfigOptions=SetBit(g_nConfigOptions,_p_MODE_);
  1062. }
  1063. break;
  1064. case 63:
  1065. #line 313 "tnadmin.y"
  1066. {
  1067. g_nConfigOptions=SetBit(g_nConfigOptions,_p_AUDITLOCATION_);
  1068. g_arVALOF[_p_AUDITLOCATION_]=DupWStr(yytext);
  1069. }
  1070. break;
  1071. case 64:
  1072. #line 317 "tnadmin.y"
  1073. {g_fComp=0;}
  1074. break;
  1075. case 65:
  1076. #line 318 "tnadmin.y"
  1077. {
  1078. g_fComp=1;
  1079. if(g_nAuditOff||g_nAuditOn)
  1080. g_nConfigOptions=SetBit(g_nConfigOptions,_p_AUDIT_);
  1081. else
  1082. {
  1083. ShowError(IDS_E_OPTIONGROUP);
  1084. }
  1085. }
  1086. break;
  1087. case 67:
  1088. #line 330 "tnadmin.y"
  1089. {
  1090. if(GetBit(g_nSecOn,NTLM_BIT)||GetBit(g_nSecOff,NTLM_BIT))
  1091. {
  1092. ShowError(IDS_E_OPTIONGROUP);
  1093. }
  1094. else
  1095. g_nSecOn=SetBit(g_nSecOn,NTLM_BIT);
  1096. }
  1097. break;
  1098. case 68:
  1099. #line 339 "tnadmin.y"
  1100. {
  1101. if(GetBit(g_nSecOn,NTLM_BIT)||GetBit(g_nSecOff,NTLM_BIT))
  1102. {
  1103. ShowError(IDS_E_OPTIONGROUP);
  1104. }
  1105. else
  1106. g_nSecOff=SetBit(g_nSecOff,NTLM_BIT);
  1107. }
  1108. break;
  1109. case 69:
  1110. #line 348 "tnadmin.y"
  1111. {
  1112. if(GetBit(g_nSecOn,PASSWD_BIT)||GetBit(g_nSecOff,PASSWD_BIT))
  1113. {
  1114. ShowError(IDS_E_OPTIONGROUP);
  1115. }
  1116. else
  1117. g_nSecOn=SetBit(g_nSecOn,PASSWD_BIT);
  1118. }
  1119. break;
  1120. case 70:
  1121. #line 357 "tnadmin.y"
  1122. {
  1123. if(GetBit(g_nSecOn,PASSWD_BIT)||GetBit(g_nSecOff,PASSWD_BIT))
  1124. {
  1125. ShowError(IDS_E_OPTIONGROUP);
  1126. }
  1127. else
  1128. g_nSecOff=SetBit(g_nSecOff,PASSWD_BIT);
  1129. }
  1130. break;
  1131. case 72:
  1132. #line 369 "tnadmin.y"
  1133. {
  1134. if(GetBit(g_nAuditOn,USER_BIT)||GetBit(g_nAuditOff,USER_BIT))
  1135. {
  1136. ShowError(IDS_E_OPTIONGROUP);
  1137. }
  1138. else
  1139. g_nAuditOn=SetBit(g_nAuditOn,USER_BIT);
  1140. }
  1141. break;
  1142. case 73:
  1143. #line 378 "tnadmin.y"
  1144. {
  1145. if(GetBit(g_nAuditOn,USER_BIT)||GetBit(g_nAuditOff,USER_BIT))
  1146. {
  1147. ShowError(IDS_E_OPTIONGROUP);
  1148. }
  1149. else
  1150. g_nAuditOff=SetBit(g_nAuditOff,USER_BIT);
  1151. }
  1152. break;
  1153. case 74:
  1154. #line 387 "tnadmin.y"
  1155. {
  1156. if(GetBit(g_nAuditOn,FAIL_BIT)||GetBit(g_nAuditOff,FAIL_BIT))
  1157. {
  1158. ShowError(IDS_E_OPTIONGROUP);
  1159. }
  1160. else
  1161. g_nAuditOn=SetBit(g_nAuditOn,FAIL_BIT);
  1162. }
  1163. break;
  1164. case 75:
  1165. #line 396 "tnadmin.y"
  1166. {
  1167. if(GetBit(g_nAuditOn,FAIL_BIT)||GetBit(g_nAuditOff,FAIL_BIT))
  1168. {
  1169. ShowError(IDS_E_OPTIONGROUP);
  1170. }
  1171. else
  1172. g_nAuditOff=SetBit(g_nAuditOff,FAIL_BIT);
  1173. }
  1174. break;
  1175. case 76:
  1176. #line 405 "tnadmin.y"
  1177. {
  1178. if(GetBit(g_nAuditOn,ADMIN_BIT)||GetBit(g_nAuditOff,ADMIN_BIT))
  1179. {
  1180. ShowError(IDS_E_OPTIONGROUP);
  1181. }
  1182. else
  1183. g_nAuditOn=SetBit(g_nAuditOn,ADMIN_BIT);
  1184. }
  1185. break;
  1186. case 77:
  1187. #line 414 "tnadmin.y"
  1188. {
  1189. if(GetBit(g_nAuditOn,ADMIN_BIT)||GetBit(g_nAuditOff,ADMIN_BIT))
  1190. {
  1191. ShowError(IDS_E_OPTIONGROUP);
  1192. }
  1193. else
  1194. g_nAuditOff=SetBit(g_nAuditOff,ADMIN_BIT);
  1195. }
  1196. break;
  1197. #line 1257 "tnadminy.c"
  1198. }
  1199. yyssp -= yym;
  1200. yystate = *yyssp;
  1201. yyvsp -= yym;
  1202. yym = yylhs[yyn];
  1203. if (yystate == 0 && yym == 0)
  1204. {
  1205. #if YYDEBUG
  1206. if (yydebug)
  1207. printf("%sdebug: after reduction, shifting from state 0 to\
  1208. state %d\n", YYPREFIX, YYFINAL);
  1209. #endif
  1210. yystate = YYFINAL;
  1211. *++yyssp = YYFINAL;
  1212. *++yyvsp = yyval;
  1213. if (yychar < 0)
  1214. {
  1215. if ((yychar = yylex()) < 0) yychar = 0;
  1216. #if YYDEBUG
  1217. if (yydebug)
  1218. {
  1219. yys = 0;
  1220. if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
  1221. if (!yys) yys = "illegal-symbol";
  1222. printf("%sdebug: state %d, reading %d (%s)\n",
  1223. YYPREFIX, YYFINAL, yychar, yys);
  1224. }
  1225. #endif
  1226. }
  1227. if (yychar == 0) goto yyaccept;
  1228. goto yyloop;
  1229. }
  1230. if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
  1231. yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
  1232. yystate = yytable[yyn];
  1233. else
  1234. yystate = yydgoto[yym];
  1235. #if YYDEBUG
  1236. if (yydebug)
  1237. printf("%sdebug: after reduction, shifting from state %d \
  1238. to state %d\n", YYPREFIX, *yyssp, yystate);
  1239. #endif
  1240. if (yyssp >= yyss + yystacksize - 1)
  1241. {
  1242. goto yyoverflow;
  1243. }
  1244. *++yyssp = yystate;
  1245. *++yyvsp = yyval;
  1246. goto yyloop;
  1247. yyoverflow:
  1248. yyerror("yacc stack overflow");
  1249. yyabort:
  1250. return (1);
  1251. yyaccept:
  1252. return (0);
  1253. }