cmd_list: /* empty */
| cmd_list cmd
- = {
+ {
fromname = (char *) 0;
restart_point = (off_t) 0;
}
;
cmd: USER SP username CRLF
- = {
+ {
user((char *) $3);
free((char *) $3);
}
| PASS SP password CRLF
- = {
+ {
pass((char *) $3);
free((char *) $3);
}
| PORT SP host_port CRLF
- = {
+ {
/*
* Don't allow a port < 1024 if we're not
* connecting back to the original source address
}
}
| PASV check_login CRLF
- = {
+ {
if ($2)
passive();
}
| PROT SP prot_code CRLF
- = {
+ {
if (maxbuf)
setdlevel ($3);
else
reply(503, "Must first set PBSZ");
}
| CCC CRLF
- = {
+ {
if (!allow_ccc) {
reply(534, "CCC not supported");
}
}
}
| PBSZ SP STRING CRLF
- = {
+ {
/* Others may want to do something more fancy here */
if (!auth_type)
reply(503, "Must first perform authentication");
}
}
| TYPE SP type_code CRLF
- = {
+ {
switch (cmd_type) {
case TYPE_A:
}
}
| STRU SP struct_code CRLF
- = {
+ {
switch ($3) {
case STRU_F:
}
}
| MODE SP mode_code CRLF
- = {
+ {
switch ($3) {
case MODE_S:
}
}
| ALLO SP NUMBER CRLF
- = {
+ {
reply(202, "ALLO command ignored.");
}
| ALLO SP NUMBER SP 'R' SP NUMBER CRLF
- = {
+ {
reply(202, "ALLO command ignored.");
}
| RETR check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
retrieve((char *) 0, (char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| STOR check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
store_file((char *) $4, "w", 0);
if ($4 != NULL)
free((char *) $4);
}
| APPE check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
store_file((char *) $4, "a", 0);
if ($4 != NULL)
free((char *) $4);
}
| NLST check_login CRLF
- = {
+ {
if ($2)
send_file_list(".");
}
| NLST check_login SP STRING CRLF
- = {
+ {
if ($2 && $4 != NULL)
send_file_list((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| LIST check_login CRLF
- = {
+ {
if ($2)
retrieve("/bin/ls -lgA", "");
}
| LIST check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
retrieve("/bin/ls -lgA %s", (char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| STAT check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
statfilecmd((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| STAT CRLF
- = {
+ {
statcmd();
}
| DELE check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
delete_file((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| RNTO SP pathname CRLF
- = {
+ {
if (fromname) {
renamecmd(fromname, (char *) $3);
free(fromname);
free((char *) $3);
}
| ABOR CRLF
- = {
+ {
reply(225, "ABOR command successful.");
}
| CWD check_login CRLF
- = {
+ {
if ($2)
cwd(pw->pw_dir);
}
| CWD check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
cwd((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| HELP CRLF
- = {
+ {
help(cmdtab, (char *) 0);
}
| HELP SP STRING CRLF
- = {
+ {
register char *cp = (char *)$3;
if (strncasecmp(cp, "SITE", 4) == 0) {
help(cmdtab, (char *) $3);
}
| NOOP CRLF
- = {
+ {
reply(200, "NOOP command successful.");
}
| MKD nonguest SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
makedir((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| RMD nonguest SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
removedir((char *) $4);
if ($4 != NULL)
free((char *) $4);
}
| PWD check_login CRLF
- = {
+ {
if ($2)
pwd();
}
| CDUP check_login CRLF
- = {
+ {
if ($2)
cwd("..");
}
| SITE SP HELP CRLF
- = {
+ {
help(sitetab, (char *) 0);
}
| SITE SP HELP SP STRING CRLF
- = {
+ {
help(sitetab, (char *) $5);
}
| SITE SP UMASK check_login CRLF
- = {
+ {
int oldmask;
if ($4) {
}
}
| SITE SP UMASK nonguest SP octal_number CRLF
- = {
+ {
int oldmask;
if ($4) {
}
}
| SITE SP CHMOD nonguest SP octal_number SP pathname CRLF
- = {
+ {
if ($4 && ($8 != NULL)) {
if ($6 > 0777)
reply(501,
free((char *) $8);
}
| SITE SP IDLE CRLF
- = {
+ {
reply(200,
"Current IDLE time limit is %d seconds; max %d",
timeout, maxtimeout);
}
| SITE SP IDLE SP NUMBER CRLF
- = {
+ {
if ($5 < 30 || $5 > maxtimeout) {
reply(501,
"Maximum IDLE time must be between 30 and %d seconds",
}
}
| STOU check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
store_file((char *) $4, "w", 1);
if ($4 != NULL)
free((char *) $4);
}
| SYST CRLF
- = {
+ {
#ifdef unix
#ifdef __svr4__
#undef BSD
* using with RESTART (we just count bytes).
*/
| SIZE check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL)
sizecmd((char *) $4);
if ($4 != NULL)
* not necessarily 3 digits)
*/
| MDTM check_login SP pathname CRLF
- = {
+ {
if ($2 && $4 != NULL) {
struct stat stbuf;
if (stat($4, &stbuf) < 0)
free((char *) $4);
}
| AUTH SP STRING CRLF
- = {
+ {
auth((char *) $3);
}
| ADAT SP STRING CRLF
- = {
+ {
auth_data((char *) $3);
free((char *) $3);
}
| QUIT CRLF
- = {
+ {
reply(221, "Goodbye.");
dologout(0);
}
| error CRLF
- = {
+ {
yyerrok;
}
;
rcmd: RNFR check_login SP pathname CRLF
- = {
+ {
restart_point = (off_t) 0;
if ($2 && $4) {
fromname = renamefrom((char *) $4);
}
}
| REST SP byte_size CRLF
- = {
+ {
fromname = (char *) 0;
restart_point = $3;
reply(350, "Restarting at %ld. %s",
;
password: /* empty */
- = {
+ {
*(char **)&($$) = (char *)calloc(1, sizeof(char));
}
| STRING
host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
NUMBER COMMA NUMBER
- = {
+ {
register char *a, *p;
a = (char *)&host_port.sin_addr;
;
form_code: 'N'
- = {
+ {
$$ = FORM_N;
}
| 'T'
- = {
+ {
$$ = FORM_T;
}
| 'C'
- = {
+ {
$$ = FORM_C;
}
;
prot_code: 'C'
- = {
+ {
$$ = PROT_C;
}
| 'S'
- = {
+ {
$$ = PROT_S;
}
| 'P'
- = {
+ {
$$ = PROT_P;
}
| 'E'
- = {
+ {
$$ = PROT_E;
}
;
type_code: 'A'
- = {
+ {
cmd_type = TYPE_A;
cmd_form = FORM_N;
}
| 'A' SP form_code
- = {
+ {
cmd_type = TYPE_A;
cmd_form = $3;
}
| 'E'
- = {
+ {
cmd_type = TYPE_E;
cmd_form = FORM_N;
}
| 'E' SP form_code
- = {
+ {
cmd_type = TYPE_E;
cmd_form = $3;
}
| 'I'
- = {
+ {
cmd_type = TYPE_I;
}
| 'L'
- = {
+ {
cmd_type = TYPE_L;
cmd_bytesz = NBBY;
}
| 'L' SP byte_size
- = {
+ {
cmd_type = TYPE_L;
cmd_bytesz = $3;
}
/* this is for a bug in the BBN ftp */
| 'L' byte_size
- = {
+ {
cmd_type = TYPE_L;
cmd_bytesz = $2;
}
;
struct_code: 'F'
- = {
+ {
$$ = STRU_F;
}
| 'R'
- = {
+ {
$$ = STRU_R;
}
| 'P'
- = {
+ {
$$ = STRU_P;
}
;
mode_code: 'S'
- = {
+ {
$$ = MODE_S;
}
| 'B'
- = {
+ {
$$ = MODE_B;
}
| 'C'
- = {
+ {
$$ = MODE_C;
}
;
pathname: pathstring
- = {
+ {
/*
* Problem: this production is used for all pathname
* processing, but only gives a 550 error reply.
;
octal_number: NUMBER
- = {
+ {
register int ret, dec, multby, digit;
/*
;
check_login: /* empty */
- = {
+ {
if (logged_in)
$$ = 1;
else {
;
nonguest: check_login
- = {
+ {
if (guest) {
reply(550, "Operation prohibited for anonymous users.");
$$ = 0;