ypserv_net_secure.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <syslog.h>
#define ACCFILE "/var/yp/securenets"
#define MAXLINE 128
typedef union {
} inaddr_t;
struct seclist {
};
static int nofile = 0;
void
get_secure_nets(char *daemon_name)
{
line++;
"%s: %s line %d: too long\n",
exit(1);
}
if (strung[0] != '#') {
items++;
"%s: %s line %d: missing fields\n",
exit(1);
}
"%s: %s line %d: error in address\n",
exit(1);
}
"%s: %s line %d: error in netmask\n",
exit(1);
}
&netin)) {
"%s: %s line %d: netmask does not match network\n",
exit(1);
}
}
}
/* if nothing to process, set nofile flag and free up memory */
if (items == 0) {
nofile = 1;
}
} else {
nofile = 1;
}
}
int
char buf[INET6_ADDRSTRLEN];
if (nofile)
return (1);
} else {
return (1);
}
return (1);
}
}
return (0);
}
static int
string = "255.255.255.255";
string = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff";
}
}
return (0);
}
return (1);
}
static int
int i;
return (0);
}
return (1);
} else {
return (0);
}
}
static void
char buf[INET6_ADDRSTRLEN];
printf("%s %s %s\n",
}