summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-10-13 11:22:39 +0000
committercharnier <charnier@FreeBSD.org>1997-10-13 11:22:39 +0000
commit8459f389a168bc4c5109f83e755a73813f58b8bb (patch)
tree34d312378554ef5de4d8763fd35100eb424ff996
parent67de6ed0a2d20541b0f95abf9e5e36e1b8d32de4 (diff)
downloadFreeBSD-src-8459f389a168bc4c5109f83e755a73813f58b8bb.zip
FreeBSD-src-8459f389a168bc4c5109f83e755a73813f58b8bb.tar.gz
Use err(3). Remove multiply defined Id string.
-rw-r--r--usr.sbin/rpc.ypupdated/update.c13
-rw-r--r--usr.sbin/rpc.ypupdated/yp_dbdelete.c13
-rw-r--r--usr.sbin/rpc.ypupdated/yp_dbupdate.c11
-rw-r--r--usr.sbin/rpc.ypupdated/ypupdated_main.c17
-rw-r--r--usr.sbin/rpc.ypupdated/ypupdated_server.c11
-rw-r--r--usr.sbin/rpc.ypxfrd/rpc.ypxfrd.823
-rw-r--r--usr.sbin/rpc.ypxfrd/ypxfrd_main.c29
-rw-r--r--usr.sbin/rpc.ypxfrd/ypxfrd_server.c8
8 files changed, 61 insertions, 64 deletions
diff --git a/usr.sbin/rpc.ypupdated/update.c b/usr.sbin/rpc.ypupdated/update.c
index d6e142f..5b11d83 100644
--- a/usr.sbin/rpc.ypupdated/update.c
+++ b/usr.sbin/rpc.ypupdated/update.c
@@ -27,9 +27,14 @@
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
+
#ifndef lint
+#if 0
static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro";
#endif
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
/*
* Copyright (C) 1986, 1989, Sun Microsystems, Inc.
@@ -64,15 +69,7 @@ static char sccsid[] = "@(#)update.c 1.2 91/03/11 Copyr 1986 Sun Micro";
#define YPOP_STORE 4 /* add, or change */
#endif
-#ifdef notdef
-extern char *getpass();
-extern char *malloc();
-#endif
-
#ifdef YP
-#ifdef notdef
-static char *basename();
-#endif
static char SHELL[] = "/bin/sh";
static char YPDBPATH[]="/var/yp"; /* This is defined but not used! */
static char PKMAP[] = "publickey.byname";
diff --git a/usr.sbin/rpc.ypupdated/yp_dbdelete.c b/usr.sbin/rpc.ypupdated/yp_dbdelete.c
index 622b445..304db74 100644
--- a/usr.sbin/rpc.ypupdated/yp_dbdelete.c
+++ b/usr.sbin/rpc.ypupdated/yp_dbdelete.c
@@ -28,10 +28,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: yp_dbdelete.c,v 1.1 1996/12/26 05:43:03 wpaul Exp wpaul $
- *
*/
+
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -45,10 +48,6 @@
#include <rpcsvc/yp.h>
#include "ypxfr_extern.h"
-#ifndef lint
-static const char rcsid[] = "$Id: yp_dbdelete.c,v 1.1 1996/12/26 05:43:03 wpaul Exp wpaul $";
-#endif
-
int yp_del_record(dbp,key)
DB *dbp;
DBT *key;
diff --git a/usr.sbin/rpc.ypupdated/yp_dbupdate.c b/usr.sbin/rpc.ypupdated/yp_dbupdate.c
index 5a395bb..db84c77 100644
--- a/usr.sbin/rpc.ypupdated/yp_dbupdate.c
+++ b/usr.sbin/rpc.ypupdated/yp_dbupdate.c
@@ -28,10 +28,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: yp_dbupdate.c,v 1.1 1996/12/26 06:00:13 wpaul Exp $
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <sys/fcntl.h>
#include <stdio.h>
@@ -46,10 +49,6 @@ struct dom_binding {};
#include "ypxfr_extern.h"
#include "ypupdated_extern.h"
-#ifndef lint
-static const char rcsid[] = "$Id: yp_dbupdate.c,v 1.1 1996/12/26 06:00:13 wpaul Exp $";
-#endif
-
static int yp_domake(map, domain)
char *map;
char *domain;
diff --git a/usr.sbin/rpc.ypupdated/ypupdated_main.c b/usr.sbin/rpc.ypupdated/ypupdated_main.c
index 95bc51d..854f611 100644
--- a/usr.sbin/rpc.ypupdated/ypupdated_main.c
+++ b/usr.sbin/rpc.ypupdated/ypupdated_main.c
@@ -28,10 +28,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: ypupdated_main.c,v 1.1 1996/12/25 19:31:28 wpaul Exp wpaul $
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include "ypupdate_prot.h"
#include <stdio.h>
#include <stdlib.h> /* getenv, exit */
@@ -63,9 +66,6 @@
#endif
#define _RPCSVC_CLOSEDOWN 120
-#ifndef lint
-static const char rcsid[] = "$Id: ypupdated_main.c,v 1.1 1996/12/25 19:31:28 wpaul Exp wpaul $";
-#endif /* not lint */
int _rpcpmstart; /* Started by a port monitor ? */
static int _rpcfdtype;
/* Whether Stream or Datagram ? */
@@ -87,7 +87,7 @@ void _msgout(char* msg)
if (_rpcpmstart)
syslog(LOG_ERR, msg);
else
- (void) fprintf(stderr, "%s\n", msg);
+ warnx("%s", msg);
#else
syslog(LOG_ERR, msg);
#endif
@@ -146,7 +146,7 @@ ypupdated_svc_run()
if (errno == EINTR) {
continue;
}
- perror("svc_run: - select failed");
+ warn("svc_run: - select failed");
return;
case 0:
continue;
@@ -181,10 +181,11 @@ static void reaper(sig)
void usage()
{
- fprintf(stderr, "%s [-p path]\n", progname);
+ fprintf(stderr, "rpc.ypupdatedd [-p path]\n");
exit(0);
}
+int
main(argc, argv)
int argc;
char *argv[];
diff --git a/usr.sbin/rpc.ypupdated/ypupdated_server.c b/usr.sbin/rpc.ypupdated/ypupdated_server.c
index 11b007e..4741c56 100644
--- a/usr.sbin/rpc.ypupdated/ypupdated_server.c
+++ b/usr.sbin/rpc.ypupdated/ypupdated_server.c
@@ -34,10 +34,13 @@
* Written by Bill Paul <wpaul@ctr.columbia.edu>
* Center for Telecommunications Research
* Columbia University, New York City
- *
- * $Id: ypupdated_server.c,v 1.3 1996/12/26 06:06:05 wpaul Exp wpaul $
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <stdio.h>
#include <rpc/rpc.h>
#include <rpc/auth_des.h>
@@ -50,10 +53,6 @@
#include "yp_extern.h"
#include "ypxfr_extern.h"
-#ifndef lint
-static const char rcsid[] = "$Id: ypupdated_server.c,v 1.3 1996/12/26 06:06:05 wpaul Exp wpaul $";
-#endif
-
int children = 0;
int forked = 0;
diff --git a/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8 b/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
index cba9879..5a403cc 100644
--- a/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
+++ b/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id$
+.\" $Id: rpc.ypxfrd.8,v 1.5 1997/02/22 16:13:01 peter Exp $
.\"
.Dd June 2, 1996
.Dt RPC.YPXFRD 8
@@ -41,7 +41,7 @@
.Op Fl p Ar path
.Sh DESCRIPTION
The
-.Nm rpc.ypxfrd
+.Nm
daemon is used to speed up the distribtion of very large NIS maps
from NIS master to NIS slave servers. The normal method for transfering
maps involves several steps:
@@ -83,18 +83,18 @@ and
.Pa passwd.by{name,uid} .
.Pp
The
-.Nm rpc.ypxfrd
+.Nm
server speeds up the transfer process by allowing NIS slave servers to
simply copy the master server's map files rather than building their
own from scratch. Simply put,
-.Nm rpc.ypxfrd
+.Nm
implements an RPC-based file transfer protocol. Transfering even
a multi-megabyte file in this fashion takes only a few seconds compared
to the several minutes it would take even a reasonably fast slave server
to build a new map from scratch.
.Pp
The
-.Nm rpc.ypxfrd
+.Nm
server uses the same access restriction mechanism as
.Xr ypserv 8 .
This means that slave servers will only be permitted to transfer
@@ -105,9 +105,8 @@ ports will be allowed to transfer the
.Pa master.passwd
maps.
.Sh OPTIONS
-The following options and flags are supported by
-.Nm rpc.ypxfrd :
-.Bl -tag -width flag
+The following option is available:
+.Bl -tag -width indent
.It Fl p Ar path
This option can be used to override the default path to
the location of the NIS
@@ -125,15 +124,17 @@ The NIS maps for a particular NIS domain.
.Xr ypserv 8 ,
.Xr ypxfr 8
.Sh BUGS
-The FreeBSD
+The
+.Bx Free
.Nm ypxfrd
protocol is not compatible with that used by SunOS. This is unfortunate
but unavoidable: Sun's protocol is not freely available, and even if it
were it would probably not be useful since the SunOS NIS v2 implementation
-uses the original ndbm package for its map databases whereas the FreeBSD
+uses the original ndbm package for its map databases whereas the
+.Bx Free
implementation uses Berkeley DB. These two packages use vastly different
file formats. Furthermore, ndbm is byte-order sensitive and not very
smart about it, meaning that am ndbm database created on a big endian
system can't be read on a little endian system.
.Sh AUTHOR
-Bill Paul <wpaul@ctr.columbia.edu>
+.An Bill Paul Aq wpaul@ctr.columbia.edu
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
index 126f338..5168409 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c
@@ -28,11 +28,16 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: ypxfrd_main.c,v 1.4 1997/03/11 15:56:48 peter Exp $
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include "ypxfrd.h"
+#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h> /* getenv, exit */
#include <unistd.h>
@@ -60,9 +65,6 @@
#endif
#define _RPCSVC_CLOSEDOWN 120
-#ifndef lint
-static const char rcsid[] = "$Id: ypxfrd_main.c,v 1.4 1997/03/11 15:56:48 peter Exp $";
-#endif /* not lint */
int _rpcpmstart; /* Started by a port monitor ? */
static int _rpcfdtype;
/* Whether Stream or Datagram ? */
@@ -84,7 +86,7 @@ void _msgout(char* msg)
if (_rpcpmstart)
syslog(LOG_ERR, msg);
else
- (void) fprintf(stderr, "%s\n", msg);
+ warnx("%s", msg);
#else
syslog(LOG_ERR, msg);
#endif
@@ -144,7 +146,7 @@ ypxfrd_svc_run()
if (errno == EINTR) {
continue;
}
- perror("svc_run: - select failed");
+ warn("svc_run: - select failed");
return;
case 0:
continue;
@@ -177,17 +179,18 @@ static void reaper(sig)
void usage()
{
- fprintf(stderr, "%s [-p path]\n", progname);
+ fprintf(stderr, "usage: rpc.ypxfrd [-p path]\n");
exit(0);
}
+int
main(argc, argv)
int argc;
char *argv[];
{
- register SVCXPRT *transp;
+ register SVCXPRT *transp = NULL;
int sock;
- int proto;
+ int proto = 0;
struct sockaddr_in saddr;
int asize = sizeof (saddr);
int ch;
@@ -223,10 +226,8 @@ main(argc, argv)
int pid, i;
pid = fork();
- if (pid < 0) {
- perror("cannot fork");
- exit(1);
- }
+ if (pid < 0)
+ err(1, "fork");
if (pid)
exit(0);
size = getdtablesize();
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
index fd98615..a8fe278 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
@@ -28,15 +28,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id: ypxfrd_server.c,v 1.5 1997/04/10 13:48:59 wpaul Exp $
*/
-#include "ypxfrd.h"
#ifndef lint
-static const char rcsid[] = "$Id: ypxfrd_server.c,v 1.5 1997/04/10 13:48:59 wpaul Exp $";
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
+#include "ypxfrd.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
OpenPOWER on IntegriCloud