diff options
author | wpaul <wpaul@FreeBSD.org> | 1997-04-10 14:18:03 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1997-04-10 14:18:03 +0000 |
commit | 052a702922427e213dce37b35b17e76a72d73449 (patch) | |
tree | a1da75ab5b5377081f44ef290449f8c02169f29d /usr.sbin/ypbind | |
parent | 2d779f05ef5a96063b9545faad4b44e44cb258cb (diff) | |
download | FreeBSD-src-052a702922427e213dce37b35b17e76a72d73449.zip FreeBSD-src-052a702922427e213dce37b35b17e76a72d73449.tar.gz |
Avoid processing obviously bogus domain names in the YPBINDPROC_DOMAIN
and YPBINDPROC_SETDOM procedures.
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 858e625..fc8bc94 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -28,7 +28,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: ypbind.c,v 1.23 1997/02/22 16:14:56 peter Exp $"; #endif #include <sys/param.h> @@ -175,6 +175,12 @@ CLIENT *clnt; res.ypbind_status = YPBIND_FAIL_VAL; res.ypbind_resp_u.ypbind_error = YPBIND_ERR_NOSERV; + if (strchr(*argp, '/')) { + syslog(LOG_WARNING, "Domain name '%s' has embedded slash -- \ +rejecting.", *argp); + return(&res); + } + for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext) { if( strcmp(ypdb->dom_domain, *argp) == 0) break; @@ -236,6 +242,11 @@ CLIENT *clnt; { struct sockaddr_in *fromsin, bindsin; + if (strchr(argp->ypsetdom_domain, '/')) { + syslog(LOG_WARNING, "Domain name '%s' has embedded slash -- \ +rejecting.", argp->ypsetdom_domain); + return; + } fromsin = svc_getcaller(transp); switch(ypsetmode) { |