summaryrefslogtreecommitdiff
blob: d0108379c350f933cea59185ffef5ca42274a003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
https://bugs.gentoo.org/567612

From e70123d8f778e3f0c3bf1606f68a70b0d9748c6a Mon Sep 17 00:00:00 2001
From: Christian Beier <dontmind@freeshell.org>
Date: Tue, 1 Dec 2015 14:14:00 +0100
Subject: [PATCH] Fix the remaining x11vnc-specific defines that are not in
 LibVNCServer anymore.

---
 src/macosx.c        |  4 ++--
 src/macosx_opengl.c |  2 +-
 src/screen.c        |  2 +-
 src/uinput.c        |  4 ++--
 src/unixpw.c        | 30 +++++++++++++++---------------
 src/user.c          |  6 +++---
 src/v4l.c           |  2 +-
 src/x11vnc.h        |  8 ++++----
 8 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/src/macosx.c b/src/macosx.c
index 6645018968c3..df622db0232d 100644
--- a/src/macosx.c
+++ b/src/macosx.c
@@ -33,7 +33,7 @@ so, delete this exception statement from your version.
 /* -- macosx.c -- */
 
 #include "config.h"
-#if (defined(__MACH__) && defined(__APPLE__) && defined(LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY))
+#if (defined(__MACH__) && defined(__APPLE__) && defined(HAVE_MACOSX_NATIVE_DISPLAY))
 
 #define DOMAC 1
 
@@ -748,5 +748,5 @@ int macosx_check_clipped(int win, int *list, int n) {
 }
 
 
-#endif 	/* LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY */
+#endif 	/* HAVE_MACOSX_NATIVE_DISPLAY */
 
diff --git a/src/macosx_opengl.c b/src/macosx_opengl.c
index 97882797452e..4efc7be94c2e 100644
--- a/src/macosx_opengl.c
+++ b/src/macosx_opengl.c
@@ -38,7 +38,7 @@ so, delete this exception statement from your version.
 #include <ApplicationServices/ApplicationServices.h>
 
 #include <rfb/rfb.h>
-#if LIBVNCSERVER_HAVE_MACOSX_OPENGL_H
+#if HAVE_MACOSX_OPENGL_H
 #include <OpenGL/OpenGL.h>
 #include <OpenGL/gl.h>
 #endif
