Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
57cf0cda
Commit
57cf0cda
authored
Jan 11, 2006
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: close fd > 2 in run_user_command(), -nocmds in crash_debug, fix 64bit bug for -solid.
parent
0b7a0030
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
68 additions
and
31 deletions
+68
-31
ChangeLog
x11vnc/ChangeLog
+4
-0
README
x11vnc/README
+4
-4
cleanup.c
x11vnc/cleanup.c
+6
-0
connections.c
x11vnc/connections.c
+25
-2
cursor.c
x11vnc/cursor.c
+1
-1
keyboard.c
x11vnc/keyboard.c
+5
-5
pointer.c
x11vnc/pointer.c
+1
-1
scan.c
x11vnc/scan.c
+4
-4
screen.c
x11vnc/screen.c
+1
-1
solid.c
x11vnc/solid.c
+2
-2
userinput.c
x11vnc/userinput.c
+4
-4
win_utils.c
x11vnc/win_utils.c
+1
-1
x11vnc.1
x11vnc/x11vnc.1
+1
-1
x11vnc.c
x11vnc/x11vnc.c
+2
-2
x11vnc_defs.c
x11vnc/x11vnc_defs.c
+1
-1
xdamage.c
x11vnc/xdamage.c
+5
-1
xrecord.c
x11vnc/xrecord.c
+1
-1
No files found.
x11vnc/ChangeLog
View file @
57cf0cda
2006-01-11 Karl Runge <runge@karlrunge.com>
* x11vnc: close fd > 2 in run_user_command(), -nocmds in crash_debug,
fix 64bit bug for -solid.
2006-01-08 Karl Runge <runge@karlrunge.com>
* x11vnc: the big split. opts: -afteraccept and -passwdfile read:
...
...
x11vnc/README
View file @
57cf0cda
x11vnc
README
file
Date
:
Sun
Jan
8
17
:
44
:
25
EST
2006
x11vnc
README
file
Date
:
Wed
Jan
11
09
:
49
:
16
EST
2006
The
following
information
is
taken
from
these
URLs
:
...
...
@@ -2367,7 +2367,7 @@ if [ "X$RFB_MODE" = "Xafteraccept" ]; then
elif [ "X$RFB_MODE" = "Xgone" ]; then
if [ "X$RFB_STATE" = "XNORMAL" ]; then # require valid login
if [ "X$RFB_CLIENT_COUNT" = "X0" ]; then
xlock &
xlock
-mode blank
&
fi
fi
fi
...
...
@@ -4783,7 +4783,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.7.3 lastmod: 2006-01-
08
x11vnc: allow VNC connections to real X11 displays. 0.7.3 lastmod: 2006-01-
10
x11vnc options:
-display disp -auth file
...
...
@@ -4893,7 +4893,7 @@ libvncserver-tight-extension options:
% x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.7.3 lastmod: 2006-01-
08
x11vnc: allow VNC connections to real X11 displays. 0.7.3 lastmod: 2006-01-
10
Typical usage is:
...
...
x11vnc/cleanup.c
View file @
57cf0cda
...
...
@@ -299,6 +299,11 @@ static void crash_shell(void) {
crash_shell_help
();
}
else
if
(
*
str
==
's'
&&
*
(
str
+
1
)
==
'\0'
)
{
sprintf
(
cmd
,
"sh -c '(%s) &'"
,
crash_stack_command1
);
if
(
no_external_cmds
)
{
fprintf
(
stderr
,
"
\n
no_external_cmds=%d
\n
"
,
no_external_cmds
);
goto
crash_prompt
;
}
fprintf
(
stderr
,
"
\n
running:
\n\t
%s
\n\n
"
,
crash_stack_command1
);
system
(
cmd
);
...
...
@@ -316,6 +321,7 @@ static void crash_shell(void) {
free
(
p
);
}
crash_prompt:
fprintf
(
stderr
,
"crash> "
);
}
}
...
...
x11vnc/connections.c
View file @
57cf0cda
...
...
@@ -428,8 +428,29 @@ static int run_user_command(char *cmd, rfbClientPtr client, char *mode) {
rfbLog
(
"running command:
\n
"
);
rfbLog
(
" %s
\n
"
,
cmd
);
/* XXX need to close port 5900, etc.. */
#if LIBVNCSERVER_HAVE_FORK
{
pid_t
pid
,
pidw
;
if
((
pid
=
fork
())
>
0
)
{
pidw
=
waitpid
(
pid
,
&
rc
,
0
);
}
else
if
(
pid
==
-
1
)
{
fprintf
(
stderr
,
"could not fork
\n
"
);
rfbLogPerror
(
"fork"
);
rc
=
system
(
cmd
);
}
else
{
/* this should close port 5900, etc.. */
int
fd
;
for
(
fd
=
3
;
fd
<
256
;
fd
++
)
{
close
(
fd
);
}
execlp
(
"/bin/sh"
,
"/bin/sh"
,
"-c"
,
cmd
,
(
char
*
)
NULL
);
exit
(
1
);
}
}
#else
/* this will still have port 5900 open */
rc
=
system
(
cmd
);
#endif
if
(
rc
>=
256
)
{
rc
=
rc
/
256
;
...
...
@@ -963,7 +984,7 @@ static int action_match(char *action, int rc) {
p
=
strtok
(
s
,
","
);
while
(
p
)
{
if
((
q
=
strchr
(
p
,
':'
))
!=
NULL
)
{
int
in
,
k
;
int
in
,
k
=
1
;
*
q
=
'\0'
;
q
++
;
if
(
strstr
(
p
,
"yes"
)
==
p
)
{
...
...
@@ -1662,6 +1683,8 @@ void start_client_info_sock(char *host_port_cookie) {
time_t
oldest
=
0
;
int
db
=
0
;
port
=
-
1
;
for
(
i
=
0
;
i
<
ICON_MODE_SOCKS
;
i
++
)
{
if
(
icon_mode_socks
[
i
]
<
0
)
{
next
=
i
;
...
...
x11vnc/cursor.c
View file @
57cf0cda
...
...
@@ -932,7 +932,7 @@ static rfbCursorPtr pixels2curs(unsigned long *pixels, int w, int h,
char
*
bitmap
,
*
rich
,
*
alpha
;
char
*
pixels_new
=
NULL
;
int
n_opaque
,
n_trans
,
n_alpha
,
len
,
histo
[
256
];
int
send_alpha
=
0
,
alpha_shift
,
thresh
;
int
send_alpha
=
0
,
alpha_shift
=
0
,
thresh
;
int
i
,
x
,
y
;
if
(
first
&&
dpy
)
{
/* raw_fb hack */
...
...
x11vnc/keyboard.c
View file @
57cf0cda
...
...
@@ -751,7 +751,7 @@ int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new) {
}
if
(
!
down
&&
!
keycode_state
[
key
]
&&
!
IsModifierKey
(
keysym
))
{
int
i
,
cnt
=
0
,
downkey
;
int
i
,
cnt
=
0
,
downkey
=
-
1
;
int
nmods_down
=
track_mod_state
(
NoSymbol
,
FALSE
,
FALSE
);
int
mods_down
[
256
];
...
...
@@ -1156,7 +1156,7 @@ xkbmodifiers[] For the KeySym bound to this (keycode,group,level) store
for
(
grp
=
0
;
grp
<
GRP
;
grp
++
)
{
for
(
lvl
=
0
;
lvl
<
LVL
;
lvl
++
)
{
unsigned
int
ms
,
mods
;
int
state_save
=
-
1
,
mods_save
;
int
state_save
=
-
1
,
mods_save
=
-
1
;
KeySym
ks2
;
/* look up the Keysym, if any */
...
...
@@ -1398,13 +1398,13 @@ static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
int
kc
,
grp
,
lvl
,
i
,
kci
;
int
kc_f
[
0x100
],
grp_f
[
0x100
],
lvl_f
[
0x100
],
state_f
[
0x100
],
found
;
int
ignore_f
[
0x100
];
unsigned
int
state
;
unsigned
int
state
=
0
;
/* these are used for finding modifiers, etc */
XkbStateRec
kbstate
;
int
got_kbstate
=
0
;
int
Kc_f
,
Grp_f
,
Lvl_f
;
int
Kc_f
,
Grp_f
=
0
,
Lvl_f
=
0
;
static
int
Kc_last_down
=
-
1
;
static
KeySym
Ks_last_down
=
NoSymbol
;
...
...
@@ -1544,7 +1544,7 @@ static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
if
(
found
>
1
)
{
if
(
down
)
{
int
l
,
score
[
0x100
];
int
best
,
best_score
=
-
1
;
int
best
=
0
,
best_score
=
-
1
;
/* need to break the tie... */
if
(
!
got_kbstate
)
{
XkbGetState
(
dpy
,
XkbUseCoreKbd
,
&
kbstate
);
...
...
x11vnc/pointer.c
View file @
57cf0cda
...
...
@@ -382,7 +382,7 @@ void do_button_mask_change(int mask, int button) {
* Send a pointer button event to the X server.
*/
static
void
update_x11_pointer_mask
(
int
mask
)
{
int
snapped
,
xr_mouse
=
1
,
i
;
int
snapped
=
0
,
xr_mouse
=
1
,
i
;
last_event
=
last_input
=
last_pointer_input
=
time
(
0
);
...
...
x11vnc/scan.c
View file @
57cf0cda
...
...
@@ -724,14 +724,14 @@ void scale_rect(double factor, int blend, int interpolate, int Bpp,
double
x1
,
y1
,
x2
,
y2
;
/* x-y coords for destination pixels edges */
double
dx
,
dy
;
/* size of destination pixel */
double
ddx
,
ddy
;
/* for interpolation expansion */
double
ddx
=
0
,
ddy
=
0
;
/* for interpolation expansion */
char
*
src
,
*
dest
;
/* pointers to the two framebuffers */
unsigned
short
us
;
unsigned
char
uc
;
unsigned
int
ui
;
unsigned
short
us
=
0
;
unsigned
char
uc
=
0
;
unsigned
int
ui
=
0
;
int
use_noblend_shortcut
=
1
;
int
shrink
;
/* whether shrinking or expanding */
...
...
x11vnc/screen.c
View file @
57cf0cda
...
...
@@ -1064,7 +1064,7 @@ XImage *initialize_xdisplay_fb(void) {
XImage
*
fb
;
char
*
vis_str
=
visual_str
;
int
try
=
0
,
subwin_tries
=
3
;
XErrorHandler
old_handler
;
XErrorHandler
old_handler
=
NULL
;
int
subwin_bs
;
if
(
raw_fb_str
)
{
...
...
x11vnc/solid.c
View file @
57cf0cda
...
...
@@ -300,7 +300,7 @@ static void solid_cde(char *color) {
int
format
;
unsigned
long
length
,
after
;
unsigned
char
*
data
;
unsigned
int
*
dp
;
unsigned
long
*
dp
;
/* crash on 64bit with int */
nws
=
0
;
...
...
@@ -323,7 +323,7 @@ static void solid_cde(char *color) {
return
;
}
dp
=
(
unsigned
int
*
)
data
;
dp
=
(
unsigned
long
*
)
data
;
wm_win
=
(
Window
)
*
(
dp
+
1
);
/* 2nd item. */
...
...
x11vnc/userinput.c
View file @
57cf0cda
...
...
@@ -722,8 +722,8 @@ static void draw_box(int x, int y, int w, int h, int restore) {
int
sz
,
lw
=
wireframe_lw
;
unsigned
long
shade
=
wireframe_shade
;
int
color
=
0
;
unsigned
short
us
;
unsigned
long
ul
;
unsigned
short
us
=
0
;
unsigned
long
ul
=
0
;
if
(
clipshift
)
{
x
-=
coff_x
;
...
...
@@ -3218,7 +3218,7 @@ static int wireframe_mod_state() {
* the toplevel windows to get better info on moves and resizes.
*/
int
check_wireframe
(
void
)
{
Window
frame
,
orig_fram
e
;
Window
frame
=
None
,
orig_frame
=
Non
e
;
XWindowAttributes
attr
;
int
dx
,
dy
;
...
...
@@ -3227,7 +3227,7 @@ int check_wireframe(void) {
int
box_x
,
box_y
,
box_w
,
box_h
;
int
orig_cursor_x
,
orig_cursor_y
,
g
;
int
already_down
=
0
,
win_gone
=
0
,
win_unmapped
=
0
;
double
spin
=
0
.
0
,
tm
,
last_ptr
,
last_draw
;
double
spin
=
0
.
0
,
tm
,
last_ptr
=
0
.
0
,
last_draw
;
int
frame_changed
=
0
,
drew_box
=
0
,
got_2nd_pointer
=
0
;
int
special_t1
=
0
,
break_reason
=
0
;
static
double
first_dt_ave
=
0
.
0
;
...
...
x11vnc/win_utils.c
View file @
57cf0cda
...
...
@@ -330,7 +330,7 @@ int pick_windowid(unsigned long *num) {
}
Window
descend_pointer
(
int
depth
,
Window
start
,
char
*
name_info
,
int
len
)
{
Window
r
,
c
,
clast
;
Window
r
,
c
,
clast
=
None
;
int
i
,
rx
,
ry
,
wx
,
wy
;
int
written
=
0
,
filled
=
0
;
char
*
store
=
NULL
;
...
...
x11vnc/x11vnc.1
View file @
57cf0cda
...
...
@@ -2,7 +2,7 @@
.TH X11VNC "1" "January 2006" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.7.3, lastmod: 2006-01-
08
version: 0.7.3, lastmod: 2006-01-
10
.SH SYNOPSIS
.B x11vnc
[OPTION]...
...
...
x11vnc/x11vnc.c
View file @
57cf0cda
...
...
@@ -207,7 +207,7 @@ static void record_last_fb_update(void) {
static
int
rbs0
=
-
1
;
static
time_t
last_call
=
0
;
time_t
now
=
time
(
0
);
int
rbs
;
int
rbs
=
-
1
;
rfbClientIteratorPtr
iter
;
rfbClientPtr
cl
;
...
...
@@ -629,7 +629,7 @@ static void check_rcfile(int argc, char **argv) {
int
i
,
j
,
pwlast
,
norc
=
0
,
argmax
=
1024
;
char
*
infile
=
NULL
;
char
rcfile
[
1024
];
FILE
*
rc
;
FILE
*
rc
=
NULL
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
strcmp
(
argv
[
i
],
"-printgui"
))
{
...
...
x11vnc/x11vnc_defs.c
View file @
57cf0cda
...
...
@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int
xdamage_base_event_type
=
0
;
/* date +'lastmod: %Y-%m-%d' */
char
lastmod
[]
=
"0.7.3 lastmod: 2006-01-
08
"
;
char
lastmod
[]
=
"0.7.3 lastmod: 2006-01-
10
"
;
/* X display info */
...
...
x11vnc/xdamage.c
View file @
57cf0cda
...
...
@@ -58,6 +58,10 @@ static void record_desired_xdamage_rect(int x, int y, int w, int h) {
int
use_direct_fb_copy
=
0
;
int
wh_min
,
wh_max
;
static
int
first
=
1
,
udfb
=
0
;
/* compiler warning: */
nt_x1
=
0
;
nt_y1
=
0
;
nt_x2
=
0
;
nt_y2
=
0
;
if
(
first
)
{
if
(
getenv
(
"XD_DFC"
))
{
udfb
=
1
;
...
...
@@ -214,7 +218,7 @@ int collect_xdamage(int scancnt, int call) {
static
time_t
last_rpt
=
0
;
time_t
now
;
int
x
,
y
,
w
,
h
,
x2
,
y2
;
int
i
,
dup
,
next
,
dup_max
=
0
;
int
i
,
dup
,
next
=
0
,
dup_max
=
0
;
#define DUPSZ 32
int
dup_x
[
DUPSZ
],
dup_y
[
DUPSZ
],
dup_w
[
DUPSZ
],
dup_h
[
DUPSZ
];
double
tm
,
dt
;
...
...
x11vnc/xrecord.c
View file @
57cf0cda
...
...
@@ -408,7 +408,7 @@ int xrecord_scroll_keysym(rfbKeySym keysym) {
}
static
int
lookup_attr_cache
(
Window
win
,
int
*
cache_index
,
int
*
next_index
)
{
double
now
,
t
,
oldest
;
double
now
,
t
,
oldest
=
0
.
0
;
int
i
,
old_index
=
-
1
,
count
=
0
;
Window
cwin
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment