/*
* 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 (c) 1984, 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.
*/
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <strings.h>
#include <stdlib.h>
#include <libintl.h>
#ifdef SYSV
#endif /* SYSV */
static int token();
static struct ruserdata {
struct toktab {
char *tokstr;
int tval;
static struct ruserdata *
{
struct toktab *t;
if (d == 0) {
if ((d = (struct ruserdata *)
return (NULL);
}
ruserdata = d;
t = d->toktab;
}
return (d);
}
void
{
if (*aname == 0) {
exit(1);
if ((*aname)[0] == '\n')
else
}
}
}
static void
{
struct ruserdata *d = _ruserdata();
int t;
if (d == 0)
return;
hdir = ".";
/* LINTED unbounded string */
return;
}
next:
while ((t = token()))
switch (t) {
case DEFAULT:
(void) token();
continue;
case MACHINE:
continue;
switch (t) {
case LOGIN:
if (token())
if (*aname == 0) {
} else {
goto next;
}
break;
case PASSWD:
"Error - .netrc file not correct mode.\n"));
"Remove password or correct mode.\n"));
exit(1);
}
}
break;
case COMMAND:
case NOTIFY:
case WRITE:
case FORCE:
(void) token();
break;
default:
"Unknown .netrc option %s\n"), d->tokval);
break;
}
goto done;
}
done:
}
static int
token()
{
struct ruserdata *d = _ruserdata();
char *cp;
int c;
struct toktab *t;
if (d == 0)
return (0);
return (0);
(c == '\n' || c == '\t' || c == ' ' || c == ','))
continue;
if (c == EOF)
return (0);
if (c == '"') {
if (c == '\\')
*cp++ = (char)c;
}
} else {
*cp++ = (char)c;
c != '\n' && c != '\t' && c != ' ' && c != ',') {
if (c == '\\')
*cp++ = (char)c;
}
}
*cp = 0;
if (d->tokval[0] == 0)
return (0);
return (t->tval);
return (ID);
}