aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw
diff options
context:
space:
mode:
Diffstat (limited to 'unix/xserver/hw')
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc2
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc44
-rw-r--r--unix/xserver/hw/vnc/xvnc.c22
3 files changed, 28 insertions, 40 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index d79c29b6..d88ef874 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -70,7 +70,7 @@ core::IntParameter
queryConnectTimeout("QueryConnectTimeout",
"Number of seconds to show the 'Accept "
"connection' dialog before rejecting the "
- "connection", 10);
+ "connection", 10, 0, INT_MAX);
XserverDesktop::XserverDesktop(int screenIndex_,
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index b64c14d3..e9924d70 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -27,7 +27,6 @@
#include <sys/types.h>
#include <pwd.h>
-#include <set>
#include <string>
#include <core/Configuration.h>
@@ -68,24 +67,17 @@ int vncFbstride[MAXSCREENS];
int vncInetdSock = -1;
-struct CaseInsensitiveCompare {
- bool operator() (const std::string &a, const std::string &b) const {
- return strcasecmp(a.c_str(), b.c_str()) < 0;
- }
-};
-
-typedef std::set<std::string, CaseInsensitiveCompare> ParamSet;
-static ParamSet allowOverrideSet;
-
static const char* defaultDesktopName();
core::IntParameter
- rfbport("rfbport", "TCP port to listen for RFB protocol", 0);
+ rfbport("rfbport",
+ "TCP port to listen for RFB protocol", 0, -1, 65535);
core::StringParameter
rfbunixpath("rfbunixpath",
"Unix socket to listen for RFB protocol", "");
core::IntParameter
- rfbunixmode("rfbunixmode", "Unix socket access mode", 0600);
+ rfbunixmode("rfbunixmode",
+ "Unix socket access mode", 0600, 0000, 0777);
core::StringParameter
desktopName("desktop", "Name of VNC desktop", defaultDesktopName());
core::BoolParameter
@@ -98,12 +90,12 @@ core::BoolParameter
avoidShiftNumLock("AvoidShiftNumLock",
"Avoid fake Shift presses for keys affected by "
"NumLock.", true);
-core::StringParameter
+core::StringListParameter
allowOverride("AllowOverride",
"Comma separated list of parameters that can be "
"modified using VNC extension.",
- "desktop,AcceptPointerEvents,SendCutText,AcceptCutText,"
- "SendPrimary,SetPrimary");
+ {"desktop", "AcceptPointerEvents", "SendCutText",
+ "AcceptCutText", "SendPrimary", "SetPrimary"});
core::BoolParameter
setPrimary("SetPrimary",
"Set the PRIMARY as well as the CLIPBOARD selection",
@@ -167,19 +159,6 @@ static rfb::PixelFormat vncGetPixelFormat(int scrIdx)
redShift, greenShift, blueShift);
}
-static void parseOverrideList(const char *text, ParamSet &out)
-{
- for (const char* iter = text; ; ++iter) {
- if (*iter == ',' || *iter == '\0') {
- out.insert(std::string(text, iter));
- text = iter + 1;
-
- if (*iter == '\0')
- break;
- }
- }
-}
-
void vncExtensionInit(void)
{
if (vncExtGeneration == vncGetServerGeneration()) {
@@ -201,7 +180,6 @@ void vncExtensionInit(void)
if (!initialised) {
core::initStdIOLoggers();
- parseOverrideList(allowOverride, allowOverrideSet);
allowOverride.setImmutable();
initialised = true;
@@ -523,8 +501,10 @@ void vncAbortMsc(int scrIdx, uint64_t id)
int vncOverrideParam(const char *param, const char *value)
{
- if (allowOverrideSet.find(param) == allowOverrideSet.end())
- return 0;
+ for (const char* allowed : allowOverride) {
+ if (strcasecmp(allowed, param) == 0)
+ return core::Configuration::setParam(param, value);
+ }
- return core::Configuration::setParam(param, value);
+ return 0;
}
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index 0b8e028f..a13168c4 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -176,11 +176,13 @@ ddxGiveUp(enum ExitCode error)
vncFreeFramebufferMemory(&vncScreenInfo.fb);
}
+#if XORG_OLDER_THAN(1, 21, 1)
void
AbortDDX(enum ExitCode error)
{
ddxGiveUp(error);
}
+#endif
void
OsVendorInit(void)
@@ -278,12 +280,14 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (argv[i][0] == ':')
displaySpecified = TRUE;
+#if XORG_OLDER_THAN(1, 21, 1)
#define CHECK_FOR_REQUIRED_ARGUMENTS(num) \
if (((i + num) >= argc) || (!argv[i + num])) { \
ErrorF("Required argument to %s not specified\n", argv[i]); \
UseMsg(); \
FatalError("Required argument to %s not specified\n", argv[i]); \
}
+#endif
if (strcmp(argv[i], "-pixdepths") == 0) { /* -pixdepths list-of-depth */
int depth, ret = 1;
@@ -442,7 +446,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
}
if (!strcmp(argv[i], "-showconfig") || !strcmp(argv[i], "-version")) {
- /* Already shown at start */
+ vncPrintBanner();
exit(0);
}
@@ -761,12 +765,13 @@ vncRandRModeGet(int width, int height)
xRRModeInfo modeInfo;
char name[100];
RRModePtr mode;
+#ifdef HAVE_LIBXCVT
+ struct libxcvt_mode_info *cvtMode;
+#endif
memset(&modeInfo, 0, sizeof(modeInfo));
#ifdef HAVE_LIBXCVT
- struct libxcvt_mode_info *cvtMode;
-
cvtMode = libxcvt_gen_mode_info(width, height, 60.0, false, false);
modeInfo.width = cvtMode->hdisplay;
@@ -899,7 +904,7 @@ vncRandRCreateScreenOutputs(int scrIdx, int extraOutputs)
/* Creating and modifying modes, used by XserverDesktop and init here */
int
-vncRandRCanCreateModes()
+vncRandRCanCreateModes(void)
{
return 1;
}
@@ -1166,8 +1171,11 @@ InitOutput(ScreenInfo * scrInfo, int argc, char **argv)
int i;
int NumFormats = 0;
- if (serverGeneration == 1)
+ if (serverGeneration == 1) {
+ vncPrintBanner();
+
LoadExtensionList(vncExtensions, ARRAY_SIZE(vncExtensions), TRUE);
+ }
#if XORG_AT_LEAST(1, 20, 0)
xorgGlxCreateVendor();
@@ -1224,11 +1232,13 @@ DDXRingBell(int percent, int pitch, int duration)
vncBell();
}
+#if XORG_OLDER_THAN(1, 21, 1)
Bool
LegalModifier(unsigned int key, DeviceIntPtr pDev)
{
return TRUE;
}
+#endif
void
ProcessInputEvents(void)
@@ -1259,7 +1269,5 @@ vncClientGone(int fd)
int
main(int argc, char *argv[], char *envp[])
{
- vncPrintBanner();
-
return dix_main(argc, argv, envp);
}