Commit f1e8149a authored by runge's avatar runge

x11vnc: tightvnc filetransfer off by default. FINDCREATEDISPLAY geometry.

parent 241f3ed5
2007-02-15 Karl Runge <runge@karlrunge.com>
* x11vnc: tightvnc filetransfer off by default. avahi
fixes. FINDCREATEDISPLAY geometry. -noultraext.
2007-02-12 Karl Runge <runge@karlrunge.com> 2007-02-12 Karl Runge <runge@karlrunge.com>
* x11vnc: add avahi (aka mDNS/Zeroconf/Bonjour...) * x11vnc: add avahi (aka mDNS/Zeroconf/Bonjour...)
support thanks to Diego Petten. -avahi/-mdns. support thanks to Diego Petten. -avahi/-mdns.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -34,12 +34,36 @@ static AvahiEntryGroup *_group = NULL; ...@@ -34,12 +34,36 @@ static AvahiEntryGroup *_group = NULL;
static int db = 0; static int db = 0;
typedef struct {
const char *name;
const char *host;
uint16_t port;
} avahi_service_t;
typedef struct {
char *name;
char *host;
uint16_t port;
} avahi_reg_t;
#define NREG 16
static avahi_reg_t registered[NREG];
void avahi_initialise(void) { void avahi_initialise(void) {
int ret; int ret;
static int first = 1;
if (getenv("AVAHI_DEBUG")) { if (getenv("AVAHI_DEBUG")) {
db = 1; db = 1;
} }
if (first) {
int i;
for (i=0; i<NREG; i++) {
registered[i].name = NULL;
registered[i].host = NULL;
}
first = 0;
}
if (db) fprintf(stderr, "in avahi_initialise\n"); if (db) fprintf(stderr, "in avahi_initialise\n");
if (_poll) { if (_poll) {
...@@ -74,12 +98,6 @@ if (db) fprintf(stderr, " avahi_initialise: poll not null\n"); ...@@ -74,12 +98,6 @@ if (db) fprintf(stderr, " avahi_initialise: poll not null\n");
if (db) fprintf(stderr, "out avahi_initialise\n"); if (db) fprintf(stderr, "out avahi_initialise\n");
} }
typedef struct {
const char *name;
const char *host;
uint16_t port;
} avahi_service_t;
static void _avahi_create_services(const char *name, const char *host, static void _avahi_create_services(const char *name, const char *host,
const uint16_t port); const uint16_t port);
...@@ -159,7 +177,8 @@ if (db) fprintf(stderr, "out _avahi_create_services\n"); ...@@ -159,7 +177,8 @@ if (db) fprintf(stderr, "out _avahi_create_services\n");
} }
void avahi_advertise(const char *name, const char *host, const uint16_t port) { void avahi_advertise(const char *name, const char *host, const uint16_t port) {
if (db) fprintf(stderr, "in avahi_advertise\n"); int i;
if (db) fprintf(stderr, "in avahi_advertise: %s %s %d\n", name, host, port);
if (!_client) { if (!_client) {
if (db) fprintf(stderr, " avahi_advertise client null\n"); if (db) fprintf(stderr, " avahi_advertise client null\n");
return; return;
...@@ -168,6 +187,31 @@ if (db) fprintf(stderr, " avahi_advertise client null\n"); ...@@ -168,6 +187,31 @@ if (db) fprintf(stderr, " avahi_advertise client null\n");
rfbLog("Avahi poll not initialized.\n"); rfbLog("Avahi poll not initialized.\n");
return; return;
} }
/* well, we just track it ourselves... */
for (i=0; i<NREG; i++) {
if (!registered[i].name) {
continue;
}
if (strcmp(registered[i].name, name)) {
continue;
}
if (strcmp(registered[i].host, host)) {
continue;
}
if (registered[i].port != port) {
continue;
}
if (db) fprintf(stderr, " avahi_advertise already did this one\n");
return;
}
for (i=0; i<NREG; i++) {
if (!registered[i].name) {
registered[i].name = strdup(name);
registered[i].host = strdup(host);
registered[i].port = port;
break;
}
}
avahi_threaded_poll_lock(_poll); avahi_threaded_poll_lock(_poll);
_avahi_create_services(name, host, port >= 5900 ? port : 5900+port); _avahi_create_services(name, host, port >= 5900 ? port : 5900+port);
...@@ -176,7 +220,18 @@ if (db) fprintf(stderr, "out avahi_advertise\n"); ...@@ -176,7 +220,18 @@ if (db) fprintf(stderr, "out avahi_advertise\n");
} }
void avahi_reset(void) { void avahi_reset(void) {
int i;
if (db) fprintf(stderr, "in avahi_reset\n"); if (db) fprintf(stderr, "in avahi_reset\n");
for (i=0; i<NREG; i++) {
if (registered[i].name) {
free(registered[i].name);
registered[i].name = NULL;
}
if (registered[i].host) {
free(registered[i].host);
registered[i].host = NULL;
}
}
if (!_client || !_group) { if (!_client || !_group) {
if (db) fprintf(stderr, " avahi_reset client/group null\n"); if (db) fprintf(stderr, " avahi_reset client/group null\n");
return; return;
......
...@@ -658,7 +658,7 @@ void client_gone(rfbClientPtr client) { ...@@ -658,7 +658,7 @@ void client_gone(rfbClientPtr client) {
if (client == unixpw_client) { if (client == unixpw_client) {
unixpw_in_progress = 0; unixpw_in_progress = 0;
screen->permitFileTransfer = unixpw_file_xfer_save; screen->permitFileTransfer = unixpw_file_xfer_save;
if ((filexfer = unixpw_tightvnc_xfer_save)) { if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
rfbRegisterTightVNCFileTransferExtension(); rfbRegisterTightVNCFileTransferExtension();
#endif #endif
...@@ -2164,8 +2164,8 @@ enum rfbNewClientAction new_client(rfbClientPtr client) { ...@@ -2164,8 +2164,8 @@ enum rfbNewClientAction new_client(rfbClientPtr client) {
unixpw_file_xfer_save = screen->permitFileTransfer; unixpw_file_xfer_save = screen->permitFileTransfer;
screen->permitFileTransfer = FALSE; screen->permitFileTransfer = FALSE;
unixpw_tightvnc_xfer_save = filexfer; unixpw_tightvnc_xfer_save = tightfilexfer;
filexfer = 0; tightfilexfer = 0;
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
rfbUnregisterTightVNCFileTransferExtension(); rfbUnregisterTightVNCFileTransferExtension();
#endif #endif
......
...@@ -346,13 +346,13 @@ void print_help(int mode) { ...@@ -346,13 +346,13 @@ void print_help(int mode) {
" will cause it to abort. Specifying both -inetd and -q\n" " will cause it to abort. Specifying both -inetd and -q\n"
" and no -o will automatically close the stderr.\n" " and no -o will automatically close the stderr.\n"
"\n" "\n"
"-nofilexfer Disable the TightVNC file transfer extension. (same as\n" "-tightfilexfer Enable the TightVNC file transfer extension. Note that\n"
" -disablefiletransfer). Note that when the -viewonly\n" " that when the -viewonly option is supplied all file\n"
" option is supplied all file transfers are disabled.\n" " transfers are disabled. Also clients that log in\n"
" Also clients that log in viewonly cannot transfer files.\n" " viewonly cannot transfer files. However, if the remote\n"
" However, if the remote control mechanism is used to\n" " control mechanism is used to change the global or\n"
" change the global or per-client viewonly state the\n" " per-client viewonly state the filetransfer permissions\n"
" filetransfer permissions will NOT change.\n" " will NOT change.\n"
"\n" "\n"
"-ultrafilexfer Note, to *enable* UltraVNC filetransfer (currently\n" "-ultrafilexfer Note, to *enable* UltraVNC filetransfer (currently\n"
" disabled by default, this may change...) and to get it\n" " disabled by default, this may change...) and to get it\n"
...@@ -360,6 +360,11 @@ void print_help(int mode) { ...@@ -360,6 +360,11 @@ void print_help(int mode) {
" options: \"-rfbversion 3.6 -permitfiletransfer\"\n" " options: \"-rfbversion 3.6 -permitfiletransfer\"\n"
" \"-ultrafilexfer\" is an alias for this combination.\n" " \"-ultrafilexfer\" is an alias for this combination.\n"
"\n" "\n"
" Note that sadly you cannot do both -tightfilexfer and\n"
" -ultrafilexfer at the same time because the latter\n"
" requires setting the version to 3.6 and tightvnc will\n"
" not do filetransfer at that version number.\n"
"\n"
"-http Instead of using -httpdir (see below) to specify\n" "-http Instead of using -httpdir (see below) to specify\n"
" where the Java vncviewer applet is, have x11vnc try\n" " where the Java vncviewer applet is, have x11vnc try\n"
" to *guess* where the directory is by looking relative\n" " to *guess* where the directory is by looking relative\n"
...@@ -798,6 +803,12 @@ void print_help(int mode) { ...@@ -798,6 +803,12 @@ void print_help(int mode) {
" your long \"login:\" line press the Up arrow once\n" " your long \"login:\" line press the Up arrow once\n"
" (before typing anything else).\n" " (before typing anything else).\n"
"\n" "\n"
" Another option is \"geom=WxH\" or \"geom=WxHxD\"\n"
" (or ge=). This only has an effect in FINDCREATEDISPLAY\n"
" mode when a virtual X server such as Xvfb is going to\n"
" be created. It sets the width and height of the new\n"
" display, and optionally the color depth as well.\n"
"\n"
" To disable the option setting set the environment\n" " To disable the option setting set the environment\n"
" variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n" " variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.\n"
" To set any other options, the user can use the gui\n" " To set any other options, the user can use the gui\n"
...@@ -871,7 +882,7 @@ void print_help(int mode) { ...@@ -871,7 +882,7 @@ void print_help(int mode) {
" definitely getting a desktop (either real or virtual)\n" " definitely getting a desktop (either real or virtual)\n"
" on the machine. E.g. a desktop service:\n" " on the machine. E.g. a desktop service:\n"
"\n" "\n"
" 5915 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc\n" " 5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc\n"
" -inetd -q -http -ssl SAVE -unixpw -users unixpw=\\\n" " -inetd -q -http -ssl SAVE -unixpw -users unixpw=\\\n"
" -passwd secret -prog /.../x11vnc \\\n" " -passwd secret -prog /.../x11vnc \\\n"
" -display WAIT:cmd=FINDCREATEDISPLAY\n" " -display WAIT:cmd=FINDCREATEDISPLAY\n"
...@@ -2734,6 +2745,10 @@ void print_help(int mode) { ...@@ -2734,6 +2745,10 @@ void print_help(int mode) {
" monitor in dpms powered off state. Use this option to\n" " monitor in dpms powered off state. Use this option to\n"
" skip powering off the monitor.\n" " skip powering off the monitor.\n"
"\n" "\n"
"-noultraext Disable the following UltraVNC extensions: SingleWindow\n"
" and ServerInput. The others managed by libvncserver\n"
" (textchat, 1/n scaling, rfbEncodingUltra) are not.\n"
"\n"
"-noxdamage Do not use the X DAMAGE extension to detect framebuffer\n" "-noxdamage Do not use the X DAMAGE extension to detect framebuffer\n"
" changes even if it is available. Use -xdamage if your\n" " changes even if it is available. Use -xdamage if your\n"
" default is to have it off.\n" " default is to have it off.\n"
...@@ -3386,8 +3401,8 @@ void print_help(int mode) { ...@@ -3386,8 +3401,8 @@ void print_help(int mode) {
" timeout:n reset -timeout to n, if there are\n" " timeout:n reset -timeout to n, if there are\n"
" currently no clients, exit unless one\n" " currently no clients, exit unless one\n"
" connects in the next n secs.\n" " connects in the next n secs.\n"
" filexfer enable filetransfer for new clients.\n" " tightfilexfer enable filetransfer for new clients.\n"
" nofilexfer disable filetransfer for new clients.\n" " notightfilexfer disable filetransfer for new clients.\n"
/* access */ /* access */
" http enable http client connections.\n" " http enable http client connections.\n"
" nohttp disable http client connections.\n" " nohttp disable http client connections.\n"
...@@ -3600,6 +3615,8 @@ void print_help(int mode) { ...@@ -3600,6 +3615,8 @@ void print_help(int mode) {
" noclientdpms disable -clientdpms mode.\n" " noclientdpms disable -clientdpms mode.\n"
" noserverdpms enable -noserverdpms mode.\n" " noserverdpms enable -noserverdpms mode.\n"
" serverdpms disable -noserverdpms mode.\n" " serverdpms disable -noserverdpms mode.\n"
" noultraext enable -noultraext mode.\n"
" ultraext disable -noultraext mode.\n"
" xdamage enable xdamage polling hints.\n" " xdamage enable xdamage polling hints.\n"
" noxdamage disable xdamage polling hints.\n" " noxdamage disable xdamage polling hints.\n"
" xd_area:A set -xd_area max pixel area to \"A\"\n" " xd_area:A set -xd_area max pixel area to \"A\"\n"
......
...@@ -100,10 +100,10 @@ char *viewonly_passwd = NULL; /* view only passwd. */ ...@@ -100,10 +100,10 @@ char *viewonly_passwd = NULL; /* view only passwd. */
char **passwd_list = NULL; /* for -passwdfile */ char **passwd_list = NULL; /* for -passwdfile */
int begin_viewonly = -1; int begin_viewonly = -1;
int inetd = 0; /* spawned from inetd(8) */ int inetd = 0; /* spawned from inetd(8) */
#ifndef FILEXFER #ifndef TIGHTFILEXFER
#define FILEXFER 1 #define TIGHTFILEXFER 0
#endif #endif
int filexfer = FILEXFER; int tightfilexfer = TIGHTFILEXFER;
int first_conn_timeout = 0; /* -timeout */ int first_conn_timeout = 0; /* -timeout */
int flash_cmap = 0; /* follow installed colormaps */ int flash_cmap = 0; /* follow installed colormaps */
int shift_cmap = 0; /* ncells < 256 and needs shift of pixel values */ int shift_cmap = 0; /* ncells < 256 and needs shift of pixel values */
...@@ -364,6 +364,7 @@ int watch_dpms = 0; /* -dpms */ ...@@ -364,6 +364,7 @@ int watch_dpms = 0; /* -dpms */
int force_dpms = 0; int force_dpms = 0;
int client_dpms = 0; int client_dpms = 0;
int no_ultra_dpms = 0; int no_ultra_dpms = 0;
int no_ultra_ext = 0;
int watch_selection = 1; /* normal selection/cutbuffer maintenance */ int watch_selection = 1; /* normal selection/cutbuffer maintenance */
int watch_primary = 1; /* more dicey, poll for changes in PRIMARY */ int watch_primary = 1; /* more dicey, poll for changes in PRIMARY */
......
...@@ -78,7 +78,7 @@ extern char *viewonly_passwd; ...@@ -78,7 +78,7 @@ extern char *viewonly_passwd;
extern char **passwd_list; extern char **passwd_list;
extern int begin_viewonly; extern int begin_viewonly;
extern int inetd; extern int inetd;
extern int filexfer; extern int tightfilexfer;
extern int first_conn_timeout; extern int first_conn_timeout;
extern int flash_cmap; extern int flash_cmap;
extern int shift_cmap; extern int shift_cmap;
...@@ -266,6 +266,7 @@ extern int watch_dpms; ...@@ -266,6 +266,7 @@ extern int watch_dpms;
extern int force_dpms; extern int force_dpms;
extern int client_dpms; extern int client_dpms;
extern int no_ultra_dpms; extern int no_ultra_dpms;
extern int no_ultra_ext;
extern int watch_selection; extern int watch_selection;
extern int watch_primary; extern int watch_primary;
......
...@@ -1265,34 +1265,34 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -1265,34 +1265,34 @@ char *process_remote_cmd(char *cmd, int stringonly) {
first_conn_timeout = to; first_conn_timeout = to;
rfbLog("remote_cmd: set -timeout to %d\n", -to); rfbLog("remote_cmd: set -timeout to %d\n", -to);
} else if (!strcmp(p, "filexfer")) { } else if (!strcmp(p, "tightfilexfer")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, filexfer); snprintf(buf, bufn, "ans=%s:%d", p, tightfilexfer);
goto qry; goto qry;
} }
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
if (! filexfer) { if (! tightfilexfer) {
rfbLog("remote_cmd: enabling -filexfer for new clients.\n"); rfbLog("remote_cmd: enabling -tightfilexfer for new clients.\n");
filexfer = 1; tightfilexfer = 1;
rfbRegisterTightVNCFileTransferExtension(); rfbRegisterTightVNCFileTransferExtension();
} }
#else #else
rfbLog("remote_cmd: -filexfer not supported in this binary.\n"); rfbLog("remote_cmd: -tightfilexfer not supported in this binary.\n");
#endif #endif
} else if (!strcmp(p, "nofilexfer")) { } else if (!strcmp(p, "notightfilexfer")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !filexfer); snprintf(buf, bufn, "ans=%s:%d", p, !tightfilexfer);
goto qry; goto qry;
} }
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
if (filexfer) { if (tightfilexfer) {
rfbLog("remote_cmd: disabling -filexfer for new clients.\n"); rfbLog("remote_cmd: disabling -tightfilexfer for new clients.\n");
filexfer = 0; tightfilexfer = 0;
rfbUnregisterTightVNCFileTransferExtension(); rfbUnregisterTightVNCFileTransferExtension();
} }
#else #else
rfbLog("remote_cmd: -filexfer not supported in this binary.\n"); rfbLog("remote_cmd: -tightfilexfer not supported in this binary.\n");
#endif #endif
} else if (!strcmp(p, "deny") || !strcmp(p, "lock")) { } else if (!strcmp(p, "deny") || !strcmp(p, "lock")) {
...@@ -3689,6 +3689,21 @@ char *process_remote_cmd(char *cmd, int stringonly) { ...@@ -3689,6 +3689,21 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: turning off -noserverdpms mode.\n"); rfbLog("remote_cmd: turning off -noserverdpms mode.\n");
no_ultra_dpms = 0; no_ultra_dpms = 0;
} else if (!strcmp(p, "noultraext")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, no_ultra_ext);
goto qry;
}
rfbLog("remote_cmd: turning on -noultraext mode.\n");
no_ultra_ext = 1;
} else if (!strcmp(p, "ultraext")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !no_ultra_ext);
goto qry;
}
rfbLog("remote_cmd: turning off -noultraext mode.\n");
no_ultra_ext = 0;
} else if (strstr(p, "fs") == p) { } else if (strstr(p, "fs") == p) {
COLON_CHECK("fs:") COLON_CHECK("fs:")
if (query) { if (query) {
......
...@@ -2477,6 +2477,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { ...@@ -2477,6 +2477,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
rfbLog("\n"); rfbLog("\n");
rfbLog("removed: -hints, -nohints\n"); rfbLog("removed: -hints, -nohints\n");
rfbLog("removed: -cursorposall\n"); rfbLog("removed: -cursorposall\n");
rfbLog("removed: -nofilexfer, now the default.\n");
rfbLog("\n"); rfbLog("\n");
rfbLog("renamed: -old_copytile, use -onetile\n"); rfbLog("renamed: -old_copytile, use -onetile\n");
rfbLog("renamed: -mouse, use -cursor\n"); rfbLog("renamed: -mouse, use -cursor\n");
......
...@@ -1234,6 +1234,18 @@ char create_display[] = ...@@ -1234,6 +1234,18 @@ char create_display[] =
"depth=${depth:-16}\n" "depth=${depth:-16}\n"
"geom=${geom:-1280x1024}\n" "geom=${geom:-1280x1024}\n"
"\n" "\n"
"if [ \"X$FD_GEOM\" != \"X\" -a \"X$FD_GEOM\" != \"XNONE\" ]; then\n"
" x1=`echo \"$FD_GEOM\" | awk -Fx '{print $1}'`\n"
" y1=`echo \"$FD_GEOM\" | awk -Fx '{print $2}'`\n"
" d1=`echo \"$FD_GEOM\" | awk -Fx '{print $3}'`\n"
" if [ \"X$x1\" != \"X\" -a \"X$y1\" != \"X\" ]; then\n"
" geom=\"${x1}x${y1}\"\n"
" fi\n"
" if [ \"X$d1\" != \"X\" ]; then\n"
" depth=\"${d1}\"\n"
" fi\n"
"fi\n"
"\n"
"if [ \"X$USER\" = \"X\" ]; then\n" "if [ \"X$USER\" = \"X\" ]; then\n"
" USER=$LOGNAME\n" " USER=$LOGNAME\n"
"fi\n" "fi\n"
......
...@@ -337,6 +337,7 @@ Permissions ...@@ -337,6 +337,7 @@ Permissions
forcedpms forcedpms
clientdpms clientdpms
noserverdpms noserverdpms
noultraext
=GAL LOFF =GAL LOFF
Tuning Tuning
......
...@@ -348,6 +348,7 @@ char gui_code[] = ""; ...@@ -348,6 +348,7 @@ char gui_code[] = "";
" forcedpms\n" " forcedpms\n"
" clientdpms\n" " clientdpms\n"
" noserverdpms\n" " noserverdpms\n"
" noultraext\n"
" =GAL LOFF\n" " =GAL LOFF\n"
"\n" "\n"
"Tuning\n" "Tuning\n"
......
...@@ -1553,7 +1553,7 @@ void unixpw_accept(char *user) { ...@@ -1553,7 +1553,7 @@ void unixpw_accept(char *user) {
} }
unixpw_in_progress = 0; unixpw_in_progress = 0;
screen->permitFileTransfer = unixpw_file_xfer_save; screen->permitFileTransfer = unixpw_file_xfer_save;
if ((filexfer = unixpw_tightvnc_xfer_save)) { if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
rfbRegisterTightVNCFileTransferExtension(); rfbRegisterTightVNCFileTransferExtension();
#endif #endif
...@@ -1599,7 +1599,7 @@ void unixpw_deny(void) { ...@@ -1599,7 +1599,7 @@ void unixpw_deny(void) {
unixpw_in_progress = 0; unixpw_in_progress = 0;
screen->permitFileTransfer = unixpw_file_xfer_save; screen->permitFileTransfer = unixpw_file_xfer_save;
if ((filexfer = unixpw_tightvnc_xfer_save)) { if ((tightfilexfer = unixpw_tightvnc_xfer_save)) {
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
rfbRegisterTightVNCFileTransferExtension(); rfbRegisterTightVNCFileTransferExtension();
#endif #endif
......
...@@ -1112,6 +1112,7 @@ void user_supplied_opts(char *opts) { ...@@ -1112,6 +1112,7 @@ void user_supplied_opts(char *opts) {
"clear_mods", "cm", "clear_keys", "ck", "repeat", "clear_mods", "cm", "clear_keys", "ck", "repeat",
"speeds", "sp", "readtimeout", "rd", "speeds", "sp", "readtimeout", "rd",
"rotate", "ro", "rotate", "ro",
"geometry", "geom", "ge",
NULL NULL
}; };
...@@ -1489,6 +1490,7 @@ if (0) db = 1; ...@@ -1489,6 +1490,7 @@ if (0) db = 1;
if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) { if (strstr(cmd, "FINDCREATEDISPLAY") == cmd) {
char *opts = strchr(cmd, '-'); char *opts = strchr(cmd, '-');
char st[] = ""; char st[] = "";
char geom[32];
if (opts) { if (opts) {
opts++; opts++;
if (strstr(opts, "xdmcp")) { if (strstr(opts, "xdmcp")) {
...@@ -1497,12 +1499,56 @@ if (0) db = 1; ...@@ -1497,12 +1499,56 @@ if (0) db = 1;
} else { } else {
opts = st; opts = st;
} }
sprintf(geom, "NONE");
#if 0
if (!keep_unixpw_opts) {
fprintf(stderr, "no keep_unixpw_opts\n");
} else {
fprintf(stderr, "keep_unixpw_opts: %s\n", keep_unixpw_opts);
}
#endif
if (unixpw && keep_unixpw_opts && keep_unixpw_opts[0] != '\0') {
char *q, *p, *t = strdup(keep_unixpw_opts);
q = strstr(t, "ge=");
if (! q) q = strstr(t, "geom=");
if (! q) q = strstr(t, "geometry=");
if (q) {
int ok = 1;
q = strstr(q, "=");
q++;
p = strstr(q, ",");
if (p) *p = '\0';
p = q;
while (*p) {
if (*p == 'x') {
;
} else if (isdigit((int) *p)) {
;
} else {
ok = 0;
break;
}
p++;
}
if (ok && strlen(q) < 32) {
sprintf(geom, q);
if (!quiet) {
rfbLog("set create display geom: %s\n", geom);
}
}
}
free(t);
}
set_env("FD_GEOM", geom);
if (unixpw && keep_unixpw_user) { if (unixpw && keep_unixpw_user) {
create_cmd = (char *) malloc(strlen(tmp) create_cmd = (char *) malloc(strlen(tmp)
+ strlen("env USER='' /bin/sh ") + strlen("env USER='' /bin/sh ")
+ strlen(keep_unixpw_user) + 1 + strlen(opts) + 1); + strlen("env FD_GEOM='' /bin/sh ")
sprintf(create_cmd, "env USER='%s' /bin/sh %s %s", + strlen(keep_unixpw_user) + 1
keep_unixpw_user, tmp, opts); + strlen(geom) + 1
+ strlen(opts) + 1);
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' /bin/sh %s %s",
keep_unixpw_user, geom, tmp, opts);
} else { } else {
create_cmd = (char *) malloc(strlen(tmp) create_cmd = (char *) malloc(strlen(tmp)
+ strlen("/bin/sh ") + 1 + strlen(opts) + 1); + strlen("/bin/sh ") + 1 + strlen(opts) + 1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "February 2007" "x11vnc " "User Commands" .TH X11VNC "1" "February 2007" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.8.5, lastmod: 2007-02-12 version: 0.8.5, lastmod: 2007-02-15
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -405,15 +405,15 @@ option, otherwise the stderr goes to the viewer which ...@@ -405,15 +405,15 @@ option, otherwise the stderr goes to the viewer which
will cause it to abort. Specifying both \fB-inetd\fR and \fB-q\fR will cause it to abort. Specifying both \fB-inetd\fR and \fB-q\fR
and no \fB-o\fR will automatically close the stderr. and no \fB-o\fR will automatically close the stderr.
.PP .PP
\fB-nofilexfer\fR \fB-tightfilexfer\fR
.IP .IP
Disable the TightVNC file transfer extension. (same as Enable the TightVNC file transfer extension. Note that
\fB-disablefiletransfer).\fR Note that when the \fB-viewonly\fR that when the \fB-viewonly\fR option is supplied all file
option is supplied all file transfers are disabled. transfers are disabled. Also clients that log in
Also clients that log in viewonly cannot transfer files. viewonly cannot transfer files. However, if the remote
However, if the remote control mechanism is used to control mechanism is used to change the global or
change the global or per-client viewonly state the per-client viewonly state the filetransfer permissions
filetransfer permissions will NOT change. will NOT change.
.PP .PP
\fB-ultrafilexfer\fR \fB-ultrafilexfer\fR
.IP .IP
...@@ -422,6 +422,11 @@ disabled by default, this may change...) and to get it ...@@ -422,6 +422,11 @@ disabled by default, this may change...) and to get it
to work you probably need to supply these libvncserver to work you probably need to supply these libvncserver
options: "\fB-rfbversion\fR \fI3.6 \fB-permitfiletransfer\fR"\fR options: "\fB-rfbversion\fR \fI3.6 \fB-permitfiletransfer\fR"\fR
"\fB-ultrafilexfer\fR" is an alias for this combination. "\fB-ultrafilexfer\fR" is an alias for this combination.
.IP
Note that sadly you cannot do both \fB-tightfilexfer\fR and
\fB-ultrafilexfer\fR at the same time because the latter
requires setting the version to 3.6 and tightvnc will
not do filetransfer at that version number.
.PP .PP
\fB-http\fR \fB-http\fR
.IP .IP
...@@ -945,6 +950,12 @@ type and enter your password incorrectly, to retrieve ...@@ -945,6 +950,12 @@ type and enter your password incorrectly, to retrieve
your long "login:" line press the Up arrow once your long "login:" line press the Up arrow once
(before typing anything else). (before typing anything else).
.IP .IP
Another option is "geom=WxH" or "geom=WxHxD"
(or ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going to
be created. It sets the width and height of the new
display, and optionally the color depth as well.
.IP
To disable the option setting set the environment To disable the option setting set the environment
variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc. variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc.
To set any other options, the user can use the gui To set any other options, the user can use the gui
...@@ -1022,7 +1033,7 @@ to provide a means of ...@@ -1022,7 +1033,7 @@ to provide a means of
definitely getting a desktop (either real or virtual) definitely getting a desktop (either real or virtual)
on the machine. E.g. a desktop service: on the machine. E.g. a desktop service:
.IP .IP
5915 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc 5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc
\fB-inetd\fR \fB-q\fR \fB-http\fR \fB-ssl\fR SAVE \fB-unixpw\fR \fB-users\fR unixpw=\\ \fB-inetd\fR \fB-q\fR \fB-http\fR \fB-ssl\fR SAVE \fB-unixpw\fR \fB-users\fR unixpw=\\
\fB-passwd\fR secret \fB-prog\fR /.../x11vnc \\ \fB-passwd\fR secret \fB-prog\fR /.../x11vnc \\
\fB-display\fR WAIT:cmd=FINDCREATEDISPLAY \fB-display\fR WAIT:cmd=FINDCREATEDISPLAY
...@@ -3223,6 +3234,12 @@ and mouse input at the physical display and put the ...@@ -3223,6 +3234,12 @@ and mouse input at the physical display and put the
monitor in dpms powered off state. Use this option to monitor in dpms powered off state. Use this option to
skip powering off the monitor. skip powering off the monitor.
.PP .PP
\fB-noultraext\fR
.IP
Disable the following UltraVNC extensions: SingleWindow
and ServerInput. The others managed by libvncserver
(textchat, 1/n scaling, rfbEncodingUltra) are not.
.PP
\fB-noxdamage\fR \fB-noxdamage\fR
.IP .IP
Do not use the X DAMAGE extension to detect framebuffer Do not use the X DAMAGE extension to detect framebuffer
...@@ -3992,9 +4009,9 @@ timeout:n reset \fB-timeout\fR to n, if there are ...@@ -3992,9 +4009,9 @@ timeout:n reset \fB-timeout\fR to n, if there are
currently no clients, exit unless one currently no clients, exit unless one
connects in the next n secs. connects in the next n secs.
.IP .IP
filexfer enable filetransfer for new clients. tightfilexfer enable filetransfer for new clients.
.IP .IP
nofilexfer disable filetransfer for new clients. notightfilexfer disable filetransfer for new clients.
.IP .IP
http enable http client connections. http enable http client connections.
.IP .IP
...@@ -4375,6 +4392,10 @@ noserverdpms enable \fB-noserverdpms\fR mode. ...@@ -4375,6 +4392,10 @@ noserverdpms enable \fB-noserverdpms\fR mode.
.IP .IP
serverdpms disable \fB-noserverdpms\fR mode. serverdpms disable \fB-noserverdpms\fR mode.
.IP .IP
noultraext enable \fB-noultraext\fR mode.
.IP
ultraext disable \fB-noultraext\fR mode.
.IP
xdamage enable xdamage polling hints. xdamage enable xdamage polling hints.
.IP .IP
noxdamage disable xdamage polling hints. noxdamage disable xdamage polling hints.
......
...@@ -1126,7 +1126,7 @@ static void print_settings(int try_http, int bg, char *gui_str) { ...@@ -1126,7 +1126,7 @@ static void print_settings(int try_http, int bg, char *gui_str) {
fprintf(stderr, " conn_once: %d\n", connect_once); fprintf(stderr, " conn_once: %d\n", connect_once);
fprintf(stderr, " timeout: %d\n", first_conn_timeout); fprintf(stderr, " timeout: %d\n", first_conn_timeout);
fprintf(stderr, " inetd: %d\n", inetd); fprintf(stderr, " inetd: %d\n", inetd);
fprintf(stderr, " filexfer: %d\n", filexfer); fprintf(stderr, " tightfilexfer: %d\n", tightfilexfer);
fprintf(stderr, " http: %d\n", try_http); fprintf(stderr, " http: %d\n", try_http);
fprintf(stderr, " connect: %s\n", client_connect fprintf(stderr, " connect: %s\n", client_connect
? client_connect : "null"); ? client_connect : "null");
...@@ -1768,10 +1768,10 @@ int main(int argc, char* argv[]) { ...@@ -1768,10 +1768,10 @@ int main(int argc, char* argv[]) {
users_list = strdup(argv[++i]); users_list = strdup(argv[++i]);
} else if (!strcmp(arg, "-inetd")) { } else if (!strcmp(arg, "-inetd")) {
inetd = 1; inetd = 1;
} else if (!strcmp(arg, "-nofilexfer")) { } else if (!strcmp(arg, "-notightfilexfer")) {
filexfer = 0; tightfilexfer = 0;
} else if (!strcmp(arg, "-filexfer")) { } else if (!strcmp(arg, "-tightfilexfer")) {
filexfer = 1; tightfilexfer = 1;
} else if (!strcmp(arg, "-http")) { } else if (!strcmp(arg, "-http")) {
try_http = 1; try_http = 1;
} else if (!strcmp(arg, "-http_ssl")) { } else if (!strcmp(arg, "-http_ssl")) {
...@@ -2386,6 +2386,8 @@ int main(int argc, char* argv[]) { ...@@ -2386,6 +2386,8 @@ int main(int argc, char* argv[]) {
client_dpms = 1; client_dpms = 1;
} else if (!strcmp(arg, "-noserverdpms")) { } else if (!strcmp(arg, "-noserverdpms")) {
no_ultra_dpms = 1; no_ultra_dpms = 1;
} else if (!strcmp(arg, "-noultraext")) {
no_ultra_ext = 1;
} else if (!strcmp(arg, "-xdamage")) { } else if (!strcmp(arg, "-xdamage")) {
use_xdamage++; use_xdamage++;
} else if (!strcmp(arg, "-noxdamage")) { } else if (!strcmp(arg, "-noxdamage")) {
...@@ -2586,8 +2588,7 @@ int main(int argc, char* argv[]) { ...@@ -2586,8 +2588,7 @@ int main(int argc, char* argv[]) {
listen_str = strdup(argv[i+1]); listen_str = strdup(argv[i+1]);
} }
/* otherwise copy it for libvncserver use below. */ /* otherwise copy it for libvncserver use below. */
if (!strcmp(arg, "-ultrafilexfer") || if (!strcmp(arg, "-ultrafilexfer")) {
!strcmp(arg, "-ultravncfilexfer")) {
if (argc_vnc + 2 < argc_vnc_max) { if (argc_vnc + 2 < argc_vnc_max) {
argv_vnc[argc_vnc++] = strdup("-rfbversion"); argv_vnc[argc_vnc++] = strdup("-rfbversion");
argv_vnc[argc_vnc++] = strdup("3.6"); argv_vnc[argc_vnc++] = strdup("3.6");
...@@ -2998,12 +2999,12 @@ int main(int argc, char* argv[]) { ...@@ -2998,12 +2999,12 @@ int main(int argc, char* argv[]) {
overlay = 0; overlay = 0;
} }
if (filexfer && view_only) { if (tightfilexfer && view_only) {
if (! quiet) { if (! quiet) {
rfbLog("setting -nofilexfer in -viewonly mode.\n"); rfbLog("setting -notightfilexfer in -viewonly mode.\n");
} }
/* how to undo via -R? */ /* how to undo via -R? */
filexfer = 0; tightfilexfer = 0;
} }
if (inetd) { if (inetd) {
...@@ -3134,7 +3135,7 @@ int main(int argc, char* argv[]) { ...@@ -3134,7 +3135,7 @@ int main(int argc, char* argv[]) {
#endif #endif
#ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER #ifdef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
if (filexfer) { if (tightfilexfer) {
rfbRegisterTightVNCFileTransferExtension(); rfbRegisterTightVNCFileTransferExtension();
} else { } else {
rfbUnregisterTightVNCFileTransferExtension(); rfbUnregisterTightVNCFileTransferExtension();
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
* -DREMOTE_DEFAULT=0 to disable remote-control on by default (-yesremote). * -DREMOTE_DEFAULT=0 to disable remote-control on by default (-yesremote).
* -DREMOTE_CONTROL=0 to disable remote-control mechanism completely. * -DREMOTE_CONTROL=0 to disable remote-control mechanism completely.
* -DEXTERNAL_COMMANDS=0 to disable the running of all external commands. * -DEXTERNAL_COMMANDS=0 to disable the running of all external commands.
* -DFILEXFER=0 disable filexfer. * -DTIGHTFILEXFER=0 disable tightfilexfer.
* *
* -DHARDWIRE_PASSWD=... hardwired passwords, quoting necessary. * -DHARDWIRE_PASSWD=... hardwired passwords, quoting necessary.
* -DHARDWIRE_VIEWPASSWD=... * -DHARDWIRE_VIEWPASSWD=...
......
...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0; ...@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.8.5 lastmod: 2007-02-12"; char lastmod[] = "0.8.5 lastmod: 2007-02-15";
/* X display info */ /* X display info */
......
...@@ -1290,6 +1290,9 @@ void kbd_release_all_keys(rfbClientPtr cl) { ...@@ -1290,6 +1290,9 @@ void kbd_release_all_keys(rfbClientPtr cl) {
void set_single_window(rfbClientPtr cl, int x, int y) { void set_single_window(rfbClientPtr cl, int x, int y) {
int ok = 0; int ok = 0;
if (no_ultra_ext) {
return;
}
if (unixpw_in_progress) { if (unixpw_in_progress) {
rfbLog("set_single_window: unixpw_in_progress, skipping.\n"); rfbLog("set_single_window: unixpw_in_progress, skipping.\n");
return; return;
...@@ -1333,6 +1336,9 @@ void set_single_window(rfbClientPtr cl, int x, int y) { ...@@ -1333,6 +1336,9 @@ void set_single_window(rfbClientPtr cl, int x, int y) {
} }
void set_server_input(rfbClientPtr cl, int grab) { void set_server_input(rfbClientPtr cl, int grab) {
if (no_ultra_ext) {
return;
}
if (unixpw_in_progress) { if (unixpw_in_progress) {
rfbLog("set_server_input: unixpw_in_progress, skipping.\n"); rfbLog("set_server_input: unixpw_in_progress, skipping.\n");
return; return;
...@@ -1368,6 +1374,10 @@ void set_server_input(rfbClientPtr cl, int grab) { ...@@ -1368,6 +1374,10 @@ void set_server_input(rfbClientPtr cl, int grab) {
} }
void set_text_chat(rfbClientPtr cl, int len, char *txt) { void set_text_chat(rfbClientPtr cl, int len, char *txt) {
char buf[100]; char buf[100];
if (no_ultra_ext) {
return;
}
rfbLog("set_text_chat: len=0x%x txt='", len); rfbLog("set_text_chat: len=0x%x txt='", len);
if (0 < len && len < 10000) write(2, txt, len); if (0 < len && len < 10000) write(2, txt, len);
fprintf(stderr, "'\n"); fprintf(stderr, "'\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment