Commit 99921601 authored by runge's avatar runge

x11vnc: misc cleanup.

parent 64e731a9
2006-06-23 Karl Runge <runge@karlrunge.com>
* x11vnc: misc cleanup.
2006-06-18 Karl Runge <runge@karlrunge.com>
* x11vnc: -grabkbd, -grabptr, -env options. under -unixpw +
WAIT let user add some options after his username (e.g. runge:3/4)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,6 +11,7 @@
#include "unixpw.h"
#include "sslcmds.h"
#include "sslhelper.h"
#include "connections.h"
/*
* Exiting and error handling routines
......
......@@ -34,6 +34,7 @@ void close_all_clients(void);
void close_clients(char *str);
void set_client_input(char *str);
void set_child_info(void);
int cmd_ok(char *cmd);
void client_gone(rfbClientPtr client);
void reverse_connect(char *str);
void set_vnc_connect_prop(char *str);
......
......@@ -17,6 +17,7 @@ extern void close_all_clients(void);
extern void close_clients(char *str);
extern void set_client_input(char *str);
extern void set_child_info(void);
extern int cmd_ok(char *cmd);
extern void client_gone(rfbClientPtr client);
extern void reverse_connect(char *str);
extern void set_vnc_connect_prop(char *str);
......
......@@ -6,6 +6,7 @@
#include "remote.h"
#include "cleanup.h"
#include "xwrappers.h"
#include "connections.h"
#include "tkx11vnc.h"
......
......@@ -240,7 +240,7 @@ static int shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
}
return 0;
}
if (db) fprintf(stderr, "shm_create simple %d %d\t%p %s\n", w, h, xim, name);
if (db) fprintf(stderr, "shm_create simple %d %d\t%p %s\n", w, h, (void *)xim, name);
xim->data = (char *) malloc(xim->bytes_per_line * xim->height);
if (xim->data == NULL) {
rfbErr("XCreateImage(%s) data malloc failed.\n", name);
......@@ -349,7 +349,7 @@ void shm_delete(XShmSegmentInfo *shm) {
void shm_clean(XShmSegmentInfo *shm, XImage *xim) {
int db = 0;
if (db) fprintf(stderr, "shm_clean: called: %p\n", xim);
if (db) fprintf(stderr, "shm_clean: called: %p\n", (void *)xim);
X_LOCK;
#if LIBVNCSERVER_HAVE_XSHM
if (shm != NULL && shm->shmid != -1 && dpy) {
......@@ -360,11 +360,11 @@ void shm_clean(XShmSegmentInfo *shm, XImage *xim) {
if (xim != NULL) {
if (! raw_fb_back_to_X) { /* raw_fb hack */
if (xim->bitmap_unit != -1) {
if (db) fprintf(stderr, "shm_clean: XDestroyImage %p\n", xim);
if (db) fprintf(stderr, "shm_clean: XDestroyImage %p\n", (void *)xim);
XDestroyImage(xim);
} else {
if (xim->data) {
if (db) fprintf(stderr, "shm_clean: free xim->data %p %p\n", xim, xim->data);
if (db) fprintf(stderr, "shm_clean: free xim->data %p %p\n", (void *)xim, (void *)(xim->data));
free(xim->data);
xim->data = NULL;
}
......
......@@ -3,6 +3,7 @@
#include "x11vnc.h"
#include "win_utils.h"
#include "xwrappers.h"
#include "connections.h"
char *guess_desktop(void);
void solid_bg(int restore);
......
......@@ -5,6 +5,7 @@
#include "cleanup.h"
#include "sslhelper.h"
#include "ssltools.h"
#include "connections.h"
#if LIBVNCSERVER_HAVE_FORK
#if LIBVNCSERVER_HAVE_SYS_WAIT_H
......@@ -671,7 +672,8 @@ void sslEncKey(char *path, int mode) {
incert = 1;
}
if (incert) {
if (strlen(cert)+strlen(line) < 2*sbuf.st_size) {
if (strlen(cert)+strlen(line) <
2 * (size_t) sbuf.st_size) {
strcat(cert, line);
}
}
......
......@@ -12,6 +12,8 @@ extern char *crypt(const char*, const char *);
#include "scan.h"
#include "cleanup.h"
#include "xinerama.h"
#include "connections.h"
#include "user.h"
#include <rfb/default8x16.h>
#if LIBVNCSERVER_HAVE_FORK
......@@ -365,7 +367,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size) {
#ifndef UNIXPW_SU
return 0;
#else
int i, j, status, fd = -1, sfd, tfd, drain_size = 4096, rsize;
int i, j, status, fd = -1, sfd, tfd, drain_size = 4096, rsize = 0;
int slow_pw = 1;
char *slave, *bin_true = NULL, *bin_su = NULL;
pid_t pid, pidw;
......
......@@ -8,6 +8,11 @@
#include "unixpw.h"
#include "sslhelper.h"
#include "xwrappers.h"
#include "connections.h"
#include "inet.h"
#include "keyboard.h"
#include "cursor.h"
#include "remote.h"
void check_switched_user(void);
void lurk_loop(char *str);
......@@ -1128,7 +1133,7 @@ int wait_for_client(int *argc, char** argv, int http) {
XImage* fb_image;
int w = 640, h = 480, b = 32;
int w0, h0, i, chg_raw_fb = 0;
char *str, *q, *p, *cmd = NULL;
char *str, *q, *cmd = NULL;
int db = 0;
char tmp[] = "/tmp/x11vnc-find_display.XXXXXX";
int tmp_fd = -1, dt = 0;
......
......@@ -2,6 +2,7 @@
#include "x11vnc.h"
#include "cleanup.h"
#include "win_utils.h"
struct timeval _mysleep;
......
......@@ -5,6 +5,7 @@
#include "scan.h"
#include "xinerama.h"
#include "screen.h"
#include "connections.h"
#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H
#if LIBVNCSERVER_HAVE_SYS_IOCTL_H
......
......@@ -5,6 +5,7 @@
#include "winattr_t.h"
#include "cleanup.h"
#include "xwrappers.h"
#include "connections.h"
winattr_t *stack_list = NULL;
int stack_list_len = 0;
......
......@@ -2,7 +2,7 @@
.TH X11VNC "1" "June 2006" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.8.2, lastmod: 2006-06-18
version: 0.8.2, lastmod: 2006-06-23
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......
......@@ -143,6 +143,7 @@
#include "sslhelper.h"
#include "selection.h"
#include "pm.h"
#include "solid.h"
/*
* main routine for the x11vnc program
......@@ -1470,7 +1471,7 @@ int main(int argc, char* argv[]) {
CHECK_ARGC
use_dpy = strdup(argv[++i]);
if (strstr(use_dpy, "WAIT")) {
extern find_display[];
extern char find_display[];
if (strstr(use_dpy, "cmd=FINDDISPLAY-print")) {
fprintf(stdout, "%s", find_display);
exit(0);
......
......@@ -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.2 lastmod: 2006-06-18";
char lastmod[] = "0.8.2 lastmod: 2006-06-23";
/* X display info */
......
......@@ -4,6 +4,7 @@
#include "xrecord.h"
#include "keyboard.h"
#include "xevents.h"
#include "connections.h"
int xshm_present = 0;
int xtest_present = 0;
......@@ -972,7 +973,7 @@ Display *XOpenDisplay_wr(char *display_name) {
}
d = XOpenDisplay(display_name);
if (db) fprintf(stderr, "XOpenDisplay_wr: %s 0x%x\n", display_name, d);
if (db) fprintf(stderr, "XOpenDisplay_wr: %s %p\n", display_name, (void *)d);
xauth_raw(0);
......@@ -981,7 +982,7 @@ Display *XOpenDisplay_wr(char *display_name) {
int XCloseDisplay_wr(Display *display) {
int db = 0;
if (db) fprintf(stderr, "XCloseDisplay_wr: 0x%x\n", display);
if (db) fprintf(stderr, "XCloseDisplay_wr: %p\n", (void *)display);
return XCloseDisplay(display);
}
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