Commit dba5e098 authored by runge's avatar runge

x11vnc: -verbose, -connect_or_exit, -rfbport 0, print out SSL cert.

parent 31d3a9fa
2006-09-17 Karl Runge <runge@karlrunge.com>
* x11vnc: move some info printout to -v, -verbose mode. Add
-connect_or_exit option. Have -rfbport 0 lead to no TCP
listening. Eliminate double certificates in .pem files.
Always print SSL certificate to the screen to aid pasting.
2006-09-15 Karl Runge <runge@karlrunge.com> 2006-09-15 Karl Runge <runge@karlrunge.com>
* x11vnc: allow user set signals to ignore, clear DISPLAY in * x11vnc: allow user set signals to ignore, clear DISPLAY in
-unixpw su_verify. -rawfb none same as null. -unixpw su_verify. -rawfb none same as null.
......
x11vnc README file Date: Fri Sep 15 12:06:02 EDT 2006 x11vnc README file Date: Sun Sep 17 13:31:31 EDT 2006
The following information is taken from these URLs: The following information is taken from these URLs:
...@@ -4001,9 +4001,14 @@ ied) ...@@ -4001,9 +4001,14 @@ ied)
[494]scrollcopyrect FAQ below) provide schemes to sweep this problem [494]scrollcopyrect FAQ below) provide schemes to sweep this problem
under the rug for window moves or resizes and for some (but not all) under the rug for window moves or resizes and for some (but not all)
window scrolls. These are the preferred way of avoiding the "lurching" window scrolls. These are the preferred way of avoiding the "lurching"
problem, contact me if they are not working. (Note on SuSE the RECORD problem, contact me if they are not working. Note on SuSE and some
X extension used by scrollcopyrect is not enabled by default, turn it other distros the RECORD X extension used by scrollcopyrect is not
on in xorg.conf) enabled by default, turn it on in xorg.conf:
Section "Module"
...
Load "record"
...
EndSection
Q-65: Why not do something like wireframe animations to avoid the Q-65: Why not do something like wireframe animations to avoid the
...@@ -4131,7 +4136,12 @@ ied) ...@@ -4131,7 +4136,12 @@ ied)
protocol between the X client with the focus window and the X server. protocol between the X client with the focus window and the X server.
This extension is usually present on most X servers (but SuSE disables This extension is usually present on most X servers (but SuSE disables
it for some reason). On XFree86/Xorg it can be enabled via Load it for some reason). On XFree86/Xorg it can be enabled via Load
"record" in the Module section of the config file if it isn't already. "record" in the Module section of the config file if it isn't already:
Section "Module"
...
Load "record"
...
EndSection
Currently the RECORD extension is used as little as possible so as to Currently the RECORD extension is used as little as possible so as to
not slow down regular use. Only simple heuristics are applied to not slow down regular use. Only simple heuristics are applied to
...@@ -8061,7 +8071,7 @@ x11vnc: a VNC server for real X displays ...@@ -8061,7 +8071,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.8.3 lastmod: 2006-09-15 x11vnc: allow VNC connections to real X11 displays. 0.8.3 lastmod: 2006-09-17
x11vnc options: x11vnc options:
-display disp -auth file -id windowid -display disp -auth file -id windowid
...@@ -8072,61 +8082,62 @@ x11vnc options: ...@@ -8072,61 +8082,62 @@ x11vnc options:
-viewonly -shared -once -viewonly -shared -once
-forever -loop -timeout n -forever -loop -timeout n
-inetd -nofilexfer -http -inetd -nofilexfer -http
-http_ssl -connect string -vncconnect -http_ssl -connect string -connect_or_exit str
-novncconnect -allow host1[,host2..] -localhost -vncconnect -novncconnect -allow host1[,host2..]
-nolookup -input string -grabkbd -localhost -nolookup -input string
-grabptr -viewpasswd string -passwdfile filename -grabkbd -grabptr -viewpasswd string
-unixpw [list] -unixpw_nis [list] -display WAIT:... -passwdfile filename -unixpw [list] -unixpw_nis [list]
-ssl [pem] -ssltimeout n -ssldir [dir] -display WAIT:... -ssl [pem] -ssltimeout n
-sslverify [path] -sslGenCA [dir] -sslGenCert type name -ssldir [dir] -sslverify [path] -sslGenCA [dir]
-sslEncKey [pem] -sslCertInfo [pem] -sslDelCert [pem] -sslGenCert type name -sslEncKey [pem] -sslCertInfo [pem]
-stunnel [pem] -stunnel3 [pem] -https [port] -sslDelCert [pem] -stunnel [pem] -stunnel3 [pem]
-usepw -storepasswd pass file -nopw -https [port] -usepw -storepasswd pass file
-accept string -afteraccept string -gone string -nopw -accept string -afteraccept string
-users list -noshm -flipbyteorder -gone string -users list -noshm
-onetile -solid [color] -blackout string -flipbyteorder -onetile -solid [color]
-xinerama -noxinerama -xtrap -blackout string -xinerama -noxinerama
-xrandr [mode] -rotate string -padgeom WxH -xtrap -xrandr [mode] -rotate string
-o logfile -flag file -rc filename -padgeom WxH -o logfile -flag file
-norc -env VAR=VALUE -h, -help -rc filename -norc -env VAR=VALUE
-?, -opts -V, -version -license -h, -help -?, -opts -V, -version
-dbg -q -bg -license -dbg -q, -quiet
-modtweak -nomodtweak -xkb -v, -verbose -bg -modtweak
-noxkb -capslock -skip_lockkeys -nomodtweak -xkb -noxkb
-skip_keycodes string -sloppy_keys -skip_dups -capslock -skip_lockkeys -skip_keycodes string
-noskip_dups -add_keysyms -noadd_keysyms -sloppy_keys -skip_dups -noskip_dups
-clear_mods -clear_keys -remap string -add_keysyms -noadd_keysyms -clear_mods
-norepeat -repeat -nofb -clear_keys -remap string -norepeat
-nobell -nosel -noprimary -repeat -nofb -nobell
-nosetprimary -noclipboard -nosetclipboard -nosel -noprimary -nosetprimary
-seldir string -cursor [mode] -nocursor -noclipboard -nosetclipboard -seldir string
-arrow n -noxfixes -alphacut n -cursor [mode] -nocursor -arrow n
-alphafrac fraction -alpharemove -noalphablend -noxfixes -alphacut n -alphafrac fraction
-nocursorshape -cursorpos -nocursorpos -alpharemove -noalphablend -nocursorshape
-xwarppointer -buttonmap string -nodragging -cursorpos -nocursorpos -xwarppointer
-wireframe [str] -nowireframe -wirecopyrect mode -buttonmap string -nodragging -wireframe [str]
-nowirecopyrect -debug_wireframe -scrollcopyrect mode -nowireframe -wirecopyrect mode -nowirecopyrect
-noscrollcopyrect -scr_area n -scr_skip list -debug_wireframe -scrollcopyrect mode -noscrollcopyrect
-scr_inc list -scr_keys list -scr_term list -scr_area n -scr_skip list -scr_inc list
-scr_keyrepeat lo-hi -scr_parms string -fixscreen string -scr_keys list -scr_term list -scr_keyrepeat lo-hi
-debug_scroll -noxrecord -grab_buster -scr_parms string -fixscreen string -debug_scroll
-nograb_buster -debug_grabs -debug_sel -noxrecord -grab_buster -nograb_buster
-pointer_mode n -input_skip n -allinput -debug_grabs -debug_sel -pointer_mode n
-speeds rd,bw,lat -wmdt string -debug_pointer -input_skip n -allinput -speeds rd,bw,lat
-debug_keyboard -defer time -wait time -wmdt string -debug_pointer -debug_keyboard
-wait_ui factor -nowait_bog -slow_fb time -defer time -wait time -wait_ui factor
-readtimeout n -nap -nonap -nowait_bog -slow_fb time -readtimeout n
-sb time -nofbpm -fbpm -nap -nonap -sb time
-noxdamage -xd_area A -xd_mem f -nofbpm -fbpm -noxdamage
-sigpipe string -threads -nothreads -xd_area A -xd_mem f -sigpipe string
-fs f -gaps n -grow n -threads -nothreads -fs f
-fuzz n -debug_tiles -snapfb -gaps n -grow n -fuzz n
-rawfb string -freqtab file -pipeinput cmd -debug_tiles -snapfb -rawfb string
-gui [gui-opts] -remote command -query variable -freqtab file -pipeinput cmd -gui [gui-opts]
-QD variable -sync -noremote -remote command -query variable -QD variable
-yesremote -unsafe -safer -sync -noremote -yesremote
-privremote -nocmds -allowedcmds list -unsafe -safer -privremote
-deny_all -nocmds -allowedcmds list -deny_all
libvncserver options: libvncserver options:
-rfbport port TCP port for RFB protocol -rfbport port TCP port for RFB protocol
...@@ -8160,7 +8171,7 @@ libvncserver-tight-extension options: ...@@ -8160,7 +8171,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.8.3 lastmod: 2006-09-15 x11vnc: allow VNC connections to real X11 displays. 0.8.3 lastmod: 2006-09-17
(type "x11vnc -opts" to just list the options.) (type "x11vnc -opts" to just list the options.)
...@@ -8485,8 +8496,14 @@ Options: ...@@ -8485,8 +8496,14 @@ Options:
If "string" contains "/" it is instead interpreted If "string" contains "/" it is instead interpreted
as a file to periodically check for new hosts. as a file to periodically check for new hosts.
The first line is read and then the file is truncated. The first line is read and then the file is truncated.
Be careful for this usage mode if x11vnc is running as Be careful about the location of this file if x11vnc
root (e.g. via gdm(1), etc). is running as root (e.g. via gdm(1), etc).
-connect_or_exit str As with -connect, except if none of the reverse
connections succeed, then x11vnc shutdowns immediately.
If you do not want x11vnc to listen on ANY interface
use -rfbport 0
-vncconnect Monitor the VNC_CONNECT X property set by the standard -vncconnect Monitor the VNC_CONNECT X property set by the standard
-novncconnect VNC program vncconnect(1). When the property is -novncconnect VNC program vncconnect(1). When the property is
...@@ -8519,6 +8536,11 @@ Options: ...@@ -8519,6 +8536,11 @@ Options:
the -allow list (and vice versa) to avoid situations the -allow list (and vice versa) to avoid situations
where no connections (or too many) are allowed. where no connections (or too many) are allowed.
If you do not want x11vnc to listen on ANY interface
(evidently you are using -connect or -connect_or_exit,
or plan to use remote control: -R connect:host), use
-rfbport 0
-nolookup Do not use gethostbyname() or gethostbyaddr() to look up -nolookup Do not use gethostbyname() or gethostbyaddr() to look up
host names or IP numbers. Use this if name resolution host names or IP numbers. Use this if name resolution
is incorrectly set up and leads to long pauses as name is incorrectly set up and leads to long pauses as name
...@@ -9676,8 +9698,10 @@ Options: ...@@ -9676,8 +9698,10 @@ Options:
-dbg Instead of exiting after cleaning up, run a simple -dbg Instead of exiting after cleaning up, run a simple
"debug crash shell" when fatal errors are trapped. "debug crash shell" when fatal errors are trapped.
-q Be quiet by printing less informational output to -q, -quiet Be quiet by printing less informational output to
stderr. Same as -quiet. stderr.
-v, -verbose Print out more information to stderr.
-bg Go into the background after screen setup. Messages to -bg Go into the background after screen setup. Messages to
stderr are lost unless -o logfile is used. Something stderr are lost unless -o logfile is used. Something
like this could be useful in a script: like this could be useful in a script:
......
...@@ -1587,6 +1587,9 @@ static int do_reverse_connect(char *str) { ...@@ -1587,6 +1587,9 @@ static int do_reverse_connect(char *str) {
free(host); free(host);
if (cl == NULL) { if (cl == NULL) {
if (quiet && connect_or_exit) {
rfbLogEnable(1);
}
rfbLog("reverse_connect: %s failed\n", str); rfbLog("reverse_connect: %s failed\n", str);
return 0; return 0;
} else { } else {
...@@ -1609,6 +1612,7 @@ void reverse_connect(char *str) { ...@@ -1609,6 +1612,7 @@ void reverse_connect(char *str) {
int sleep_between_host = 300; int sleep_between_host = 300;
int sleep_min = 1500, sleep_max = 4500, n_max = 5; int sleep_min = 1500, sleep_max = 4500, n_max = 5;
int n, tot, t, dt = 100, cnt = 0; int n, tot, t, dt = 100, cnt = 0;
int nclients0 = client_count;
if (unixpw_in_progress) return; if (unixpw_in_progress) return;
...@@ -1634,6 +1638,11 @@ void reverse_connect(char *str) { ...@@ -1634,6 +1638,11 @@ void reverse_connect(char *str) {
free(tmp); free(tmp);
if (cnt == 0) { if (cnt == 0) {
if (connect_or_exit) {
rfbLogEnable(1);
rfbLog("exiting under -connect_or_exit\n");
clean_up_exit(0);
}
return; return;
} }
...@@ -1652,10 +1661,24 @@ void reverse_connect(char *str) { ...@@ -1652,10 +1661,24 @@ void reverse_connect(char *str) {
t = 0; t = 0;
while (t < tot) { while (t < tot) {
rfbPE(-1);
rfbPE(-1); rfbPE(-1);
usleep(dt * 1000); usleep(dt * 1000);
t += dt; t += dt;
} }
if (connect_or_exit) {
if (client_count <= nclients0) {
for (t = 0; t < 10; t++) {
rfbPE(-1);
usleep(100 * 1000);
}
}
if (client_count <= nclients0) {
rfbLogEnable(1);
rfbLog("exiting under -connect_or_exit\n");
clean_up_exit(0);
}
}
} }
/* /*
......
...@@ -554,7 +554,9 @@ static void setup_cursors(void) { ...@@ -554,7 +554,9 @@ static void setup_cursors(void) {
int i, j, n = 0; int i, j, n = 0;
static int first = 1; static int first = 1;
rfbLog("setting up %d cursors...\n", CURS_MAX); if (verbose) {
rfbLog("setting up %d cursors...\n", CURS_MAX);
}
if (first) { if (first) {
for (i=0; i<CURS_MAX; i++) { for (i=0; i<CURS_MAX; i++) {
...@@ -814,7 +816,9 @@ static void setup_cursors(void) { ...@@ -814,7 +816,9 @@ static void setup_cursors(void) {
if (screen) { if (screen) {
UNLOCK(screen->cursorMutex); UNLOCK(screen->cursorMutex);
} }
rfbLog(" done.\n"); if (verbose) {
rfbLog(" done.\n");
}
rfbLog("\n"); rfbLog("\n");
} }
......
...@@ -345,8 +345,14 @@ void print_help(int mode) { ...@@ -345,8 +345,14 @@ void print_help(int mode) {
" If \"string\" contains \"/\" it is instead interpreted\n" " If \"string\" contains \"/\" it is instead interpreted\n"
" as a file to periodically check for new hosts.\n" " as a file to periodically check for new hosts.\n"
" The first line is read and then the file is truncated.\n" " The first line is read and then the file is truncated.\n"
" Be careful for this usage mode if x11vnc is running as\n" " Be careful about the location of this file if x11vnc\n"
" root (e.g. via gdm(1), etc).\n" " is running as root (e.g. via gdm(1), etc).\n"
"\n"
"-connect_or_exit str As with -connect, except if none of the reverse\n"
" connections succeed, then x11vnc shutdowns immediately.\n"
"\n"
" If you do not want x11vnc to listen on ANY interface\n"
" use -rfbport 0\n"
"\n" "\n"
"-vncconnect Monitor the VNC_CONNECT X property set by the standard\n" "-vncconnect Monitor the VNC_CONNECT X property set by the standard\n"
"-novncconnect VNC program vncconnect(1). When the property is\n" "-novncconnect VNC program vncconnect(1). When the property is\n"
...@@ -379,6 +385,11 @@ void print_help(int mode) { ...@@ -379,6 +385,11 @@ void print_help(int mode) {
" the -allow list (and vice versa) to avoid situations\n" " the -allow list (and vice versa) to avoid situations\n"
" where no connections (or too many) are allowed.\n" " where no connections (or too many) are allowed.\n"
"\n" "\n"
" If you do not want x11vnc to listen on ANY interface\n"
" (evidently you are using -connect or -connect_or_exit,\n"
" or plan to use remote control: -R connect:host), use\n"
" -rfbport 0\n"
"\n"
"-nolookup Do not use gethostbyname() or gethostbyaddr() to look up\n" "-nolookup Do not use gethostbyname() or gethostbyaddr() to look up\n"
" host names or IP numbers. Use this if name resolution\n" " host names or IP numbers. Use this if name resolution\n"
" is incorrectly set up and leads to long pauses as name\n" " is incorrectly set up and leads to long pauses as name\n"
...@@ -1543,8 +1554,10 @@ void print_help(int mode) { ...@@ -1543,8 +1554,10 @@ void print_help(int mode) {
"-dbg Instead of exiting after cleaning up, run a simple\n" "-dbg Instead of exiting after cleaning up, run a simple\n"
" \"debug crash shell\" when fatal errors are trapped.\n" " \"debug crash shell\" when fatal errors are trapped.\n"
"\n" "\n"
"-q Be quiet by printing less informational output to\n" "-q, -quiet Be quiet by printing less informational output to\n"
" stderr. Same as -quiet.\n" " stderr.\n"
"-v, -verbose Print out more information to stderr.\n"
"\n"
"-bg Go into the background after screen setup. Messages to\n" "-bg Go into the background after screen setup. Messages to\n"
" stderr are lost unless -o logfile is used. Something\n" " stderr are lost unless -o logfile is used. Something\n"
" like this could be useful in a script:\n" " like this could be useful in a script:\n"
......
...@@ -996,27 +996,31 @@ void switch_to_xkb_if_better(void) { ...@@ -996,27 +996,31 @@ void switch_to_xkb_if_better(void) {
XFree(keymap); XFree(keymap);
if (missing_noxkb == 0 && syms_gt_4 >= 8) { if (missing_noxkb == 0 && syms_gt_4 >= 8) {
rfbLog("XKEYBOARD: number of keysyms per keycode %d " if (! raw_fb_str) {
"is greater\n", syms_per_keycode); rfbLog("XKEYBOARD: number of keysyms per keycode %d "
rfbLog(" than 4 and %d keysyms are mapped above 4.\n", "is greater\n", syms_per_keycode);
syms_gt_4); rfbLog(" than 4 and %d keysyms are mapped above 4.\n",
rfbLog(" Automatically switching to -xkb mode.\n"); syms_gt_4);
rfbLog(" If this makes the key mapping worse you can\n"); rfbLog(" Automatically switching to -xkb mode.\n");
rfbLog(" disable it with the \"-noxkb\" option.\n"); rfbLog(" If this makes the key mapping worse you can\n");
rfbLog(" Also, remember \"-remap DEAD\" for accenting" rfbLog(" disable it with the \"-noxkb\" option.\n");
" characters.\n"); rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
}
use_xkb_modtweak = 1; use_xkb_modtweak = 1;
return; return;
} else if (missing_noxkb == 0) { } else if (missing_noxkb == 0) {
rfbLog("XKEYBOARD: all %d \"must have\" keysyms accounted" if (! raw_fb_str) {
" for.\n", n); rfbLog("XKEYBOARD: all %d \"must have\" keysyms accounted"
rfbLog(" Not automatically switching to -xkb mode.\n"); " for.\n", n);
rfbLog(" If some keys still cannot be typed, try using" rfbLog(" Not automatically switching to -xkb mode.\n");
" -xkb.\n"); rfbLog(" If some keys still cannot be typed, try using"
rfbLog(" Also, remember \"-remap DEAD\" for accenting" " -xkb.\n");
" characters.\n"); rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
}
return; return;
} }
......
...@@ -150,6 +150,7 @@ int noxrecord = 0; ...@@ -150,6 +150,7 @@ int noxrecord = 0;
char *client_connect = NULL; /* strings for -connect option */ char *client_connect = NULL; /* strings for -connect option */
char *client_connect_file = NULL; char *client_connect_file = NULL;
int connect_or_exit = 0;
int vnc_connect = 1; /* -vncconnect option */ int vnc_connect = 1; /* -vncconnect option */
int show_cursor = 1; /* show cursor shapes */ int show_cursor = 1; /* show cursor shapes */
...@@ -326,6 +327,7 @@ int debug_pointer = 0; ...@@ -326,6 +327,7 @@ int debug_pointer = 0;
int debug_keyboard = 0; int debug_keyboard = 0;
int quiet = 0; int quiet = 0;
int verbose = 0;
/* threaded vs. non-threaded (default) */ /* threaded vs. non-threaded (default) */
#if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(X11VNC_THREADED) #if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(X11VNC_THREADED)
...@@ -336,6 +338,7 @@ int use_threads = 0; ...@@ -336,6 +338,7 @@ int use_threads = 0;
/* info about command line opts */ /* info about command line opts */
int got_rfbport = 0; int got_rfbport = 0;
int got_rfbport_val = -1;
int got_alwaysshared = 0; int got_alwaysshared = 0;
int got_nevershared = 0; int got_nevershared = 0;
int got_cursorpos = 0; int got_cursorpos = 0;
......
...@@ -125,6 +125,7 @@ extern int noxrecord; ...@@ -125,6 +125,7 @@ extern int noxrecord;
extern char *client_connect; extern char *client_connect;
extern char *client_connect_file; extern char *client_connect_file;
extern int connect_or_exit;
extern int vnc_connect; extern int vnc_connect;
extern int show_cursor; extern int show_cursor;
...@@ -247,10 +248,12 @@ extern int debug_pointer; ...@@ -247,10 +248,12 @@ extern int debug_pointer;
extern int debug_keyboard; extern int debug_keyboard;
extern int quiet; extern int quiet;
extern int verbose;
extern int use_threads; extern int use_threads;
extern int got_rfbport; extern int got_rfbport;
extern int got_rfbport_val;
extern int got_alwaysshared; extern int got_alwaysshared;
extern int got_nevershared; extern int got_nevershared;
extern int got_cursorpos; extern int got_cursorpos;
......
...@@ -36,7 +36,9 @@ static void check_fbpm(void) { ...@@ -36,7 +36,9 @@ static void check_fbpm(void) {
" VNC clients are connected.\n"); " VNC clients are connected.\n");
} }
} else { } else {
rfbLog("X display is not capable of FBPM.\n"); if (! raw_fb_str) {
rfbLog("X display is not capable of FBPM.\n");
}
fbpm_capable = 0; fbpm_capable = 0;
} }
init_fbpm = 1; init_fbpm = 1;
...@@ -85,7 +87,9 @@ static void check_fbpm(void) { ...@@ -85,7 +87,9 @@ static void check_fbpm(void) {
#else #else
RAWFB_RET_VOID RAWFB_RET_VOID
if (! init_fbpm) { if (! init_fbpm) {
rfbLog("X FBPM extension not supported.\n"); if (! raw_fb_str) {
rfbLog("X FBPM extension not supported.\n");
}
init_fbpm = 1; init_fbpm = 1;
} }
#endif #endif
......
...@@ -467,7 +467,7 @@ void initialize_polling_images(void) { ...@@ -467,7 +467,7 @@ void initialize_polling_images(void) {
break; break;
} }
} }
if (!quiet) { if (verbose) {
if (using_shm && ! xform24to32) { if (using_shm && ! xform24to32) {
rfbLog("created %d tile_row shm polling images.\n", rfbLog("created %d tile_row shm polling images.\n",
tile_shm_count); tile_shm_count);
......
...@@ -565,7 +565,7 @@ void set_raw_fb_params(int restore) { ...@@ -565,7 +565,7 @@ void set_raw_fb_params(int restore) {
return; return;
} }
if (! quiet) { if (verbose) {
rfbLog("set_raw_fb_params: modifying settings for " rfbLog("set_raw_fb_params: modifying settings for "
"-rawfb mode.\n"); "-rawfb mode.\n");
} }
...@@ -577,7 +577,7 @@ void set_raw_fb_params(int restore) { ...@@ -577,7 +577,7 @@ void set_raw_fb_params(int restore) {
* (i.e. rawfb but also send user input to the X * (i.e. rawfb but also send user input to the X
* display, most likely using /dev/fb0 for some reason...) * display, most likely using /dev/fb0 for some reason...)
*/ */
if (! quiet) { if (verbose) {
rfbLog("rawfb: -noviewonly mode: still sending mouse and\n"); rfbLog("rawfb: -noviewonly mode: still sending mouse and\n");
rfbLog("rawfb: keyboard input to the X DISPLAY!!\n"); rfbLog("rawfb: keyboard input to the X DISPLAY!!\n");
} }
...@@ -590,50 +590,50 @@ void set_raw_fb_params(int restore) { ...@@ -590,50 +590,50 @@ void set_raw_fb_params(int restore) {
} }
#endif #endif
if (watch_selection) { if (watch_selection) {
if (! quiet) rfbLog(" rawfb: turning off " if (verbose) rfbLog(" rawfb: turning off "
"watch_selection\n"); "watch_selection\n");
watch_selection = 0; watch_selection = 0;
} }
if (watch_primary) { if (watch_primary) {
if (! quiet) rfbLog(" rawfb: turning off " if (verbose) rfbLog(" rawfb: turning off "
"watch_primary\n"); "watch_primary\n");
watch_primary = 0; watch_primary = 0;
} }
if (watch_clipboard) { if (watch_clipboard) {
if (! quiet) rfbLog(" rawfb: turning off " if (verbose) rfbLog(" rawfb: turning off "
"watch_clipboard\n"); "watch_clipboard\n");
watch_clipboard = 0; watch_clipboard = 0;
} }
if (watch_bell) { if (watch_bell) {
if (! quiet) rfbLog(" rawfb: turning off watch_bell\n"); if (verbose) rfbLog(" rawfb: turning off watch_bell\n");
watch_bell = 0; watch_bell = 0;
} }
if (no_autorepeat) { if (no_autorepeat) {
if (! quiet) rfbLog(" rawfb: turning off " if (verbose) rfbLog(" rawfb: turning off "
"no_autorepeat\n"); "no_autorepeat\n");
no_autorepeat = 0; no_autorepeat = 0;
} }
if (use_solid_bg) { if (use_solid_bg) {
if (! quiet) rfbLog(" rawfb: turning off " if (verbose) rfbLog(" rawfb: turning off "
"use_solid_bg\n"); "use_solid_bg\n");
use_solid_bg = 0; use_solid_bg = 0;
} }
multiple_cursors_mode = strdup("arrow"); multiple_cursors_mode = strdup("arrow");
} }
if (using_shm) { if (using_shm) {
if (! quiet) rfbLog(" rawfb: turning off using_shm\n"); if (verbose) rfbLog(" rawfb: turning off using_shm\n");
using_shm = 0; using_shm = 0;
} }
if (take_naps) { if (take_naps) {
if (! quiet) rfbLog(" rawfb: turning off take_naps\n"); if (verbose) rfbLog(" rawfb: turning off take_naps\n");
take_naps = 0; take_naps = 0;
} }
if (xrandr) { if (xrandr) {
if (! quiet) rfbLog(" rawfb: turning off xrandr\n"); if (verbose) rfbLog(" rawfb: turning off xrandr\n");
xrandr = 0; xrandr = 0;
} }
if (! noxrecord) { if (! noxrecord) {
if (! quiet) rfbLog(" rawfb: turning off xrecord\n"); if (verbose) rfbLog(" rawfb: turning off xrecord\n");
noxrecord = 1; noxrecord = 1;
} }
} }
...@@ -1304,16 +1304,19 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n"); ...@@ -1304,16 +1304,19 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
memset(raw_fb, 0xff, dpy_x * dpy_y * b/8); memset(raw_fb, 0xff, dpy_x * dpy_y * b/8);
} }
rfbLog("\n"); if (verbose) {
rfbLog("rawfb: raw_fb %p\n", raw_fb);
rfbLog(" format %d\n", raw_fb_image->format); rfbLog("\n");
rfbLog(" width %d\n", raw_fb_image->width); rfbLog("rawfb: raw_fb %p\n", raw_fb);
rfbLog(" height %d\n", raw_fb_image->height); rfbLog(" format %d\n", raw_fb_image->format);
rfbLog(" bpp %d\n", raw_fb_image->bits_per_pixel); rfbLog(" width %d\n", raw_fb_image->width);
rfbLog(" depth %d\n", raw_fb_image->depth); rfbLog(" height %d\n", raw_fb_image->height);
rfbLog(" bpl %d\n", raw_fb_image->bytes_per_line); rfbLog(" bpp %d\n", raw_fb_image->bits_per_pixel);
if (use_snapfb && snap_fb) { rfbLog(" depth %d\n", raw_fb_image->depth);
rfbLog(" snap_fb %p\n", snap_fb); rfbLog(" bpl %d\n", raw_fb_image->bytes_per_line);
if (use_snapfb && snap_fb) {
rfbLog(" snap_fb %p\n", snap_fb);
}
} }
free(str); free(str);
...@@ -2196,7 +2199,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { ...@@ -2196,7 +2199,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} }
#if !SMALL_FOOTPRINT #if !SMALL_FOOTPRINT
if (!quiet) { if (verbose) {
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "FrameBuffer Info:\n"); fprintf(stderr, "FrameBuffer Info:\n");
fprintf(stderr, " width: %d\n", fb->width); fprintf(stderr, " width: %d\n", fb->width);
...@@ -2325,7 +2328,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { ...@@ -2325,7 +2328,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} else { } else {
screen->frameBuffer = rfb_fb; screen->frameBuffer = rfb_fb;
} }
if (!quiet) { if (verbose) {
fprintf(stderr, " rfb_fb: %p\n", rfb_fb); fprintf(stderr, " rfb_fb: %p\n", rfb_fb);
fprintf(stderr, " main_fb: %p\n", main_fb); fprintf(stderr, " main_fb: %p\n", main_fb);
fprintf(stderr, " 8to24_fb: %p\n", cmap8to24_fb); fprintf(stderr, " 8to24_fb: %p\n", cmap8to24_fb);
...@@ -2399,6 +2402,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) { ...@@ -2399,6 +2402,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} else if (! got_rfbport) { } else if (! got_rfbport) {
screen->autoPort = TRUE; screen->autoPort = TRUE;
} else if (got_rfbport && got_rfbport_val == 0) {
screen->autoPort = FALSE;
screen->port = 0;
} }
if (! got_nevershared && ! got_alwaysshared) { if (! got_nevershared && ! got_alwaysshared) {
......
...@@ -314,6 +314,7 @@ void setup_stunnel(int rport, int *argc, char **argv) { ...@@ -314,6 +314,7 @@ void setup_stunnel(int rport, int *argc, char **argv) {
argv[i+1] = strdup(tmp); argv[i+1] = strdup(tmp);
*argc += 2; *argc += 2;
got_rfbport = 1; got_rfbport = 1;
got_rfbport_val = atoi(tmp);
} }
} }
stunnel_port = rport; stunnel_port = rport;
...@@ -710,14 +711,34 @@ void sslEncKey(char *path, int mode) { ...@@ -710,14 +711,34 @@ void sslEncKey(char *path, int mode) {
unlink(tmp); unlink(tmp);
if (! mode && cert && cert[0] != '\0') { if (! mode && cert && cert[0] != '\0') {
file = fopen(path, "a"); int got_cert = 0;
file = fopen(path, "r");
if (file == NULL) { if (file == NULL) {
rfbLog("sslEncKey: %s\n", path); rfbLog("sslEncKey: %s\n", path);
rfbLogPerror("fopen"); rfbLogPerror("fopen");
exit(1); exit(1);
} }
fprintf(file, "%s", cert); while (fgets(line, 1024, file) != NULL) {
if (strstr(line, "-----BEGIN CERTIFICATE-----")
== line) {
got_cert++;
}
if (strstr(line, "-----END CERTIFICATE-----")
== line) {
got_cert++;
}
}
fclose(file); fclose(file);
if (got_cert < 2) {
file = fopen(path, "a");
if (file == NULL) {
rfbLog("sslEncKey: %s\n", path);
rfbLogPerror("fopen");
exit(1);
}
fprintf(file, "%s", cert);
fclose(file);
}
free(cert); free(cert);
} }
......
...@@ -146,9 +146,35 @@ char *get_saved_pem(char *save, int create) { ...@@ -146,9 +146,35 @@ char *get_saved_pem(char *save, int create) {
} }
} }
return new; return new;
} else {
return strdup(path);
} }
if (! quiet) {
char line[1024];
int on = 0;
FILE *in = fopen(path, "r");
if (in != NULL) {
rfbLog("\n");
rfbLog("Using SSL Certificate:\n");
fprintf(stderr, "\n");
while (fgets(line, 1024, in) != NULL) {
if (strstr(line, "BEGIN CERTIFICATE")) {
on = 1;
}
if (on) {
fprintf(stderr, "%s", line);
}
if (strstr(line, "END CERTIFICATE")) {
on = 0;
}
if (strstr(line, "PRIVATE KEY")) {
on = 0;
}
}
fprintf(stderr, "\n");
fclose(in);
}
}
return strdup(path);
} }
static char *get_input(char *tag, char **in) { static char *get_input(char *tag, char **in) {
...@@ -441,14 +467,17 @@ static char *create_tmp_pem(char *pathin, int prompt) { ...@@ -441,14 +467,17 @@ static char *create_tmp_pem(char *pathin, int prompt) {
return NULL; return NULL;
} }
while (fgets(line, 1024, in) != NULL) { while (fgets(line, 1024, in) != NULL) {
if (strstr(line, "-----BEGIN CERTIFICATE-----")) { if (strstr(line, "BEGIN CERTIFICATE")) {
on = 1; on = 1;
} }
fprintf(out, "%s", line); fprintf(out, "%s", line);
if (on) { if (on) {
fprintf(crt, "%s", line); fprintf(crt, "%s", line);
} }
if (strstr(line, "-----END CERTIFICATE-----")) { if (strstr(line, "END CERTIFICATE")) {
on = 0;
}
if (strstr(line, "PRIVATE KEY")) {
on = 0; on = 0;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "September 2006" "x11vnc " "User Commands" .TH X11VNC "1" "September 2006" "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.3, lastmod: 2006-09-15 version: 0.8.3, lastmod: 2006-09-17
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -409,11 +409,19 @@ your environment before starting x11vnc. ...@@ -409,11 +409,19 @@ your environment before starting x11vnc.
If \fIstring\fR contains "/" it is instead interpreted If \fIstring\fR contains "/" it is instead interpreted
as a file to periodically check for new hosts. as a file to periodically check for new hosts.
The first line is read and then the file is truncated. The first line is read and then the file is truncated.
Be careful for this usage mode if x11vnc is running as Be careful about the location of this file if x11vnc
root (e.g. via is running as root (e.g. via
.IR gdm (1) .IR gdm (1)
, etc). , etc).
.PP .PP
\fB-connect_or_exit\fR \fIstr\fR
.IP
As with \fB-connect,\fR except if none of the reverse
connections succeed, then x11vnc shutdowns immediately.
.IP
If you do not want x11vnc to listen on ANY interface
use \fB-rfbport\fR 0
.PP
\fB-vncconnect,\fR \fB-novncconnect\fR \fB-vncconnect,\fR \fB-novncconnect\fR
.IP .IP
Monitor the VNC_CONNECT X property set by the standard Monitor the VNC_CONNECT X property set by the standard
...@@ -455,6 +463,11 @@ you use the remote control mechanism (-R) to change ...@@ -455,6 +463,11 @@ you use the remote control mechanism (-R) to change
the \fB-listen\fR interface you may need to manually adjust the \fB-listen\fR interface you may need to manually adjust
the \fB-allow\fR list (and vice versa) to avoid situations the \fB-allow\fR list (and vice versa) to avoid situations
where no connections (or too many) are allowed. where no connections (or too many) are allowed.
.IP
If you do not want x11vnc to listen on ANY interface
(evidently you are using \fB-connect\fR or \fB-connect_or_exit,\fR
or plan to use remote control: \fB-R\fR connect:host), use
\fB-rfbport\fR 0
.PP .PP
\fB-nolookup\fR \fB-nolookup\fR
.IP .IP
...@@ -1788,10 +1801,14 @@ Print out license information. Same as \fB-copying\fR and ...@@ -1788,10 +1801,14 @@ Print out license information. Same as \fB-copying\fR and
Instead of exiting after cleaning up, run a simple Instead of exiting after cleaning up, run a simple
"debug crash shell" when fatal errors are trapped. "debug crash shell" when fatal errors are trapped.
.PP .PP
\fB-q\fR \fB-q,\fR \fB-quiet\fR
.IP .IP
Be quiet by printing less informational output to Be quiet by printing less informational output to
stderr. Same as \fB-quiet.\fR stderr.
.PP
\fB-v,\fR \fB-verbose\fR
.IP
Print out more information to stderr.
.PP .PP
\fB-bg\fR \fB-bg\fR
.IP .IP
......
...@@ -1625,13 +1625,17 @@ int main(int argc, char* argv[]) { ...@@ -1625,13 +1625,17 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-http_ssl")) { } else if (!strcmp(arg, "-http_ssl")) {
try_http = 1; try_http = 1;
http_ssl = 1; http_ssl = 1;
} else if (!strcmp(arg, "-connect")) { } else if (!strcmp(arg, "-connect") ||
!strcmp(arg, "-connect_or_exit")) {
CHECK_ARGC CHECK_ARGC
if (strchr(argv[++i], '/')) { if (strchr(argv[++i], '/')) {
client_connect_file = strdup(argv[i]); client_connect_file = strdup(argv[i]);
} else { } else {
client_connect = strdup(argv[i]); client_connect = strdup(argv[i]);
} }
if (!strcmp(arg, "-connect_or_exit")) {
connect_or_exit = 1;
}
} else if (!strcmp(arg, "-vncconnect")) { } else if (!strcmp(arg, "-vncconnect")) {
vnc_connect = 1; vnc_connect = 1;
} else if (!strcmp(arg, "-novncconnect")) { } else if (!strcmp(arg, "-novncconnect")) {
...@@ -1887,6 +1891,8 @@ int main(int argc, char* argv[]) { ...@@ -1887,6 +1891,8 @@ int main(int argc, char* argv[]) {
crash_debug = 0; crash_debug = 0;
} else if (!strcmp(arg, "-q") || !strcmp(arg, "-quiet")) { } else if (!strcmp(arg, "-q") || !strcmp(arg, "-quiet")) {
quiet = 1; quiet = 1;
} else if (!strcmp(arg, "-v") || !strcmp(arg, "-verbose")) {
verbose = 1;
} else if (!strcmp(arg, "-bg") || !strcmp(arg, "-background")) { } else if (!strcmp(arg, "-bg") || !strcmp(arg, "-background")) {
#if LIBVNCSERVER_HAVE_SETSID #if LIBVNCSERVER_HAVE_SETSID
bg = 1; bg = 1;
...@@ -2306,7 +2312,8 @@ int main(int argc, char* argv[]) { ...@@ -2306,7 +2312,8 @@ int main(int argc, char* argv[]) {
got_deferupdate = 1; got_deferupdate = 1;
} }
if (!strcmp(arg, "-rfbport") && i < argc-1) { if (!strcmp(arg, "-rfbport") && i < argc-1) {
got_rfbport = atoi(argv[i+1]); got_rfbport = 1;
got_rfbport_val = atoi(argv[i+1]);
} }
if (!strcmp(arg, "-alwaysshared ")) { if (!strcmp(arg, "-alwaysshared ")) {
got_alwaysshared = 1; got_alwaysshared = 1;
...@@ -2710,7 +2717,6 @@ int main(int argc, char* argv[]) { ...@@ -2710,7 +2717,6 @@ int main(int argc, char* argv[]) {
if (use_stunnel) { if (use_stunnel) {
exit(1); exit(1);
} }
/* others? */
} }
if (flip_byte_order && using_shm && ! quiet) { if (flip_byte_order && using_shm && ! quiet) {
...@@ -2790,7 +2796,9 @@ int main(int argc, char* argv[]) { ...@@ -2790,7 +2796,9 @@ int main(int argc, char* argv[]) {
initialize_crash_handler(); initialize_crash_handler();
if (! quiet) { if (! quiet) {
print_settings(try_http, bg, gui_str); if (verbose) {
print_settings(try_http, bg, gui_str);
}
} else { } else {
rfbLogEnable(0); rfbLogEnable(0);
} }
...@@ -2907,7 +2915,7 @@ int main(int argc, char* argv[]) { ...@@ -2907,7 +2915,7 @@ int main(int argc, char* argv[]) {
scr = DefaultScreen(dpy); scr = DefaultScreen(dpy);
rootwin = RootWindow(dpy, scr); rootwin = RootWindow(dpy, scr);
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("\n"); rfbLog("\n");
rfbLog("------------------ USEFUL INFORMATION ------------------\n"); rfbLog("------------------ USEFUL INFORMATION ------------------\n");
} }
...@@ -2938,7 +2946,7 @@ int main(int argc, char* argv[]) { ...@@ -2938,7 +2946,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXFIXES #if LIBVNCSERVER_HAVE_LIBXFIXES
if (! XFixesQueryExtension(dpy, &xfixes_base_event_type, &er)) { if (! XFixesQueryExtension(dpy, &xfixes_base_event_type, &er)) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("Disabling XFIXES mode: display does not " rfbLog("Disabling XFIXES mode: display does not "
"support it.\n"); "support it.\n");
} }
...@@ -2954,7 +2962,7 @@ int main(int argc, char* argv[]) { ...@@ -2954,7 +2962,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXDAMAGE #if LIBVNCSERVER_HAVE_LIBXDAMAGE
if (! XDamageQueryExtension(dpy, &xdamage_base_event_type, &er)) { if (! XDamageQueryExtension(dpy, &xdamage_base_event_type, &er)) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("Disabling X DAMAGE mode: display does not " rfbLog("Disabling X DAMAGE mode: display does not "
"support it.\n"); "support it.\n");
} }
...@@ -2967,14 +2975,14 @@ int main(int argc, char* argv[]) { ...@@ -2967,14 +2975,14 @@ int main(int argc, char* argv[]) {
if (! xdamage_present) { if (! xdamage_present) {
use_xdamage = 0; use_xdamage = 0;
} }
if (! quiet && xdamage_present && use_xdamage) { if (! quiet && xdamage_present && use_xdamage && ! raw_fb_str) {
rfbLog("X DAMAGE available on display, using it for" rfbLog("X DAMAGE available on display, using it for"
" polling hints.\n"); " polling hints.\n");
rfbLog(" To disable this behavior use: " rfbLog(" To disable this behavior use: "
"'-noxdamage'\n"); "'-noxdamage'\n");
} }
if (! quiet && wireframe) { if (! quiet && wireframe && ! raw_fb_str) {
rfbLog("Wireframing: -wireframe mode is in effect for window " rfbLog("Wireframing: -wireframe mode is in effect for window "
"moves.\n"); "moves.\n");
rfbLog(" If this yields undesired behavior (poor response, " rfbLog(" If this yields undesired behavior (poor response, "
...@@ -2999,7 +3007,7 @@ int main(int argc, char* argv[]) { ...@@ -2999,7 +3007,7 @@ int main(int argc, char* argv[]) {
overlay_present = 0; overlay_present = 0;
#if defined(SOLARIS_OVERLAY) && !NO_X11 #if defined(SOLARIS_OVERLAY) && !NO_X11
if (! XQueryExtension(dpy, "SUN_OVL", &maj, &ev, &er)) { if (! XQueryExtension(dpy, "SUN_OVL", &maj, &ev, &er)) {
if (! quiet && overlay) { if (! quiet && overlay && ! raw_fb_str) {
rfbLog("Disabling -overlay: SUN_OVL " rfbLog("Disabling -overlay: SUN_OVL "
"extension not available.\n"); "extension not available.\n");
} }
...@@ -3009,7 +3017,7 @@ int main(int argc, char* argv[]) { ...@@ -3009,7 +3017,7 @@ int main(int argc, char* argv[]) {
#endif #endif
#if defined(IRIX_OVERLAY) && !NO_X11 #if defined(IRIX_OVERLAY) && !NO_X11
if (! XReadDisplayQueryExtension(dpy, &ev, &er)) { if (! XReadDisplayQueryExtension(dpy, &ev, &er)) {
if (! quiet && overlay) { if (! quiet && overlay && ! raw_fb_str) {
rfbLog("Disabling -overlay: IRIX ReadDisplay " rfbLog("Disabling -overlay: IRIX ReadDisplay "
"extension not available.\n"); "extension not available.\n");
} }
...@@ -3032,7 +3040,7 @@ int main(int argc, char* argv[]) { ...@@ -3032,7 +3040,7 @@ int main(int argc, char* argv[]) {
free(multiple_cursors_mode); free(multiple_cursors_mode);
multiple_cursors_mode = strdup("most"); multiple_cursors_mode = strdup("most");
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("XFIXES available on display, resetting" rfbLog("XFIXES available on display, resetting"
" cursor mode\n"); " cursor mode\n");
rfbLog(" to: '-cursor most'.\n"); rfbLog(" to: '-cursor most'.\n");
...@@ -3044,7 +3052,7 @@ int main(int argc, char* argv[]) { ...@@ -3044,7 +3052,7 @@ int main(int argc, char* argv[]) {
if(!strcmp(multiple_cursors_mode, "most")) { if(!strcmp(multiple_cursors_mode, "most")) {
if (xfixes_present && use_xfixes && if (xfixes_present && use_xfixes &&
overlay_cursor == 1) { overlay_cursor == 1) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("using XFIXES for cursor " rfbLog("using XFIXES for cursor "
"drawing.\n"); "drawing.\n");
} }
...@@ -3055,7 +3063,7 @@ int main(int argc, char* argv[]) { ...@@ -3055,7 +3063,7 @@ int main(int argc, char* argv[]) {
if (overlay) { if (overlay) {
using_shm = 0; using_shm = 0;
if (flash_cmap && ! quiet) { if (flash_cmap && ! quiet && ! raw_fb_str) {
rfbLog("warning: -flashcmap may be " rfbLog("warning: -flashcmap may be "
"incompatible with -overlay\n"); "incompatible with -overlay\n");
} }
...@@ -3082,7 +3090,7 @@ int main(int argc, char* argv[]) { ...@@ -3082,7 +3090,7 @@ int main(int argc, char* argv[]) {
/* check for XTEST */ /* check for XTEST */
if (! XTestQueryExtension_wr(dpy, &ev, &er, &maj, &min)) { if (! XTestQueryExtension_wr(dpy, &ev, &er, &maj, &min)) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("WARNING: XTEST extension not available " rfbLog("WARNING: XTEST extension not available "
"(either missing from\n"); "(either missing from\n");
rfbLog(" display or client library libXtst " rfbLog(" display or client library libXtst "
...@@ -3149,7 +3157,7 @@ int main(int argc, char* argv[]) { ...@@ -3149,7 +3157,7 @@ int main(int argc, char* argv[]) {
#if !LIBVNCSERVER_HAVE_RECORD #if !LIBVNCSERVER_HAVE_RECORD
tmpi = 0; tmpi = 0;
#endif #endif
if (! quiet && tmpi) { if (! quiet && tmpi && ! raw_fb_str) {
rfbLog("Scroll Detection: -scrollcopyrect mode is in effect " rfbLog("Scroll Detection: -scrollcopyrect mode is in effect "
"to\n"); "to\n");
rfbLog(" use RECORD extension to try to detect scrolling " rfbLog(" use RECORD extension to try to detect scrolling "
...@@ -3183,12 +3191,12 @@ int main(int argc, char* argv[]) { ...@@ -3183,12 +3191,12 @@ int main(int argc, char* argv[]) {
if (! XShmQueryExtension_wr(dpy)) { if (! XShmQueryExtension_wr(dpy)) {
xshm_present = 0; xshm_present = 0;
if (! using_shm) { if (! using_shm) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("info: display does not support" rfbLog("info: display does not support"
" XShm.\n"); " XShm.\n");
} }
} else { } else {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("warning: XShm extension is not available.\n"); rfbLog("warning: XShm extension is not available.\n");
rfbLog("For best performance the X Display should be" rfbLog("For best performance the X Display should be"
" local. (i.e.\n"); " local. (i.e.\n");
...@@ -3212,7 +3220,7 @@ int main(int argc, char* argv[]) { ...@@ -3212,7 +3220,7 @@ int main(int argc, char* argv[]) {
initialize_xkb(); initialize_xkb();
initialize_watch_bell(); initialize_watch_bell();
if (!xkb_present && use_xkb_modtweak) { if (!xkb_present && use_xkb_modtweak) {
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("warning: disabling xkb modtweak." rfbLog("warning: disabling xkb modtweak."
" XKEYBOARD ext. not present.\n"); " XKEYBOARD ext. not present.\n");
} }
...@@ -3228,7 +3236,7 @@ int main(int argc, char* argv[]) { ...@@ -3228,7 +3236,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXRANDR #if LIBVNCSERVER_HAVE_LIBXRANDR
if (! XRRQueryExtension(dpy, &xrandr_base_event_type, &er)) { if (! XRRQueryExtension(dpy, &xrandr_base_event_type, &er)) {
if (xrandr && ! quiet) { if (xrandr && ! quiet && ! raw_fb_str) {
rfbLog("Disabling -xrandr mode: display does not" rfbLog("Disabling -xrandr mode: display does not"
" support X RANDR.\n"); " support X RANDR.\n");
} }
...@@ -3242,7 +3250,7 @@ int main(int argc, char* argv[]) { ...@@ -3242,7 +3250,7 @@ int main(int argc, char* argv[]) {
check_pm(); check_pm();
if (! quiet) { if (! quiet && ! raw_fb_str) {
rfbLog("--------------------------------------------------------\n"); rfbLog("--------------------------------------------------------\n");
rfbLog("\n"); rfbLog("\n");
} }
...@@ -3337,9 +3345,13 @@ int main(int argc, char* argv[]) { ...@@ -3337,9 +3345,13 @@ int main(int argc, char* argv[]) {
} }
if (! inetd && ! use_openssl) { if (! inetd && ! use_openssl) {
if (! screen->port || screen->listenSock < 0) { if (! screen->port || screen->listenSock < 0) {
rfbLogEnable(1); if (got_rfbport && got_rfbport_val == 0) {
rfbLog("Error: could not obtain listening port.\n"); ;
clean_up_exit(1); } else {
rfbLogEnable(1);
rfbLog("Error: could not obtain listening port.\n");
clean_up_exit(1);
}
} }
} }
if (! quiet) { if (! quiet) {
......
...@@ -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.3 lastmod: 2006-09-15"; char lastmod[] = "0.8.3 lastmod: 2006-09-17";
/* X display info */ /* X display info */
......
...@@ -243,14 +243,18 @@ static void initialize_xinerama (void) { ...@@ -243,14 +243,18 @@ static void initialize_xinerama (void) {
RAWFB_RET_VOID RAWFB_RET_VOID
if (! XineramaQueryExtension(dpy, &ev, &er)) { if (! XineramaQueryExtension(dpy, &ev, &er)) {
rfbLog("Xinerama: disabling: display does not support it.\n"); if (verbose) {
rfbLog("Xinerama: disabling: display does not support it.\n");
}
xinerama = 0; xinerama = 0;
xinerama_present = 0; xinerama_present = 0;
return; return;
} }
if (! XineramaIsActive(dpy)) { if (! XineramaIsActive(dpy)) {
/* n.b. change to XineramaActive(dpy, window) someday */ /* n.b. change to XineramaActive(dpy, window) someday */
rfbLog("Xinerama: disabling: not active on display.\n"); if (verbose) {
rfbLog("Xinerama: disabling: not active on display.\n");
}
xinerama = 0; xinerama = 0;
xinerama_present = 0; xinerama_present = 0;
return; return;
...@@ -259,11 +263,15 @@ static void initialize_xinerama (void) { ...@@ -259,11 +263,15 @@ static void initialize_xinerama (void) {
/* n.b. change to XineramaGetData() someday */ /* n.b. change to XineramaGetData() someday */
xineramas = XineramaQueryScreens(dpy, &n); xineramas = XineramaQueryScreens(dpy, &n);
rfbLog("Xinerama: number of sub-screens: %d\n", n); if (verbose) {
rfbLog("Xinerama: number of sub-screens: %d\n", n);
}
if (n == 1) { if (n == 1) {
rfbLog("Xinerama: no blackouts needed (only one" if (verbose) {
" sub-screen)\n"); rfbLog("Xinerama: no blackouts needed (only one"
" sub-screen)\n");
}
XFree(xineramas); XFree(xineramas);
return; /* must be OK w/o change */ return; /* must be OK w/o change */
} }
......
...@@ -922,7 +922,7 @@ void disable_grabserver(Display *in_dpy, int change) { ...@@ -922,7 +922,7 @@ void disable_grabserver(Display *in_dpy, int change) {
if (change) { if (change) {
XTRAP_GrabControl_wr(in_dpy, False); XTRAP_GrabControl_wr(in_dpy, False);
} }
if (! didmsg) { if (! didmsg && ! raw_fb_str) {
rfbLog("GrabServer control via XTEST.\n"); rfbLog("GrabServer control via XTEST.\n");
didmsg = 1; didmsg = 1;
} }
...@@ -930,7 +930,7 @@ void disable_grabserver(Display *in_dpy, int change) { ...@@ -930,7 +930,7 @@ void disable_grabserver(Display *in_dpy, int change) {
} else { } else {
if (XTRAP_GrabControl_wr(in_dpy, True)) { if (XTRAP_GrabControl_wr(in_dpy, True)) {
ok = 1; ok = 1;
if (! didmsg) { if (! didmsg && ! raw_fb_str) {
rfbLog("Using DEC-XTRAP for protection" rfbLog("Using DEC-XTRAP for protection"
" from XGrabServer.\n"); " from XGrabServer.\n");
didmsg = 1; didmsg = 1;
...@@ -942,7 +942,7 @@ void disable_grabserver(Display *in_dpy, int change) { ...@@ -942,7 +942,7 @@ void disable_grabserver(Display *in_dpy, int change) {
if (change) { if (change) {
XTestGrabControl_wr(in_dpy, False); XTestGrabControl_wr(in_dpy, False);
} }
if (! didmsg) { if (! didmsg && ! raw_fb_str) {
rfbLog("GrabServer control via DEC-XTRAP.\n"); rfbLog("GrabServer control via DEC-XTRAP.\n");
didmsg = 1; didmsg = 1;
} }
...@@ -950,7 +950,7 @@ void disable_grabserver(Display *in_dpy, int change) { ...@@ -950,7 +950,7 @@ void disable_grabserver(Display *in_dpy, int change) {
} else { } else {
if (XTestGrabControl_wr(in_dpy, True)) { if (XTestGrabControl_wr(in_dpy, True)) {
ok = 1; ok = 1;
if (! didmsg) { if (! didmsg && ! raw_fb_str) {
rfbLog("DEC-XTRAP XGrabServer " rfbLog("DEC-XTRAP XGrabServer "
"protection not available, " "protection not available, "
"using XTEST.\n"); "using XTEST.\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