summaryrefslogtreecommitdiffstats
path: root/x11vnc/sslhelper.c
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-12-07 09:15:22 -0500
committerrunge <runge@karlrunge.com>2009-12-07 09:15:22 -0500
commit8f5c9ef01ef9101cf8f8d8f1eacdaab27ac7c2c8 (patch)
treeb56c0f6b003075bffc43cae033c647ab31eeff60 /x11vnc/sslhelper.c
parent6153bd69835da0e7217ae844bdba4e2ba676f981 (diff)
downloadlibtdevnc-8f5c9ef01ef9101cf8f8d8f1eacdaab27ac7c2c8.tar.gz
libtdevnc-8f5c9ef01ef9101cf8f8d8f1eacdaab27ac7c2c8.zip
X11VNC_EXTRA_HTTPS_PARAMS, X11VNC_HTTP_LISTEN_LOCALHOST, X11VNC_REOPEN_SLEEP_MAX,
-findauth/-auth guess FD_XDM=1 for root, work around xhost SI:localuser:root.
Diffstat (limited to 'x11vnc/sslhelper.c')
-rw-r--r--x11vnc/sslhelper.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/x11vnc/sslhelper.c b/x11vnc/sslhelper.c
index 12f5819..b36c7fd 100644
--- a/x11vnc/sslhelper.c
+++ b/x11vnc/sslhelper.c
@@ -3626,8 +3626,26 @@ void accept_openssl(int mode, int presock) {
* the rest of the SSL session to it:
*/
if (n > 0) {
- if (db) fprintf(stderr, "sending http buffer httpsock: %d\n'%s'\n", httpsock, buf);
- write(httpsock, buf, n);
+ char *s = getenv("X11VNC_EXTRA_HTTPS_PARAMS");
+ int did_extra = 0;
+
+ if (db) fprintf(stderr, "sending http buffer httpsock: %d n=%d\n'%s'\n", httpsock, n, buf);
+ if (s != NULL) {
+ char *q = strstr(buf, " HTTP/");
+ if (q) {
+ int m;
+ *q = '\0';
+ m = strlen(buf);
+ write(httpsock, buf, m);
+ write(httpsock, s, strlen(s));
+ *q = ' ';
+ write(httpsock, q, n-m);
+ did_extra = 1;
+ }
+ }
+ if (!did_extra) {
+ write(httpsock, buf, n);
+ }
}
ssl_xfer(httpsock, s_in, s_out, is_http);
rfbLog("SSL: ssl_helper[%d]: exit case 6 (https ssl_xfer done)\n", getpid());