--- portmap_4/portmap.c.orig	2004-08-12 10:48:13.405000000 -0400
+++ portmap_4/portmap.c	2004-08-12 10:58:13.666000000 -0400
@@ -126,6 +126,7 @@
 static void callit();
 struct pmaplist *pmaplist;
 int debugging = 0;
+int localhost_only = 0;
 
 #include "pmap_check.h"
 
@@ -140,13 +141,17 @@
 	int len = sizeof(struct sockaddr_in);
 	register struct pmaplist *pml;
 
-	while ((c = getopt(argc, argv, "dv")) != EOF) {
+	while ((c = getopt(argc, argv, "dlv")) != EOF) {
 		switch (c) {
 
 		case 'd':
 			debugging = 1;
 			break;
 
+		case 'l':
+			localhost_only = 1;
+			break;
+
 		case 'v':
 			verboselog = 1;
 			break;
@@ -154,6 +159,7 @@
 		default:
 			(void) fprintf(stderr, "usage: %s [-dv]\n", argv[0]);
 			(void) fprintf(stderr, "-d: debugging mode\n");
+			(void) fprintf(stderr, "-l: listen on localhost only\n");
 			(void) fprintf(stderr, "-v: verbose logging\n");
 			exit(1);
 		}
@@ -176,7 +182,12 @@
 		exit(1);
 	}
 
-	addr.sin_addr.s_addr = 0;
+    if (localhost_only) {
+        addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+        syslog(LOG_NOTICE, "Only binding to LOOPBACK address!");
+    } else {
+        addr.sin_addr.s_addr = 0;
+    }
 	addr.sin_family = AF_INET;
 	addr.sin_port = htons(PMAPPORT);
 	if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
