yp_dbupdate.c (90297) | yp_dbupdate.c (90298) |
---|---|
1/* 2 * Copyright (c) 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = | 1/* 2 * Copyright (c) 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = |
35 "$FreeBSD: head/usr.sbin/rpc.ypupdated/yp_dbupdate.c 90297 2002-02-06 13:30:31Z des $"; | 35 "$FreeBSD: head/usr.sbin/rpc.ypupdated/yp_dbupdate.c 90298 2002-02-06 15:26:07Z des $"; |
36#endif /* not lint */ 37 38#include <sys/fcntl.h> 39 40#include <stdio.h> 41#include <string.h> 42#include <errno.h> 43#include <limits.h> 44#include <db.h> 45#include <unistd.h> 46struct dom_binding {}; 47#include <rpcsvc/ypclnt.h> 48#include <rpcsvc/ypupdate_prot.h> 49#include "ypxfr_extern.h" 50#include "ypupdated_extern.h" 51 | 36#endif /* not lint */ 37 38#include <sys/fcntl.h> 39 40#include <stdio.h> 41#include <string.h> 42#include <errno.h> 43#include <limits.h> 44#include <db.h> 45#include <unistd.h> 46struct dom_binding {}; 47#include <rpcsvc/ypclnt.h> 48#include <rpcsvc/ypupdate_prot.h> 49#include "ypxfr_extern.h" 50#include "ypupdated_extern.h" 51 |
52static int yp_domake(map, domain) 53 char *map; 54 char *domain; | 52static int 53yp_domake(char *map, char *domain) |
55{ 56 int pid; 57 58 switch ((pid = fork())) { 59 case 0: 60 execlp(MAP_UPDATE_PATH, MAP_UPDATE, map, domain, (char *)NULL); 61 yp_error("couldn't exec map update process: %s", 62 strerror(errno)); --- 6 unchanged lines hidden (view full) --- 69 default: 70 children++; 71 break; 72 } 73 74 return(0); 75} 76 | 54{ 55 int pid; 56 57 switch ((pid = fork())) { 58 case 0: 59 execlp(MAP_UPDATE_PATH, MAP_UPDATE, map, domain, (char *)NULL); 60 yp_error("couldn't exec map update process: %s", 61 strerror(errno)); --- 6 unchanged lines hidden (view full) --- 68 default: 69 children++; 70 break; 71 } 72 73 return(0); 74} 75 |
77int ypmap_update(netname, map, op, keylen, keyval, datlen, datval) 78 char *netname; 79 char *map; 80 unsigned int op; 81 unsigned int keylen; 82 char *keyval; 83 unsigned int datlen; 84 char *datval; | 76int 77ypmap_update(char *netname, char *map, unsigned int op, unsigned int keylen, 78 char *keyval, unsigned int datlen, char *datval) |
85{ 86 DB *dbp; 87 DBT key = { NULL, 0 }, data = { NULL, 0 }; 88 char *yp_last = "YP_LAST_MODIFIED"; 89 char yplastbuf[YPMAXRECORD]; 90 char *domptr; 91 int rval = 0; 92 --- 62 unchanged lines hidden --- | 79{ 80 DB *dbp; 81 DBT key = { NULL, 0 }, data = { NULL, 0 }; 82 char *yp_last = "YP_LAST_MODIFIED"; 83 char yplastbuf[YPMAXRECORD]; 84 char *domptr; 85 int rval = 0; 86 --- 62 unchanged lines hidden --- |