Deleted Added
full compact
rpcbind.c (108533) rpcbind.c (109363)
1/* $NetBSD: rpcbind.c,v 1.1 2000/06/02 23:15:42 fvdl Exp $ */
2/* $FreeBSD: head/usr.sbin/rpcbind/rpcbind.c 108533 2003-01-01 18:49:04Z schweikh $ */
1/* $NetBSD: rpcbind.c,v 1.3 2002/11/08 00:16:40 fvdl Exp $ */
2/* $FreeBSD: head/usr.sbin/rpcbind/rpcbind.c 109363 2003-01-16 07:27:30Z mbr $ */
3
4/*
5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6 * unrestricted use provided that this legend is included on all tape
7 * media and as a part of the software program in whole or part. Users
8 * may copy or modify Sun RPC without charge, but are not authorized
9 * to license or distribute it to anyone else except as part of a product or
10 * program developed by the user.

--- 41 unchanged lines hidden (view full) ---

52#include <sys/errno.h>
53#include <sys/time.h>
54#include <sys/resource.h>
55#include <sys/wait.h>
56#include <sys/signal.h>
57#include <sys/socket.h>
58#include <sys/un.h>
59#include <rpc/rpc.h>
3
4/*
5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
6 * unrestricted use provided that this legend is included on all tape
7 * media and as a part of the software program in whole or part. Users
8 * may copy or modify Sun RPC without charge, but are not authorized
9 * to license or distribute it to anyone else except as part of a product or
10 * program developed by the user.

--- 41 unchanged lines hidden (view full) ---

52#include <sys/errno.h>
53#include <sys/time.h>
54#include <sys/resource.h>
55#include <sys/wait.h>
56#include <sys/signal.h>
57#include <sys/socket.h>
58#include <sys/un.h>
59#include <rpc/rpc.h>
60#include <rpc/rpc_com.h>
60#ifdef PORTMAP
61#include <netinet/in.h>
62#endif
63#include <arpa/inet.h>
64#include <fcntl.h>
65#include <netdb.h>
66#include <stdio.h>
67#include <netconfig.h>

--- 51 unchanged lines hidden (view full) ---

119static void parseargs __P((int, char *[]));
120
121int
122main(int argc, char *argv[])
123{
124 struct netconfig *nconf;
125 void *nc_handle; /* Net config handle */
126 struct rlimit rl;
61#ifdef PORTMAP
62#include <netinet/in.h>
63#endif
64#include <arpa/inet.h>
65#include <fcntl.h>
66#include <netdb.h>
67#include <stdio.h>
68#include <netconfig.h>

--- 51 unchanged lines hidden (view full) ---

120static void parseargs __P((int, char *[]));
121
122int
123main(int argc, char *argv[])
124{
125 struct netconfig *nconf;
126 void *nc_handle; /* Net config handle */
127 struct rlimit rl;
128 int maxrec = RPC_MAXDATASIZE;
127
128 parseargs(argc, argv);
129
130 /* Check that another rpcbind isn't already running. */
131 if ((rpcbindlockfd = (open(RPCBINDDLOCK,
132 O_RDONLY|O_CREAT, 0444))) == -1)
133 err(1, "%s", RPCBINDDLOCK);
134

--- 25 unchanged lines hidden (view full) ---

160
161 nconf = getnetconfigent("local");
162 if (nconf == NULL)
163 nconf = getnetconfigent("unix");
164 if (nconf == NULL) {
165 syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
166 exit(1);
167 }
129
130 parseargs(argc, argv);
131
132 /* Check that another rpcbind isn't already running. */
133 if ((rpcbindlockfd = (open(RPCBINDDLOCK,
134 O_RDONLY|O_CREAT, 0444))) == -1)
135 err(1, "%s", RPCBINDDLOCK);
136

--- 25 unchanged lines hidden (view full) ---

162
163 nconf = getnetconfigent("local");
164 if (nconf == NULL)
165 nconf = getnetconfigent("unix");
166 if (nconf == NULL) {
167 syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
168 exit(1);
169 }
170
171 rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
172
168 init_transport(nconf);
169
170 while ((nconf = getnetconfig(nc_handle))) {
171 if (nconf->nc_flag & NC_VISIBLE)
172 init_transport(nconf);
173 }
174 endnetconfig(nc_handle);
175

--- 250 unchanged lines hidden (view full) ---

426 (void) free(uaddr);
427 }
428#endif
429
430 if (nconf->nc_semantics != NC_TPI_CLTS)
431 listen(fd, SOMAXCONN);
432
433 my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
173 init_transport(nconf);
174
175 while ((nconf = getnetconfig(nc_handle))) {
176 if (nconf->nc_flag & NC_VISIBLE)
177 init_transport(nconf);
178 }
179 endnetconfig(nc_handle);
180

--- 250 unchanged lines hidden (view full) ---

431 (void) free(uaddr);
432 }
433#endif
434
435 if (nconf->nc_semantics != NC_TPI_CLTS)
436 listen(fd, SOMAXCONN);
437
438 my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr,
434 0, 0);
439 RPC_MAXDATASIZE, RPC_MAXDATASIZE);
435 if (my_xprt == (SVCXPRT *)NULL) {
436 syslog(LOG_ERR, "%s: could not create service",
437 nconf->nc_netid);
438 goto error;
439 }
440 }
441 if (!checkbind)
442 return 1;

--- 43 unchanged lines hidden (view full) ---

486 uaddr);
487 (void) free(uaddr);
488 }
489#endif
490
491 if (nconf->nc_semantics != NC_TPI_CLTS)
492 listen(fd, SOMAXCONN);
493
440 if (my_xprt == (SVCXPRT *)NULL) {
441 syslog(LOG_ERR, "%s: could not create service",
442 nconf->nc_netid);
443 goto error;
444 }
445 }
446 if (!checkbind)
447 return 1;

--- 43 unchanged lines hidden (view full) ---

491 uaddr);
492 (void) free(uaddr);
493 }
494#endif
495
496 if (nconf->nc_semantics != NC_TPI_CLTS)
497 listen(fd, SOMAXCONN);
498
494 my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, 0, 0);
499 my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE);
495 if (my_xprt == (SVCXPRT *)NULL) {
496 syslog(LOG_ERR, "%s: could not create service",
497 nconf->nc_netid);
498 goto error;
499 }
500 }
501
502#ifdef PORTMAP

--- 252 unchanged lines hidden ---
500 if (my_xprt == (SVCXPRT *)NULL) {
501 syslog(LOG_ERR, "%s: could not create service",
502 nconf->nc_netid);
503 goto error;
504 }
505 }
506
507#ifdef PORTMAP

--- 252 unchanged lines hidden ---