mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Add extra paranoia test. In theory this doesn't really gain you anything,
but the extra warning message could be useful.
This commit is contained in:
parent
401116d519
commit
d075eaa4da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24776
1 changed files with 12 additions and 2 deletions
|
@ -29,12 +29,12 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ypxfrd_server.c,v 1.4 1997/02/22 16:13:03 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ypxfrd.h"
|
#include "ypxfrd.h"
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] = "$Id$";
|
static const char rcsid[] = "$Id: ypxfrd_server.c,v 1.4 1997/02/22 16:13:03 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -89,10 +89,20 @@ ypxfrd_getmap_1_svc(ypxfr_mapname *argp, struct svc_req *rqstp)
|
||||||
{
|
{
|
||||||
static struct xfr result;
|
static struct xfr result;
|
||||||
char buf[MAXPATHLEN];
|
char buf[MAXPATHLEN];
|
||||||
|
struct sockaddr_in *rqhost;
|
||||||
|
|
||||||
result.ok = FALSE;
|
result.ok = FALSE;
|
||||||
result.xfr_u.xfrstat = XFR_DENIED;
|
result.xfr_u.xfrstat = XFR_DENIED;
|
||||||
|
|
||||||
|
rqhost = svc_getcaller(rqstp->rq_xprt);
|
||||||
|
|
||||||
|
if (ntohs(rqhost->sin_port) >= IPPORT_RESERVED) {
|
||||||
|
yp_error("%s:%d didn't use reserved port -- rejecting",
|
||||||
|
inet_ntoa(rqhost->sin_addr),
|
||||||
|
ntohs(rqhost->sin_port));
|
||||||
|
return(&result);
|
||||||
|
}
|
||||||
|
|
||||||
if (yp_validdomain(argp->xfrdomain)) {
|
if (yp_validdomain(argp->xfrdomain)) {
|
||||||
return(&result);
|
return(&result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue