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>
* x11vnc: allow user set signals to ignore, clear DISPLAY in
-unixpw su_verify. -rawfb none same as null.
......
This diff is collapsed.
......@@ -1587,6 +1587,9 @@ static int do_reverse_connect(char *str) {
free(host);
if (cl == NULL) {
if (quiet && connect_or_exit) {
rfbLogEnable(1);
}
rfbLog("reverse_connect: %s failed\n", str);
return 0;
} else {
......@@ -1609,6 +1612,7 @@ void reverse_connect(char *str) {
int sleep_between_host = 300;
int sleep_min = 1500, sleep_max = 4500, n_max = 5;
int n, tot, t, dt = 100, cnt = 0;
int nclients0 = client_count;
if (unixpw_in_progress) return;
......@@ -1634,6 +1638,11 @@ void reverse_connect(char *str) {
free(tmp);
if (cnt == 0) {
if (connect_or_exit) {
rfbLogEnable(1);
rfbLog("exiting under -connect_or_exit\n");
clean_up_exit(0);
}
return;
}
......@@ -1652,10 +1661,24 @@ void reverse_connect(char *str) {
t = 0;
while (t < tot) {
rfbPE(-1);
rfbPE(-1);
usleep(dt * 1000);
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) {
int i, j, n = 0;
static int first = 1;
rfbLog("setting up %d cursors...\n", CURS_MAX);
if (verbose) {
rfbLog("setting up %d cursors...\n", CURS_MAX);
}
if (first) {
for (i=0; i<CURS_MAX; i++) {
......@@ -814,7 +816,9 @@ static void setup_cursors(void) {
if (screen) {
UNLOCK(screen->cursorMutex);
}
rfbLog(" done.\n");
if (verbose) {
rfbLog(" done.\n");
}
rfbLog("\n");
}
......
......@@ -345,8 +345,14 @@ void print_help(int mode) {
" If \"string\" contains \"/\" it is instead interpreted\n"
" as a file to periodically check for new hosts.\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"
" root (e.g. via gdm(1), etc).\n"
" Be careful about the location of this file if x11vnc\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"
"-vncconnect Monitor the VNC_CONNECT X property set by the standard\n"
"-novncconnect VNC program vncconnect(1). When the property is\n"
......@@ -379,6 +385,11 @@ void print_help(int mode) {
" the -allow list (and vice versa) to avoid situations\n"
" where no connections (or too many) are allowed.\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"
" host names or IP numbers. Use this if name resolution\n"
" is incorrectly set up and leads to long pauses as name\n"
......@@ -1543,8 +1554,10 @@ void print_help(int mode) {
"-dbg Instead of exiting after cleaning up, run a simple\n"
" \"debug crash shell\" when fatal errors are trapped.\n"
"\n"
"-q Be quiet by printing less informational output to\n"
" stderr. Same as -quiet.\n"
"-q, -quiet Be quiet by printing less informational output to\n"
" stderr.\n"
"-v, -verbose Print out more information to stderr.\n"
"\n"
"-bg Go into the background after screen setup. Messages to\n"
" stderr are lost unless -o logfile is used. Something\n"
" like this could be useful in a script:\n"
......
......@@ -996,27 +996,31 @@ void switch_to_xkb_if_better(void) {
XFree(keymap);
if (missing_noxkb == 0 && syms_gt_4 >= 8) {
rfbLog("XKEYBOARD: number of keysyms per keycode %d "
"is greater\n", syms_per_keycode);
rfbLog(" than 4 and %d keysyms are mapped above 4.\n",
syms_gt_4);
rfbLog(" Automatically switching to -xkb mode.\n");
rfbLog(" If this makes the key mapping worse you can\n");
rfbLog(" disable it with the \"-noxkb\" option.\n");
rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
if (! raw_fb_str) {
rfbLog("XKEYBOARD: number of keysyms per keycode %d "
"is greater\n", syms_per_keycode);
rfbLog(" than 4 and %d keysyms are mapped above 4.\n",
syms_gt_4);
rfbLog(" Automatically switching to -xkb mode.\n");
rfbLog(" If this makes the key mapping worse you can\n");
rfbLog(" disable it with the \"-noxkb\" option.\n");
rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
}
use_xkb_modtweak = 1;
return;
} else if (missing_noxkb == 0) {
rfbLog("XKEYBOARD: all %d \"must have\" keysyms accounted"
" for.\n", n);
rfbLog(" Not automatically switching to -xkb mode.\n");
rfbLog(" If some keys still cannot be typed, try using"
" -xkb.\n");
rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
if (! raw_fb_str) {
rfbLog("XKEYBOARD: all %d \"must have\" keysyms accounted"
" for.\n", n);
rfbLog(" Not automatically switching to -xkb mode.\n");
rfbLog(" If some keys still cannot be typed, try using"
" -xkb.\n");
rfbLog(" Also, remember \"-remap DEAD\" for accenting"
" characters.\n");
}
return;
}
......
......@@ -150,6 +150,7 @@ int noxrecord = 0;
char *client_connect = NULL; /* strings for -connect option */
char *client_connect_file = NULL;
int connect_or_exit = 0;
int vnc_connect = 1; /* -vncconnect option */
int show_cursor = 1; /* show cursor shapes */
......@@ -326,6 +327,7 @@ int debug_pointer = 0;
int debug_keyboard = 0;
int quiet = 0;
int verbose = 0;
/* threaded vs. non-threaded (default) */
#if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(X11VNC_THREADED)
......@@ -336,6 +338,7 @@ int use_threads = 0;
/* info about command line opts */
int got_rfbport = 0;
int got_rfbport_val = -1;
int got_alwaysshared = 0;
int got_nevershared = 0;
int got_cursorpos = 0;
......
......@@ -125,6 +125,7 @@ extern int noxrecord;
extern char *client_connect;
extern char *client_connect_file;
extern int connect_or_exit;
extern int vnc_connect;
extern int show_cursor;
......@@ -247,10 +248,12 @@ extern int debug_pointer;
extern int debug_keyboard;
extern int quiet;
extern int verbose;
extern int use_threads;
extern int got_rfbport;
extern int got_rfbport_val;
extern int got_alwaysshared;
extern int got_nevershared;
extern int got_cursorpos;
......
......@@ -36,7 +36,9 @@ static void check_fbpm(void) {
" VNC clients are connected.\n");
}
} 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;
}
init_fbpm = 1;
......@@ -85,7 +87,9 @@ static void check_fbpm(void) {
#else
RAWFB_RET_VOID
if (! init_fbpm) {
rfbLog("X FBPM extension not supported.\n");
if (! raw_fb_str) {
rfbLog("X FBPM extension not supported.\n");
}
init_fbpm = 1;
}
#endif
......
......@@ -467,7 +467,7 @@ void initialize_polling_images(void) {
break;
}
}
if (!quiet) {
if (verbose) {
if (using_shm && ! xform24to32) {
rfbLog("created %d tile_row shm polling images.\n",
tile_shm_count);
......
......@@ -565,7 +565,7 @@ void set_raw_fb_params(int restore) {
return;
}
if (! quiet) {
if (verbose) {
rfbLog("set_raw_fb_params: modifying settings for "
"-rawfb mode.\n");
}
......@@ -577,7 +577,7 @@ void set_raw_fb_params(int restore) {
* (i.e. rawfb but also send user input to the X
* display, most likely using /dev/fb0 for some reason...)
*/
if (! quiet) {
if (verbose) {
rfbLog("rawfb: -noviewonly mode: still sending mouse and\n");
rfbLog("rawfb: keyboard input to the X DISPLAY!!\n");
}
......@@ -590,50 +590,50 @@ void set_raw_fb_params(int restore) {
}
#endif
if (watch_selection) {
if (! quiet) rfbLog(" rawfb: turning off "
if (verbose) rfbLog(" rawfb: turning off "
"watch_selection\n");
watch_selection = 0;
}
if (watch_primary) {
if (! quiet) rfbLog(" rawfb: turning off "
if (verbose) rfbLog(" rawfb: turning off "
"watch_primary\n");
watch_primary = 0;
}
if (watch_clipboard) {
if (! quiet) rfbLog(" rawfb: turning off "
if (verbose) rfbLog(" rawfb: turning off "
"watch_clipboard\n");
watch_clipboard = 0;
}
if (watch_bell) {
if (! quiet) rfbLog(" rawfb: turning off watch_bell\n");
if (verbose) rfbLog(" rawfb: turning off watch_bell\n");
watch_bell = 0;
}
if (no_autorepeat) {
if (! quiet) rfbLog(" rawfb: turning off "
if (verbose) rfbLog(" rawfb: turning off "
"no_autorepeat\n");
no_autorepeat = 0;
}
if (use_solid_bg) {
if (! quiet) rfbLog(" rawfb: turning off "
if (verbose) rfbLog(" rawfb: turning off "
"use_solid_bg\n");
use_solid_bg = 0;
}
multiple_cursors_mode = strdup("arrow");
}
if (using_shm) {
if (! quiet) rfbLog(" rawfb: turning off using_shm\n");
if (verbose) rfbLog(" rawfb: turning off using_shm\n");
using_shm = 0;
}
if (take_naps) {
if (! quiet) rfbLog(" rawfb: turning off take_naps\n");
if (verbose) rfbLog(" rawfb: turning off take_naps\n");
take_naps = 0;
}
if (xrandr) {
if (! quiet) rfbLog(" rawfb: turning off xrandr\n");
if (verbose) rfbLog(" rawfb: turning off xrandr\n");
xrandr = 0;
}
if (! noxrecord) {
if (! quiet) rfbLog(" rawfb: turning off xrecord\n");
if (verbose) rfbLog(" rawfb: turning off xrecord\n");
noxrecord = 1;
}
}
......@@ -1304,16 +1304,19 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
memset(raw_fb, 0xff, dpy_x * dpy_y * b/8);
}
rfbLog("\n");
rfbLog("rawfb: raw_fb %p\n", raw_fb);
rfbLog(" format %d\n", raw_fb_image->format);
rfbLog(" width %d\n", raw_fb_image->width);
rfbLog(" height %d\n", raw_fb_image->height);
rfbLog(" bpp %d\n", raw_fb_image->bits_per_pixel);
rfbLog(" depth %d\n", raw_fb_image->depth);
rfbLog(" bpl %d\n", raw_fb_image->bytes_per_line);
if (use_snapfb && snap_fb) {
rfbLog(" snap_fb %p\n", snap_fb);
if (verbose) {
rfbLog("\n");
rfbLog("rawfb: raw_fb %p\n", raw_fb);
rfbLog(" format %d\n", raw_fb_image->format);
rfbLog(" width %d\n", raw_fb_image->width);
rfbLog(" height %d\n", raw_fb_image->height);
rfbLog(" bpp %d\n", raw_fb_image->bits_per_pixel);
rfbLog(" depth %d\n", raw_fb_image->depth);
rfbLog(" bpl %d\n", raw_fb_image->bytes_per_line);
if (use_snapfb && snap_fb) {
rfbLog(" snap_fb %p\n", snap_fb);
}
}
free(str);
......@@ -2196,7 +2199,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
}
#if !SMALL_FOOTPRINT
if (!quiet) {
if (verbose) {
fprintf(stderr, "\n");
fprintf(stderr, "FrameBuffer Info:\n");
fprintf(stderr, " width: %d\n", fb->width);
......@@ -2325,7 +2328,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} else {
screen->frameBuffer = rfb_fb;
}
if (!quiet) {
if (verbose) {
fprintf(stderr, " rfb_fb: %p\n", rfb_fb);
fprintf(stderr, " main_fb: %p\n", main_fb);
fprintf(stderr, " 8to24_fb: %p\n", cmap8to24_fb);
......@@ -2399,6 +2402,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} else if (! got_rfbport) {
screen->autoPort = TRUE;
} else if (got_rfbport && got_rfbport_val == 0) {
screen->autoPort = FALSE;
screen->port = 0;
}
if (! got_nevershared && ! got_alwaysshared) {
......
......@@ -314,6 +314,7 @@ void setup_stunnel(int rport, int *argc, char **argv) {
argv[i+1] = strdup(tmp);
*argc += 2;
got_rfbport = 1;
got_rfbport_val = atoi(tmp);
}
}
stunnel_port = rport;
......@@ -710,14 +711,34 @@ void sslEncKey(char *path, int mode) {
unlink(tmp);
if (! mode && cert && cert[0] != '\0') {
file = fopen(path, "a");
int got_cert = 0;
file = fopen(path, "r");
if (file == NULL) {
rfbLog("sslEncKey: %s\n", path);
rfbLogPerror("fopen");
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);
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);
}
......
......@@ -146,9 +146,35 @@ char *get_saved_pem(char *save, int create) {
}
}
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) {
......@@ -441,14 +467,17 @@ static char *create_tmp_pem(char *pathin, int prompt) {
return NULL;
}
while (fgets(line, 1024, in) != NULL) {
if (strstr(line, "-----BEGIN CERTIFICATE-----")) {
if (strstr(line, "BEGIN CERTIFICATE")) {
on = 1;
}
fprintf(out, "%s", line);
if (on) {
fprintf(crt, "%s", line);
}
if (strstr(line, "-----END CERTIFICATE-----")) {
if (strstr(line, "END CERTIFICATE")) {
on = 0;
}
if (strstr(line, "PRIVATE KEY")) {
on = 0;
}
}
......
......@@ -2,7 +2,7 @@
.TH X11VNC "1" "September 2006" "x11vnc " "User Commands"
.SH NAME
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
.B x11vnc
[OPTION]...
......@@ -409,11 +409,19 @@ your environment before starting x11vnc.
If \fIstring\fR contains "/" it is instead interpreted
as a file to periodically check for new hosts.
The first line is read and then the file is truncated.
Be careful for this usage mode if x11vnc is running as
root (e.g. via
Be careful about the location of this file if x11vnc
is running as root (e.g. via
.IR gdm (1)
, etc).
.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
.IP
Monitor the VNC_CONNECT X property set by the standard
......@@ -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-allow\fR list (and vice versa) to avoid situations
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
\fB-nolookup\fR
.IP
......@@ -1788,10 +1801,14 @@ Print out license information. Same as \fB-copying\fR and
Instead of exiting after cleaning up, run a simple
"debug crash shell" when fatal errors are trapped.
.PP
\fB-q\fR
\fB-q,\fR \fB-quiet\fR
.IP
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
\fB-bg\fR
.IP
......
......@@ -1625,13 +1625,17 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-http_ssl")) {
try_http = 1;
http_ssl = 1;
} else if (!strcmp(arg, "-connect")) {
} else if (!strcmp(arg, "-connect") ||
!strcmp(arg, "-connect_or_exit")) {
CHECK_ARGC
if (strchr(argv[++i], '/')) {
client_connect_file = strdup(argv[i]);
} else {
client_connect = strdup(argv[i]);
}
if (!strcmp(arg, "-connect_or_exit")) {
connect_or_exit = 1;
}
} else if (!strcmp(arg, "-vncconnect")) {
vnc_connect = 1;
} else if (!strcmp(arg, "-novncconnect")) {
......@@ -1887,6 +1891,8 @@ int main(int argc, char* argv[]) {
crash_debug = 0;
} else if (!strcmp(arg, "-q") || !strcmp(arg, "-quiet")) {
quiet = 1;
} else if (!strcmp(arg, "-v") || !strcmp(arg, "-verbose")) {
verbose = 1;
} else if (!strcmp(arg, "-bg") || !strcmp(arg, "-background")) {
#if LIBVNCSERVER_HAVE_SETSID
bg = 1;
......@@ -2306,7 +2312,8 @@ int main(int argc, char* argv[]) {
got_deferupdate = 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 ")) {
got_alwaysshared = 1;
......@@ -2710,7 +2717,6 @@ int main(int argc, char* argv[]) {
if (use_stunnel) {
exit(1);
}
/* others? */
}
if (flip_byte_order && using_shm && ! quiet) {
......@@ -2790,7 +2796,9 @@ int main(int argc, char* argv[]) {
initialize_crash_handler();
if (! quiet) {
print_settings(try_http, bg, gui_str);
if (verbose) {
print_settings(try_http, bg, gui_str);
}
} else {
rfbLogEnable(0);
}
......@@ -2907,7 +2915,7 @@ int main(int argc, char* argv[]) {
scr = DefaultScreen(dpy);
rootwin = RootWindow(dpy, scr);
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("\n");
rfbLog("------------------ USEFUL INFORMATION ------------------\n");
}
......@@ -2938,7 +2946,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXFIXES
if (! XFixesQueryExtension(dpy, &xfixes_base_event_type, &er)) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("Disabling XFIXES mode: display does not "
"support it.\n");
}
......@@ -2954,7 +2962,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXDAMAGE
if (! XDamageQueryExtension(dpy, &xdamage_base_event_type, &er)) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("Disabling X DAMAGE mode: display does not "
"support it.\n");
}
......@@ -2967,14 +2975,14 @@ int main(int argc, char* argv[]) {
if (! xdamage_present) {
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"
" polling hints.\n");
rfbLog(" To disable this behavior use: "
"'-noxdamage'\n");
}
if (! quiet && wireframe) {
if (! quiet && wireframe && ! raw_fb_str) {
rfbLog("Wireframing: -wireframe mode is in effect for window "
"moves.\n");
rfbLog(" If this yields undesired behavior (poor response, "
......@@ -2999,7 +3007,7 @@ int main(int argc, char* argv[]) {
overlay_present = 0;
#if defined(SOLARIS_OVERLAY) && !NO_X11
if (! XQueryExtension(dpy, "SUN_OVL", &maj, &ev, &er)) {
if (! quiet && overlay) {
if (! quiet && overlay && ! raw_fb_str) {
rfbLog("Disabling -overlay: SUN_OVL "
"extension not available.\n");
}
......@@ -3009,7 +3017,7 @@ int main(int argc, char* argv[]) {
#endif
#if defined(IRIX_OVERLAY) && !NO_X11
if (! XReadDisplayQueryExtension(dpy, &ev, &er)) {
if (! quiet && overlay) {
if (! quiet && overlay && ! raw_fb_str) {
rfbLog("Disabling -overlay: IRIX ReadDisplay "
"extension not available.\n");
}
......@@ -3032,7 +3040,7 @@ int main(int argc, char* argv[]) {
free(multiple_cursors_mode);
multiple_cursors_mode = strdup("most");
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("XFIXES available on display, resetting"
" cursor mode\n");
rfbLog(" to: '-cursor most'.\n");
......@@ -3044,7 +3052,7 @@ int main(int argc, char* argv[]) {
if(!strcmp(multiple_cursors_mode, "most")) {
if (xfixes_present && use_xfixes &&
overlay_cursor == 1) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("using XFIXES for cursor "
"drawing.\n");
}
......@@ -3055,7 +3063,7 @@ int main(int argc, char* argv[]) {
if (overlay) {
using_shm = 0;
if (flash_cmap && ! quiet) {
if (flash_cmap && ! quiet && ! raw_fb_str) {
rfbLog("warning: -flashcmap may be "
"incompatible with -overlay\n");
}
......@@ -3082,7 +3090,7 @@ int main(int argc, char* argv[]) {
/* check for XTEST */
if (! XTestQueryExtension_wr(dpy, &ev, &er, &maj, &min)) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("WARNING: XTEST extension not available "
"(either missing from\n");
rfbLog(" display or client library libXtst "
......@@ -3149,7 +3157,7 @@ int main(int argc, char* argv[]) {
#if !LIBVNCSERVER_HAVE_RECORD
tmpi = 0;
#endif
if (! quiet && tmpi) {
if (! quiet && tmpi && ! raw_fb_str) {
rfbLog("Scroll Detection: -scrollcopyrect mode is in effect "
"to\n");
rfbLog(" use RECORD extension to try to detect scrolling "
......@@ -3183,12 +3191,12 @@ int main(int argc, char* argv[]) {
if (! XShmQueryExtension_wr(dpy)) {
xshm_present = 0;
if (! using_shm) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("info: display does not support"
" XShm.\n");
}
} else {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("warning: XShm extension is not available.\n");
rfbLog("For best performance the X Display should be"
" local. (i.e.\n");
......@@ -3212,7 +3220,7 @@ int main(int argc, char* argv[]) {
initialize_xkb();
initialize_watch_bell();
if (!xkb_present && use_xkb_modtweak) {
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("warning: disabling xkb modtweak."
" XKEYBOARD ext. not present.\n");
}
......@@ -3228,7 +3236,7 @@ int main(int argc, char* argv[]) {
#if LIBVNCSERVER_HAVE_LIBXRANDR
if (! XRRQueryExtension(dpy, &xrandr_base_event_type, &er)) {
if (xrandr && ! quiet) {
if (xrandr && ! quiet && ! raw_fb_str) {
rfbLog("Disabling -xrandr mode: display does not"
" support X RANDR.\n");
}
......@@ -3242,7 +3250,7 @@ int main(int argc, char* argv[]) {
check_pm();
if (! quiet) {
if (! quiet && ! raw_fb_str) {
rfbLog("--------------------------------------------------------\n");
rfbLog("\n");
}
......@@ -3337,9 +3345,13 @@ int main(int argc, char* argv[]) {
}
if (! inetd && ! use_openssl) {
if (! screen->port || screen->listenSock < 0) {
rfbLogEnable(1);
rfbLog("Error: could not obtain listening port.\n");
clean_up_exit(1);
if (got_rfbport && got_rfbport_val == 0) {
;
} else {
rfbLogEnable(1);
rfbLog("Error: could not obtain listening port.\n");
clean_up_exit(1);
}
}
}
if (! quiet) {
......
......@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* 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 */
......
......@@ -243,14 +243,18 @@ static void initialize_xinerama (void) {
RAWFB_RET_VOID
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_present = 0;
return;
}
if (! XineramaIsActive(dpy)) {
/* 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_present = 0;
return;
......@@ -259,11 +263,15 @@ static void initialize_xinerama (void) {
/* n.b. change to XineramaGetData() someday */
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) {
rfbLog("Xinerama: no blackouts needed (only one"
" sub-screen)\n");
if (verbose) {
rfbLog("Xinerama: no blackouts needed (only one"
" sub-screen)\n");
}
XFree(xineramas);
return; /* must be OK w/o change */
}
......
......@@ -922,7 +922,7 @@ void disable_grabserver(Display *in_dpy, int change) {
if (change) {
XTRAP_GrabControl_wr(in_dpy, False);
}
if (! didmsg) {
if (! didmsg && ! raw_fb_str) {
rfbLog("GrabServer control via XTEST.\n");
didmsg = 1;
}
......@@ -930,7 +930,7 @@ void disable_grabserver(Display *in_dpy, int change) {
} else {
if (XTRAP_GrabControl_wr(in_dpy, True)) {
ok = 1;
if (! didmsg) {
if (! didmsg && ! raw_fb_str) {
rfbLog("Using DEC-XTRAP for protection"
" from XGrabServer.\n");
didmsg = 1;
......@@ -942,7 +942,7 @@ void disable_grabserver(Display *in_dpy, int change) {
if (change) {
XTestGrabControl_wr(in_dpy, False);
}
if (! didmsg) {
if (! didmsg && ! raw_fb_str) {
rfbLog("GrabServer control via DEC-XTRAP.\n");
didmsg = 1;
}
......@@ -950,7 +950,7 @@ void disable_grabserver(Display *in_dpy, int change) {
} else {
if (XTestGrabControl_wr(in_dpy, True)) {
ok = 1;
if (! didmsg) {
if (! didmsg && ! raw_fb_str) {
rfbLog("DEC-XTRAP XGrabServer "
"protection not available, "
"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