yppush_main.c (15443) | yppush_main.c (16242) |
---|---|
1/* 2 * Copyright (c) 1995 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 --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * | 1/* 2 * Copyright (c) 1995 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 --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 * $Id: yppush_main.c,v 1.3 1996/04/03 03:24:03 wpaul Exp $ | 32 * $Id: yppush_main.c,v 1.4 1996/04/29 05:24:26 wpaul Exp $ |
33 */ 34 35#include <stdio.h> 36#include <stdlib.h> 37#include <unistd.h> 38#include <string.h> 39#include <signal.h> 40#include <time.h> --- 7 unchanged lines hidden (view full) --- 48#include <rpc/pmap_clnt.h> 49#include <rpcsvc/yp.h> 50struct dom_binding {}; 51#include <rpcsvc/ypclnt.h> 52#include "ypxfr_extern.h" 53#include "yppush_extern.h" 54 55#ifndef lint | 33 */ 34 35#include <stdio.h> 36#include <stdlib.h> 37#include <unistd.h> 38#include <string.h> 39#include <signal.h> 40#include <time.h> --- 7 unchanged lines hidden (view full) --- 48#include <rpc/pmap_clnt.h> 49#include <rpcsvc/yp.h> 50struct dom_binding {}; 51#include <rpcsvc/ypclnt.h> 52#include "ypxfr_extern.h" 53#include "yppush_extern.h" 54 55#ifndef lint |
56static const char rcsid[] = "$Id: yppush_main.c,v 1.3 1996/04/03 03:24:03 wpaul Exp $"; | 56static const char rcsid[] = "$Id: yppush_main.c,v 1.4 1996/04/29 05:24:26 wpaul Exp $"; |
57#endif 58 59char *progname = "yppush"; 60int debug = 1; 61int _rpcpmstart = 0; 62char *yp_dir = _PATH_YP; 63 64char *yppush_mapname = NULL; /* Map to transfer. */ --- 558 unchanged lines hidden (view full) --- 623 if (strncmp(myname, data.data, data.size)) { 624 yp_error("warning: this host is not the master for %s", 625 yppush_mapname); 626#ifdef NITPICKY 627 yppush_exit(1); 628#endif 629 } 630 | 57#endif 58 59char *progname = "yppush"; 60int debug = 1; 61int _rpcpmstart = 0; 62char *yp_dir = _PATH_YP; 63 64char *yppush_mapname = NULL; /* Map to transfer. */ --- 558 unchanged lines hidden (view full) --- 623 if (strncmp(myname, data.data, data.size)) { 624 yp_error("warning: this host is not the master for %s", 625 yppush_mapname); 626#ifdef NITPICKY 627 yppush_exit(1); 628#endif 629 } 630 |
631 yppush_master = strdup(data.data); | 631 yppush_master = malloc(data.size + 1); 632 strncpy(yppush_master, data.data, data.size); |
632 yppush_master[data.size] = '\0'; 633 634 /* Install some handy handlers. */ 635 signal(SIGALRM, handler); 636 signal(SIGTERM, handler); 637 signal(SIGINT, handler); 638 signal(SIGABRT, handler); 639 --- 47 unchanged lines hidden --- | 633 yppush_master[data.size] = '\0'; 634 635 /* Install some handy handlers. */ 636 signal(SIGALRM, handler); 637 signal(SIGTERM, handler); 638 signal(SIGINT, handler); 639 signal(SIGABRT, handler); 640 --- 47 unchanged lines hidden --- |