Commit c9610778 authored by runge's avatar runge

x11vnc: prepare_x11vnc_dist.sh for 0.9.10. -xdummy_xvfb,

        -svc_xdummy_xvfb and -create_x shorthand. lxde session.
        Xdummy improvements and root no longer required.
parent 9659bc12
#!/bin/bash #!/bin/bash
VERSION="0.9.9" VERSION="0.9.10"
cd "$(dirname "$0")" cd "$(dirname "$0")"
......
2009-12-24 Karl Runge <runge@karlrunge.com>
* x11vnc: prepare_x11vnc_dist.sh for 0.9.10. -xdummy_xvfb,
-svc_xdummy_xvfb and -create_x shorthand. lxde session.
Xdummy improvements and root no longer required.
2009-12-21 Karl Runge <runge@karlrunge.com> 2009-12-21 Karl Runge <runge@karlrunge.com>
* x11vnc: -DENC_HAVE_OPENSSL=0 to disable enc.h but still * x11vnc: -DENC_HAVE_OPENSSL=0 to disable enc.h but still
have ssl. Tweak ps command in find_display. Try to handle have ssl. Tweak ps command in find_display. Try to handle
......
This diff is collapsed.
...@@ -1117,6 +1117,11 @@ void print_help(int mode) { ...@@ -1117,6 +1117,11 @@ void print_help(int mode) {
"-xdummy As in -create, except Xdummy instead of Xvfb.\n" "-xdummy As in -create, except Xdummy instead of Xvfb.\n"
"-xvnc As in -create, except Xvnc instead of Xvfb.\n" "-xvnc As in -create, except Xvnc instead of Xvfb.\n"
"-xvnc_redirect As in -create, except Xvnc.redirect instead of Xvfb.\n" "-xvnc_redirect As in -create, except Xvnc.redirect instead of Xvfb.\n"
"-xdummy_xvfb Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb\n"
"\n"
"-create_x str Sets WAIT:cmd=FINDCREATEDISPLAY-<str> Can be on cmdline\n"
" after anything that sets WAIT:.. and other things\n"
" (e.g. -svc, -xdmsvc) to adjust the X server list.\n"
"\n" "\n"
"-svc Terminal services mode based on SSL access. Alias for\n" "-svc Terminal services mode based on SSL access. Alias for\n"
" -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users\n" " -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users\n"
...@@ -1124,6 +1129,7 @@ void print_help(int mode) { ...@@ -1124,6 +1129,7 @@ void print_help(int mode) {
"\n" "\n"
"-svc_xdummy As -svc except Xdummy instead of Xvfb.\n" "-svc_xdummy As -svc except Xdummy instead of Xvfb.\n"
"-svc_xvnc As -svc except Xvnc instead of Xvfb.\n" "-svc_xvnc As -svc except Xvnc instead of Xvfb.\n"
"-svc_xdummy_xvfb As -svc with Xdummy,Xvfb.\n"
"\n" "\n"
"-xdmsvc Display manager Terminal services mode based on SSL.\n" "-xdmsvc Display manager Terminal services mode based on SSL.\n"
" Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp\n" " Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp\n"
...@@ -1295,11 +1301,13 @@ void print_help(int mode) { ...@@ -1295,11 +1301,13 @@ void print_help(int mode) {
" mode when a virtual X server such as Xvfb is going\n" " mode when a virtual X server such as Xvfb is going\n"
" to be created. It sets the width and height of\n" " to be created. It sets the width and height of\n"
" the new display, and optionally the color depth as\n" " the new display, and optionally the color depth as\n"
" well. You can also supply \"gnome\", \"kde\", \"twm\",\n" " well.\n"
"\n"
" You can also supply \"gnome\", \"kde\", \"twm\",\n"
" \"fvwm\", \"mwm\", \"dtwm\", \"wmaker\", \"xfce\",\n" " \"fvwm\", \"mwm\", \"dtwm\", \"wmaker\", \"xfce\",\n"
" \"enlightenment\", \"Xsession\", or \"failsafe\"\n" " \"lxde\", \"enlightenment\", \"Xsession\", or\n"
" (same as \"xterm\") to have the created display use\n" " \"failsafe\" (same as \"xterm\") to have the created\n"
" that mode for the user session.\n" " display use that mode for the user session.\n"
"\n" "\n"
" Specify \"tag=...\" to set the unique FD_TAG desktop\n" " Specify \"tag=...\" to set the unique FD_TAG desktop\n"
" session tag described below. Note: this option will\n" " session tag described below. Note: this option will\n"
...@@ -1398,17 +1406,21 @@ void print_help(int mode) { ...@@ -1398,17 +1406,21 @@ void print_help(int mode) {
" Xdummy:\n" " Xdummy:\n"
"\n" "\n"
" The Xdummy wrapper is part of the x11vnc source code\n" " The Xdummy wrapper is part of the x11vnc source code\n"
" (x11vnc/misc/Xdummy) It should be available in PATH and\n" " (x11vnc/misc/Xdummy) It should be available in PATH\n"
" have run \"Xdummy -install\" once to create the shared\n" " and have run \"Xdummy -install\" once to create the\n"
" library. Xdummy requires root permission and only works\n" " shared library. Xdummy only works on Linux. As of\n"
" on Linux. (Note: specify FD_XDUMMY_NOROOT=1 to skip\n" " 12/2009 it no longer needs to be run as root, and the\n"
" a check for the root id; evidently your sudo(1) will\n" " default is to not run as root. In some circumstances\n"
" take care of everything. The -xdummy and -svc_xdummy\n" " permissions may require running it as root, in these\n"
" options imply FD_XDUMMY_NOROOT=1).\n" " cases specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same\n"
" as supplying -root to the Xdummy cmdline.\n"
"\n" "\n"
" Xvfb is available on most platforms and does not\n" " Xvfb is available on most platforms and does not\n"
" require root.\n" " require root.\n"
"\n" "\n"
" An advantage of Xdummy over Xvfb is that Xdummy supports\n"
" RANDR dynamic screen resizing.\n"
"\n"
" When x11vnc exits (i.e. user disconnects) the X\n" " When x11vnc exits (i.e. user disconnects) the X\n"
" server session stays running in the background.\n" " server session stays running in the background.\n"
" The FINDDISPLAY will find it directly next time.\n" " The FINDDISPLAY will find it directly next time.\n"
...@@ -1466,13 +1478,11 @@ void print_help(int mode) { ...@@ -1466,13 +1478,11 @@ void print_help(int mode) {
" More FD tricks: FD_CUPS=port or FD_CUPS=host:port\n" " More FD tricks: FD_CUPS=port or FD_CUPS=host:port\n"
" will set the cups printing environment. Similarly for\n" " will set the cups printing environment. Similarly for\n"
" FD_ESD=port or FD_ESD=host:port for esddsp sound\n" " FD_ESD=port or FD_ESD=host:port for esddsp sound\n"
" redirection. FD_XDUMMY_NOROOT means the Xdummy\n" " redirection. Set FD_EXTRA to a command to be run a\n"
" server does not need to be started as root (e.g. it\n" " few seconds after the X server starts up. Set FD_TAG\n"
" will sudo automatically). Set FD_EXTRA to a command\n" " to be a unique name for the session, it is set as an\n"
" to be run a few seconds after the X server starts up.\n" " X property, that makes FINDDISPLAY only find sessions\n"
" Set FD_TAG to be a unique name for the session, it is\n" " with that tag value.\n"
" set as an X property, that makes FINDDISPLAY only find\n"
" sessions with that tag value.\n"
"\n" "\n"
" If you want the FINDCREATEDISPLAY session to contact an\n" " If you want the FINDCREATEDISPLAY session to contact an\n"
" XDMCP login manager (xdm/gdm/kdm) on the same machine,\n" " XDMCP login manager (xdm/gdm/kdm) on the same machine,\n"
......
This diff is collapsed.
...@@ -1537,6 +1537,9 @@ char create_display[] = ...@@ -1537,6 +1537,9 @@ char create_display[] =
" elif [ \"X$have_startkde\" != \"X\" -a \"X$FD_SESS\" = \"Xkde\" ]; then\n" " elif [ \"X$have_startkde\" != \"X\" -a \"X$FD_SESS\" = \"Xkde\" ]; then\n"
" echo \"$have_startkde\"\n" " echo \"$have_startkde\"\n"
" return\n" " return\n"
" elif [ \"X$have_startlxde\" != \"X\" -a \"X$FD_SESS\" = \"Xlxde\" ]; then\n"
" echo \"$have_startlxde\"\n"
" return\n"
" elif [ \"X$have_twm\" != \"X\" -a \"X$FD_SESS\" = \"Xtwm\" ]; then\n" " elif [ \"X$have_twm\" != \"X\" -a \"X$FD_SESS\" = \"Xtwm\" ]; then\n"
" echo \"$have_twm\"\n" " echo \"$have_twm\"\n"
" return\n" " return\n"
...@@ -1605,6 +1608,12 @@ char create_display[] = ...@@ -1605,6 +1608,12 @@ char create_display[] =
" return\n" " return\n"
" fi\n" " fi\n"
" fi\n" " fi\n"
" if [ \"X$have_startlxde\" != \"X\" ]; then\n"
" if egrep -i 'Session=lxde' \"$home/.dmrc\" > /dev/null; then\n"
" echo \"$have_startlxde\"\n"
" return\n"
" fi\n"
" fi\n"
" if [ \"X$have_gnome_session\" != \"X\" ]; then\n" " if [ \"X$have_gnome_session\" != \"X\" ]; then\n"
" if egrep -i 'Session=gnome' \"$home/.dmrc\" > /dev/null; then\n" " if egrep -i 'Session=gnome' \"$home/.dmrc\" > /dev/null; then\n"
" echo \"$have_gnome_session\"\n" " echo \"$have_gnome_session\"\n"
...@@ -1990,19 +1999,6 @@ char create_display[] = ...@@ -1990,19 +1999,6 @@ char create_display[] =
" fi\n" " fi\n"
"}\n" "}\n"
"\n" "\n"
"try_Xdummy() {\n"
" if [ \"X$have_Xdummy\" = \"X\" ]; then\n"
" return\n"
" fi\n"
" if [ \"X$FD_XDUMMY_NOROOT\" != \"X\" ]; then\n"
" :\n"
" elif [ \"X$have_root\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" server $have_Xdummy :$N -geometry $geom -depth $depth\n"
"}\n"
"\n"
"try_Xvnc() {\n" "try_Xvnc() {\n"
" if [ \"X$have_Xvnc\" = \"X\" ]; then\n" " if [ \"X$have_Xvnc\" = \"X\" ]; then\n"
" return\n" " return\n"
...@@ -2019,32 +2015,7 @@ char create_display[] = ...@@ -2019,32 +2015,7 @@ char create_display[] =
" server $FD_XSRV :$N -geometry $geom -depth $depth\n" " server $FD_XSRV :$N -geometry $geom -depth $depth\n"
"}\n" "}\n"
"\n" "\n"
"\n" "add_modmap() {\n"
"try_Xvfb() {\n"
" if [ \"X$have_Xvfb\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" sarg=\"-screen\"\n"
" if uname | grep SunOS > /dev/null; then\n"
" if grep /usr/openwin/bin/Xsun $have_Xvfb > /dev/null; then\n"
" sarg=\"screen\"\n"
" fi\n"
" fi\n"
" margs=\"+kb\"\n"
"\n"
" # currently not enabled in Xvfb's we see.\n"
"# if $have_Xvfb -extension MOOMOO 2>&1 | grep -w RANDR >/dev/null; then\n"
"# margs=\"$margs +extension RANDR\"\n"
"# fi\n"
"\n"
" if [ $depth -ge 16 ]; then\n"
" # avoid DirectColor for default visual:\n"
" margs=\"$margs -cc 4\"\n"
" fi\n"
" server $have_Xvfb :$N $sarg 0 ${geom}x${depth} $margs\n"
"\n"
" if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
" if [ \"X$have_root\" = \"X\" ]; then\n" " if [ \"X$have_root\" = \"X\" ]; then\n"
" $have_nohup sh -c \"(\n" " $have_nohup sh -c \"(\n"
" sleep 10;\n" " sleep 10;\n"
...@@ -2094,9 +2065,54 @@ char create_display[] = ...@@ -2094,9 +2065,54 @@ char create_display[] =
" fi\n" " fi\n"
" ) 1>&2 &\n" " ) 1>&2 &\n"
" fi\n" " fi\n"
"}\n"
"\n"
"try_Xvfb() {\n"
" if [ \"X$have_Xvfb\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" sarg=\"-screen\"\n"
" if uname | grep SunOS > /dev/null; then\n"
" if grep /usr/openwin/bin/Xsun $have_Xvfb > /dev/null; then\n"
" sarg=\"screen\"\n"
" fi\n"
" fi\n"
" margs=\"+kb\"\n"
"\n"
" # currently not enabled in Xvfb's we see.\n"
"# if $have_Xvfb -extension MOOMOO 2>&1 | grep -w RANDR >/dev/null; then\n"
"# margs=\"$margs +extension RANDR\"\n"
"# fi\n"
"\n"
" if [ $depth -ge 16 ]; then\n"
" # avoid DirectColor for default visual:\n"
" margs=\"$margs -cc 4\"\n"
" fi\n"
" server $have_Xvfb :$N $sarg 0 ${geom}x${depth} $margs\n"
"\n"
" if [ \"X$result\" = \"X1\" -a \"X$have_xmodmap\" != \"X\" ]; then\n"
" add_modmap\n"
" fi\n"
"}\n"
"\n"
"try_Xdummy() {\n"
" if [ \"X$have_Xdummy\" = \"X\" ]; then\n"
" return\n"
" fi\n"
" if [ \"X$FD_XDUMMY_RUN_AS_ROOT\" != \"X\" -a \"X$have_root\" = \"X\" ]; then\n"
" return\n"
" fi\n"
"\n"
" server $have_Xdummy :$N -geometry $geom -depth $depth\n"
" \n"
" if [ \"X$result\" = \"X1\" -a \"X$have_xprop\" != \"X\" ]; then\n"
" (sleep 1; $have_xprop -display :$N -root -f X11VNC_TRAP_XRANDR 8s -set X11VNC_TRAP_XRANDR 1 >/dev/null 2>&1) &\n"
" sleep 1\n"
" fi\n" " fi\n"
"}\n" "}\n"
"\n" "\n"
"\n"
"cookie() {\n" "cookie() {\n"
" cookie=\"\"\n" " cookie=\"\"\n"
" if [ \"X$have_mcookie\" != \"X\" ]; then\n" " if [ \"X$have_mcookie\" != \"X\" ]; then\n"
...@@ -2234,7 +2250,7 @@ char create_display[] = ...@@ -2234,7 +2250,7 @@ char create_display[] =
" USER=`whoami`\n" " USER=`whoami`\n"
"fi\n" "fi\n"
"\n" "\n"
"PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde4/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin\n" "PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11:/usr/openwin/bin:/usr/dt/bin:/opt/kde4/bin:/opt/kde3/bin:/opt/gnome/bin:/usr/bin:/bin:/usr/sfw/bin:/usr/local/bin\n"
"\n" "\n"
"have_root=\"\"\n" "have_root=\"\"\n"
"id0=`id`\n" "id0=`id`\n"
...@@ -2247,7 +2263,7 @@ char create_display[] = ...@@ -2247,7 +2263,7 @@ char create_display[] =
" p_ok=1\n" " p_ok=1\n"
"fi\n" "fi\n"
"\n" "\n"
"for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth xdpyinfo mcookie md5sum xmodmap startkde dbus-launch gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker enlightenment metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup esddsp konsole gnome-terminal x-terminal-emulator perl startxfce4 startxfce\n" "for prog in startx xinit xdm gdm kdm xterm Xdummy Xvfb Xvnc xauth xdpyinfo mcookie md5sum xmodmap startkde startlxde dbus-launch gnome-session blackbox fvwm2 mwm openbox twm windowmaker wmaker enlightenment metacity X Xorg XFree86 Xsun Xsession dtwm netstat nohup esddsp konsole gnome-terminal x-terminal-emulator perl startxfce4 startxfce xprop\n"
"do\n" "do\n"
" p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n" " p2=`echo \"$prog\" | sed -e 's/-/_/g'`\n"
" eval \"have_$p2=''\"\n" " eval \"have_$p2=''\"\n"
......
...@@ -1272,8 +1272,11 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int ...@@ -1272,8 +1272,11 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
sprintf(luser, "%s's", user); sprintf(luser, "%s's", user);
lowercase(luser); lowercase(luser);
if (db) fprintf(stderr, "\nAIX luser compare: \"%s\" to \"%s\"\n", luser, instr);
if (strstr(luser, instr) == luser) { if (strstr(luser, instr) == luser) {
if (db) fprintf(stderr, "AIX luser compare: strstr OK.\n");
if (!strcmp(luser, instr)) { if (!strcmp(luser, instr)) {
if (db) fprintf(stderr, "AIX luser compare: strings equal.\n");
i = -1; i = -1;
j = 0; j = 0;
memset(instr, 0, sizeof(instr)); memset(instr, 0, sizeof(instr));
...@@ -1286,6 +1289,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int ...@@ -1286,6 +1289,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
continue; continue;
} }
} else { } else {
if (db) fprintf(stderr, "AIX luser compare: problem=1\n");
problem = 1; problem = 1;
} }
free(luser); free(luser);
...@@ -1297,7 +1301,6 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int ...@@ -1297,7 +1301,6 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
} }
if (problem) { if (problem) {
if (db) { if (db) {
fprintf(stderr, "\"Password:\" did not " fprintf(stderr, "\"Password:\" did not "
"appear: '%s'" " n=%d\n", instr, n); "appear: '%s'" " n=%d\n", instr, n);
...@@ -1319,7 +1322,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int ...@@ -1319,7 +1322,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
return 0; return 0;
} }
if (db > 2) fprintf(stderr, "\nsending passwd: %s\n", pass); if (db) fprintf(stderr, "\nsending passwd: %s\n", db > 2 ? pass : "****");
usleep(100 * 1000); usleep(100 * 1000);
if (slow_pw) { if (slow_pw) {
unsigned int k; unsigned int k;
...@@ -1703,7 +1706,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) { ...@@ -1703,7 +1706,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
char h3[] = " scale=... (n/m); scale_cursor=... (sc=); solid (so); id=; repeat; clear_mods (cm); clear_keys (ck);"; char h3[] = " scale=... (n/m); scale_cursor=... (sc=); solid (so); id=; repeat; clear_mods (cm); clear_keys (ck);";
char h4[] = " clear_all (ca); speeds=... (sp=); readtimeout=... (rd=) rotate=... (ro=); noncache (nc) (nc=n);"; char h4[] = " clear_all (ca); speeds=... (sp=); readtimeout=... (rd=) rotate=... (ro=); noncache (nc) (nc=n);";
char h5[] = " geom=WxHxD (ge=); nodisplay=... (nd=); viewonly (vo); tag=...; gnome kde twm fvwm mwm dtwm wmaker"; char h5[] = " geom=WxHxD (ge=); nodisplay=... (nd=); viewonly (vo); tag=...; gnome kde twm fvwm mwm dtwm wmaker";
char h6[] = " xfce enlightenment Xsession failsafe. Examples: fred:3/4,so,cm wilma:geom=1024x768x16,kde"; char h6[] = " xfce lxde enlightenment Xsession failsafe. Examples: fred:3/4,so,cm wilma:geom=1024x768x16,kde";
int ch = 13, p; int ch = 13, p;
if (f1_help) { if (f1_help) {
p = black_pixel(); p = black_pixel();
......
...@@ -1988,6 +1988,8 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t ...@@ -1988,6 +1988,8 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t
sprintf(fdsess, "gnome"); sprintf(fdsess, "gnome");
} else if (strstr(t, "kde")) { } else if (strstr(t, "kde")) {
sprintf(fdsess, "kde"); sprintf(fdsess, "kde");
} else if (strstr(t, "lxde")) {
sprintf(fdsess, "lxde");
} else if (strstr(t, "twm")) { } else if (strstr(t, "twm")) {
sprintf(fdsess, "twm"); sprintf(fdsess, "twm");
} else if (strstr(t, "fvwm")) { } else if (strstr(t, "fvwm")) {
...@@ -2120,8 +2122,8 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t ...@@ -2120,8 +2122,8 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t
if (fdtag[0] == '\0' && getenv("FD_TAG")) { if (fdtag[0] == '\0' && getenv("FD_TAG")) {
snprintf(fdtag, 120, "%s", getenv("FD_TAG")); snprintf(fdtag, 120, "%s", getenv("FD_TAG"));
} }
if (fdxdum[0] == '\0' && getenv("FD_XDUMMY_NOROOT")) { if (fdxdum[0] == '\0' && getenv("FD_XDUMMY_RUN_AS_ROOT")) {
snprintf(fdxdum, 120, "%s", getenv("FD_XDUMMY_NOROOT")); snprintf(fdxdum, 120, "%s", getenv("FD_XDUMMY_RUN_AS_ROOT"));
} }
if (getenv("CREATE_DISPLAY_OUTPUT")) { if (getenv("CREATE_DISPLAY_OUTPUT")) {
snprintf(cdout, 120, "CREATE_DISPLAY_OUTPUT='%s'", getenv("CREATE_DISPLAY_OUTPUT")); snprintf(cdout, 120, "CREATE_DISPLAY_OUTPUT='%s'", getenv("CREATE_DISPLAY_OUTPUT"));
...@@ -2151,7 +2153,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t ...@@ -2151,7 +2153,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t
set_env("FD_NAS", fdnas); set_env("FD_NAS", fdnas);
set_env("FD_SMB", fdsmb); set_env("FD_SMB", fdsmb);
set_env("FD_TAG", fdtag); set_env("FD_TAG", fdtag);
set_env("FD_XDUMMY_NOROOT", fdxdum); set_env("FD_XDUMMY_RUN_AS_ROOT", fdxdum);
set_env("FD_SESS", fdsess); set_env("FD_SESS", fdsess);
if (usslpeer || (unixpw && keep_unixpw_user)) { if (usslpeer || (unixpw && keep_unixpw_user)) {
...@@ -2174,7 +2176,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t ...@@ -2174,7 +2176,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t
+ strlen("FD_NAS='' ") + strlen("FD_NAS='' ")
+ strlen("FD_SMB='' ") + strlen("FD_SMB='' ")
+ strlen("FD_TAG='' ") + strlen("FD_TAG='' ")
+ strlen("FD_XDUMMY_NOROOT='' ") + strlen("FD_XDUMMY_RUN_AS_ROOT='' ")
+ strlen("FD_SESS='' /bin/sh ") + strlen("FD_SESS='' /bin/sh ")
+ strlen(uu) + 1 + strlen(uu) + 1
+ strlen(fdgeom) + 1 + strlen(fdgeom) + 1
...@@ -2194,7 +2196,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t ...@@ -2194,7 +2196,7 @@ static char *build_create_cmd(char *cmd, int *saw_xdmcp, char *usslpeer, char *t
sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' " sprintf(create_cmd, "env USER='%s' FD_GEOM='%s' FD_SESS='%s' "
"FD_OPTS='%s' FD_EXTRA='%s' FD_PROG='%s' FD_XSRV='%s' FD_CUPS='%s' " "FD_OPTS='%s' FD_EXTRA='%s' FD_PROG='%s' FD_XSRV='%s' FD_CUPS='%s' "
"FD_ESD='%s' FD_NAS='%s' FD_SMB='%s' FD_TAG='%s' " "FD_ESD='%s' FD_NAS='%s' FD_SMB='%s' FD_TAG='%s' "
"FD_XDUMMY_NOROOT='%s' %s /bin/sh %s %s", "FD_XDUMMY_RUN_AS_ROOT='%s' %s /bin/sh %s %s",
uu, fdgeom, fdsess, fdopts, fdextra, fdprog, fdxsrv, uu, fdgeom, fdsess, fdopts, fdextra, fdprog, fdxsrv,
fdcups, fdesd, fdnas, fdsmb, fdtag, fdxdum, cdout, tmp, opts); fdcups, fdesd, fdnas, fdsmb, fdtag, fdxdum, cdout, tmp, opts);
} else { } else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.TH X11VNC "1" "December 2009" "x11vnc " "User Commands" .TH X11VNC "1" "December 2009" "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.9.9, lastmod: 2009-12-21 version: 0.9.10, lastmod: 2009-12-24
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -1247,6 +1247,16 @@ As in \fB-create,\fR except Xvnc instead of Xvfb. ...@@ -1247,6 +1247,16 @@ As in \fB-create,\fR except Xvnc instead of Xvfb.
.IP .IP
As in \fB-create,\fR except Xvnc.redirect instead of Xvfb. As in \fB-create,\fR except Xvnc.redirect instead of Xvfb.
.PP .PP
\fB-xdummy_xvfb\fR
.IP
Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb
.PP
\fB-create_x\fR \fIstr\fR
.IP
Sets WAIT:cmd=FINDCREATEDISPLAY-<str> Can be on cmdline
after anything that sets WAIT:.. and other things
(e.g. \fB-svc,\fR \fB-xdmsvc)\fR to adjust the X server list.
.PP
\fB-svc\fR \fB-svc\fR
.IP .IP
Terminal services mode based on SSL access. Alias for Terminal services mode based on SSL access. Alias for
...@@ -1261,6 +1271,10 @@ As \fB-svc\fR except Xdummy instead of Xvfb. ...@@ -1261,6 +1271,10 @@ As \fB-svc\fR except Xdummy instead of Xvfb.
.IP .IP
As \fB-svc\fR except Xvnc instead of Xvfb. As \fB-svc\fR except Xvnc instead of Xvfb.
.PP .PP
\fB-svc_xdummy_xvfb\fR
.IP
As \fB-svc\fR with Xdummy,Xvfb.
.PP
\fB-xdmsvc\fR \fB-xdmsvc\fR
.IP .IP
Display manager Terminal services mode based on SSL. Display manager Terminal services mode based on SSL.
...@@ -1444,11 +1458,13 @@ ge=). This only has an effect in FINDCREATEDISPLAY ...@@ -1444,11 +1458,13 @@ ge=). This only has an effect in FINDCREATEDISPLAY
mode when a virtual X server such as Xvfb is going mode when a virtual X server such as Xvfb is going
to be created. It sets the width and height of to be created. It sets the width and height of
the new display, and optionally the color depth as the new display, and optionally the color depth as
well. You can also supply "gnome", "kde", "twm", well.
.IP
You can also supply "gnome", "kde", "twm",
"fvwm", "mwm", "dtwm", "wmaker", "xfce", "fvwm", "mwm", "dtwm", "wmaker", "xfce",
"enlightenment", "Xsession", or "failsafe" "lxde", "enlightenment", "Xsession", or
(same as "xterm") to have the created display use "failsafe" (same as "xterm") to have the created
that mode for the user session. display use that mode for the user session.
.IP .IP
Specify "tag=..." to set the unique FD_TAG desktop Specify "tag=..." to set the unique FD_TAG desktop
session tag described below. Note: this option will session tag described below. Note: this option will
...@@ -1552,19 +1568,21 @@ By default FINDCREATEDISPLAY will try Xvfb and then ...@@ -1552,19 +1568,21 @@ By default FINDCREATEDISPLAY will try Xvfb and then
Xdummy: Xdummy:
.IP .IP
The Xdummy wrapper is part of the x11vnc source code The Xdummy wrapper is part of the x11vnc source code
(x11vnc/misc/Xdummy) It should be available in PATH and (x11vnc/misc/Xdummy) It should be available in PATH
have run "Xdummy \fB-install"\fR once to create the shared and have run "Xdummy \fB-install"\fR once to create the
library. Xdummy requires root permission and only works shared library. Xdummy only works on Linux. As of
on Linux. (Note: specify FD_XDUMMY_NOROOT=1 to skip 12/2009 it no longer needs to be run as root, and the
a check for the root id; evidently your default is to not run as root. In some circumstances
.IR sudo (1) permissions may require running it as root, in these
will cases specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same
take care of everything. The \fB-xdummy\fR and \fB-svc_xdummy\fR as supplying \fB-root\fR to the Xdummy cmdline.
options imply FD_XDUMMY_NOROOT=1).
.IP .IP
Xvfb is available on most platforms and does not Xvfb is available on most platforms and does not
require root. require root.
.IP .IP
An advantage of Xdummy over Xvfb is that Xdummy supports
RANDR dynamic screen resizing.
.IP
When x11vnc exits (i.e. user disconnects) the X When x11vnc exits (i.e. user disconnects) the X
server session stays running in the background. server session stays running in the background.
The FINDDISPLAY will find it directly next time. The FINDDISPLAY will find it directly next time.
...@@ -1629,13 +1647,11 @@ be the full path to the session/windowmanager program. ...@@ -1629,13 +1647,11 @@ be the full path to the session/windowmanager program.
More FD tricks: FD_CUPS=port or FD_CUPS=host:port More FD tricks: FD_CUPS=port or FD_CUPS=host:port
will set the cups printing environment. Similarly for will set the cups printing environment. Similarly for
FD_ESD=port or FD_ESD=host:port for esddsp sound FD_ESD=port or FD_ESD=host:port for esddsp sound
redirection. FD_XDUMMY_NOROOT means the Xdummy redirection. Set FD_EXTRA to a command to be run a
server does not need to be started as root (e.g. it few seconds after the X server starts up. Set FD_TAG
will sudo automatically). Set FD_EXTRA to a command to be a unique name for the session, it is set as an
to be run a few seconds after the X server starts up. X property, that makes FINDDISPLAY only find sessions
Set FD_TAG to be a unique name for the session, it is with that tag value.
set as an X property, that makes FINDDISPLAY only find
sessions with that tag value.
.IP .IP
If you want the FINDCREATEDISPLAY session to contact an If you want the FINDCREATEDISPLAY session to contact an
XDMCP login manager (xdm/gdm/kdm) on the same machine, XDMCP login manager (xdm/gdm/kdm) on the same machine,
......
...@@ -2221,10 +2221,20 @@ int main(int argc, char* argv[]) { ...@@ -2221,10 +2221,20 @@ int main(int argc, char* argv[]) {
use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb"); use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvfb");
continue; continue;
} }
if (!strcmp(arg, "-create_x")) {
CHECK_ARGC
use_dpy = (char *) malloc(strlen(argv[i+1])+100);
sprintf(use_dpy, "WAIT:cmd=FINDCREATEDISPLAY-%s", argv[++i]);
continue;
}
if (!strcmp(arg, "-xdummy")) { if (!strcmp(arg, "-xdummy")) {
use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy"); use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy");
continue; continue;
} }
if (!strcmp(arg, "-xdummy_xvfb")) {
use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb");
continue;
}
if (!strcmp(arg, "-xvnc")) { if (!strcmp(arg, "-xvnc")) {
use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvnc"); use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xvnc");
continue; continue;
...@@ -2557,7 +2567,14 @@ int main(int argc, char* argv[]) { ...@@ -2557,7 +2567,14 @@ int main(int argc, char* argv[]) {
users_list = strdup("unixpw="); users_list = strdup("unixpw=");
use_openssl = 1; use_openssl = 1;
openssl_pem = strdup("SAVE"); openssl_pem = strdup("SAVE");
set_env("FD_XDUMMY_NOROOT", "1"); continue;
}
if (!strcmp(arg, "-svc_xdummy_xvfb")) {
use_dpy = strdup("WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb");
unixpw = 1;
users_list = strdup("unixpw=");
use_openssl = 1;
openssl_pem = strdup("SAVE");
continue; continue;
} }
if (!strcmp(arg, "-svc_xvnc")) { if (!strcmp(arg, "-svc_xvnc")) {
...@@ -4924,6 +4941,15 @@ int main(int argc, char* argv[]) { ...@@ -4924,6 +4941,15 @@ int main(int argc, char* argv[]) {
} else if (use_dpy && strstr(use_dpy, "WAIT:") == use_dpy) { } else if (use_dpy && strstr(use_dpy, "WAIT:") == use_dpy) {
char *mcm = multiple_cursors_mode; char *mcm = multiple_cursors_mode;
if (strstr(use_dpy, "Xdummy")) {
if (!xrandr && !got_noxrandr) {
if (! quiet) {
rfbLog("Enabling -xrandr for possible use of Xdummy server.\n");
}
xrandr = 1;
}
}
waited_for_client = wait_for_client(&argc_vnc, argv_vnc, waited_for_client = wait_for_client(&argc_vnc, argv_vnc,
try_http && ! got_httpdir); try_http && ! got_httpdir);
...@@ -4933,6 +4959,7 @@ int main(int argc, char* argv[]) { ...@@ -4933,6 +4959,7 @@ int main(int argc, char* argv[]) {
} }
} }
if (auth_file) { if (auth_file) {
check_guess_auth_file(); check_guess_auth_file();
if (auth_file != NULL) { if (auth_file != NULL) {
...@@ -4990,6 +5017,16 @@ int main(int argc, char* argv[]) { ...@@ -4990,6 +5017,16 @@ int main(int argc, char* argv[]) {
exit(0); exit(0);
} }
if (dpy && !xrandr && !got_noxrandr) {
Atom trap_xrandr = XInternAtom(dpy, "X11VNC_TRAP_XRANDR", True);
if (trap_xrandr != None) {
if (! quiet) {
rfbLog("Enabling -xrandr due to X11VNC_TRAP_XRANDR atom.\n");
}
xrandr = 1;
}
}
#ifdef MACOSX #ifdef MACOSX
if (! dpy && ! raw_fb_str) { if (! dpy && ! raw_fb_str) {
raw_fb_str = strdup("console"); raw_fb_str = strdup("console");
......
...@@ -47,7 +47,7 @@ int xtrap_base_event_type = 0; ...@@ -47,7 +47,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.9.9 lastmod: 2009-12-21"; char lastmod[] = "0.9.10 lastmod: 2009-12-24";
/* X display info */ /* X display info */
......
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