126236Swpaul/* 226236Swpaul * Copyright (c) 1995, 1996 326236Swpaul * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 426236Swpaul * 526236Swpaul * Redistribution and use in source and binary forms, with or without 626236Swpaul * modification, are permitted provided that the following conditions 726236Swpaul * are met: 826236Swpaul * 1. Redistributions of source code must retain the above copyright 926236Swpaul * notice, this list of conditions and the following disclaimer. 1026236Swpaul * 2. Redistributions in binary form must reproduce the above copyright 1126236Swpaul * notice, this list of conditions and the following disclaimer in the 1226236Swpaul * documentation and/or other materials provided with the distribution. 1326236Swpaul * 3. All advertising materials mentioning features or use of this software 1426236Swpaul * must display the following acknowledgement: 1526236Swpaul * This product includes software developed by Bill Paul. 1626236Swpaul * 4. Neither the name of the author nor the names of any co-contributors 1726236Swpaul * may be used to endorse or promote products derived from this software 1826236Swpaul * without specific prior written permission. 1926236Swpaul * 2026236Swpaul * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 2126236Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2226236Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2326236Swpaul * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 2426236Swpaul * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2526236Swpaul * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2626236Swpaul * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2726236Swpaul * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2826236Swpaul * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2926236Swpaul * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3026236Swpaul * SUCH DAMAGE. 3126236Swpaul */ 3230378Scharnier 33114601Sobrien#include <sys/cdefs.h> 34114601Sobrien__FBSDID("$FreeBSD$"); 3530378Scharnier 3626236Swpaul#include <stdio.h> 3726236Swpaul#include <stdlib.h> 3826236Swpaul#include <fcntl.h> 3926236Swpaul#include <string.h> 4026236Swpaul#include <limits.h> 4126236Swpaul#include <unistd.h> 4226236Swpaul#include <db.h> 4326236Swpaul#include <sys/stat.h> 4426236Swpaul#include <errno.h> 4526236Swpaul#include <paths.h> 4626236Swpaul#include <rpcsvc/yp.h> 4726236Swpaul#include "ypxfr_extern.h" 4826236Swpaul 4990298Sdesint 5090298Sdesyp_del_record(DB *dbp, DBT *key) 5126236Swpaul{ 5226236Swpaul int rval; 5326236Swpaul 5426236Swpaul if ((rval = (dbp->del)(dbp,key,0))) { 5590297Sdes switch (rval) { 5626236Swpaul case 1: 5726236Swpaul return(YP_FALSE); 5826236Swpaul break; 5926236Swpaul case -1: 6026236Swpaul default: 6126236Swpaul (void)(dbp->close)(dbp); 6226236Swpaul return(YP_BADDB); 6326236Swpaul break; 6426236Swpaul } 6526236Swpaul } 6626236Swpaul 6726236Swpaul return(YP_TRUE); 6826236Swpaul} 69