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
93ca945a
Commit
93ca945a
authored
Jul 04, 2006
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: plug a couple unixpw gaps.
parent
1b51530a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
19 deletions
+55
-19
README
x11vnc/README
+1
-1
keyboard.c
x11vnc/keyboard.c
+14
-2
unixpw.c
x11vnc/unixpw.c
+39
-16
unixpw.h
x11vnc/unixpw.h
+1
-0
No files found.
x11vnc/README
View file @
93ca945a
x11vnc
README
file
Date
:
Tue
Jul
4
1
4
:
26
:
15
EDT
2006
x11vnc
README
file
Date
:
Tue
Jul
4
1
8
:
26
:
52
EDT
2006
The
following
information
is
taken
from
these
URLs
:
The
following
information
is
taken
from
these
URLs
:
...
...
x11vnc/keyboard.c
View file @
93ca945a
...
@@ -2627,13 +2627,25 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
...
@@ -2627,13 +2627,25 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
char
*
str
;
char
*
str
;
X_LOCK
;
X_LOCK
;
str
=
XKeysymToString
(
keysym
);
str
=
XKeysymToString
(
keysym
);
rfbLog
(
"# keyboard(%s, 0x%x
\"
%s
\"
) %.4f
\n
"
,
down
?
"down"
:
"up"
,
(
int
)
keysym
,
str
?
str
:
"null"
,
tnow
-
x11vnc_start
);
X_UNLOCK
;
X_UNLOCK
;
rfbLog
(
"# keyboard(%s, 0x%x
\"
%s
\"
) uip=%d %.4f
\n
"
,
down
?
"down"
:
"up"
,
(
int
)
keysym
,
str
?
str
:
"null"
,
unixpw_in_progress
,
tnow
-
x11vnc_start
);
}
if
(
keysym
<=
0
)
{
rfbLog
(
"keyboard: skipping 0x0 keysym
\n
"
);
return
;
}
}
if
(
unixpw
&&
unixpw_in_progress
)
{
if
(
unixpw
&&
unixpw_in_progress
)
{
if
(
unixpw_denied
)
{
rfbLog
(
"keyboard: ignoring keystroke 0x%x in "
"unixpw_denied=1 state
\n
"
,
(
int
)
keysym
);
return
;
}
if
(
client
!=
unixpw_client
)
{
if
(
client
!=
unixpw_client
)
{
rfbLog
(
"keyboard: skipping other client in unixpw
\n
"
);
return
;
return
;
}
}
unixpw_keystroke
(
down
,
keysym
,
0
);
unixpw_keystroke
(
down
,
keysym
,
0
);
...
...
x11vnc/unixpw.c
View file @
93ca945a
...
@@ -71,6 +71,7 @@ static void set_db(void);
...
@@ -71,6 +71,7 @@ static void set_db(void);
static
void
unixpw_verify
(
char
*
user
,
char
*
pass
);
static
void
unixpw_verify
(
char
*
user
,
char
*
pass
);
int
unixpw_in_progress
=
0
;
int
unixpw_in_progress
=
0
;
int
unixpw_denied
=
0
;
int
unixpw_in_rfbPE
=
0
;
int
unixpw_in_rfbPE
=
0
;
int
unixpw_login_viewonly
=
0
;
int
unixpw_login_viewonly
=
0
;
time_t
unixpw_last_try_time
=
0
;
time_t
unixpw_last_try_time
=
0
;
...
@@ -929,6 +930,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
...
@@ -929,6 +930,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
static
char
user
[
100
],
pass
[
100
];
static
char
user
[
100
],
pass
[
100
];
static
int
u_cnt
=
0
,
p_cnt
=
0
,
first
=
1
;
static
int
u_cnt
=
0
,
p_cnt
=
0
,
first
=
1
;
char
keystr
[
100
];
char
keystr
[
100
];
char
*
str
;
if
(
first
)
{
if
(
first
)
{
set_db
();
set_db
();
...
@@ -938,6 +940,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
...
@@ -938,6 +940,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
if
(
init
)
{
if
(
init
)
{
in_login
=
1
;
in_login
=
1
;
in_passwd
=
0
;
in_passwd
=
0
;
unixpw_denied
=
0
;
if
(
init
==
1
)
{
if
(
init
==
1
)
{
tries
=
0
;
tries
=
0
;
}
}
...
@@ -963,9 +966,22 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
...
@@ -963,9 +966,22 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
return
;
return
;
}
}
if
(
unixpw_denied
)
{
rfbLog
(
"unixpw_keystroke: unixpw_denied state: 0x%x
\n
"
,
(
int
)
keysym
);
return
;
}
if
(
keysym
<=
0
)
{
rfbLog
(
"unixpw_keystroke: bad keysym1: 0x%x
\n
"
,
(
int
)
keysym
);
return
;
}
X_LOCK
;
X_LOCK
;
s
printf
(
keystr
,
"%s"
,
XKeysymToString
(
keysym
)
);
s
tr
=
XKeysymToString
(
keysym
);
X_UNLOCK
;
X_UNLOCK
;
if
(
!
str
)
{
rfbLog
(
"unixpw_keystroke: bad keysym2: 0x%x
\n
"
,
(
int
)
keysym
);
return
;
}
snprintf
(
keystr
,
100
,
"%s"
,
str
);
if
(
db
>
2
)
{
if
(
db
>
2
)
{
fprintf
(
stderr
,
"%s / %s 0x%x %s
\n
"
,
in_login
?
"login"
:
"pass "
,
fprintf
(
stderr
,
"%s / %s 0x%x %s
\n
"
,
in_login
?
"login"
:
"pass "
,
...
@@ -1247,27 +1263,34 @@ void unixpw_deny(void) {
...
@@ -1247,27 +1263,34 @@ void unixpw_deny(void) {
int
x
,
y
,
i
;
int
x
,
y
,
i
;
char
pd
[]
=
"Permission denied."
;
char
pd
[]
=
"Permission denied."
;
char_row
+=
2
;
rfbLog
(
"unixpw_deny: %d, %d
\n
"
,
unixpw_denied
,
unixpw_in_progress
);
char_col
=
0
;
if
(
!
unixpw_denied
)
{
x
=
char_x
+
char_col
*
char_w
;
unixpw_denied
=
1
;
y
=
char_y
+
char_row
*
char_h
;
rfbDrawString
(
screen
,
&
default8x16Font
,
x
,
y
,
pd
,
white
());
char_row
+=
2
;
if
(
scaling
)
{
char_col
=
0
;
mark_rect_as_modified
(
0
,
0
,
dpy_x
,
dpy_y
,
1
);
x
=
char_x
+
char_col
*
char_w
;
}
else
{
y
=
char_y
+
char_row
*
char_h
;
mark_rect_as_modified
(
0
,
0
,
dpy_x
,
dpy_y
,
0
);
rfbDrawString
(
screen
,
&
default8x16Font
,
x
,
y
,
pd
,
white
());
if
(
scaling
)
{
mark_rect_as_modified
(
0
,
0
,
dpy_x
,
dpy_y
,
1
);
}
else
{
mark_rect_as_modified
(
0
,
0
,
dpy_x
,
dpy_y
,
0
);
}
for
(
i
=
0
;
i
<
5
;
i
++
)
{
rfbPE
(
-
1
);
usleep
(
500
*
1000
);
}
}
}
for
(
i
=
0
;
i
<
5
;
i
++
)
{
if
(
unixpw_client
)
{
rfbCloseClient
(
unixpw_client
);
rfbClientConnectionGone
(
unixpw_client
);
rfbPE
(
-
1
);
rfbPE
(
-
1
);
usleep
(
500
*
1000
);
}
}
rfbCloseClient
(
unixpw_client
);
rfbClientConnectionGone
(
unixpw_client
);
rfbPE
(
-
1
);
unixpw_in_progress
=
0
;
unixpw_in_progress
=
0
;
unixpw_client
=
NULL
;
unixpw_client
=
NULL
;
copy_screen
();
copy_screen
();
...
...
x11vnc/unixpw.h
View file @
93ca945a
...
@@ -12,6 +12,7 @@ extern int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_si
...
@@ -12,6 +12,7 @@ extern int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_si
extern
int
crypt_verify
(
char
*
user
,
char
*
pass
);
extern
int
crypt_verify
(
char
*
user
,
char
*
pass
);
extern
int
unixpw_in_progress
;
extern
int
unixpw_in_progress
;
extern
int
unixpw_denied
;
extern
int
unixpw_in_rfbPE
;
extern
int
unixpw_in_rfbPE
;
extern
int
unixpw_login_viewonly
;
extern
int
unixpw_login_viewonly
;
extern
time_t
unixpw_last_try_time
;
extern
time_t
unixpw_last_try_time
;
...
...
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