/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ftp_var.h"
static int token(void);
int
{
#if 0
#endif
}
static struct toktab {
char *tokstr;
int tval;
} toktab[] = {
"default", DEFAULT,
"login", LOGIN,
"password", PASSWD,
"account", ACCOUNT,
"machine", MACHINE,
"macdef", MACDEF,
"skipsyst", SKIPSYST,
0, 0
};
static int
{
int t, i, c;
extern int errno;
hdir = ".";
exit(1);
}
return (0);
}
next:
while ((t = token()))
switch (t) {
case MACHINE:
continue;
/* "machine name" matches host */
/* FALLTHROUGH */
case DEFAULT:
/* "default" matches any host */
switch (t) {
case LOGIN:
if (token())
if (*aname == 0) {
"Error - out of VM\n");
exit(1);
}
} else {
goto next;
}
break;
case PASSWD:
"correct mode.\n");
"mode.\n");
return (-1);
}
exit(1);
}
}
break;
case ACCOUNT:
"correct mode.\n");
"mode.\n");
return (-1);
}
exit(1);
}
}
break;
case MACDEF:
if (proxy) {
return (0);
}
c == '\t');
if (c == EOF || c == '\n') {
printf("Missing macdef name argument.\n");
return (-1);
}
if (macnum == 16) {
printf("Limit of 16 macros have already "
"been defined\n");
return (-1);
}
*tmp++ = c;
!isspace(c); ++i) {
*tmp++ = c;
}
if (c == EOF) {
printf("Macro definition for `%s` missing "
"null line terminator.\n",
return (-1);
}
*tmp = '\0';
if (c != '\n') {
}
if (c == EOF) {
printf("Macro definition for `%s` missing "
"null line terminator.\n",
return (-1);
}
if (macnum == 0) {
} else {
}
printf("Macro definition for `%s` missing "
"null line terminator.\n",
return (-1);
}
*tmp = c;
if (*tmp == '\n') {
tmp - 1;
break;
}
*tmp = '\0';
}
tmp++;
}
printf("4K macro buffer exceeded\n");
return (-1);
}
printf("Macro definition for `%s` is empty, "
"macro not stored.\n",
}
break;
case SKIPSYST:
skipsyst = 1;
break;
default:
break;
}
goto done;
}
done:
return (0);
}
static int
token(void)
{
char *cp;
int c;
struct toktab *t;
int len;
return (0);
(c == '\n' || c == '\t' || c == ' ' || c == ','))
continue;
if (c == EOF)
return (0);
if (c == '"') {
if (c == '\\')
len = 1;
*cp = (unsigned char)c;
}
}
} else {
*cp = (unsigned char)c;
len = 1;
}
c != ' ' && c != ',') {
if (c == '\\')
len = 1;
*cp = (unsigned char)c;
}
}
}
*cp = 0;
if (tokval[0] == 0)
return (0);
return (t->tval);
return (ID);
}