summaryrefslogtreecommitdiffstats
path: root/x11vnc/connections.c
diff options
context:
space:
mode:
authorrunge <runge>2006-02-25 05:10:37 +0000
committerrunge <runge>2006-02-25 05:10:37 +0000
commit79310af7e7a289d2baf1bdc295daefdcc76ecc0e (patch)
treeda68674a1beef5ce0ba807187657ca5fe215f68c /x11vnc/connections.c
parentb7773ea6e683e5fcfae5bf020828596c5f90b7d3 (diff)
downloadlibtdevnc-79310af7e7a289d2baf1bdc295daefdcc76ecc0e.tar.gz
libtdevnc-79310af7e7a289d2baf1bdc295daefdcc76ecc0e.zip
x11vnc: -unixpw and -stunnel. Add clipboard to input control.
Diffstat (limited to 'x11vnc/connections.c')
-rw-r--r--x11vnc/connections.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/x11vnc/connections.c b/x11vnc/connections.c
index 4415f38..197d7d9 100644
--- a/x11vnc/connections.c
+++ b/x11vnc/connections.c
@@ -9,6 +9,7 @@
#include "solid.h"
#include "rates.h"
#include "screen.h"
+#include "unixpw.h"
/*
* routines for handling incoming, outgoing, etc connections
@@ -262,7 +263,7 @@ void set_client_input(char *str) {
}
*p = '\0';
p++;
- val = short_kmb(p);
+ val = short_kmbc(p);
cl_list = client_match(str);
@@ -504,6 +505,14 @@ static void client_gone(rfbClientPtr client) {
rfbLog("client_count: %d\n", client_count);
+ if (unixpw_in_progress && unixpw_client) {
+ if (client == unixpw_client) {
+ unixpw_in_progress = 0;
+ unixpw_client = NULL;
+ copy_screen();
+ }
+ }
+
if (no_autorepeat && client_count == 0) {
autorepeat(1, 0);
}
@@ -1518,6 +1527,8 @@ static void send_client_connect(void) {
*/
void check_connect_inputs(void) {
+ if (unixpw_in_progress) return;
+
/* flush any already set: */
send_client_connect();
@@ -1543,6 +1554,8 @@ void check_gui_inputs(void) {
char buf[VNC_CONNECT_MAX+1];
ssize_t nbytes;
+ if (unixpw_in_progress) return;
+
for (i=0; i<ICON_MODE_SOCKS; i++) {
if (icon_mode_socks[i] >= 0) {
socks[n++] = i;
@@ -1624,6 +1637,11 @@ enum rfbNewClientAction new_client(rfbClientPtr client) {
clients_served++;
+ if (unixpw && unixpw_in_progress) {
+ rfbLog("denying additional client: %s during -unixpw login.\n",
+ client->host);
+ return(RFB_CLIENT_REFUSE);
+ }
if (connect_once) {
if (screen->dontDisconnect && screen->neverShared) {
if (! shared && accepted_client) {
@@ -1696,6 +1714,14 @@ enum rfbNewClientAction new_client(rfbClientPtr client) {
accepted_client = 1;
last_client = time(0);
+ if (unixpw) {
+ unixpw_in_progress = 1;
+ unixpw_client = client;
+ unixpw_last_try_time = time(0);
+ unixpw_screen(1);
+ unixpw_keystroke(0, 0, 1);
+ }
+
return(RFB_CLIENT_ACCEPT);
}
@@ -1832,6 +1858,15 @@ void check_new_clients(void) {
rfbClientPtr cl;
int i, send_info = 0;
int run_after_accept = 0;
+
+ if (unixpw_in_progress) {
+ int present = 0;
+ if (time(0) > unixpw_last_try_time + 20) {
+ rfbLog("unixpw_deny: timed out waiting for reply.\n");
+ unixpw_deny();
+ return;
+ }
+ }
if (client_count == last_count) {
return;