FreeBSD Bugzilla – Attachment 478 Details for
Bug 2090
[patch] [nis] clients may bind to FreeBSD ypserv refusing to serve them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.58 KB, created by
Tor Egge
on 1996-11-23 04:40:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Tor Egge
Created:
1996-11-23 04:40:09 UTC
Size:
3.58 KB
patch
obsolete
>Index: Makefile >=================================================================== >RCS file: /export/akg1/cvs/src/usr.sbin/portmap/Makefile,v >retrieving revision 1.4 >diff -c -r1.4 Makefile >*** Makefile 1994/09/29 09:36:16 1.4 >--- Makefile 1996/11/23 03:47:43 >*************** >*** 2,11 **** > > PROG= portmap > MAN8= portmap.8 >! SRCS= portmap.c from_local.c pmap_check.c > SUBDIR= pmap_set pmap_dump > > # -DHOSTS_ACCESS (requires tcpwrapper libraries) >! CFLAGS+=-DCHECK_PORT > > .include <bsd.prog.mk> >--- 2,12 ---- > > PROG= portmap > MAN8= portmap.8 >! SRCS= portmap.c from_local.c pmap_check.c yp_access.c yp_error.c > SUBDIR= pmap_set pmap_dump >+ .PATH: ${.CURDIR}/../ypserv > > # -DHOSTS_ACCESS (requires tcpwrapper libraries) >! CFLAGS+=-DCHECK_PORT -I${.CURDIR}/../ypserv > > .include <bsd.prog.mk> >Index: portmap.c >=================================================================== >RCS file: /export/akg1/cvs/src/usr.sbin/portmap/portmap.c,v >retrieving revision 1.4 >diff -c -r1.4 portmap.c >*** portmap.c 1996/02/05 15:35:41 1.4 >--- portmap.c 1996/11/23 04:01:09 >*************** >*** 95,100 **** >--- 95,101 ---- > #include <sys/resource.h> > > #include "pmap_check.h" >+ #include "yp_extern.h" > > void reg_service(); > void reap(); >*************** >*** 103,108 **** >--- 104,114 ---- > int debugging = 0; > extern int errno; > >+ char *yp_dir = _PATH_YP; >+ int debug = 0; >+ char *progname = "portmap"; >+ int _rpcpmstart; /* Started by a port monitor ? */ >+ > main(argc, argv) > int argc; > char **argv; >*************** >*** 113,136 **** > int len = sizeof(struct sockaddr_in); > register struct pmaplist *pml; > >! while ((c = getopt(argc, argv, "dv")) != EOF) { > switch (c) { > > case 'd': > debugging = 1; > break; > > case 'v': > verboselog = 1; > break; > > default: >! (void) fprintf(stderr, "usage: %s [-dv]\n", argv[0]); > (void) fprintf(stderr, "-d: debugging mode\n"); > (void) fprintf(stderr, "-v: verbose logging\n"); > exit(1); > } > } > > if (!debugging && daemon(0, 0)) { > (void) fprintf(stderr, "portmap: fork: %s", strerror(errno)); >--- 119,148 ---- > int len = sizeof(struct sockaddr_in); > register struct pmaplist *pml; > >! while ((c = getopt(argc, argv, "dvp:")) != EOF) { > switch (c) { > > case 'd': > debugging = 1; >+ debug = 1; > break; > > case 'v': > verboselog = 1; > break; >+ case 'p': >+ yp_dir = optarg; >+ break; > > default: >! (void) fprintf(stderr, "usage: %s [-dv] [-p path]\n", argv[0]); > (void) fprintf(stderr, "-d: debugging mode\n"); > (void) fprintf(stderr, "-v: verbose logging\n"); >+ (void) fprintf(stderr, "-p: specify NIS directory\n"); > exit(1); > } > } >+ load_securenets(); > > if (!debugging && daemon(0, 0)) { > (void) fprintf(stderr, "portmap: fork: %s", strerror(errno)); >*************** >*** 524,529 **** >--- 536,546 ---- > return (xdr_opaque_parms(xdrs, cap)); > } > >+ /* Explicit #defines in case the include files are not available. */ >+ >+ #define YPPROG ((u_long) 100004) >+ #define YPPROC_DOMAIN_NONACK ((u_long) 2) >+ > /* > * Call a remote procedure service > * This procedure is very quiet when things go wrong. >*************** >*** 558,563 **** >--- 575,588 ---- > if (!check_callit(svc_getcaller(xprt), > rqstp->rq_proc, a.rmt_prog, a.rmt_proc)) > return; >+ >+ /* Avoid lying to naive ypbind implementations */ >+ if (a.rmt_prog==YPPROG && a.rmt_proc == YPPROC_DOMAIN_NONACK && >+ yp_access(NULL, (struct svc_req *)rqstp)) { >+ return; >+ } >+ >+ > if ((pml = find_service(a.rmt_prog, a.rmt_vers, > (u_long)IPPROTO_UDP)) == NULL) > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2090
: 478