void _STUB_rcmd(){}
#else
/*
* Copyright (c) 1983
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#endif /* LIBC_SCCS and not lint */
#include "rlib.h"
#include <pwd.h>
#if 1
#endif
#if NLS
#include "nl_types.h"
#endif
#ifdef YP
extern void setnetgrent(const char *);
extern void endnetgrent(void);
extern int getnetgrent(char **, char **, char **);
static int _checknetgrouphost(const char *, const char *, int);
static int _checknetgroupuser(const char *, const char *);
#endif
#if defined(__EXPORT__)
#define extern __EXPORT__
#endif
{
int s;
if (s < 0)
return (-1);
for (;;) {
return (s);
if (errno != EADDRINUSE) {
(void) close(s);
return (-1);
}
(*alport)--;
(void) close(s);
return (-1);
}
}
}
extern int rcmd(char **ahost, unsigned short rport, const char *locuser, const char *remuser, const char *cmd, int *fd2p)
{
#ifdef F_SETOWN
#endif
#ifdef _POSIX_SOURCE
#else
long oldmask;
#endif
char c;
#if NLS
#endif
#ifdef F_SETOWN
#endif
if (hp == 0) {
#if NLS
2, "unknown host"));
#else
#endif
return (-1);
}
#ifdef SIGURG
#ifdef _POSIX_SOURCE
sigemptyset (&set);
#else
#endif
#endif
for (;;) {
if (s < 0) {
#if NLS
"All ports in use"));
#else
#endif
else
#if NLS
"rcmd: socket"));
#else
perror("rcmd: socket");
#endif
#ifdef SIGURG
#ifdef _POSIX_SOURCE
#else
#endif
#endif
return (-1);
}
#ifdef F_SETOWN
#endif
break;
(void) close(s);
if (errno == EADDRINUSE) {
lport--;
continue;
}
timo *= 2;
continue;
}
#if NLS
"connect to address"),
#else
#endif
perror(0);
hp->h_addr_list++;
#if NLS
"Trying %s...\n"),
#else
#endif
continue;
}
#ifdef SIGURG
#ifdef _POSIX_SOURCE
#else
#endif
#endif
return (-1);
}
lport--;
if (fd2p == 0) {
lport = 0;
} else {
if (s2 < 0)
goto bad;
#if NLS
"write: setting up stderr"));
#else
perror("write: setting up stderr");
#endif
goto bad;
}
if (s3 < 0) {
#if NLS
"accept"));
#else
perror("accept");
#endif
lport = 0;
goto bad;
}
#if NLS
"%s\n",
"socket: protocol failure in circuit setup."));
#else
"socket: protocol failure in circuit setup.\n");
#endif
goto bad2;
}
}
goto bad2;
}
if (c != 0) {
if (c == '\n')
break;
}
goto bad2;
}
#ifdef SIGURG
#ifdef _POSIX_SOURCE
#else
#endif
#endif
return (s);
bad2:
if (lport)
bad:
(void) close(s);
#ifdef SIGURG
#ifdef _POSIX_SOURCE
#else
#endif
#endif
return (-1);
}
{
register const char *sp;
register char *p;
p = fhost;
while (*sp) {
if (*sp == '.') {
if (baselen == -1)
*p++ = *sp++;
} else {
}
}
*p = '\0';
if (hostf) {
return(0);
}
}
if (first == 1) {
first = 0;
return(-1);
return(-1);
}
return(-1);
}
goto again;
}
return (-1);
}
int
{
char *user;
register char *p;
int hostvalid = 0;
int uservalid = 0;
/* We need to get rid of all comments. */
if (p) *p = '\0';
p = ahost;
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
p++;
}
if (*p == ' ' || *p == '\t') {
*p++ = '\0';
while (*p == ' ' || *p == '\t')
p++;
user = p;
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0')
p++;
} else
user = p;
*p = '\0';
/* Adding new authentication -Nilendu */
/* enable all host for + entry */
hostvalid = 1;
/* enable all user for + entry */
uservalid = 1;
/* disable all host for - entry */
hostvalid = 0;
/* disable all user for - entry */
uservalid = 0;
#ifdef YP
/* disable host from -hostname entry */
return -1;
/* disable host from -@netgroup entry for host */
return -1;
/* disable user from -user entry */
return -1;
/* disable user from -@netgroup entry for user */
return -1;
/* enable host from +@netgroup entry for host */
else
/* enable user from +@netgroup entry for user */
else
return 0;
#else
return 0;
#endif /* YP */
}
return (-1);
}
int
{
static int nodomain = 0;
register char *cp;
if (len == -1)
return(0);
return(1);
return(0);
if (nodomain)
return(0);
if (!domainp) {
nodomain = 1;
return(0);
}
ldomain[MAXHOSTNAMELEN] = (char) 0;
nodomain = 1;
return(0);
}
}
}
#ifdef YP
static int
{
int status;
while (1)
{
; /* find valid host entry */
{
endnetgrent();
return 0;
}
{
endnetgrent();
return 1;
}
}
}
static int
{
int status;
while (1)
{
; /* find valid user entry */
{
endnetgrent();
return 0;
}
{
endnetgrent();
return 1;
}
}
}
#endif /* YP */
#endif