diff --git a/src/screen.c b/src/screen.c
index 5d37761c9038..bda46903b59a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2119,7 +2119,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 
 	if (sscanf(str, "shm:%d", &shmid) == 1) {
 		/* shm:N */
-#if HAVE_XSHM || LIBVNCSERVER_HAVE_SHMAT
+#if HAVE_XSHM || HAVE_SHMAT
 		raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY);
 		if (! raw_fb_addr) {
 			rfbLogEnable(1);
diff --git a/src/uinput.c b/src/uinput.c
index ac0324f1b0f0..d9e2b2656a5f 100644
--- a/src/uinput.c
+++ b/src/uinput.c
@@ -42,8 +42,8 @@ so, delete this exception statement from your version.
 #include "allowed_input_t.h"
 
 #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
-#if LIBVNCSERVER_HAVE_LINUX_INPUT_H
-#if LIBVNCSERVER_HAVE_LINUX_UINPUT_H
+#if HAVE_LINUX_INPUT_H
+#if HAVE_LINUX_UINPUT_H
 #define UINPUT_OK
 #endif
 #endif
diff --git a/src/unixpw.c b/src/unixpw.c
index 3a548808881f..66b776f1e8a4 100644
--- a/src/unixpw.c
+++ b/src/unixpw.c
@@ -62,14 +62,14 @@ extern char *crypt(const char*, const char *);
 #endif
 
 #ifdef IGNORE_GETSPNAM
-#undef LIBVNCSERVER_HAVE_GETSPNAM
-#define LIBVNCSERVER_HAVE_GETSPNAM 0
+#undef HAVE_GETSPNAM
+#define HAVE_GETSPNAM 0
 #endif
 
-#if LIBVNCSERVER_HAVE_PWD_H && LIBVNCSERVER_HAVE_GETPWNAM
+#if LIBVNCSERVER_HAVE_PWD_H && HAVE_GETPWNAM
 #if LIBVNCSERVER_HAVE_CRYPT || LIBVNCSERVER_HAVE_LIBCRYPT || HAVE_LIBCRYPT
 #define UNIXPW_CRYPT
-#if LIBVNCSERVER_HAVE_GETSPNAM
+#if HAVE_GETSPNAM
 #include <shadow.h>
 #endif
 #endif
@@ -78,10 +78,10 @@ extern char *crypt(const char*, const char *);
 #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
-#if LIBVNCSERVER_HAVE_TERMIOS_H
+#if HAVE_TERMIOS_H
 #include <termios.h>
 #endif
-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
+#if HAVE_SYS_STROPTS_H
 #include <sys/stropts.h>
 #endif
 
@@ -520,7 +520,7 @@ char *get_pty_ptmx(int *fd_p) {
 
 	*fd_p = -1;
 
-#if LIBVNCSERVER_HAVE_GRANTPT
+#if HAVE_GRANTPT
 
 	for (i=0; i < ndevs; i++) {
 #ifdef O_NOCTTY
@@ -628,7 +628,7 @@ char *get_pty(int *fd_p) {
 #ifdef IS_BSD
 	return get_pty_loop(fd_p);
 #else
-#if LIBVNCSERVER_HAVE_GRANTPT
+#if HAVE_GRANTPT
 	used_get_pty_ptmx = 1;
 	return get_pty_ptmx(fd_p);
 #else
@@ -644,16 +644,16 @@ void try_to_be_nobody(void) {
 	pw = getpwnam("nobody");
 
 	if (pw) {
-#if LIBVNCSERVER_HAVE_SETUID
+#if HAVE_SETUID
 		setuid(pw->pw_uid);
 #endif
-#if LIBVNCSERVER_HAVE_SETEUID
+#if HAVE_SETEUID
 		seteuid(pw->pw_uid);
 #endif
-#if LIBVNCSERVER_HAVE_SETGID
+#if HAVE_SETGID
 		setgid(pw->pw_gid);
 #endif
-#if LIBVNCSERVER_HAVE_SETEGID
+#if HAVE_SETEGID
 		setegid(pw->pw_gid);
 #endif
 	}
@@ -788,7 +788,7 @@ int crypt_verify(char *user, char *pass) {
 
 	if (strlen(realpw) < 12) {
 		/* e.g. "x", try getspnam(), sometimes root for inetd, etc */
-#if LIBVNCSERVER_HAVE_GETSPNAM
+#if HAVE_GETSPNAM
 		struct spwd *sp = getspnam(user);
 		if (sp != NULL && sp->sp_pwdp != NULL) {
 			if (db) fprintf(stderr, "using getspnam()\n");
@@ -1086,7 +1086,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
 
 /* streams options fixups, handle cases as they are found: */
 #if defined(__hpux)
-#if LIBVNCSERVER_HAVE_SYS_STROPTS_H
+#if HAVE_SYS_STROPTS_H
 #if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(I_PUSH)
 		if (used_get_pty_ptmx) {
 			ioctl(sfd, I_PUSH, "ptem");
@@ -1127,7 +1127,7 @@ int su_verify(char *user, char *pass, char *cmd, char *rbuf, int *rbuf_size, int
 		chdir("/");
 
 		try_to_be_nobody();
-#if LIBVNCSERVER_HAVE_GETUID
+#if HAVE_GETUID
 		if (getuid() == 0 || geteuid() == 0) {
 			exit(1);
 		}
diff --git a/src/user.c b/src/user.c
index b759a61ae50a..aa14814de2b7 100644
--- a/src/user.c
+++ b/src/user.c
@@ -140,7 +140,7 @@ void check_switched_user(void) {
 /* utilities for switching users */
 static char *get_login_list(int with_display) {
 	char *out;
-#if LIBVNCSERVER_HAVE_UTMPX_H
+#if HAVE_UTMPX_H
 	int i, cnt, max = 200, ut_namesize = 32;
 	int dpymax = 1000, sawdpy[1000];
 	struct utmpx *utx;
@@ -761,7 +761,7 @@ static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_
 	int reset_fb = 0;
 	int grp_ok = 0;
 
-#if !LIBVNCSERVER_HAVE_SETUID
+#if !HAVE_SETUID
 	return 0;
 #else
 	/*
@@ -773,7 +773,7 @@ static int switch_user_env(uid_t uid, gid_t gid, char *name, char *home, int fb_
 		clean_shm(0);
 		free_tiles();
 	}
-#if LIBVNCSERVER_HAVE_INITGROUPS
+#if HAVE_INITGROUPS
 #if LIBVNCSERVER_HAVE_PWD_H
 	if (getpwuid(uid) != NULL && getenv("X11VNC_SINGLE_GROUP") == NULL) {
 		struct passwd *p = getpwuid(uid);
diff --git a/src/v4l.c b/src/v4l.c
index 86c33a6b9e75..8a3581362599 100644
--- a/src/v4l.c
+++ b/src/v4l.c
@@ -41,7 +41,7 @@ so, delete this exception statement from your version.
 #include "keyboard.h"
 #include "allowed_input_t.h"
 
-#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H
+#if HAVE_LINUX_VIDEODEV_H
 #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #define CONFIG_VIDEO_V4L1_COMPAT
diff --git a/src/x11vnc.h b/src/x11vnc.h
index 7a84703eabc8..79319a420eec 100644
--- a/src/x11vnc.h
+++ b/src/x11vnc.h
@@ -255,10 +255,10 @@ so, delete this exception statement from your version.
 #endif
 
 #if (SMALL_FOOTPRINT > 2)
-#undef LIBVNCSERVER_HAVE_UTMPX_H
+#undef HAVE_UTMPX_H
 #undef LIBVNCSERVER_HAVE_PWD_H
 #undef REMOTE_CONTROL
-#define LIBVNCSERVER_HAVE_UTMPX_H 0
+#define HAVE_UTMPX_H 0
 #define LIBVNCSERVER_HAVE_PWD_H 0
 #define REMOTE_CONTROL 0
 #endif
@@ -308,7 +308,7 @@ so, delete this exception statement from your version.
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
 #endif
-#if LIBVNCSERVER_HAVE_SHMAT
+#if HAVE_SHMAT
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #endif
@@ -392,7 +392,7 @@ extern int h_errno;
 #if LIBVNCSERVER_HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
-#if LIBVNCSERVER_HAVE_UTMPX_H
+#if HAVE_UTMPX_H
 #include <utmpx.h>
 #endif
 
-- 
2.11.0.rc2