Avoid processing obviously bogus domain names in the YPBINDPROC_DOMAIN

and YPBINDPROC_SETDOM procedures.
This commit is contained in:
Bill Paul 1997-04-10 14:18:03 +00:00
parent 832035088b
commit fcccefae4a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24782

View File

@ -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) {