summaryrefslogtreecommitdiffstats
path: root/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sockets.c b/sockets.c
index 812e4f8..7164904 100644
--- a/sockets.c
+++ b/sockets.c
@@ -67,6 +67,13 @@ struct timeval
#include <fcntl.h>
#include <errno.h>
+#ifdef USE_LIBWRAP
+#include <syslog.h>
+#include <tcpd.h>
+int allow_severity=LOG_INFO;
+int deny_severity=LOG_WARNING;
+#endif
+
#include "rfb.h"
/*#ifndef WIN32
@@ -223,6 +230,16 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
return;
}
+#ifdef USE_LIBWRAP
+ if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr),
+ STRING_UNKNOWN)) {
+ rfbLog("Rejected connection from client %s\n",
+ inet_ntoa(addr.sin_addr));
+ close(sock);
+ return;
+ }
+#endif
+
rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr));
rfbNewClient(rfbScreen,sock);