⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftpcmd.c

📁 压缩包中包含LINUX下多个命令的源码
💻 C
📖 第 1 页 / 共 5 页
字号:
/* A Bison parser, made from ../../inetutils/ftpd/ftpcmd.y   by GNU bison 1.35.  */#define YYBISON 1  /* Identify Bison output.  */# define	A	257# define	B	258# define	C	259# define	E	260# define	F	261# define	I	262# define	L	263# define	N	264# define	P	265# define	R	266# define	S	267# define	T	268# define	SP	269# define	CRLF	270# define	COMMA	271# define	USER	272# define	PASS	273# define	ACCT	274# define	REIN	275# define	QUIT	276# define	PORT	277# define	PASV	278# define	TYPE	279# define	STRU	280# define	MODE	281# define	RETR	282# define	STOR	283# define	APPE	284# define	MLFL	285# define	MAIL	286# define	MSND	287# define	MSOM	288# define	MSAM	289# define	MRSQ	290# define	MRCP	291# define	ALLO	292# define	REST	293# define	RNFR	294# define	RNTO	295# define	ABOR	296# define	DELE	297# define	CWD	298# define	LIST	299# define	NLST	300# define	SITE	301# define	STAT	302# define	HELP	303# define	NOOP	304# define	MKD	305# define	RMD	306# define	PWD	307# define	CDUP	308# define	STOU	309# define	SMNT	310# define	SYST	311# define	SIZE	312# define	MDTM	313# define	UMASK	314# define	IDLE	315# define	CHMOD	316# define	LEXERR	317# define	STRING	318# define	NUMBER	319#line 37 "../../inetutils/ftpd/ftpcmd.y"#ifndef lintstatic char sccsid[] = "@(#)ftpcmd.y	8.3 (Berkeley) 4/6/94";#endif /* not lint */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <sys/types.h>#include <sys/param.h>#include <sys/socket.h>#include <sys/stat.h>#include <netinet/in.h>#include <arpa/ftp.h>#include <ctype.h>#include <errno.h>#include <pwd.h>#include <setjmp.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <syslog.h>#ifdef TIME_WITH_SYS_TIME# include <sys/time.h># include <time.h>#else# ifdef HAVE_SYS_TIME_H#  include <sys/time.h># else#  include <time.h># endif#endif#include <unistd.h>#include <limits.h>#ifdef HAVE_SYS_UTSNAME_H#include <sys/utsname.h>#endif/* Include glob.h last, because it may define "const" which breaks   system headers on some platforms. */#include <glob.h>#include "extern.h"#if ! defined (NBBY) && defined (CHAR_BIT)#define NBBY CHAR_BIT#endifoff_t restart_point;static char cbuf[512];           /* Command Buffer.  */static char *fromname;static int cmd_type;static int cmd_form;static int cmd_bytesz;struct tab{  const char	*name;  short	token;  short	state;  short	implemented;	/* 1 if command is implemented */  const char	*help;};extern struct tab cmdtab[];extern struct tab sitetab[];static char *copy         __P ((char *));static void help          __P ((struct tab *, char *));static struct tab *lookup __P ((struct tab *, char *));static void sizecmd       __P ((char *));static int yylex          __P ((void));static void yyerror       __P ((const char *s));#line 117 "../../inetutils/ftpd/ftpcmd.y"#ifndef YYSTYPEtypedef union {	int	i;	char   *s;} yystype;# define YYSTYPE yystype# define YYSTYPE_IS_TRIVIAL 1#endif#ifndef YYDEBUG# define YYDEBUG 0#endif#define	YYFINAL		210#define	YYFLAG		-32768#define	YYNTBASE	66/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */#define YYTRANSLATE(x) ((unsigned)(x) <= 319 ? yytranslate[x] : 81)/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */static const char yytranslate[] ={       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,      56,    57,    58,    59,    60,    61,    62,    63,    64,    65};#if YYDEBUGstatic const short yyprhs[] ={       0,     0,     1,     4,     7,    12,    17,    23,    27,    32,      37,    42,    47,    56,    62,    68,    74,    78,    84,    88,      94,   100,   103,   109,   115,   118,   122,   128,   131,   136,     139,   145,   151,   155,   159,   164,   171,   177,   185,   195,     200,   208,   214,   217,   223,   229,   232,   235,   241,   246,     248,   249,   251,   253,   265,   267,   269,   271,   273,   277,     279,   283,   285,   287,   291,   294,   296,   298,   300,   302,     304,   306,   308,   310,   312};static const short yyrhs[] ={      -1,    66,    67,     0,    66,    68,     0,    18,    15,    69,      16,     0,    19,    15,    70,    16,     0,    23,    80,    15,      72,    16,     0,    24,    80,    16,     0,    25,    15,    74,      16,     0,    26,    15,    75,    16,     0,    27,    15,    76,      16,     0,    38,    15,    65,    16,     0,    38,    15,    65,      15,    12,    15,    65,    16,     0,    28,    80,    15,    77,      16,     0,    29,    80,    15,    77,    16,     0,    30,    80,      15,    77,    16,     0,    46,    80,    16,     0,    46,    80,      15,    64,    16,     0,    45,    80,    16,     0,    45,    80,      15,    77,    16,     0,    48,    80,    15,    77,    16,     0,      48,    16,     0,    43,    80,    15,    77,    16,     0,    41,      80,    15,    77,    16,     0,    42,    16,     0,    44,    80,      16,     0,    44,    80,    15,    77,    16,     0,    49,    16,       0,    49,    15,    64,    16,     0,    50,    16,     0,    51,      80,    15,    77,    16,     0,    52,    80,    15,    77,    16,       0,    53,    80,    16,     0,    54,    80,    16,     0,    47,      15,    49,    16,     0,    47,    15,    49,    15,    64,    16,       0,    47,    15,    60,    80,    16,     0,    47,    15,    60,      80,    15,    79,    16,     0,    47,    15,    62,    80,    15,      79,    15,    77,    16,     0,    47,    15,    61,    16,     0,      47,    15,    80,    61,    15,    65,    16,     0,    55,    80,      15,    77,    16,     0,    57,    16,     0,    58,    80,    15,      77,    16,     0,    59,    80,    15,    77,    16,     0,    22,      16,     0,     1,    16,     0,    40,    80,    15,    77,    16,       0,    39,    15,    71,    16,     0,    64,     0,     0,    64,       0,    65,     0,    65,    17,    65,    17,    65,    17,    65,      17,    65,    17,    65,     0,    10,     0,    14,     0,     5,       0,     3,     0,     3,    15,    73,     0,     6,     0,     6,      15,    73,     0,     8,     0,     9,     0,     9,    15,    71,       0,     9,    71,     0,     7,     0,    12,     0,    11,     0,      13,     0,     4,     0,     5,     0,    78,     0,    64,     0,      65,     0,     0};#endif#if YYDEBUG/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const short yyrline[] ={       0,   152,   153,   160,   164,   169,   175,   197,   202,   237,     249,   261,   265,   269,   276,   283,   290,   295,   302,   307,     314,   321,   325,   332,   345,   349,   354,   361,   365,   382,     386,   393,   400,   405,   410,   414,   420,   430,   445,   459,     465,   481,   488,   534,   551,   573,   578,   584,   595,   610,     614,   618,   622,   626,   640,   644,   648,   655,   660,   665,     670,   675,   679,   684,   690,   698,   702,   706,   713,   717,     721,   728,   765,   769,   796};#endif#if (YYDEBUG) || defined YYERROR_VERBOSE/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */static const char *const yytname[] ={  "$", "error", "$undefined.", "A", "B", "C", "E", "F", "I", "L", "N", "P",   "R", "S", "T", "SP", "CRLF", "COMMA", "USER", "PASS", "ACCT", "REIN",   "QUIT", "PORT", "PASV", "TYPE", "STRU", "MODE", "RETR", "STOR", "APPE",   "MLFL", "MAIL", "MSND", "MSOM", "MSAM", "MRSQ", "MRCP", "ALLO", "REST",   "RNFR", "RNTO", "ABOR", "DELE", "CWD", "LIST", "NLST", "SITE", "STAT",   "HELP", "NOOP", "MKD", "RMD", "PWD", "CDUP", "STOU", "SMNT", "SYST",   "SIZE", "MDTM", "UMASK", "IDLE", "CHMOD", "LEXERR", "STRING", "NUMBER",   "cmd_list", "cmd", "rcmd", "username", "password", "byte_size",   "host_port", "form_code", "type_code", "struct_code", "mode_code",   "pathname", "pathstring", "octal_number", "check_login", 0};#endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const short yyr1[] ={       0,    66,    66,    66,    67,    67,    67,    67,    67,    67,      67,    67,    67,    67,    67,    67,    67,    67,    67,    67,      67,    67,    67,    67,    67,    67,    67,    67,    67,    67,      67,    67,    67,    67,    67,    67,    67,    67,    67,    67,      67,    67,    67,    67,    67,    67,    67,    68,    68,    69,      70,    70,    71,    72,    73,    73,    73,    74,    74,    74,      74,    74,    74,    74,    74,    75,    75,    75,    76,    76,      76,    77,    78,    79,    80};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const short yyr2[] ={       0,     0,     2,     2,     4,     4,     5,     3,     4,     4,       4,     4,     8,     5,     5,     5,     3,     5,     3,     5,       5,     2,     5,     5,     2,     3,     5,     2,     4,     2,       5,     5,     3,     3,     4,     6,     5,     7,     9,     4,       7,     5,     2,     5,     5,     2,     2,     5,     4,     1,       0,     1,     1,    11,     1,     1,     1,     1,     3,     1,       3,     1,     1,     3,     2,     1,     1,     1,     1,     1,       1,     1,     1,     1,     0};/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE   doesn't specify something else to do.  Zero means the default is an   error. */static const short yydefact[] ={       1,     0,     0,     0,     0,     0,    74,    74,     0,     0,       0,    74,    74,    74,     0,     0,    74,    74,     0,    74,      74,    74,    74,     0,    74,     0,     0,    74,    74,    74,      74,    74,     0,    74,    74,     2,     3,    46,     0,    50,      45,     0,     0,     0,     0,     0,     0,     0,     0,     0,       0,     0,     0,    24,     0,     0,     0,     0,     0,    21,       0,     0,    27,    29,     0,     0,     0,     0,     0,    42,       0,     0,    49,     0,    51,     0,     0,     7,    57,    59,      61,    62,     0,    65,    67,    66,     0,    69,    70,    68,       0,     0,     0,     0,     0,    52,     0,     0,     0,     0,       0,    25,     0,    18,     0,    16,     0,    74,     0,    74,       0,     0,     0,     0,     0,    32,    33,     0,     0,     0,       4,     5,     0,     0,     0,     0,     0,    64,     8,     9,      10,    72,     0,    71,     0,     0,     0,    11,    48,     0,       0,     0,     0,     0,     0,     0,    34,     0,    39,     0,       0,     0,    28,     0,     0,     0,     0,     0,     0,     6,      56,    54,    55,    58,    60,    63,    13,    14,    15,     0,      47,    23,    22,    26,    19,    17,     0,     0,    36,     0,       0,    20,    30,    31,    41,    43,    44,     0,     0,    35,      73,     0,     0,     0,     0,     0,    37,     0,    40,     0,      12,     0,     0,    38,     0,     0,     0,     0,    53,     0,       0};static const short yydefgoto[] ={       1,    35,    36,    73,    75,    96,   123,   163,    82,    86,      90,   132,   133,   191,    41};static const short yypact[] ={  -32768,    42,    -7,     8,    20,    24,-32768,-32768,    44,    59,      62,-32768,-32768,-32768,    83,    89,-32768,-32768,    47,-32768,  -32768,-32768,-32768,    97,    98,    16,    99,-32768,-32768,-32768,  -32768,-32768,   100,-32768,-32768,-32768,-32768,-32768,    49,    53,  -32768,   103,   104,    70,     6,     7,   106,   107,   108,    54,      60,   112,   113,-32768,   114,    39,    41,    87,   -46,-32768,     115,    67,-32768,-32768,   117,   118,   119,   120,   122,-32768,     123,   124,-32768,   125,-32768,   126,    69,-32768,   128,   129,  -32768,   -13,   130,-32768,-32768,-32768,   131,-32768,-32768,-32768,     132,    76,    76,    76,    91,-32768,   133,    76,    76,    76,      76,-32768,    76,-32768,    81,-32768,    93,-32768,   134,-32768,      90,    76,   136,    76,    76,-32768,-32768,    76,    76,    76,  -32768,-32768,   137,   139,    48,    48,    60,-32768,-32768,-32768,  -32768,-32768,   140,-32768,   141,   142,   147,-32768,-32768,   144,     145,   146,   148,   149,   150,   105,-32768,    95,-32768,   138,     152,   154,-32768,   155,   156,   157,   158,   159,   111,-32768,  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   153,  -32768,-32768,-32768,-32768,-32768,-32768,   161,   116,-32768,   116,     121,-32768,-32768,-32768,-32768,-32768,-32768,   162,   127,-32768,  -32768,   164,   163,   166,   135,   167,-32768,    76,-32768,   168,  -32768,   171,   143,-32768,   172,   151,   173,   160,-32768,   184,  -32768};static const short yypgoto[] ={  -32768,-32768,-32768,-32768,-32768,   -77,-32768,    38,-32768,-32768,  -32768,   -92,-32768,     9,    17};#define	YYLAST		225static const short yytable[] ={     134,   135,   126,   106,   127,   139,   140,   141,   142,    37,     143,    87,    88,    83,   107,   108,   109,    84,    85,   151,      89,   153,   154,    38,    42,   155,   156,   157,    46,    47,      48,    61,    62,    51,    52,    39,    54,    55,    56,    57,      40,    60,   209,     2,    64,    65,    66,    67,    68,   165,      70,    71,    95,   160,   100,   101,   102,   103,   161,    43,       3,     4,   162,    53,     5,     6,     7,     8,     9,    10,      11,    12,    13,    78,    44,   110,    79,    45,    80,    81,      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,      24,    25,    26,    27,    28,    29,    30,    31,    49,    32,      33,    34,   104,   105,    50,   201,   136,   137,   145,   146,     177,   178,    58,    72,    59,    63,    69,    74,    76,    94,      77,    91,    92,    93,   147,    95,   149,    97,    98,    99,     111,   112,   113,   114,   122,   115,   116,   117,   118,   119,     131,   120,   121,   124,   125,   144,   128,   129,   130,   138,     148,   150,   152,   179,   158,   159,   166,   167,   168,   169,     170,   171,   172,   164,   173,   174,   175,   180,   188,   176,     181,   182,   183,   184,   185,   186,   187,   189,   197,   194,     196,   190,   198,   200,   210,   202,   193,   203,   192,   205,     207,     0,   195,     0,     0,     0,     0,     0,     0,     0,     199,     0,     0,     0,     0,     0,     0,     0,   204,     0,       0,     0,     0,     0,     0,     0,   206,     0,     0,     0,       0,     0,     0,     0,     0,   208};static const short yycheck[] ={      92,    93,    15,    49,    81,    97,    98,    99,   100,    16,     102,     4,     5,     7,    60,    61,    62,    11,    12,   111,      13,   113,   114,    15,     7,   117,   118,   119,    11,    12,      13,    15,    16,    16,    17,    15,    19,    20,    21,    22,      16,    24,     0,     1,    27,    28,    29,    30,    31,   126,      33,    34,    65,     5,    15,    16,    15,    16,    10,    15,      18,    19,    14,    16,    22,    23,    24,    25,    26,    27,      28,    29,    30,     3,    15,    58,     6,    15,     8,     9,      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,      48,    49,    50,    51,    52,    53,    54,    55,    15,    57,      58,    59,    15,    16,    15,   197,    15,    16,    15,    16,      15,    16,    15,    64,    16,    16,    16,    64,    15,    65,      16,    15,    15,    15,   107,    65,   109,    15,    15,    15,      15,    64,    15,    15,    65,    16,    16,    15,    15,    15,      64,    16,    16,    15,    15,    64,    16,    16,    16,    16,      16,    61,    16,    15,    17,    16,    16,    16,    16,    12,      16,    16,    16,   125,    16,    16,    16,    15,    15,    64,      16,    16,    16,    16,    16,    16,    65,    16,    15,    17,      16,    65,    16,    16,     0,    17,    65,    16,   179,    17,      17,    -1,    65,    -1,    -1,    -1,    -1,    -1,    -1,    -1,      65,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    65,    -1,      -1,    -1,    -1,    -1,    -1,    -1,    65,    -1,    -1,    -1,      -1,    -1,    -1,    -1,    -1,    65};/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */#line 3 "/usr/share/bison/bison.simple"/* Skeleton output parser for bison,   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software   Foundation, Inc.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2, or (at your option)   any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 59 Temple Place - Suite 330,   Boston, MA 02111-1307, USA.  *//* As a special exception, when this file is copied by Bison into a   Bison output file, you may use that output file without restriction.   This special exception was added by the Free Software Foundation   in version 1.24 of Bison.  *//* This is the parser code that is written into each bison parser when   the %semantic_parser declaration is not specified in the grammar.   It was written by Richard Stallman by simplifying the hairy parser   used when %semantic_parser is specified.  *//* All symbols defined below should begin with yy or YY, to avoid   infringing on user name space.  This should be done even for local   variables, as they might otherwise be expanded by user macros.   There are some unavoidable exceptions within include files to   define necessary library symbols; they are noted "INFRINGES ON   USER NAME SPACE" below.  */#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)/* The parser invokes alloca or malloc; define the necessary symbols.  */# if YYSTACK_USE_ALLOCA#  define YYSTACK_ALLOC alloca# else#  ifndef YYSTACK_USE_ALLOCA#   if defined (alloca) || defined (_ALLOCA_H)#    define YYSTACK_ALLOC alloca#   else#    ifdef __GNUC__#     define YYSTACK_ALLOC __builtin_alloca#    endif#   endif#  endif# endif# ifdef YYSTACK_ALLOC   /* Pacify GCC's `empty if-body' warning. */#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)# else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -