Avoid processing obviously bogus domain names in the YPBINDPROC_DOMAIN
and YPBINDPROC_SETDOM procedures.
This commit is contained in:
parent
2d779f05ef
commit
052a702922
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user