summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.ypxfrd
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1997-04-10 13:48:59 +0000
committerwpaul <wpaul@FreeBSD.org>1997-04-10 13:48:59 +0000
commit261bc7b5748c505961797f88858cc5dd45f7f6ae (patch)
tree9e0d83c41809715d969252e36ecd103efc28dde0 /usr.sbin/rpc.ypxfrd
parentd276e13d26bfc0ec77707ee42b13aca1bdb75b83 (diff)
downloadFreeBSD-src-261bc7b5748c505961797f88858cc5dd45f7f6ae.zip
FreeBSD-src-261bc7b5748c505961797f88858cc5dd45f7f6ae.tar.gz
Add extra paranoia test. In theory this doesn't really gain you anything,
but the extra warning message could be useful.
Diffstat (limited to 'usr.sbin/rpc.ypxfrd')
-rw-r--r--usr.sbin/rpc.ypxfrd/ypxfrd_server.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
index 85d1da2..bfac1b1 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
@@ -29,12 +29,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ypxfrd_server.c,v 1.4 1997/02/22 16:13:03 peter Exp $
*/
#include "ypxfrd.h"
#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 */
#include <stdio.h>
@@ -89,10 +89,20 @@ ypxfrd_getmap_1_svc(ypxfr_mapname *argp, struct svc_req *rqstp)
{
static struct xfr result;
char buf[MAXPATHLEN];
+ struct sockaddr_in *rqhost;
result.ok = FALSE;
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)) {
return(&result);
}
OpenPOWER on IntegriCloud