New upstream version 3.5.99.27
This commit is contained in:
21
nxproxy/.gitignore
vendored
Normal file
21
nxproxy/.gitignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
compile
|
||||
config.guess
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
config.h
|
||||
config.h.in
|
||||
libtool
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
src/Makefile
|
||||
src/Makefile.in
|
||||
src/nxproxy
|
||||
19
nxproxy/Makefile.am
Normal file
19
nxproxy/Makefile.am
Normal file
@@ -0,0 +1,19 @@
|
||||
SUBDIRS = src man
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(srcdir)/autom4te.cache/* \
|
||||
$(srcdir)/build-aux/* \
|
||||
$(srcdir)/Makefile.in \
|
||||
$(srcdir)/man/Makefile.in \
|
||||
$(srcdir)/src/Makefile.in \
|
||||
$(srcdir)/aclocal.m4 \
|
||||
$(srcdir)/config.h.in \
|
||||
$(srcdir)/config.h.in~ \
|
||||
$(srcdir)/config.guess \
|
||||
$(srcdir)/config.sub \
|
||||
$(srcdir)/configure \
|
||||
$(NULL)
|
||||
|
||||
DISTCLEANFILES=$(MAINTAINERCLEANFILES)
|
||||
1
nxproxy/VERSION
Symbolic link
1
nxproxy/VERSION
Symbolic link
@@ -0,0 +1 @@
|
||||
../VERSION
|
||||
45
nxproxy/configure.ac
Normal file
45
nxproxy/configure.ac
Normal file
@@ -0,0 +1,45 @@
|
||||
dnl ***************************************************************************
|
||||
dnl *** configure.ac for nxproxy ***
|
||||
dnl ***************************************************************************
|
||||
|
||||
m4_define([nxproxy_version], m4_esyscmd([tr -d '\n' < VERSION]))
|
||||
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
AC_INIT([NX Proxy], [nxproxy_version], [https://github.com/ArcticaProject/nx-libs/issues])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_PROG_CC
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2])
|
||||
|
||||
# Initialize libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# enable this to add the variable to the Makefiles
|
||||
#AC_ARG_VAR(NX_VERSION_CUSTOM, [custom version string])
|
||||
|
||||
if test "x$NX_VERSION_CUSTOM" != x; then
|
||||
AC_DEFINE_UNQUOTED([NX_VERSION_CUSTOM], ["${NX_VERSION_CUSTOM}"], [user provided custom version string])
|
||||
fi
|
||||
|
||||
PROXY_VERSION=nxproxy_version
|
||||
AC_SUBST([PROXY_VERSION])
|
||||
|
||||
AC_LANG([C])
|
||||
NX_COMPILER_BRAND
|
||||
NX_DEFAULT_OPTIONS
|
||||
|
||||
NX_TARGET_USE_ELF
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
man/Makefile
|
||||
src/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
1
nxproxy/m4/ax_cxx_compile_stdcxx.m4
Symbolic link
1
nxproxy/m4/ax_cxx_compile_stdcxx.m4
Symbolic link
@@ -0,0 +1 @@
|
||||
../../m4/ax_cxx_compile_stdcxx.m4
|
||||
1
nxproxy/m4/ax_cxx_compile_stdcxx_11.m4
Symbolic link
1
nxproxy/m4/ax_cxx_compile_stdcxx_11.m4
Symbolic link
@@ -0,0 +1 @@
|
||||
../../m4/ax_cxx_compile_stdcxx_11.m4
|
||||
1
nxproxy/m4/nx-macros.m4
Symbolic link
1
nxproxy/m4/nx-macros.m4
Symbolic link
@@ -0,0 +1 @@
|
||||
../../m4/nx-macros.m4
|
||||
5
nxproxy/man/Makefile.am
Normal file
5
nxproxy/man/Makefile.am
Normal file
@@ -0,0 +1,5 @@
|
||||
NULL =
|
||||
|
||||
dist_man_MANS = \
|
||||
nxproxy.1 \
|
||||
$(NULL)
|
||||
432
nxproxy/man/nxproxy.1
Normal file
432
nxproxy/man/nxproxy.1
Normal file
@@ -0,0 +1,432 @@
|
||||
'\" -*- coding: utf-8 -*-
|
||||
.if \n(.g .ds T< \\FC
|
||||
.if \n(.g .ds T> \\F[\n[.fam]]
|
||||
.de URL
|
||||
\\$2 \(la\\$1\(ra\\$3
|
||||
..
|
||||
.if \n(.g .mso www.tmac
|
||||
.TH nxproxy 1 "Jun 2023" "Version 3.5.99.27" "NX Proxy"
|
||||
.SH NAME
|
||||
nxproxy \- NX Proxy Tool
|
||||
.SH SYNOPSIS
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBnxproxy\fR \fI[<options>] <host>:<port>\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBnxproxy\fR is a tool that allows one to tunnel X sessions through
|
||||
the NX compression library. \fBnxproxy\fR is a backend application
|
||||
utilized by various client application (Remmina, X2Go Client, PyHoca-Gui,
|
||||
Arctica Client, TheQVD Client, etc.).
|
||||
.PP
|
||||
.SH COMMAND LINE OPTIONS
|
||||
.TP 8
|
||||
.B -C
|
||||
Specify that nxproxy has to run on the 'X client' side, listening for
|
||||
connections and impersonating an X server.
|
||||
.TP 8
|
||||
.B -S
|
||||
Specify that nxproxy has to run in 'X server' mode, thus forwarding the
|
||||
connections to daemons running on the client.
|
||||
.TP 8
|
||||
.B -h
|
||||
Print this message.
|
||||
.TP 8
|
||||
.B -v
|
||||
Print version information.
|
||||
.TP 8
|
||||
.B -d <int>
|
||||
Set log level (0 for FATAL, 1 for ERROR, 2 for WARNING, 3 for INFO, 4 for
|
||||
DEBUG). The default is 0.
|
||||
.TP 8
|
||||
.B -o <string>
|
||||
Name of the log file. Default is stderr.
|
||||
.TP 8
|
||||
.B -f <string>
|
||||
Specify log format. The characters in <string> define how the loglines
|
||||
are formatted. The following characters are supported, default is '0':
|
||||
.RS 8
|
||||
.TP 8
|
||||
.I 0
|
||||
only the plain text without any additions. This is the default.
|
||||
.TP 8
|
||||
.I u
|
||||
include time
|
||||
.TP 8
|
||||
.I l
|
||||
include loglevel
|
||||
.TP 8
|
||||
.I T
|
||||
include thread ids
|
||||
.TP 8
|
||||
.I L
|
||||
include the location of the log call in the source code
|
||||
.RE
|
||||
.TP 8
|
||||
.B <host>:<port>
|
||||
Put at the end, specifies the host and port of the listening proxy.
|
||||
|
||||
.SH NX/NX DISPLAY OPTIONS
|
||||
Multiple nx/nx options can be specified in the DISPLAY environment or on
|
||||
the command line, by using the nx/nx,option=value notation.
|
||||
.TP 8
|
||||
.B link=<string>
|
||||
An indication of the link speed that is going to be used between the
|
||||
proxies. Usually the compression and the other link parameters depend on
|
||||
this setting. The value can be either 'modem', 'isdn', 'adsl', 'wan', 'lan', 'local'
|
||||
or a bandwidth specification, like for example '56k', '1m', '100m', etc.
|
||||
|
||||
.TP 8
|
||||
.B type=<string>
|
||||
Type of session, for example 'windows', 'unix-kde'. 'unix-application',
|
||||
etc.
|
||||
|
||||
.TP 8
|
||||
.B display=<string>
|
||||
Specify the real display where X connections have to be forwarded by the
|
||||
proxy running on the client.
|
||||
|
||||
.TP 8
|
||||
.B listen=<int>
|
||||
Local port used for accepting the proxy connection.
|
||||
|
||||
.TP 8
|
||||
.B loopback=<bool>
|
||||
Bind to the loopback device only.
|
||||
|
||||
.TP 8
|
||||
.B accept=<string>
|
||||
Name or IP of host that can connect to the proxy.
|
||||
|
||||
.TP 8
|
||||
.B connect=<string>
|
||||
Name or IP of host that the proxy will connect to.
|
||||
|
||||
.TP 8
|
||||
.B port=<int>
|
||||
Remote port used for the connection.
|
||||
|
||||
.TP 8
|
||||
.B retry=<int>
|
||||
Number of connection attempts.
|
||||
|
||||
.TP 8
|
||||
.B root=<string>
|
||||
The root directory for the session. Usually is the C\-* or S\-* in the .nx
|
||||
directory in the user's home, with '*' being the virtual display.
|
||||
|
||||
.TP 8
|
||||
.B session=<string>
|
||||
Name of the session file. The default is the name 'session' in the
|
||||
session directory.
|
||||
|
||||
.TP 8
|
||||
.B errors=<string>
|
||||
Name of the log file used by the proxy. The default is the name 'errors'
|
||||
in the session directory.
|
||||
|
||||
.TP 8
|
||||
.B stats=<string>
|
||||
Name of the file where are written the proxy statistics. The default is a
|
||||
file 'stats' in the session directory. The proxy replaces the data in the
|
||||
file whenever it receives a SIGUSR1 or SIGUSR2 signal:
|
||||
|
||||
.I SIGUSR1:
|
||||
Gives total statistics, i.e. statistics collected since the beginning of
|
||||
the session.
|
||||
|
||||
.I SIGUSR2:
|
||||
Gives partial statistics, i.e. statistics collected since the last time
|
||||
this signal was received.
|
||||
|
||||
.TP 8
|
||||
.B cookie=<string>
|
||||
Use the provided cookie for authenticating to the remote proxy. The same
|
||||
cookie is used as the fake value used for the X authorization. The fake
|
||||
cookie is replaced on the X server side with the real cookie to be used
|
||||
for the display, so that the real cookie doesn't have to travel over the
|
||||
net. When not using a proxy cookie, any host will be able to connect to
|
||||
the proxy. See also the 'accept' parameter.
|
||||
|
||||
.TP 8
|
||||
.B nodelay=<bool>
|
||||
A boolean indicating if TCP_NODELAY has to be set on the proxy link. Old
|
||||
Linux kernels had problems with handling TCP_NODELAY on PPP links.
|
||||
|
||||
.TP 8
|
||||
.B policy=<bool>
|
||||
Let or not the agent decide when it is the best time to flush the proxy
|
||||
link. If set to 0, the proxy will flush any encoded data immediately. The
|
||||
option has only effect on the X client side proxy.
|
||||
|
||||
.TP 8
|
||||
.B render=<bool>
|
||||
Enable or disable use of the RENDER extension.
|
||||
|
||||
.TP 8
|
||||
.B taint=<bool>
|
||||
Try to suppress trivial sources of X roundtrips by generating the reply
|
||||
on the X client side.
|
||||
|
||||
.TP 8
|
||||
.B delta=<bool>
|
||||
Enable X differential compression.
|
||||
|
||||
.TP 8
|
||||
.B data=<int>
|
||||
Enable or disable the ZLIB data compression. It is possible to specify a
|
||||
value between 0 and 9. Usually the value is chosen automatically based on
|
||||
the requested link setting.
|
||||
|
||||
.TP 8
|
||||
.B stream=<int>
|
||||
Enable or disable the ZLIB stream compression. The value, between 0 and
|
||||
9, is usually determined according to the requested link setting. Not
|
||||
fully implemented in nx-X11 Agent, yet.
|
||||
|
||||
.TP 8
|
||||
.B limit=<int>
|
||||
Specify a bitrate limit allowed for this session.
|
||||
|
||||
.TP 8
|
||||
.B memory=<int>
|
||||
Trigger memory optimizations used to keep small the size of X buffers.
|
||||
This is useful on embedded plat- forms, or where memory is scarce.
|
||||
|
||||
.TP 8
|
||||
.B cache=<int>
|
||||
Size of the in-memory X message cache. Setting the value to 0 will
|
||||
disable the memory cache as well as the NX differential compression.
|
||||
|
||||
.TP 8
|
||||
.B images=<int>
|
||||
Size of the persistent image cache.
|
||||
|
||||
.TP 8
|
||||
.B shseg=<int>
|
||||
Enable the use of the MIT-SHM extension between the \fBnxproxy\fR and the
|
||||
real X server. A value greater than 1 is assumed to be the size of
|
||||
requested shared memory segment. By default, the size of the segment is
|
||||
determined based on the size of the in-memory cache.
|
||||
|
||||
.TP 8
|
||||
.B load=<bool>
|
||||
Enable loading a persistent X message cache at the proxy startup.
|
||||
|
||||
.TP 8
|
||||
.B save=<bool>
|
||||
Enable saving a persistent X message cache at the end of session.
|
||||
|
||||
.TP 8
|
||||
.B cups=<int>
|
||||
Enable or disable forwarding of CUPS connections, by listening on the
|
||||
optional port 'n'.
|
||||
|
||||
.TP 8
|
||||
.B aux=<int>
|
||||
Enable or disable forwarding of the auxiliary X channel used for
|
||||
controlling the keyboard. The 'keybd=<int>' form is accepted for backward
|
||||
compatibility.
|
||||
|
||||
.TP 8
|
||||
.B smb=<int>
|
||||
Enable or disable forwarding of SMB connections. The 'samba=<int>' form is
|
||||
accepted for backward compatibility.
|
||||
|
||||
.TP 8
|
||||
.B media=<int>
|
||||
Enable forwarding of audio connections.
|
||||
|
||||
.TP 8
|
||||
.B http=<int>
|
||||
Enable forwarding of HTTP connections.
|
||||
|
||||
.TP 8
|
||||
.B font=<int>
|
||||
Enable forwarding of reversed connections to a font
|
||||
server running on the NX server.
|
||||
|
||||
.TP 8
|
||||
.B file=<int>
|
||||
Enable forwarding of file transfer connections.
|
||||
|
||||
.TP 8
|
||||
.B mask=<int>
|
||||
Determine the distribution of channel ids between the proxies. By
|
||||
default, channels whose ids are multiple of 8 (starting from 0) are
|
||||
reserved for the NX client side. All the other channels can be allocated
|
||||
by the nx-X11 Agent side.
|
||||
|
||||
.TP 8
|
||||
.B timeout=t
|
||||
Specify the keep-alive timeout used by proxies to determine if there is a
|
||||
network problem preventing communication with the remote peer. A value of
|
||||
0 disables the check.
|
||||
|
||||
.TP 8
|
||||
.B cleanup=t
|
||||
Specify the number of seconds the proxy has to wait at session shutdown
|
||||
before closing all channels. The feature is used by the NX server to
|
||||
ensure that services are disconnected before shutting down the link.
|
||||
|
||||
.TP 8
|
||||
.B pack=<string>
|
||||
Determine the method used to compress images.
|
||||
|
||||
.TP 8
|
||||
.B product=<string>
|
||||
The product id of the client or server. The value is ignored by the
|
||||
proxy, but the client or server can provide it to facilitate the support.
|
||||
|
||||
.TP 8
|
||||
.B core=<bool>
|
||||
Enable production of core dumps when aborting the proxy connection.
|
||||
|
||||
.TP 8
|
||||
.B options=<string>
|
||||
Specify an additional file containing options that has to be merged with
|
||||
option read from the command line or the environment.
|
||||
|
||||
.TP 8
|
||||
.B kill=<int>
|
||||
Add the given process to the list of daemons that must be terminated at
|
||||
session shutdown. Multiple 'kill=<int>' options can be specified. The proxy
|
||||
will send them a SIGTERM signal just before exiting.
|
||||
|
||||
.TP 8
|
||||
.B strict=<bool>
|
||||
Optimize for responsiveness, rather than for the best use of all the
|
||||
available bandwidth.
|
||||
|
||||
.TP 8
|
||||
.B encryption=<bool>
|
||||
Should be set to 1 if the proxy is running as part of a program providing
|
||||
encryption of the point to point communication.
|
||||
|
||||
.TP 8
|
||||
.I The following options are interpreted by the nx-NX Agent. They are ignored by the proxy:
|
||||
|
||||
autodpi=<bool>
|
||||
autograb=<bool>
|
||||
backingstore=<int>
|
||||
client=<string>
|
||||
clients=<string>
|
||||
clipboard=<int>
|
||||
composite=<int>
|
||||
copysize=<int>
|
||||
defer=<int>
|
||||
fullscreen=<bool>
|
||||
geometry=<string>
|
||||
kbtype=<string>
|
||||
keyboard=<string>
|
||||
keyconv=<string>
|
||||
magicpixel=<bool>
|
||||
menu=<int>
|
||||
resize=<bool>
|
||||
rootless=<bool>
|
||||
shadow=<int>
|
||||
shadowmode=<string>
|
||||
shadowuid=<int>
|
||||
shmem=<bool>
|
||||
shpix=<bool>
|
||||
sleep=<int>
|
||||
state=<string>
|
||||
streaming=<int>
|
||||
textclipboard=<bool>
|
||||
tile=<string>
|
||||
tolerancechecks=<int>
|
||||
xinerama=<int>
|
||||
|
||||
|
||||
.SH NX ENVIRONMENT VARIABLES
|
||||
|
||||
The \fBnxproxy\fR application (and also \fBnxagent\fR when using nxcomp
|
||||
support) can be influenced by the following environment variables:
|
||||
|
||||
|
||||
.TP 8
|
||||
.B NX_ROOT
|
||||
The root NX directory is the place where the session directory and the
|
||||
cache files are created. This is usually overridden by passing the 'root='
|
||||
option. By default, the root NX directory is assumed to be the
|
||||
directory '.nx' in the user's home.
|
||||
|
||||
.TP 8
|
||||
.B NX_SYSTEM
|
||||
The directory where NX programs and libraries reside. If not set, the
|
||||
value is assumed to be '/usr/NX'. Programs, libraries and data files are
|
||||
respectedly searched in the 'bin', 'lib' and 'share' subdirectories.
|
||||
|
||||
.TP 8
|
||||
.B NX_HOME
|
||||
The NX user's home directory. If NX_ROOT is not set or invalid, the
|
||||
user's NX directory is created here.
|
||||
|
||||
.TP 8
|
||||
.B NX_TEMP
|
||||
The directory where all temporary files are to be created.
|
||||
|
||||
.TP 8
|
||||
.B NX_CLIENT
|
||||
The full path to the <nxclient> executable. If the variable is not set,
|
||||
the <nxclient> executable will be run assuming that the program is in the
|
||||
system path. This can be useful on platforms like Windows and the MacOS X
|
||||
where <nxclient> is located in a different directory compared to the
|
||||
other programs, to make easier for the user to execute the program from
|
||||
the shell.
|
||||
|
||||
.TP 8
|
||||
.B NX_SLAVE_CMD
|
||||
The full path to the slave channel handler. When the slave channel is
|
||||
enabled, the agent will listen on a port and forward the connection to
|
||||
the NX_SLAVE_CMD program. This can be used to implement agent/proxy
|
||||
communication for applications such as serial port and USB forwarding.
|
||||
|
||||
.SH SHELL ENVIRONMENT VARIABLES
|
||||
|
||||
.TP 8
|
||||
.B HOME
|
||||
The variable is checked in the case NX_HOME is not set, null or invalid.
|
||||
|
||||
.TP 8
|
||||
.B TEMP
|
||||
The variable is checked whenever the NX_TEMP directory is not set, null
|
||||
or invalid.
|
||||
|
||||
.TP 8
|
||||
.B PATH
|
||||
The path where all executables are searched, except <nxclient>. If
|
||||
NX_CLIENT is not set, also the client executable is searched in the
|
||||
system path.
|
||||
|
||||
.TP 8
|
||||
.B LD_LIBRARY_PATH
|
||||
System-wide library search order. This should be set by the program
|
||||
invoking the proxy.
|
||||
|
||||
.TP 8
|
||||
.B DISPLAY
|
||||
On the X server side, the DISPLAY variable indicates the location of the
|
||||
X11 server. When nxcomp is used as a transport library, the DISPLAY may
|
||||
represent a NX transport specification and options can passed in the form
|
||||
nx/nx,option=value...
|
||||
|
||||
.TP 8
|
||||
.B XAUTHORITY
|
||||
This is the file containing the X11 authorization cookie. If not set, the
|
||||
file is assumed to be in the user's home (either NX_HOME or HOME).
|
||||
|
||||
.SH AUTHOR
|
||||
The \fBnxproxy\fR application has originally been derived from a software
|
||||
project called DXCP. The company NoMachine turned DXCP into nxcomp with
|
||||
nxproxy as executable around nxcomp.
|
||||
.PP
|
||||
The current maintenance of \fBnxproxy\fR (major version 3) is coordinated
|
||||
between various projects, mainly by The Arctica Project, TheQVD (Qindel
|
||||
Group) and the X2Go Project.
|
||||
.PP
|
||||
This manual has been written by Mike Gabriel
|
||||
<mike.gabriel@das\-netzwerkteam.de> for the X2Go project
|
||||
(http://www.x2go.org) and later on improved for the Arctica Project
|
||||
(https://arctica-project.org).
|
||||
121
nxproxy/src/Main.c
Normal file
121
nxproxy/src/Main.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
|
||||
/* */
|
||||
/* NXPROXY, NX protocol compression and NX extensions to this software */
|
||||
/* are copyright of NoMachine. Redistribution and use of the present */
|
||||
/* software is allowed according to terms specified in the file LICENSE */
|
||||
/* which comes in the source distribution. */
|
||||
/* */
|
||||
/* Check http://www.nomachine.com/licensing.html for applicability. */
|
||||
/* */
|
||||
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
|
||||
/* */
|
||||
/* All rights reserved. */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "NX.h"
|
||||
|
||||
#define PANIC
|
||||
#define WARNING
|
||||
#undef TEST
|
||||
#undef DEBUG
|
||||
|
||||
extern const char *__progname;
|
||||
|
||||
/*
|
||||
* Entry point when running nxproxy stand-alone.
|
||||
*/
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
char *options = NULL;
|
||||
|
||||
unsigned long int nx_commfd;
|
||||
char *nx_commfd_str = NULL;
|
||||
|
||||
options = getenv("NX_DISPLAY");
|
||||
|
||||
if ((nx_commfd_str = getenv("NX_COMMFD")) != NULL)
|
||||
{
|
||||
errno = 0;
|
||||
nx_commfd = strtoul(nx_commfd_str, NULL, 10);
|
||||
|
||||
if ((errno) && (0 == nx_commfd))
|
||||
{
|
||||
fprintf(stderr, "%s: NX_COMMFD environment variable's value [%s] is not a file descriptor number. "
|
||||
"Aborting...\n",
|
||||
__progname, nx_commfd_str
|
||||
);
|
||||
NXTransCleanup();
|
||||
}
|
||||
else if ((unsigned long int) INT_MAX < nx_commfd)
|
||||
{
|
||||
fprintf(stderr, "%s: NX_COMMFD environment variable's value [%lu] is out of range for a file descriptor number. "
|
||||
"Aborting...\n",
|
||||
__progname, nx_commfd);
|
||||
NXTransCleanup();
|
||||
}
|
||||
else {
|
||||
result = NXTransCreate(nx_commfd, NX_MODE_SERVER, options);
|
||||
|
||||
if (result != 1)
|
||||
{
|
||||
fprintf(stderr, "%s: NXTransCreate failed for FD#%lu\n"
|
||||
"Aborting...",
|
||||
__progname, nx_commfd);
|
||||
NXTransCleanup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// go into endless loop
|
||||
|
||||
if (result == 1)
|
||||
{
|
||||
while (NXTransRunning(NX_FD_ANY))
|
||||
result = NXTransContinue(NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (NXTransParseCommandLine(argc, argv) < 0)
|
||||
{
|
||||
NXTransCleanup();
|
||||
}
|
||||
|
||||
if (NXTransParseEnvironment(options, 0) < 0)
|
||||
{
|
||||
NXTransCleanup();
|
||||
}
|
||||
|
||||
/*
|
||||
* This should not return...
|
||||
*/
|
||||
|
||||
#ifdef TEST
|
||||
fprintf(stderr, "%s: Yielding control to NX entry point.\n", __progname);
|
||||
#endif
|
||||
|
||||
result = NXTransProxy(NX_FD_ANY, NX_MODE_ANY, NX_DISPLAY_ANY);
|
||||
}
|
||||
|
||||
/*
|
||||
* ...So these should not be called.
|
||||
*/
|
||||
|
||||
NXTransExit(result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
nxproxy/src/Makefile.am
Normal file
30
nxproxy/src/Makefile.am
Normal file
@@ -0,0 +1,30 @@
|
||||
NULL =
|
||||
|
||||
nxexecdir = $(bindir)
|
||||
|
||||
nxexec_PROGRAMS = nxproxy
|
||||
|
||||
nxproxy_SOURCES = \
|
||||
Main.c \
|
||||
$(NULL)
|
||||
|
||||
nxproxy_LDADD = \
|
||||
-L$(top_srcdir)/../nxcomp/src/.libs -lXcomp \
|
||||
$(NULL)
|
||||
|
||||
nxproxy_LDFLAGS = \
|
||||
$(NULL)
|
||||
|
||||
if TARGET_ELF
|
||||
nxproxy_LDFLAGS += \
|
||||
-Wl,--enable-new-dtags \
|
||||
$(NULL)
|
||||
endif TARGET_ELF
|
||||
|
||||
nxproxy_CFLAGS = \
|
||||
$(BASE_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/../nxcomp/include/ \
|
||||
$(NULL)
|
||||
Reference in New Issue
Block a user