ancil.c revision 4a19049349b8aa3a6f741b8303a0a60e1fa770c9
0N/A/*
196N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License (the "License").
0N/A * You may not use this file except in compliance with the License.
0N/A *
0N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A * or http://www.opensolaris.org/os/licensing.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A * If applicable, add the following below this CDDL HEADER, with the
0N/A * fields enclosed by brackets "[]" replaced with your own identifying
0N/A * information: Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A */
0N/A/*
0N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
0N/A * Use is subject to license terms.
0N/A */
0N/A
0N/A
0N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
0N/A/* All Rights Reserved */
0N/A
0N/A/*
0N/A * Portions of this source code were derived from Berkeley 4.3 BSD
0N/A * under license from the Regents of the University of California.
0N/A */
0N/A
0N/A#pragma ident "%Z%%M% %I% %E% SMI"
0N/A
0N/A#include <dirent.h>
0N/A#include "../ypsym.h"
0N/A#include "../ypdefs.h"
0N/AUSE_YPDBPATH
0N/AUSE_DBM
0N/A
0N/Abool onmaplist();
0N/Aextern unsigned int strlen();
0N/Aextern int strcmp();
0N/Aextern int isvar_sysv();
0N/Aextern char *strncpy();
0N/Aextern bool ypcheck_domain_yptol();
0N/A
0N/A/*
0N/A * This checks to see whether a domain name is present at the local node as a
0N/A * subdirectory of ypdbpath
0N/A *
0N/A * Calls ypcheck_domain_yptol() defined in
0N/A * usr/src/lib/libnisdb/yptol/shim_ancil.c
113N/A */
113N/Abool
113N/Aypcheck_domain(domain)
113N/A char *domain;
113N/A{
113N/A return (ypcheck_domain_yptol(domain));
113N/A}
113N/A
0N/A/*
0N/A * This returns TRUE if map is on list, and FALSE otherwise.
113N/A */
113N/Abool
113N/Aonmaplist(map, list)
113N/A char *map;
113N/A struct ypmaplist *list;
0N/A{
0N/A struct ypmaplist *scan;
0N/A
0N/A for (scan = list; scan; scan = scan->ypml_next) {
0N/A
0N/A if (strcmp(map, scan->ypml_name) == 0) {
0N/A return (TRUE);
0N/A }
0N/A }
0N/A
0N/A return (FALSE);
0N/A}
0N/A