Compare commits
No commits in common. "devel" and "gh-pages" have entirely different histories.
21
.cirrus.yml
21
.cirrus.yml
@ -1,21 +0,0 @@
|
||||
FreeBSD_task:
|
||||
matrix:
|
||||
env:
|
||||
SSL: libressl
|
||||
matrix:
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-2
|
||||
prepare_script:
|
||||
- pkg install -y $SSL git autoconf automake libtool pkgconf opus jpeg-turbo fdk-aac pixman libX11 libXfixes libXrandr nasm fusefs-libs check imlib2 freetype2 cmocka
|
||||
- git submodule update --init --recursive
|
||||
configure_script:
|
||||
- ./bootstrap
|
||||
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --localstatedir=/var --enable-strict-locations --with-pkgconfigdir=/usr/local/libdata/pkgconfig --enable-strict-locations --enable-ipv6 --enable-opus --enable-jpeg --enable-fdkaac --enable-painter --enable-pixman --enable-fuse --with-imlib2 --with-freetype2
|
||||
build_script:
|
||||
- make -j $(sysctl -n hw.ncpu || echo 4)
|
||||
check_script:
|
||||
- make check
|
||||
install_script:
|
||||
- make install
|
||||
test_script:
|
||||
- /usr/local/sbin/xrdp -v
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
||||
open_collective: xrdp-project
|
||||
109
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
109
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,109 +0,0 @@
|
||||
name: "🕷️ Bug report"
|
||||
description: Report errors or unexpected behavior
|
||||
labels:
|
||||
- "bug"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before submitting a bug, read the [FAQ](https://github.com/neutrinolabs/xrdp/wiki/Tips-and-FAQ).
|
||||
**In particular, on systemd-based systems. make sure you are not logged in on the console as the same user you are trying to use for xrdp**
|
||||
- type: input
|
||||
attributes:
|
||||
label: xrdp version
|
||||
placeholder: 0.9.20
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Detailed xrdp version, build options
|
||||
description: Copy & paste the result of `xrdp --version`. DO NOT remove `~~~` but paste the result between two `~~~`.
|
||||
value: |
|
||||
~~~
|
||||
PASTE HERE
|
||||
~~~
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating system & version
|
||||
placeholder: "Ubuntu 22.04 / AlmaLinux 9 / FreeBSD 13.2 / etc"
|
||||
description: Tell us about your operating system. See PRETTY_NAME
|
||||
in /etc/os-release if you don't know.
|
||||
|
||||
Note we are currently unable to provide direct support for Red Hat
|
||||
Enterprise Linux. Either reproduce the issue on CentOS/Alma/Rocky
|
||||
OS, or contact Red Hat directly for support.
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Installation method
|
||||
description: How was xrdp installed from?
|
||||
options:
|
||||
- dnf / apt / zypper / pkg / etc
|
||||
- Homebrew / MacPorts
|
||||
- git clone & make install
|
||||
- Doesn't matter
|
||||
- other
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Which backend do you use?
|
||||
description: Tell us about xrdp backend and version you're using. Typically, it would be either Xvnc or xorgxrdp or rarely NeutrionRDP / FreeRDP.
|
||||
placeholder: Xvnc (tigervnc-1.12.0-13.el9_2)
|
||||
- type: input
|
||||
attributes:
|
||||
label: What desktop environment do you use?
|
||||
description: Tell us about your desktop (e.g. GNOME / KDE / Xfce / xterm). If you're certain the bug you about to report is not desktop specific, fill "any" here.
|
||||
placeholder: GNOME
|
||||
- type: input
|
||||
attributes:
|
||||
label: Environment xrdp running on
|
||||
description: Tell us whether xrdp is running on a VM, or if on a physical machine what graphics cards are installed.
|
||||
- type: input
|
||||
attributes:
|
||||
label: What's your client?
|
||||
description: If you issue occurs with specific clients, tell us the client app name, app version client os version and platform.
|
||||
placeholder: Microsoft's official client from Mac App Store, running on macOS Ventura.
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Area(s) with issue?
|
||||
description: What things had an issue? Check all that apply.
|
||||
multiple: true
|
||||
options:
|
||||
- Audio redirection
|
||||
- Authentication
|
||||
- Crashes such as segfault
|
||||
- Clipboard
|
||||
- Compatiblity aginst clients
|
||||
- Compile error
|
||||
- File transfer / drive redirection
|
||||
- Graphic glitches
|
||||
- Keyboard / Mouse
|
||||
- Network
|
||||
- Performance
|
||||
- Session manager (sesman)
|
||||
- Smartcard
|
||||
- Other
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
placeholder: Having detailed steps helps us reproduce the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ✔️ Expected Behavior
|
||||
placeholder: What were you expecting?
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ❌ Actual Behavior
|
||||
placeholder: What happened instead?
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: Links? References? Anything that will give us more context about the issue you are encountering! We recommend attaching `xrdp.log`, `xrdp-sesman.log`, `xrdp/xorg.conf` or screenshots to clarify context.
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,5 +0,0 @@
|
||||
contact_links:
|
||||
- name: Questions
|
||||
about: If you are new to xrdp and want to ask community for help, raise it as Q&A in discussion.
|
||||
url: https://github.com/neutrinolabs/xrdp/discussions/new?category=q-a
|
||||
|
||||
219
.github/workflows/build.yml
vendored
219
.github/workflows/build.yml
vendored
@ -1,219 +0,0 @@
|
||||
name: build and test
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "gh-pages"
|
||||
tags-ignore:
|
||||
- "v0.[0-8]**"
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "gh-pages"
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
|
||||
# Minimal 64-bit arch builds
|
||||
- CC: gcc
|
||||
feature_set: min
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: false
|
||||
DISTCHECK: false
|
||||
|
||||
- CC: g++
|
||||
feature_set: min
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: false
|
||||
DISTCHECK: false
|
||||
|
||||
- CC: clang
|
||||
feature_set: min
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: false
|
||||
DISTCHECK: false
|
||||
|
||||
# Maximal 64-bit arch builds
|
||||
- CC: gcc
|
||||
feature_set: max
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: true
|
||||
DISTCHECK: true
|
||||
|
||||
- CC: g++
|
||||
feature_set: max
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: false
|
||||
DISTCHECK: false
|
||||
|
||||
- CC: clang
|
||||
feature_set: max
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: true
|
||||
DISTCHECK: true
|
||||
|
||||
# Maximal debug 64-bit arch builds
|
||||
# Check we can also do a static build without
|
||||
# installing .a files
|
||||
- CC: gcc
|
||||
feature_set: max
|
||||
arch: amd64
|
||||
os: ubuntu-latest
|
||||
unittests: true
|
||||
DISTCHECK: false
|
||||
name_extra: and DEBUG
|
||||
CONF_FLAGS_EXTRA: "--enable-devel-all --disable-static"
|
||||
|
||||
# Maximal 32-bit arch builds
|
||||
- CC: gcc
|
||||
feature_set: max
|
||||
arch: i386
|
||||
os: ubuntu-latest
|
||||
unittests: true
|
||||
DISTCHECK: false
|
||||
name_extra: for 32-bit arch (legacy OS)
|
||||
|
||||
- CC: g++
|
||||
feature_set: max
|
||||
arch: i386
|
||||
os: ubuntu-latest
|
||||
unittests: false
|
||||
DISTCHECK: false
|
||||
name_extra: for 32-bit arch (legacy OS)
|
||||
|
||||
- CC: clang
|
||||
feature_set: max
|
||||
arch: i386
|
||||
os: ubuntu-latest
|
||||
unittests: true
|
||||
DISTCHECK: false
|
||||
name_extra: for 32-bit arch (legacy OS)
|
||||
|
||||
name: ${{ matrix.feature_set }} features with ${{ matrix.CC }} ${{ matrix.name_extra }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: ${{ matrix.CC }}
|
||||
|
||||
# HACK (2020-11-16): github actions doesn't support YAML anchors/aliases to
|
||||
# avoid repeating long config values. So instead the config values are defined
|
||||
# as environment variables using a naming convention with fields that come from
|
||||
# the job config. These environment variables are then referenced as regular
|
||||
# environment variables via the naming convention in the "define env" step to
|
||||
# define the standard environment variable used in the rest of the steps.
|
||||
CONF_FLAGS_amd64_min: "--disable-ipv6 --disable-jpeg --disable-fuse --disable-mp3lame
|
||||
--disable-fdkaac --disable-opus --disable-rfxcodec --disable-painter
|
||||
--disable-pixman --disable-utmp"
|
||||
CONF_FLAGS_amd64_max: "--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame
|
||||
--enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter
|
||||
--enable-pixman --enable-utmp
|
||||
--with-imlib2 --with-freetype2 --enable-tests"
|
||||
CONF_FLAGS_i386_max: "--enable-ipv6 --enable-jpeg --enable-mp3lame
|
||||
--enable-opus --enable-rfxcodec --enable-painter
|
||||
--disable-pixman --with-imlib2 --with-freetype2
|
||||
--host=i686-linux --enable-tests"
|
||||
|
||||
PKG_CONFIG_PATH_i386: "/usr/lib/i386-linux-gnu/pkgconfig"
|
||||
CFLAGS_i386: "-m32"
|
||||
LDFLAGS_i386: "-m32"
|
||||
steps:
|
||||
- name: "Define feature and arch dependent environment variables"
|
||||
# Note: any "variable=value" written to the $GITHUB_ENV file will be
|
||||
# defined as an environment variable for all future steps in this job
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||
run: |
|
||||
echo "CONF_FLAGS=$CONF_FLAGS_${{ matrix.arch }}_${{ matrix.feature_set }} ${{ matrix.CONF_FLAGS_EXTRA }}" >> $GITHUB_ENV
|
||||
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH_${{ matrix.arch }}" >> $GITHUB_ENV
|
||||
echo "CFLAGS=$CFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV
|
||||
echo "LDFLAGS=$LDFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v4
|
||||
- name: "Install Dependencies"
|
||||
# See https://github.com/actions/runner-images/issues/7192
|
||||
run: |
|
||||
echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
|
||||
sudo scripts/install_xrdp_build_dependencies_with_apt.sh ${{ matrix.feature_set }} ${{ matrix.arch }} --allow-downgrades --allow-remove-essential --allow-change-held-packages
|
||||
- name: Bootstrap
|
||||
run: ./bootstrap
|
||||
- name: configure
|
||||
run: ./configure $CONF_FLAGS
|
||||
- name: make
|
||||
run: make -j $(nproc)
|
||||
- name: unittests
|
||||
if: ${{ matrix.unittests }}
|
||||
run: make check -j $(nproc)
|
||||
- name: distcheck
|
||||
id: dist_check
|
||||
if: ${{ matrix.DISTCHECK }}
|
||||
run: make distcheck -j $(nproc)
|
||||
- name: "Artifact: test-suite.log distcheck"
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always() && steps.dist_check.outcome == 'failure'
|
||||
with:
|
||||
name: test-suite-distcheck-${{ matrix.cc }}-${{ matrix.feature_set }}
|
||||
path: ${{ github.workspace }}/xrdp-*/_build/sub/tests/xrdp/test-suite.log
|
||||
|
||||
cppcheck:
|
||||
name: cppcheck
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CC: gcc
|
||||
# This is required to use a version of cppcheck other than that
|
||||
# supplied with the operating system
|
||||
CPPCHECK_VER: "2.13.0"
|
||||
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
|
||||
steps:
|
||||
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
|
||||
- name: Get operating system name and version.
|
||||
id: os
|
||||
run: echo "image=$ImageOS" >>$GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache cppcheck
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-cppcheck
|
||||
with:
|
||||
path: ~/cppcheck.local
|
||||
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
|
||||
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh $CPPCHECK_VER
|
||||
- run: ./bootstrap
|
||||
- run: ./configure
|
||||
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
|
||||
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
|
||||
|
||||
code_formatting_check:
|
||||
name: code formatting check
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CC: gcc
|
||||
# This is required to use a version of astyle other than that
|
||||
# supplied with the operating system
|
||||
ASTYLE_VER: 3.4.12
|
||||
ASTYLE_REPO: https://gitlab.com/saalen/astyle.git
|
||||
steps:
|
||||
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
|
||||
- name: Get operating system name and version.
|
||||
id: os
|
||||
run: echo "image=$ImageOS" >>$GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache astyle
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-astyle
|
||||
with:
|
||||
path: ~/astyle.local
|
||||
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }}
|
||||
- run: sudo scripts/install_astyle_dependencies_with_apt.sh
|
||||
- run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER
|
||||
- name: Format code with astyle
|
||||
run: scripts/run_astyle.sh -v $ASTYLE_VER
|
||||
- name: Check code formatting
|
||||
run: git diff --exit-code
|
||||
63
.gitignore
vendored
63
.gitignore
vendored
@ -1,63 +0,0 @@
|
||||
*~
|
||||
*.a
|
||||
aclocal.m4
|
||||
AUTHORS
|
||||
autom4te.cache/
|
||||
ChangeLog
|
||||
compile
|
||||
config_ac.h
|
||||
config_ac-h.in
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
.deps/
|
||||
fontutils/xrdp-dumpfv1
|
||||
fontutils/xrdp-mkfv1
|
||||
genkeymap/xrdp-genkeymap
|
||||
install-sh
|
||||
instfiles/pam.d/xrdp-sesman
|
||||
instfiles/*.service
|
||||
keygen/xrdp-keygen
|
||||
*.la
|
||||
.libs
|
||||
libtool
|
||||
*.lo
|
||||
*.log
|
||||
ltmain.sh
|
||||
Makefile
|
||||
Makefile.in
|
||||
missing
|
||||
mkinstalldirs
|
||||
NEWS
|
||||
*.o
|
||||
README
|
||||
sesman/chansrv/xrdp-chansrv
|
||||
sesman/sesexec/xrdp-sesexec
|
||||
sesman/tools/xrdp-authtest
|
||||
sesman/tools/xrdp-dis
|
||||
sesman/tools/xrdp-sesadmin
|
||||
sesman/tools/xrdp-sesrun
|
||||
sesman/tools/xrdp-sestest
|
||||
sesman/tools/xrdp-xcon
|
||||
sesman/xrdp-sesman
|
||||
sesman/sesman.ini
|
||||
*.so
|
||||
stamp-h1
|
||||
tap-driver.sh
|
||||
test-driver
|
||||
tests/common/test_common
|
||||
tests/libipm/test_libipm
|
||||
tests/libxrdp/test_libxrdp
|
||||
tests/memtest/memtest
|
||||
tests/xrdp/test_xrdp
|
||||
tools/devel/tcp_proxy/tcp_proxy
|
||||
*.trs
|
||||
waitforx/waitforx
|
||||
xrdp/xrdp
|
||||
xrdp/xrdp.ini
|
||||
xrdp_configure_options.h
|
||||
xrdpapi/xrdp-xrdpapi-simple
|
||||
.vscode/*
|
||||
13
.gitmodules
vendored
13
.gitmodules
vendored
@ -1,13 +0,0 @@
|
||||
[submodule "librfxcodec"]
|
||||
path = librfxcodec
|
||||
url = https://github.com/neutrinolabs/librfxcodec.git
|
||||
branch = .
|
||||
ignore = untracked
|
||||
[submodule "libpainter"]
|
||||
path = libpainter
|
||||
url = https://github.com/neutrinolabs/libpainter.git
|
||||
branch = .
|
||||
ignore = untracked
|
||||
[submodule "ulalaca"]
|
||||
path = ulalaca
|
||||
url = https://github.com/neutrinolabs/ulalaca-xrdp.git
|
||||
176
COPYING
176
COPYING
@ -1,176 +0,0 @@
|
||||
Apache License, Version 2.0
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the
|
||||
copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other
|
||||
entities that control, are controlled by, or are under common control
|
||||
with that entity. For the purposes of this definition, "control" means
|
||||
(i) the power, direct or indirect, to cause the direction or management
|
||||
of such entity, whether by contract or otherwise, or (ii) ownership of
|
||||
fifty percent (50%) or more of the outstanding shares, or
|
||||
(iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation source,
|
||||
and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation
|
||||
or translation of a Source form, including but not limited to compiled
|
||||
object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form,
|
||||
made available under the License, as indicated by a copyright notice that is
|
||||
included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form,
|
||||
that is based on (or derived from) the Work and for which the editorial
|
||||
revisions, annotations, elaborations, or other modifications represent, as a
|
||||
whole, an original work of authorship. For the purposes of this License,
|
||||
Derivative Works shall not include works that remain separable from, or
|
||||
merely link (or bind by name) to the interfaces of, the Work and
|
||||
Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original
|
||||
version of the Work and any modifications or additions to that Work or Derivative
|
||||
Works thereof, that is intentionally submitted to Licensor for inclusion in the
|
||||
Work by the copyright owner or by an individual or Legal Entity authorized to
|
||||
submit on behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently incorporated
|
||||
within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License,
|
||||
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
||||
no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||
Derivative Works of, publicly display, publicly perform, sublicense, and distribute
|
||||
the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
||||
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
||||
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||
license to make, have made, use, offer to sell, sell, import, and otherwise transfer
|
||||
the Work, where such license applies only to those patent claims licensable by such
|
||||
Contributor that are necessarily infringed by their Contribution(s) alone or by
|
||||
combination of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution
|
||||
incorporated within the Work constitutes direct or contributory patent infringement,
|
||||
then any patent licenses granted to You under this License for that Work shall
|
||||
terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative
|
||||
Works thereof in any medium, with or without modifications, and in Source or Object
|
||||
form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this
|
||||
License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed
|
||||
the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the attribution
|
||||
notices contained within such NOTICE file, excluding those notices that do not pertain
|
||||
to any part of the Derivative Works, in at least one of the following places: within a
|
||||
NOTICE text file distributed as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or, within a display
|
||||
generated by the Derivative Works, if and wherever such third-party notices normally
|
||||
appear. The contents of the NOTICE file are for informational purposes only and do not
|
||||
modify the License. You may add Your own attribution notices within Derivative Works
|
||||
that You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
||||
provided that such additional attribution notices cannot be construed as modifying
|
||||
the License. You may add Your own copyright statement to Your modifications and may
|
||||
provide additional or different license terms and conditions for use, reproduction,
|
||||
or distribution of Your modifications, or for any such Derivative Works as a whole,
|
||||
provided Your use, reproduction, and distribution of the Work otherwise complies
|
||||
with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution
|
||||
intentionally submitted for inclusion in the Work by You to the Licensor shall be under
|
||||
the terms and conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of any
|
||||
separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the Licensor, except as required for reasonable and
|
||||
customary use in describing the origin of the Work and reproducing the content of
|
||||
the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing,
|
||||
Licensor provides the Work (and each Contributor provides its Contributions) on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||
including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for
|
||||
determining the appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort
|
||||
(including negligence), contract, or otherwise, unless required by applicable law
|
||||
(such as deliberate and grossly negligent acts) or agreed to in writing, shall any
|
||||
Contributor be liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a result of this
|
||||
License or out of the use or inability to use the Work (including but not limited to
|
||||
damages for loss of goodwill, work stoppage, computer failure or malfunction, or any
|
||||
and all other commercial damages or losses), even if such Contributor has been advised
|
||||
of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
||||
Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance
|
||||
of support, warranty, indemnity, or other liability obligations and/or rights consistent
|
||||
with this License. However, in accepting such obligations, You may act only on Your
|
||||
own behalf and on Your sole responsibility, not on behalf of any other Contributor,
|
||||
and only if You agree to indemnify, defend, and hold each Contributor harmless for any
|
||||
liability incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work
|
||||
To apply the Apache License to your work, attach the following boilerplate notice,
|
||||
with the fields enclosed by brackets "[]" replaced with your own identifying
|
||||
information. (Don't include the brackets!) The text should be enclosed in the
|
||||
appropriate comment syntax for the file format. We also recommend that a file or class
|
||||
name and description of purpose be included on the same "printed page" as the
|
||||
copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
76
Makefile.am
76
Makefile.am
@ -1,76 +0,0 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--without-systemdsystemunitdir \
|
||||
--enable-strict-locations \
|
||||
--enable-tests
|
||||
|
||||
EXTRA_DIST = \
|
||||
COPYING \
|
||||
README.md \
|
||||
NEWS.md \
|
||||
astyle_config.as \
|
||||
bootstrap \
|
||||
coding_style.md \
|
||||
m4 \
|
||||
vrplayer
|
||||
|
||||
if XRDP_NEUTRINORDP
|
||||
NEUTRINORDPDIR = neutrinordp
|
||||
else
|
||||
NEUTRINORDPDIR =
|
||||
endif
|
||||
|
||||
if XRDP_XRDPVR
|
||||
XRDPVRDIR = xrdpvr
|
||||
else
|
||||
XRDPVRDIR =
|
||||
endif
|
||||
|
||||
if XRDP_PAINTER
|
||||
PAINTERDIR = libpainter
|
||||
else
|
||||
PAINTERDIR =
|
||||
endif
|
||||
|
||||
if XRDP_RFXCODEC
|
||||
RFXCODECDIR = librfxcodec
|
||||
else
|
||||
RFXCODECDIR =
|
||||
endif
|
||||
|
||||
if XRDP_ULALACA
|
||||
ULALACADIR = ulalaca
|
||||
else
|
||||
ULALACADIR =
|
||||
endif
|
||||
|
||||
# This should not be dictionary order but build order
|
||||
SUBDIRS = \
|
||||
third_party \
|
||||
third_party/tomlc99 \
|
||||
common \
|
||||
vnc \
|
||||
xup \
|
||||
mc \
|
||||
$(NEUTRINORDPDIR) \
|
||||
libipm \
|
||||
libxrdp \
|
||||
$(PAINTERDIR) \
|
||||
$(RFXCODECDIR) \
|
||||
sesman \
|
||||
xrdp \
|
||||
fontutils \
|
||||
keygen \
|
||||
waitforx \
|
||||
docs \
|
||||
instfiles \
|
||||
genkeymap \
|
||||
xrdpapi \
|
||||
pkgconfig \
|
||||
$(XRDPVRDIR) \
|
||||
$(ULALACADIR) \
|
||||
tests \
|
||||
tools
|
||||
|
||||
distclean-local:
|
||||
-rm -f xrdp_configure_options.h
|
||||
651
NEWS.md
651
NEWS.md
@ -1,651 +0,0 @@
|
||||
# Release notes for xrdp v0.9.19 (2022/03/17)
|
||||
|
||||
## General announcements
|
||||
* Running xrdp and xrdp-sesman on separate hosts is still supported by this release, but is now deprecated. This is not secure. A future release will replace the TCP socket used between these processes with a Unix Domain Socket, and then cross-host running will not be possible.
|
||||
|
||||
## New features
|
||||
* Both inbound and outbound clipboards can now be restricted for text, files or images [Sponsored by @CyberTrust @clear-code and @kenhys] (#2087)
|
||||
|
||||
## Bug fixes
|
||||
* [CVE-2022-23613](https://www.cve.org/CVERecord?id=CVE-2022-23613): Privilege escalation on xrdp-sesman (This fix is also in the out-of-band v0.9.18.1 release)
|
||||
* The versions of imlib2 used on RHEL 7 and 8 are now detected correctly (#2118)
|
||||
* Some situations where zombie processes could exist have been resolved (#2146, #2151, #2168)
|
||||
* Some null-pointer exceptions which can happen in the logging module have been addressed (#2149)
|
||||
* Some minor logging errors have been corrected (#2152)
|
||||
* The signal handling in sesman has been reworked to prevent race conditions when a child exits. This has also made it possible to reliably reload the sesman configuration with SIGHUP (#1729, #2168)
|
||||
|
||||
## Internal changes
|
||||
* Versions 0.13 and later of checklib can undefine the pre-processor symbol `HAVE_STDINT_H`. The xrdp tests now build successfully against these versions (#2124)
|
||||
* OpenSSL packaging changes (#2130):-
|
||||
- The OpenSSL 3 EVP interface is now fully supported
|
||||
- When building against OpenSSL 3, an internal implementation of the RC4 cipher is used instead of the implementation from the OpenSSL legacy provider
|
||||
- The wrapping of the OpenSSL library has been improved which should make it simpler to provide an alternative cryptographic provider in the future, if required
|
||||
- The logging of TLS/non-TLS security negotiation has been improved
|
||||
* cppcheck version used for CI bumped to 2.7 (#2140)
|
||||
* The `s_check()` macro which is easily mis-used has been removed (#2144)
|
||||
* Status values for the DRDYNVC channel are now available in `libxrdp/xrdp_channel.h`
|
||||
|
||||
## Changes for packagers or developers
|
||||
* On OpenSSL 3 systems, there is now no need to build with the `-Wno-error=deprecated-declarations` flag
|
||||
|
||||
## Known issues
|
||||
|
||||
* On-the-fly resolution change requires the Microsoft Store version of Remote Desktop client but sometimes crashes on connect (#1869)
|
||||
* xrdp's login dialog is not relocated at the center of the new resolution after on-the-fly resolution change happens (#1867)
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.18.1 (2022/02/08)
|
||||
|
||||
This is a security fix release that includes fixes for the following privilege escalation vulnerability.
|
||||
|
||||
* [CVE-2022-23613: Privilege escalation on xrdp-sesman](https://www.cve.org/CVERecord?id=CVE-2022-23613)
|
||||
|
||||
Users who uses xrdp v0.9.17 or v0.9.18 are recommended to update to this version.
|
||||
|
||||
## Special thanks
|
||||
|
||||
Thanks to [Gilad Kleinman](https://github.com/giladkl) reporting the vulnerability and reviewing fix.
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.18 (2022/01/10)
|
||||
|
||||
## General announcements
|
||||
* Running xrdp and xrdp-sesman on separate hosts is still supported by this release, but is now deprecated. This is not secure. A future release will replace the TCP socket used between these processes with a Unix Domain Socket, and then cross-host running will not be possible.
|
||||
* Special thanks for @trishume for contributing code to the RFX codec
|
||||
|
||||
## New features
|
||||
* Backgrounds and logos on the login screen can now be zoomed and scaled (#1962)
|
||||
* Small change for Alpine Linux support (#2005)
|
||||
* loongarch support (#2057)
|
||||
* Improved Fail2ban support (#1976)
|
||||
|
||||
## Bug fixes
|
||||
* Logging is improved for security protocol level decisions (#1974, #1975)
|
||||
* An unnecessary log error message which is always generated when running neutrinordp has been removed (#2016)
|
||||
* An incorrect development log message has been fixed (#2074)
|
||||
* Some informational and error messages written to the console on stdout have been removed or replaced with log messages (#2078 #2080)
|
||||
* Failure to attach to the memory area shared with xorgxrdp is now logged (#2065)
|
||||
* A regression in the VNC module logging which might cause a connection to drop out has been identified and fixed (#1989)
|
||||
* Remote drive redirection now works if printer redirection is also requested by the client (#327)
|
||||
* Some file names could not be copied from the client to the server over the clipboard. This is now fixed (#1992, #1995)
|
||||
* A config value has been added which allows copy-pasting of files to work with Nautilus for GNOME 3 versions >= 3.29.92 (#1994, #1996)
|
||||
* Clipboard now works properly when files can't be read (#1997 #2001)
|
||||
* (xorgxrdp v0.2.18) The screen is fully refreshed after initialising shared memory which should fix black screen problems like #1964
|
||||
* An incorrect initialisation reported by @qarmin has been fixed (#1909)
|
||||
* Some minor memory leaks have been fixed (#2014 #2028)
|
||||
* A hard hang in chansrv when copying files from the remote system has been addressed (#2032)
|
||||
* Users can now capitalise username and password on the login screen if required (#2061)
|
||||
* Some failed size checks in the fastpath code with `--enable-devel-streamcheck` have been addressed (#2066,#2070)
|
||||
* Log level for clipboard restriction has been promoted from DEVEL DEBUG to INFO (#2088)
|
||||
* A buffer overflow in the RFX codec associated with large screens has been fixed (#2087)
|
||||
|
||||
## Internal changes
|
||||
* Some 64-bit packages are removed during the 32-bit CI build process in an attempt to make this more robust (#1985)
|
||||
* Minor improvements to error checking and logging for file copy-paste (#1996)
|
||||
* Now uses cppcheck 2.6 for CI builds (#2008)
|
||||
* Generated systemd unit files now ignored by git (#2006)
|
||||
* More internal tests (#2015)
|
||||
* Some unnecessary files have been removed from the distribution (#2030)
|
||||
* The `which` command in shell scripts has been replaced with `command -v` (#2067)
|
||||
* Additional unit tests added for `g_file_get_size()` (#1988)
|
||||
* A compiler warning with -O3 on gcc 11.1 has been addressed (#2105)
|
||||
* An unused declaration for xrdp_wm_drdynvc_up has been removed (#2098)
|
||||
* The SCP V0 code has been unified, which will make it easier to update and replace (#2011)
|
||||
* Monitor processing unit tests for existing xrdp_sec function have been added (#1932)
|
||||
* The librfxcodec has been updated as part of #2087, and also to add stack frames to assemble code to assist debugging
|
||||
|
||||
## Changes for packagers or developers
|
||||
* The `--with-imlib2` option has been added. If xrdp is built with imlib2, the login screen supports more image formats for the background and logo, and better quality zooming and scaling (#1962)
|
||||
|
||||
## Known issues
|
||||
|
||||
* On-the-fly resolution change requires the Microsoft Store version of Remote Desktop client but sometimes crashes on connect (#1869)
|
||||
* xrdp's login dialog is not relocated at the center of the new resolution after on-the-fly resolution change happens (#1867)
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.17 (2021/08/31)
|
||||
|
||||
## General announcements
|
||||
* Running xrdp and xrdp-sesman on separate hosts is still supported by this release, but is now deprecated. This is not secure. A future release will replace the TCP socket used between these processes with a Unix Domain Socket, and then cross-host running will not be possible.
|
||||
|
||||
## New features
|
||||
* The IP address, port, and user name of NeutrinoRDP Proxy connection are logged in xrdp.log - these connections may not have a sesman log to use (#1873)
|
||||
* The performance settings for NeutrinoRDP can be now configured (#1903)
|
||||
* Support for Alpine Linux in startwm.sh (#1965)
|
||||
* clipboard: log file transfer for the purpose of audit (#1954)
|
||||
* Client's Keyboard layout now can be overridden by xrdp configuration for debugging purposes (#1952)
|
||||
|
||||
## Bug fixes
|
||||
* PAM_USER environment variable is not set when using pam_exec module (#1882)
|
||||
* Allow common channel settings to be overridden for modules as well as chansrv (#1899)
|
||||
* The text only-copy/paste interface for the VNC module (used only when chansrv is not active) has been improved (#1900)
|
||||
* The unsupported `tcutils` utility has been removed (#1943)
|
||||
* The quality of TLS logging has been improved (#1926)
|
||||
* Keyboard information is now passed correctly through NeuutrinoRDP, and can be overridden if required (#1934)
|
||||
* A message is now logged in the sesman log for unsuccessful login attempts detailing the user used (#1947)
|
||||
|
||||
|
||||
## Internal changes
|
||||
* astyle formatting is now checked during CI builds (#1879)
|
||||
* Generalise development build options, and add --enable-devel-streamcheck (#1887)
|
||||
* Now uses cppcheck 2.5 for CI builds (#1938)
|
||||
* The SCP protocol is now using a standard `struct trans` for messaging rather than its own thing (#1925)
|
||||
|
||||
## Changes for packagers or developers
|
||||
* The `--enable-xrdpdebug` developer option has been replaced with finer-grained `--enable-devel-*` options. Consequently, specifying `--enable-xrdpdebug` is now an error (#1913)
|
||||
|
||||
## Known issues
|
||||
|
||||
* On-the-fly resolution change requires the Microsoft Store version of Remote Desktop client but sometimes crashes on connect (#1869)
|
||||
* xrdp's login dialog is not relocated at the center of the new resolution after on-the-fly resolution change happens (#1867)
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.16 (2021/04/30)
|
||||
|
||||
## New features
|
||||
* On-the-fly resolution change now supported for Xvnc and Xorg (#448, #1820) - thanks to @Nexarian for this significant first contribution. See the following YouTube video for a demo.
|
||||
* [Windows] https://youtu.be/cZ0ebieZHeA
|
||||
* [Mac] https://youtu.be/6kfAkyLUgFY
|
||||
* xrdp can now use key algorithms other than RSA for TLS (#1776)
|
||||
* Do not spit on the console 2nd stage (inspired by Debian) #1762
|
||||
* Unified and improved logging (#1742, #1767, #1802, #1806, #1807, #1826, #1843) - thanks to @aquesnel for this detailed work.
|
||||
* Other logging level fixes (#1864)
|
||||
* chansrv can now work on `DISPLAY=:0` so it can be used with x11vnc/Vino/etc sessions (#1849)
|
||||
|
||||
## Bug fixes
|
||||
* Fix some regressions in sesman auth modules (#1769)
|
||||
* Minor manpage fixes (#1787)
|
||||
* Fix TS_PLAY_SOUND_PDU_DATA to set the correct frequency and duration (#1793)
|
||||
* Fix password leakage to logs in NeutrinoRDP module (#1872) - thanks to @TOMATO-ONE for reporting.
|
||||
|
||||
## Internal changes
|
||||
* cppcheck version for CI bumped to 2.4 (#1771, #1836)
|
||||
* FreeBSD version for CI bumped to 12-2 (#1804)
|
||||
* Support for check unit test framework added (#1843, #1860)
|
||||
* FreeBSD FUSE module now compiles under CI but needs additional work (#1856)
|
||||
* Compilation support added for additional Debian platforms (#1818)
|
||||
* Refactoring:-
|
||||
* Confusing preprocessor macro USE_NOPAM replaced with USE_PAM (#1800)
|
||||
* Window manager states in xrdp executable now use symbolic constants instead of numbers (#1803)
|
||||
* Documentation improvements
|
||||
* KRDC added to client list (#1817)
|
||||
* Platform support tier added (#1822)
|
||||
* README file revised (#1863)
|
||||
* Don't install test+development executables by default (#1858)
|
||||
|
||||
## Changes for packagers
|
||||
These changes are likely to impact operating system package builders and those building xrdp from source.
|
||||
* (#1843, #1860) This release introduces an additional optional compile-time dependency on the `check` unit test framework. The dependency is recommended when packaging for compile-time tests.
|
||||
* (#1858) The executables `memtest` and `tcp_proxy` are no longer copied to the sbin directory on a package install.
|
||||
|
||||
## Known issues
|
||||
|
||||
* On-the-fly resolution change requires the Microsoft Store version of Remote Desktop client but sometimes crashes on connect (#1869)
|
||||
* xrdp's login dialog is not relocated at the center of the new resolution after on-the-fly resolution change happens (#1867)
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.15 (2020/12/28)
|
||||
|
||||
## New features
|
||||
* Allow token sign in without autologon for SSO (#1667 #1668)
|
||||
* Norwegian keyboard support (#1675)
|
||||
* Improved config support for chansrv (#1635)
|
||||
* Unified chansrv, sesman and libxrdp logging (#1633 #1708 #1738) - thanks to @aquesnel
|
||||
* Support SUSE move to /usr/etc (#1702)
|
||||
* Parameters may now be specified for user-specified shell (#1270 #1695)
|
||||
* xrdp executables now allow alternative config files to be specified with -c (#1588 #1650 #1651)
|
||||
* sesrun improvements (#1741)
|
||||
* Drive redirection location can now be specified (#1048)
|
||||
* Now compiles on RISC-V (#1761)
|
||||
|
||||
## Bug fixes
|
||||
* Additional buffer overflow checks (#1662)
|
||||
* FUSE support now builds on 32-bit platforms (#1682)
|
||||
* genkeymap array size conflict fixed (#1691)
|
||||
* Buffering issue with neutrinordp over a slow link fixed (#1608 1634)
|
||||
* Various documentation fixes (#1704 #1741 #1755 #1759)
|
||||
* Prevent PAM info message from causing authentication failure (#1727)
|
||||
* Cosmetic fixes for minor issues (#1751 #1755 #1749)
|
||||
* Try harder to clean up socket files on session exit (#1740 #1756)
|
||||
* xrdp-chansrv become defunct in docker while file copy (#1658)
|
||||
|
||||
## Internal changes
|
||||
* Compilation warnings with newer compilers (#1659 #1680)
|
||||
* Continuation Integration checks on 32-bit platforms now include FUSE support (#1682)
|
||||
* Continuation Integration builds now default to the Ubuntu Focal platform (#1666)
|
||||
* FUSE type tidy-ups (#1686)
|
||||
* Switch from Travis CI to GitHub Actions (#1728 #1732)
|
||||
* Easier to set up console logging for utilities (#1711)
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.14 (2020/08/31)
|
||||
|
||||
## New features
|
||||
* VNC multi-monitor support if you are using a suitable Xvnc server #1343
|
||||
* VNC sessions now resize by default on reconnection if you are using a suitable Xvnc server #1343
|
||||
* Support Slackware for PAM #1558 #1560
|
||||
* Support Programmer Dvorak Keyboard #1663
|
||||
|
||||
**[HEADS UP]** The VNC changes are significant. They described in more detail on the following wiki page.
|
||||
* [Xvnc backend : Multi monitor and resize support](https://github.com/neutrinolabs/xrdp/wiki/Xvnc-backend-:-Multi-monitor-and-resize-support)
|
||||
|
||||
## Bug fixes
|
||||
* Fix odd shift key behavior (workaround) #397 #1522
|
||||
* Fix Xorg path in the document for Arch Linux #1448 #1529
|
||||
* Fix Xorg path in the document for CentOS 8 #1646 #1647
|
||||
* Fix internal username/password buffer is smaller than RDP protocol specification #1648 #1653
|
||||
* Fix possible memory out-of-bounds accesses #1549
|
||||
* Fix memory allocation overflow #1557
|
||||
* Prevent chansrv input channels being scanned during a server reset #1595
|
||||
* Ignore TS_MULTIFRAGMENTUPDATE_CAPABILITYSET from client if fp disabled #1593
|
||||
* Minor manpage fixes #1611
|
||||
|
||||
## Other changes
|
||||
* CI error fixes
|
||||
* Introduce cppcheck
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
# Release notes for xrdp v0.9.13.1 (2020/06/30)
|
||||
|
||||
This is a security fix release that includes fixes for the following local buffer overflow vulnerability.
|
||||
|
||||
* [CVE-2020-4044: Local users can perform a buffer overflow attack against the xrdp-sesman service and then impersonate it](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4044)
|
||||
|
||||
This update is recommended for all xrdp users.
|
||||
|
||||
## Special thanks
|
||||
|
||||
Thanks to [Ashley Newson](https://github.com/ashleynewson) reporting the vulnerability and reviewing fix.
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.13 (2020/03/11)
|
||||
|
||||
This release is an intermediate bugfix release. The previous version v0.9.12 has some regressions on drive redirection.
|
||||
|
||||
## Bug fixes (drive redirection related)
|
||||
* Fix chansrv crashes with segmentation fault (regression in #1449) #1487
|
||||
* Drive redirection now supports Guacamole client #1505 #1507
|
||||
* Prevent a coredump in the event of a corrupted file system #1507
|
||||
* Resolve double-free in `chansrv_fuse` #1469
|
||||
|
||||
## Bug fixes (other)
|
||||
* Fix the issue `xrdp --version | less` will show empty output #1471 #1472
|
||||
* Fix some warnings found by cppcheck #1479 #1481 #1484 #1485
|
||||
|
||||
## Other changes
|
||||
* Add FreeBSD CI test #1466
|
||||
* Move Microsoft-defined constants into separate includes #1470
|
||||
* Perform cppcheck during CI test #1493
|
||||
* Support mousex button 8/9 #1478
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.12 (2019/12/28)
|
||||
|
||||
## Bug fixes
|
||||
* Fix "The log reference is NULL" error when sesman startup #1425
|
||||
* Fix behavior when shmem_id changes #1439
|
||||
* Make vsock config accept -1 for cid and port #1441
|
||||
* Cleanup refresh rect and check stream bounds #1437
|
||||
* Significant improvements in drive redirection #1449
|
||||
* Fix build on macOS Catalina #1462
|
||||
|
||||
## Other changes
|
||||
* Proprietary microphone redirection via rdpsnd is now default off
|
||||
RDP compatible microphone redirection is on instead #1427
|
||||
* Skip connecting to chansrv when no channels enabled #1393
|
||||
* Add openSUSE's pam rules #1442
|
||||
* Do not terminate xrdp daemon when caught SIGHUP #1319
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
# Release notes for xrdp v0.9.11 (2019/08/19)
|
||||
|
||||
## New features
|
||||
* Suppress output (do not draw screen when client window is minimized) #1330
|
||||
* Audio input (microphone) redirection compatible with [MS-RDPEAI](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeai/d04ffa42-5a0f-4f80-abb1-cc26f71c9452) #1369
|
||||
* Now xrdp can listen on more than one port #1124 #1366
|
||||
|
||||
## Bug fixes
|
||||
* Fix the issue audio redirection sometimes sounds with long delay #1363
|
||||
* Check term event for more responsive shutdown #1372
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.11 (2019/08/19)
|
||||
|
||||
## New features
|
||||
* Suppress output (do not draw screen when client window is minimized) #1330
|
||||
* Audio input (microphone) redirection compatible with [MS-RDPEAI](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeai/d04ffa42-5a0f-4f80-abb1-cc26f71c9452) #1369
|
||||
* Now xrdp can listen on more than one port #1124 #1366
|
||||
|
||||
## Bug fixes
|
||||
* Fix the issue audio redirection sometimes sounds with long delay #1363
|
||||
* Check term event for more responsive shutdown #1372
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.10 (2019/04/18)
|
||||
|
||||
## Special thanks
|
||||
Thank you for matt335672 contributing to lots of improvements in drive redirection!
|
||||
|
||||
## New features
|
||||
* Restrict outbound (server->client) clipboard transfer, configured in `sesman.ini` #1298
|
||||
|
||||
## Bug fixes
|
||||
* Fix the issue libscp v1 not setting width but height twice #1293
|
||||
* Fix the issue reconnecting to session causes duplicate drive entries in fuse fs #1299
|
||||
* Fix default_wm and reconnect_sh refer wrong path after sesman caught SIGUP #1315 #1331
|
||||
* Shutdown xrdp more responsively #1325
|
||||
* Improve remote file lookup in drive redirection #996 #1327
|
||||
* Overwriting & appending to existing files is are now supported #1327
|
||||
|
||||
## Other changes
|
||||
* Add Danish Keyboard #1290
|
||||
* Put xrdp- prefix to some executables appear in man page #1313
|
||||
* Replace some URLs from SF.net to xrdp.org #1313
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.9 (2018/12/25)
|
||||
|
||||
## Release cycle
|
||||
From the next release, release cycle will be changed from quarterly to every
|
||||
4 months. xrdp will be released in April, August, December.
|
||||
|
||||
## New features
|
||||
* Disconnection by idle timeout (requires xorgxrdp v0.2.9 or later) #1227
|
||||
* Glyph cache v2 (fixes no font issue on iOS/macOS/Android client) #367 #1235
|
||||
|
||||
## Bug fixes
|
||||
* Fix xrdp-chansrv crashes caused in drive redirection #1202 #1225
|
||||
* Fix build with FDK AAC v2 #1257
|
||||
* Do not enable RemoteApp if the INFO_RAIL flag is not set (RDP-RDP proxy) #1253
|
||||
|
||||
## Other changes
|
||||
* Add Spanish Latin Amarican keyboard #1237 #1240 #1244
|
||||
* Dynamic channel improvements #1222 #1224
|
||||
* Remove some deprecated sesman session types #1232
|
||||
* Refactoring and cleanups
|
||||
|
||||
## Known issues
|
||||
* FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp due to
|
||||
xrdp's bad-mannered behaviour, add `+glyph-cache` option to FreeRDP to connect #1266
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.8 (2018/09/25)
|
||||
|
||||
## Deprecation notice
|
||||
We removed TLSv1 and TLSv1.1 from the default config. The current default is TLSv1.2
|
||||
and TLSv1.3. Users can whenever re-enable these early TLS versions by editing xrdp.
|
||||
To use TLSv1.3, OpenSSL or LibreSSL must support TLSv1.3. You can know the OpenSSL
|
||||
or LibreSSL version by `xrdp --version` command that compiled with xrdp.
|
||||
|
||||
## Other topics
|
||||
|
||||
Pulseaudio modules has been removed from xrdp source tree since it is actually
|
||||
independent and not part of xrdp. The repository has been moved to:
|
||||
https://github.com/neutrinolabs/pulseaudio-module-xrdp
|
||||
|
||||
If you want to use audio redirection, make sure install the module separately.
|
||||
|
||||
## New features
|
||||
* Add TLSv1.3 support #1193
|
||||
|
||||
## Bug fixes
|
||||
* Ensure unmount redirected drive on fatal X error #1140
|
||||
|
||||
## Other changes
|
||||
* Show more helpful message if xrdp-dis failed #1206
|
||||
* Pass pulse socket name via environment variable #1198
|
||||
* Fix xrdp's log path in man page #1168
|
||||
|
||||
# Release notes for xrdp v0.9.7 (2018/06/29)
|
||||
|
||||
## Deprecation notice
|
||||
x11rdp has been removed from xrdp reposiory and stored in the separate repository.
|
||||
Checkout [x11rdp repository](https://github.com/neutrionlabs/x11rdp) if you still need x11rdp.
|
||||
In most cases, [xorgxrdp](https://github.com/neutrinolabs/xorgxrdp) can replace x11rdp.
|
||||
|
||||
## Bug fixes
|
||||
* Fix endianness detection on ppc64el #1082
|
||||
* Fix a bug xrdp file copy slow #1112 #1132
|
||||
* Copy the PAM session environment for the reconnect script #1120
|
||||
* Accept fullpath for DefaultWindowManager, ReconnectScript #1147
|
||||
|
||||
## Other changes
|
||||
* Add PAM support for Arch Linux #1078
|
||||
* Show OpenSSL version to '--version' CLI option #1096
|
||||
* Separate x11rdp from xrdp repository #1104
|
||||
* Support sesrun start xorgxrdp sessions #1108
|
||||
* Show configure summary when configure is done #1126 #1134 #1137
|
||||
* Less spit on the console when sesman starts #1142
|
||||
* Fix memory leaks #1146
|
||||
* Separate rc script for FreeBSD into xrdp and xrdp-sesman #1153
|
||||
* Improve documents and helps
|
||||
|
||||
## Known issues
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.6 (2018/03/26)
|
||||
|
||||
## Compatibility notice
|
||||
Exclamation mark (`!`) has been removed from comment out symbol of config files.
|
||||
Use number sign (`#`) or semicolon (`;`) instead. As a result of this change, now
|
||||
you can use exclamation mark as config value such as in `tls_ciphers`.
|
||||
|
||||
```
|
||||
tls_ciphers=HIGH:!aNULL:!eNULL:!EXPORT:!RC4
|
||||
```
|
||||
|
||||
See also: #1033
|
||||
|
||||
## macOS supports
|
||||
Please note that xrdp still doesn't support macOS officially so far.
|
||||
However, a volunteer is working on macOS compatibility.
|
||||
|
||||
* Generate dylibs for macOS #1015
|
||||
* Add PAM support for macOS #1021
|
||||
|
||||
## Bug fixes
|
||||
* Make listen check before daemon fork #988
|
||||
* Fix xrdp sometimes become zombie processes #1000
|
||||
* Include hostname in sesman password file name #1006 #1007 #1076
|
||||
* Fix default startwm.sh to use bash explicitly #1009 #1049
|
||||
* Fix the issue FreeBSD doesn't acknowledge terminated sessions #1016 #1030
|
||||
|
||||
## Other changes
|
||||
* Add Swiss French keyboard #1053
|
||||
* Improve perfect forward secrecy, explicitly enable ECDHE/DHE #1024 #1052 #1063
|
||||
* Lots of leak fixes, cleanups and refactoring
|
||||
|
||||
## Known issues
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.5 (2017/12/27)
|
||||
|
||||
## Security fixes
|
||||
* Fix local denial of service [CVE-2017-16927](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16927) #958 #979
|
||||
|
||||
## New features
|
||||
* Add a new log level TRACE more verbose than DEBUG #835 #944
|
||||
* SSH agent forwarding via RDP #867 #868 FreeRDP/FreeRDP#4122
|
||||
* Support horizontal wheel properly #928
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* Avoid use of hard-coded sesman port #895
|
||||
* Workaround for corrupted display with Windows Server 2008 using NeutrinoRDP #869
|
||||
* Fix glitch in audio redirection by AAC #910 #936
|
||||
* Implement vsock support #930 #935 #948
|
||||
* Avoid 100% CPU usage on SSL accept #956
|
||||
|
||||
## Other changes
|
||||
* Add US Dvorak keyboard #929
|
||||
* Suppress some misleading logs #964
|
||||
* Add Finnish keyboard #972
|
||||
* Add more user-friendlier description about Xorg config #974
|
||||
* Renew pulseaudio document #984 #985
|
||||
* Lots of cleanups and refactoring
|
||||
|
||||
## Known issues
|
||||
* Audio redirection by MP3 codec doesn't sound with some client, use AAC instead #965
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.4 (2017/09/28)
|
||||
|
||||
## New features
|
||||
* Accept prefill credentials in base64 form #153 #811
|
||||
* Indroduce AAC encoder to audio redirection (requires Windows 10 client)
|
||||
|
||||
## Bugfixes
|
||||
* Fix ocasional SEGV in drive redirection #838
|
||||
* Fix client's IP addresses in xrdp-sesman.log are always logged as `0.0.0.0` #878 #882
|
||||
* Fix `ls_background_image` didn't accept full path #776 #853
|
||||
* Fix misuse of hidelogwindow #414 #876
|
||||
* Fix WTSVirtualChannelWrite return code #859
|
||||
* Fix no longer needed socket files remained in the socket dir #812 #831
|
||||
* Make creating socket path a bit more robust #823
|
||||
|
||||
## Other changes
|
||||
* Add Belgian keyboard #858
|
||||
* Add a PAM file for FreeBSD #824
|
||||
* Several refactorings and cosmetic changes
|
||||
|
||||
## Known issues
|
||||
* Windows 10 (1703) shows black blank screen in RemoteFX mode
|
||||
* This issue is already fixed at Insider Preview build 16273
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.3.1 (2017/08/16)
|
||||
|
||||
This release fixes a trivial packaging issue #848 occurred in v0.9.3. The issue only affects systemd systems. This release is principally for distro packagers or users who compile & install xrdp from source.
|
||||
|
||||
Users who running xrdp on these systems don't need to upgrade from v0.9.3 to v0.9.3.1.
|
||||
|
||||
* Linux systems without systemd
|
||||
* non-Linux systems such as BSD operating systems
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.3 (2017/07/15)
|
||||
|
||||
## New features
|
||||
* Log user-friendly messages when certificate/privkey is inaccessible
|
||||
|
||||
## Bugfixes
|
||||
* Now sesman sets mandatory LOGNAME environment variable #725
|
||||
* Now sesman ensures socket directory present #801
|
||||
* Exit with failure status if port already in use #644
|
||||
* Eliminate some hard coded paths
|
||||
* Fix glitches with IPv4 struct initialization #803
|
||||
* Fix some keyboard layout integration (UK, Spanish)
|
||||
* Fix handle OS when IPv6 disabled #714
|
||||
* Fix issues around systemd session #778
|
||||
* Fix protocol error when 32 bit color and non RemoteFX session #737 #804
|
||||
* Fix sesadmin shows error when no sessions #797
|
||||
* Fix TLS spins 100% CPU #728
|
||||
* Fix Xvnc backend disconnects when some data copied to clipboard #755
|
||||
* Pick up the first section if given section(domain) doesn't match anything #750
|
||||
|
||||
## Other changes
|
||||
* Change xrdp-chansrv log path to include display number
|
||||
* Optimize startwm.sh for SUSE
|
||||
* Several cleanups and optimizations
|
||||
|
||||
## Known issues
|
||||
* Windows 10 (1703) shows black blank screen in RemoteFX mode
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.2 (2017/03/30)
|
||||
## New features
|
||||
* RemoteFX codec support is now enabled by default.
|
||||
* Bitmap updates support is now enabled by default.
|
||||
* TLS ciphers suites and version is now logged.
|
||||
* Connected computer name is now logged.
|
||||
* Switched to Xorg (xorgxrdp) as the default backend now.
|
||||
* Miscellaneous RemoteFX codec mode improvements.
|
||||
* Socket directory is configurable at the compile time.
|
||||
|
||||
## Bugfixes
|
||||
* Parallels client for MacOS / iOS can now connect (audio redirection must be disabled on client or xrdp server though).
|
||||
* MS RDP client for iOS can now connect using TLS security layer.
|
||||
* MS RDP client for Android can now connect to xrdp.
|
||||
* Large resolutions (4K) can be used with RemoteFX graphics.
|
||||
* Multiple RemoteApps can be opened throguh NeutrinoRDP proxy.
|
||||
* tls_ciphers in xrdp.ini is not limited to 63 chars anymore, it's variable-length.
|
||||
* Fixed an issue where tls_ciphers were ignored and rdp security layer could be used instead.
|
||||
* Kill disconnected sessions feature is working with Xorg (xorgxrdp) backend.
|
||||
* Miscellaneous code cleanup and memory issues fixes.
|
||||
|
||||
-----------------------
|
||||
|
||||
# Release notes for xrdp v0.9.1 (2016/12/21)
|
||||
## New features
|
||||
* New xorgxrdp backend using existing Xorg with additional modules
|
||||
* Improvements to X11rdp backend
|
||||
* Support for IPv6 (disabled by default)
|
||||
* Initial support for RemoteFX Codec (disabled by default)
|
||||
* Support for TLS security layer (preferred over RDP layer if supported by the client)
|
||||
* Support for disabling deprecated SSLv3 protocol and for selecting custom cipher suites in xrdp.ini
|
||||
* Support for bidirectional fastpath (enabled in both directions by default)
|
||||
* Support clients that don't support drawing orders, such as MS RDP client for Android, ChromeRDP (disabled by default)
|
||||
* More configurable login screen
|
||||
* Support for new virtual channels:
|
||||
* rdpdr: device redirection
|
||||
* rdpsnd: audio output
|
||||
* cliprdr: clipboard
|
||||
* xrdpvr: xrdp video redirection channel (can be used along with NeutrinoRDP client)
|
||||
* Support for disabling virtual channels globally or by session type
|
||||
* Allow to specify the path for backends (Xorg, X11rdp, Xvnc)
|
||||
* Added files for systemd support
|
||||
* Multi-monitor support
|
||||
* xrdp-chansrv stroes logs in `${XDG_DATA_HOME}/xrdp` now
|
||||
|
||||
## Security fixes
|
||||
* User's password could be recovered from the Xvnc password file
|
||||
* X11 authentication was not used
|
||||
154
README.md
154
README.md
@ -1,154 +0,0 @@
|
||||
[](https://github.com/neutrinolabs/xrdp/actions)
|
||||
[](https://gitter.im/neutrinolabs/xrdp-questions)
|
||||

|
||||
|
||||
[](https://github.com/neutrinolabs/xrdp/releases)
|
||||
|
||||
# xrdp - an open source RDP server
|
||||
|
||||
## Overview
|
||||
|
||||
**xrdp** provides a graphical login to remote machines using Microsoft
|
||||
Remote Desktop Protocol (RDP). xrdp accepts connections from a variety of RDP clients:
|
||||
* FreeRDP
|
||||
* rdesktop
|
||||
* KRDC
|
||||
* NeutrinoRDP
|
||||
* Windows MSTSC (Microsoft Terminal Services Client, aka `mstsc.exe`)
|
||||
* Microsoft Remote Desktop (found on Microsoft Store, which is distinct from MSTSC)
|
||||
|
||||
Many of these work on some or all of Windows, Mac OS, iOS, and/or Android.
|
||||
|
||||
RDP transport is encrypted using TLS by default.
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
### Remote Desktop Access
|
||||
|
||||
* Connect to a Linux desktop using RDP from anywhere (requires
|
||||
[xorgxrdp](https://github.com/neutrinolabs/xorgxrdp) Xorg module)
|
||||
* Reconnect to an existing session
|
||||
* Session resizing (both on-connect and on-the-fly)
|
||||
* RDP/VNC proxy (connect to another RDP/VNC server via xrdp)
|
||||
|
||||
### Access to Remote Resources
|
||||
* Two-way clipboard transfer (text, bitmap, file)
|
||||
* Audio redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection))
|
||||
* Microphone redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection))
|
||||
* Drive redirection (mount local client drives on remote machine)
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
**xrdp** primarily targets GNU/Linux operating system. x86 (including x86-64)
|
||||
and ARM processors are most mature architecture to run xrdp on.
|
||||
See also [Platform Support Tier](https://github.com/neutrinolabs/xrdp/wiki/Platform-Support-Tier).
|
||||
|
||||
Some components such as xorgxrdp and RemoteFX codec have special optimization
|
||||
for x86 using SIMD instructions. So running xrdp on x86 processors will get
|
||||
fully accelerated experience.
|
||||
|
||||
## Quick Start
|
||||
|
||||
Most Linux distributions should distribute the latest release of xrdp in their
|
||||
repository. You would need xrdp and xorgxrdp packages for the best
|
||||
experience. It is recommended that xrdp depends on xorgxrdp, so it should
|
||||
be sufficient to install xrdp. If xorgxrdp is not provided, use Xvnc
|
||||
server.
|
||||
|
||||
xrdp listens on 3389/tcp. Make sure your firewall accepts connection to
|
||||
3389/tcp from where you want to access.
|
||||
|
||||
### Ubuntu / Debian
|
||||
```bash
|
||||
apt install xrdp
|
||||
```
|
||||
|
||||
### RedHat / CentOS / Fedora
|
||||
|
||||
On RedHat and CentOS, make sure to enable EPEL packages first.
|
||||
|
||||
```bash
|
||||
yum install epel-release
|
||||
```
|
||||
|
||||
Install xrdp package.
|
||||
|
||||
```bash
|
||||
yum install xrdp
|
||||
```
|
||||
|
||||
`yum` is being replaced with `dnf`, so you may need to use `dnf` instead
|
||||
of `yum` in the above commands.
|
||||
|
||||
## Compiling
|
||||
|
||||
See also https://github.com/neutrinolabs/xrdp/wiki#building-from-sources
|
||||
|
||||
### Prerequisites
|
||||
|
||||
To compile xrdp from the packaged sources, you need basic build tools - a
|
||||
compiler (**gcc** or **clang**) and the **make** program. Additionally,
|
||||
you would need **openssl-devel**, **pam-devel**, **libX11-devel**,
|
||||
**libXfixes-devel**, **libXrandr-devel**. More additional software would
|
||||
be needed depending on your configuration.
|
||||
|
||||
To compile xrdp from a checked out git repository, you would additionally
|
||||
need **autoconf**, **automake**, **libtool** and **pkg-config**.
|
||||
|
||||
### Get the source and build it
|
||||
|
||||
If compiling from the packaged source, unpack the tarball and change to the
|
||||
resulting directory.
|
||||
|
||||
If compiling from a checked out repository, please make sure you've got the submodules
|
||||
cloned too (use `git clone --recursive https://github.com/neutrinolabs/xrdp`)
|
||||
|
||||
Then run following commands to compile and install xrdp:
|
||||
```bash
|
||||
./bootstrap
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
If you want to use audio redirection, you need to build and install additional
|
||||
pulseaudio modules. The build instructions can be found at wiki.
|
||||
|
||||
* [How to set up audio redirection](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection)
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
xrdp
|
||||
├── common ······ common code
|
||||
├── docs ········ documentation
|
||||
├── fontutils ··· font handling utilities
|
||||
├── genkeymap ··· keymap generator
|
||||
├── instfiles ··· installable data file
|
||||
├── keygen ······ xrdp RSA key pair generator
|
||||
├── libpainter ·· painter library
|
||||
├── librfxcodec · RFX codec library
|
||||
├── libxrdp ····· core RDP protocol implementation
|
||||
├── m4 ·········· Autoconf macros
|
||||
├── mc ·········· media center module
|
||||
├── neutrinordp · RDP client module for proxying RDP connections using NeutrinoRDP
|
||||
├── pkgconfig ··· pkg-config configuration
|
||||
├── scripts ····· build scripts
|
||||
├┬─ sesman ······ session manager for xrdp
|
||||
|├── chansrv ···· channel server for xrdp
|
||||
|├── libsesman ·· Code common to sesman and its related executables
|
||||
|└── tools ······ session management tools for sys admins
|
||||
├── tests ······· tests for the code
|
||||
├┬─ tools ······· tools
|
||||
|└┬─ devel ······ development tools
|
||||
| ├── gtcp_proxy GTK app that forwards TCP connections to a remote host
|
||||
| └── tcp_proxy · CLI app that forwards TCP connections to a remote host
|
||||
├── vnc ········· VNC client module for xrdp
|
||||
├── vrplayer ···· QT player redirecting video/audio to clients over xrdpvr channel
|
||||
├── xrdp ········ main server code
|
||||
├── xrdpapi ····· virtual channel API
|
||||
├── xrdpvr ······ API for playing media over RDP
|
||||
└── xup ········· xorgxrdp client module
|
||||
```
|
||||
12
SECURITY.md
12
SECURITY.md
@ -1,12 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please DO NOT report any security issues to public GitHub issue.
|
||||
|
||||
If you find a security vulnerability please kindly inform us via [Report Form](https://github.com/neutrinolabs/xrdp/security/advisories/new) so that we can fix the security problem to protect a lot of users around the world as soon as possible.
|
||||
|
||||
If you have anything else you want to report privately to developers, send us an email to the following email address. This is a private mailing list not open for public viewing.
|
||||
|
||||
* [xrdp-core@googlegroups.com](mailto:xrdp-core@googlegroups.com)
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
|
||||
# detached brackets
|
||||
--style=allman
|
||||
|
||||
# 4 spaces, no tabs
|
||||
--indent=spaces=4
|
||||
|
||||
# for C++ files only
|
||||
--indent-classes
|
||||
|
||||
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
||||
# The entire case block is indented.
|
||||
--indent-switches
|
||||
|
||||
# Add extra indentation to namespace blocks. This option has no effect on Java files.
|
||||
--indent-namespaces
|
||||
|
||||
# Converts tabs into spaces in the non-indentation part of the line.
|
||||
--convert-tabs
|
||||
|
||||
# requires --convert-tabs to work properly
|
||||
--indent-preproc-define
|
||||
|
||||
--indent-col1-comments
|
||||
|
||||
--min-conditional-indent=2
|
||||
|
||||
--max-continuation-indent=40
|
||||
|
||||
# Insert space padding around operators.
|
||||
--pad-oper
|
||||
|
||||
# Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...).
|
||||
--pad-header
|
||||
|
||||
|
||||
# Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for', 'while'...).
|
||||
--add-braces
|
||||
|
||||
--align-pointer=name
|
||||
|
||||
# Do not retain a backup of the original file. The original file is purged after it is formatted.
|
||||
--suffix=none
|
||||
|
||||
# For each directory in the command line, process all subdirectories recursively.
|
||||
--recursive
|
||||
|
||||
# Exclude git submodule directories and generated files.
|
||||
--exclude=libpainter
|
||||
--exclude=librfxcodec
|
||||
--exclude=xrdp_configure_options.h
|
||||
|
||||
# ignore errors from generated files that do not exist
|
||||
--ignore-exclude-errors
|
||||
|
||||
# Preserve the original file's date and time modified.
|
||||
--preserve-date
|
||||
|
||||
# Formatted files display mode. Display only the files that have been formatted.
|
||||
# Do not display files that are unchanged.
|
||||
--formatted
|
||||
|
||||
--lineend=linux
|
||||
46
bootstrap
46
bootstrap
@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
command -v autoconf
|
||||
if ! test $? -eq 0
|
||||
then
|
||||
echo "error, install autoconf"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command -v automake
|
||||
if ! test $? -eq 0
|
||||
then
|
||||
echo "error, install automake"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command -v libtool || command -v libtoolize
|
||||
if ! test $? -eq 0
|
||||
then
|
||||
echo "error, install libtool"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command -v pkg-config
|
||||
if ! test $? -eq 0
|
||||
then
|
||||
echo "error, install pkg-config"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! test -f libpainter/configure.ac
|
||||
then
|
||||
git submodule update --init libpainter
|
||||
fi
|
||||
|
||||
if ! test -f librfxcodec/configure.ac
|
||||
then
|
||||
git submodule update --init librfxcodec
|
||||
fi
|
||||
|
||||
if ! test -f ulalaca/Makefile.am
|
||||
then
|
||||
git submodule update --init ulalaca
|
||||
fi
|
||||
|
||||
autoreconf -fvi
|
||||
210
coding_style.md
210
coding_style.md
@ -1,210 +0,0 @@
|
||||
XRdp Coding Style
|
||||
=================
|
||||
|
||||
The coding style used by XRdp is described below.
|
||||
|
||||
The XRdp project uses astyle (artistic style) to format the code. Astyle
|
||||
requires a configuration file that describes how you want your code
|
||||
formatted. This file is present in the XRdp root directory and is named
|
||||
`astyle_config.as`.
|
||||
|
||||
Here is how we run the astyle command:
|
||||
|
||||
astyle --options=/path/to/file/astyle_config.as "*.c"
|
||||
|
||||
This coding style is a work in progress and is still evolving.
|
||||
|
||||
|
||||
Language Standard
|
||||
-----------------
|
||||
|
||||
Try to make all code compile with both C and C++ compiler. C++ is more
|
||||
strict, which makes the code safer.
|
||||
|
||||
|
||||
Indentation
|
||||
-----------
|
||||
|
||||
* 4 spaces per indent
|
||||
* No tabs for any indents
|
||||
|
||||
☞
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Line wrapping
|
||||
-------------
|
||||
|
||||
* Keep lines not longer than 80 chars
|
||||
* Align wrapped argument to the first argument
|
||||
|
||||
☞
|
||||
|
||||
log_message("connection aborted: error %d",
|
||||
ret);
|
||||
|
||||
|
||||
Variable names
|
||||
--------------
|
||||
|
||||
* Use lowercase with underscores as needed
|
||||
* Don't use camelCase
|
||||
* Preprocessor constants should be uppercase
|
||||
|
||||
☞
|
||||
|
||||
#define BUF_SIZE 1024
|
||||
int fd;
|
||||
int bytes_in_stream;
|
||||
|
||||
|
||||
Variable declaration
|
||||
--------------------
|
||||
|
||||
* Each variable is declared on a separate line
|
||||
|
||||
☞
|
||||
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
Whitespace
|
||||
----------
|
||||
|
||||
* Use blank lines to group statements
|
||||
* Use at most one empty line between statements
|
||||
* For pointers and references, use a single space before * or & but not after
|
||||
* Use one space after a cast
|
||||
* No space before square brackets
|
||||
|
||||
☞
|
||||
|
||||
char *cptr;
|
||||
int *iptr;
|
||||
cptr = (char *) malloc(1024);
|
||||
|
||||
write(fd, &buf[12], 16);
|
||||
|
||||
|
||||
Function declarations
|
||||
---------------------
|
||||
|
||||
* Use newline before function name
|
||||
|
||||
☞
|
||||
|
||||
static int
|
||||
value_ok(int val)
|
||||
{
|
||||
return (val >= 0);
|
||||
}
|
||||
|
||||
|
||||
Braces
|
||||
------
|
||||
|
||||
* Opening brace is always on a separate line
|
||||
* Align braces with the line preceding the opening brace
|
||||
|
||||
☞
|
||||
|
||||
struct stream
|
||||
{
|
||||
int flags;
|
||||
char *data;
|
||||
};
|
||||
|
||||
void
|
||||
process_data(struct stream *s)
|
||||
{
|
||||
if (stream == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`if` statements
|
||||
---------------
|
||||
|
||||
* Always use braces
|
||||
* Put both braces on separate lines
|
||||
|
||||
☞
|
||||
|
||||
if (val <= 0xff)
|
||||
{
|
||||
out_uint8(s, val);
|
||||
}
|
||||
else if (val <= 0xffff)
|
||||
{
|
||||
out_uint16_le(s, val);
|
||||
}
|
||||
else
|
||||
{
|
||||
out_uint32_le(s, val);
|
||||
}
|
||||
|
||||
|
||||
`for` statements
|
||||
----------------
|
||||
|
||||
* Always use braces
|
||||
* Put both braces on separate lines
|
||||
|
||||
☞
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
printf("i = %d\n", i);
|
||||
}
|
||||
|
||||
|
||||
`while` and `do while` statements
|
||||
---------------------------------
|
||||
|
||||
* Always use braces
|
||||
* `while` after the closing brace is on the same line
|
||||
|
||||
☞
|
||||
|
||||
while (cptr)
|
||||
{
|
||||
cptr—;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
cptr--;
|
||||
} while (cptr);
|
||||
|
||||
|
||||
`switch` statements
|
||||
-------------------
|
||||
|
||||
* Indent `case` once
|
||||
* Indent statements under `case` one more time
|
||||
* Put both braces on separate lines
|
||||
|
||||
☞
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case READ:
|
||||
read(fd, buf, 1024);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("bad cmd\n");
|
||||
}
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
Use /* */ for comments
|
||||
Don't use //
|
||||
@ -1,76 +0,0 @@
|
||||
if XRDP_PIXMAN
|
||||
PIXMAN_SOURCES =
|
||||
else
|
||||
PIXMAN_SOURCES = pixman-region16.c pixman-region.h
|
||||
endif
|
||||
|
||||
EXTRA_DIST = pixman-region.c
|
||||
|
||||
include_HEADERS = \
|
||||
ms-erref.h \
|
||||
ms-fscc.h \
|
||||
ms-rdpbcgr.h \
|
||||
ms-rdpeclip.h \
|
||||
ms-rdpefs.h \
|
||||
ms-rdpegdi.h \
|
||||
ms-rdpele.h \
|
||||
ms-rdperp.h \
|
||||
ms-rdpedisp.h \
|
||||
ms-smb2.h \
|
||||
xrdp_client_info.h \
|
||||
xrdp_constants.h \
|
||||
xrdp_rail.h \
|
||||
xrdp_sockets.h
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
|
||||
-DXRDP_SBIN_PATH=\"${sbindir}\" \
|
||||
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
|
||||
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
|
||||
-DXRDP_LOG_PATH=\"${localstatedir}/log\"
|
||||
|
||||
# -no-suppress is an automake-specific flag which is needed
|
||||
# to prevent us missing compiler errors in some circumstances
|
||||
# (see https://github.com/neutrinolabs/xrdp/pull/1843 )
|
||||
AM_CFLAGS = -no-suppress $(OPENSSL_CFLAGS)
|
||||
|
||||
module_LTLIBRARIES = \
|
||||
libcommon.la
|
||||
|
||||
libcommon_la_SOURCES = \
|
||||
arch.h \
|
||||
base64.h \
|
||||
base64.c \
|
||||
defines.h \
|
||||
fifo.c \
|
||||
fifo.h \
|
||||
file.c \
|
||||
file.h \
|
||||
guid.c \
|
||||
guid.h \
|
||||
list.c \
|
||||
list.h \
|
||||
list16.c \
|
||||
list16.h \
|
||||
log.c \
|
||||
log.h \
|
||||
os_calls.c \
|
||||
os_calls.h \
|
||||
parse.c \
|
||||
parse.h \
|
||||
rail.h \
|
||||
ssl_calls.c \
|
||||
ssl_calls.h \
|
||||
string_calls.c \
|
||||
string_calls.h \
|
||||
thread_calls.c \
|
||||
thread_calls.h \
|
||||
trans.c \
|
||||
trans.h \
|
||||
unicode_defines.h \
|
||||
$(PIXMAN_SOURCES)
|
||||
|
||||
libcommon_la_LIBADD = \
|
||||
-lpthread \
|
||||
$(OPENSSL_LIBS) \
|
||||
$(DLOPEN_LIBS)
|
||||
174
common/arch.h
174
common/arch.h
@ -1,174 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(ARCH_H)
|
||||
#define ARCH_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#if defined(_WIN64)
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef signed long intptr_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
// Define Unicode character types
|
||||
#if defined(HAVE_UCHAR_H)
|
||||
#include <uchar.h>
|
||||
#elif defined(HAVE_STDINT_H)
|
||||
typedef uint_least16_t char16_t;
|
||||
typedef uint_least32_t char32_t;
|
||||
#else
|
||||
typedef uint16_t char16_t;
|
||||
typedef uint32_t char32_t;
|
||||
#endif
|
||||
|
||||
/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
|
||||
in the makefile to override */
|
||||
|
||||
/* check endianness */
|
||||
#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
|
||||
#if !defined(__BYTE_ORDER) && defined(__linux__)
|
||||
#include <endian.h>
|
||||
#endif
|
||||
|
||||
#if defined(BYTE_ORDER)
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define B_ENDIAN
|
||||
#else
|
||||
#define L_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
|
||||
#if defined(__sparc__) || \
|
||||
defined(__s390__) || defined (__s390x__) || \
|
||||
defined(__hppa__) || defined (__m68k__) || \
|
||||
(defined(__PPC__) && defined(__BIG_ENDIAN__)) || \
|
||||
(defined(__ppc__) && defined(__BIG_ENDIAN__))
|
||||
#define B_ENDIAN
|
||||
#else
|
||||
#define L_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* check if we need to align data */
|
||||
#if !(defined(NEED_ALIGN) || defined(NO_NEED_ALIGN))
|
||||
#if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \
|
||||
defined(__AIX__) || defined(__m68k__) || defined(__mips__) || \
|
||||
defined(__ia64__) || defined(__arm__) || defined(__sh__) || \
|
||||
(defined(__PPC__) && defined(__BIG_ENDIAN__)) || \
|
||||
(defined(__ppc__) && defined(__BIG_ENDIAN__)) || \
|
||||
defined(__loongarch__) || defined(__e2k__)
|
||||
#define NEED_ALIGN
|
||||
#elif defined(__x86__) || defined(__x86_64__) || \
|
||||
defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \
|
||||
defined(__i386__) || defined(__aarch64__) || \
|
||||
defined(__PPC__) || defined(__LITTLE_ENDIAN__) || \
|
||||
defined(__s390__) || defined (__s390x__) || \
|
||||
defined(__riscv)
|
||||
#define NO_NEED_ALIGN
|
||||
#else
|
||||
#warning unknown arch
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* defines for thread creation factory functions */
|
||||
#if defined(_WIN32)
|
||||
#define THREAD_RV unsigned long
|
||||
#define THREAD_CC __stdcall
|
||||
#else
|
||||
#define THREAD_RV void*
|
||||
#define THREAD_CC
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(__BORLANDC__)
|
||||
#define EXPORT_CC _export __cdecl
|
||||
#else
|
||||
#define EXPORT_CC
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_CC
|
||||
#endif
|
||||
|
||||
#ifndef DEFINED_Ts
|
||||
#define DEFINED_Ts
|
||||
typedef int8_t ti8;
|
||||
typedef uint8_t tui8;
|
||||
typedef int8_t tsi8;
|
||||
typedef int16_t ti16;
|
||||
typedef uint16_t tui16;
|
||||
typedef int16_t tsi16;
|
||||
typedef int32_t ti32;
|
||||
typedef uint32_t tui32;
|
||||
typedef int32_t tsi32;
|
||||
typedef int64_t ti64;
|
||||
typedef uint64_t tui64;
|
||||
typedef int64_t tsi64;
|
||||
typedef bool_t tbool;
|
||||
typedef intptr_t tbus;
|
||||
typedef intptr_t tintptr;
|
||||
|
||||
/* socket */
|
||||
#if defined(_WIN32)
|
||||
typedef unsigned int tsock;
|
||||
#else
|
||||
typedef int tsock;
|
||||
#endif
|
||||
#endif /* DEFINED_Ts */
|
||||
|
||||
/* format string verification */
|
||||
#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT)
|
||||
#define printflike(arg_format, arg_first_check) \
|
||||
__attribute__((__format__(__printf__, arg_format, arg_first_check)))
|
||||
#else
|
||||
#define printflike(arg_format, arg_first_check)
|
||||
#endif
|
||||
|
||||
/* module interface */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
tintptr mod_init(void);
|
||||
int mod_exit(tintptr);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
254
common/base64.c
254
common/base64.c
@ -1,254 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2022 Matt Burt, all xrdp contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/base64.c
|
||||
* @brief Base64 encoder / decoder
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include "string_calls.h"
|
||||
|
||||
#include "base64.h"
|
||||
|
||||
/*
|
||||
* Values for invalid and padding characters, used in the charmap
|
||||
* for converting base64 to binary
|
||||
*
|
||||
* These values are specially chosen to make it easy to detect padding or
|
||||
* invalid characters by or-ing together the values looked up in
|
||||
* a base64 quantum */
|
||||
#define E_INVALID 0x40
|
||||
#define E_PAD 0x80
|
||||
|
||||
/* Determine the character set on this platform */
|
||||
#if ('a' == 0x61 && 'z' == 0x7a ) && \
|
||||
('A' == 0x41 && 'Z' == 0x5a ) && \
|
||||
('0' == 0x30 && '9' == 0x39 )
|
||||
# define PLATFORM_IS_ASCII 1
|
||||
#else
|
||||
# error "Unrecognised character set on this platform"
|
||||
#endif /* character set check */
|
||||
|
||||
|
||||
/*
|
||||
* Define a table to map the base64 character values to bit values.
|
||||
*/
|
||||
#ifdef PLATFORM_IS_ASCII
|
||||
#define CHARMAP_BASE 0x28
|
||||
#define E_IV E_INVALID /* For table alignment */
|
||||
const unsigned char charmap[] =
|
||||
{
|
||||
/* 0x28 */ E_IV, E_IV, E_IV, 0x3e, E_IV, E_IV, E_IV, 0x3f,
|
||||
/* 0x30 */ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
|
||||
/* 0x38 */ 0x3c, 0x3d, E_IV, E_IV, E_IV, E_PAD, E_IV, E_IV,
|
||||
/* 0x40 */ E_IV, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
||||
/* 0x48 */ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
|
||||
/* 0x50 */ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
|
||||
/* 0x58 */ 0x17, 0x18, 0x19, E_IV, E_IV, E_IV, E_IV, E_IV,
|
||||
/* 0x60 */ E_IV, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
|
||||
/* 0x68 */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
|
||||
/* 0x70 */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
|
||||
/* 0x78 */ 0x31, 0x32, 0x33
|
||||
};
|
||||
#undef E_IV
|
||||
#endif /* PLATFORM_IS_ASCII */
|
||||
|
||||
|
||||
/**
|
||||
* Lookup a value in the charmap
|
||||
*
|
||||
* @param x - byte to lookup. Only referenced once so can safely have
|
||||
* side effects.
|
||||
* @param dest - destination to assign result to.
|
||||
*/
|
||||
#define CM_LOOKUP(x,dest) \
|
||||
{ \
|
||||
unsigned int t = (unsigned int)(x) - CHARMAP_BASE;\
|
||||
dest = (t < sizeof(charmap)) ? charmap[t] : E_INVALID; \
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
int
|
||||
base64_decode(const char *src, char *dst, size_t dst_len, size_t *actual_len)
|
||||
{
|
||||
*actual_len = 0;
|
||||
size_t src_len;
|
||||
size_t src_i = 0;
|
||||
size_t dst_i = 0;
|
||||
unsigned int a; /* Four characters of base64 quantum */
|
||||
unsigned int b;
|
||||
unsigned int c;
|
||||
unsigned int d;
|
||||
unsigned int v;
|
||||
|
||||
#define OUTPUT_CHAR(x) \
|
||||
{ \
|
||||
if (dst_i < dst_len) \
|
||||
{ \
|
||||
dst[dst_i] = (x);\
|
||||
} \
|
||||
++dst_i; \
|
||||
}
|
||||
|
||||
src_len = g_strlen(src);
|
||||
|
||||
while (src_i < src_len)
|
||||
{
|
||||
if ((src_len - src_i) >= 4)
|
||||
{
|
||||
/* Usual case - full quantum */
|
||||
CM_LOOKUP(src[src_i++], a);
|
||||
CM_LOOKUP(src[src_i++], b);
|
||||
CM_LOOKUP(src[src_i++], c);
|
||||
CM_LOOKUP(src[src_i++], d);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Add padding on the end to make up the full quantum */
|
||||
CM_LOOKUP(src[src_i++], a);
|
||||
b = E_PAD;
|
||||
c = E_PAD;
|
||||
d = E_PAD;
|
||||
if ((src_len - src_i) > 0)
|
||||
{
|
||||
CM_LOOKUP(src[src_i++], b);
|
||||
}
|
||||
if ((src_len - src_i) > 0)
|
||||
{
|
||||
CM_LOOKUP(src[src_i++], c);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise-or the translated quantum values together, so that
|
||||
* any invalid or padding characters can be detected with a
|
||||
* single test */
|
||||
v = a | b | c | d;
|
||||
|
||||
if ((v & E_INVALID) != 0)
|
||||
{
|
||||
return -1; /* At least one invalid character */
|
||||
}
|
||||
|
||||
if ((v & E_PAD) == 0)
|
||||
{
|
||||
/* No padding - a full quantum */
|
||||
v = (a << 18) | (b << 12) | (c << 6) | d;
|
||||
OUTPUT_CHAR(v >> 16);
|
||||
OUTPUT_CHAR((v >> 8) & 0xff);
|
||||
OUTPUT_CHAR(v & 0xff);
|
||||
}
|
||||
else if (((a | b | c) & E_PAD) == 0)
|
||||
{
|
||||
/* No padding in the first 3 chars, so the padding must
|
||||
* be at the end */
|
||||
v = (a << 10) | (b << 4) | (c >> 2);
|
||||
OUTPUT_CHAR(v >> 8);
|
||||
OUTPUT_CHAR(v & 0xff);
|
||||
}
|
||||
else if (((a | b) & E_PAD) == 0 && c == d)
|
||||
{
|
||||
/* No padding in first two chars, so if the last two chars are
|
||||
* equal, they must both be padding */
|
||||
v = (a << 2) | (b >> 4);
|
||||
OUTPUT_CHAR(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Illegal padding */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*actual_len = dst_i;
|
||||
return 0;
|
||||
|
||||
#undef OUTPUT_CHAR
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
size_t
|
||||
base64_encode(const char *src, size_t src_len, char *dst, size_t dst_len)
|
||||
{
|
||||
char *p = dst;
|
||||
size_t src_i = 0;
|
||||
size_t max_src_len;
|
||||
unsigned int v;
|
||||
static const char *b64chr =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/=";
|
||||
|
||||
/* Each three octets of the source results in four bytes at the output,
|
||||
* plus we need a terminator. So we can work out the maximum number of
|
||||
* source octets we can process */
|
||||
if (dst_len == 0)
|
||||
{
|
||||
max_src_len = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_src_len = (dst_len - 1) / 4 * 3;
|
||||
}
|
||||
|
||||
if (src_len > max_src_len)
|
||||
{
|
||||
src_len = max_src_len;
|
||||
}
|
||||
|
||||
while (src_i < src_len)
|
||||
{
|
||||
switch (src_len - src_i)
|
||||
{
|
||||
case 1:
|
||||
v = (unsigned int)(unsigned char)src[src_i++] << 4;
|
||||
*p++ = b64chr[v >> 6];
|
||||
*p++ = b64chr[v & 0x3f];
|
||||
*p++ = b64chr[64];
|
||||
*p++ = b64chr[64];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
v = (unsigned int)(unsigned char)src[src_i++] << 10;
|
||||
v |= (unsigned int)(unsigned char)src[src_i++] << 2;
|
||||
*p++ = b64chr[v >> 12];
|
||||
*p++ = b64chr[(v >> 6) & 0x3f];
|
||||
*p++ = b64chr[v & 0x3f];
|
||||
*p++ = b64chr[64];
|
||||
break;
|
||||
|
||||
default:
|
||||
v = (unsigned int)(unsigned char)src[src_i++] << 16;
|
||||
v |= (unsigned int)(unsigned char)src[src_i++] << 8;
|
||||
v |= (unsigned int)(unsigned char)src[src_i++];
|
||||
*p++ = b64chr[v >> 18];
|
||||
*p++ = b64chr[(v >> 12) & 0x3f];
|
||||
*p++ = b64chr[(v >> 6) & 0x3f];
|
||||
*p++ = b64chr[v & 0x3f];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*p = '\0';
|
||||
|
||||
return src_len;
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2021 Koichiro Iwao, all xrdp contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/base64.h
|
||||
* @brief Base64 encoder / decoder
|
||||
*
|
||||
* Base-64 is described in RFC4648. The following notes apply to this
|
||||
* implementation:-
|
||||
* - The only supported characters are [A-Za-z0-9+/=]. At present,
|
||||
* embedded linefeeds and URL encodings are not supported.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(BASE64_CALLS_H)
|
||||
#define BASE64_CALLS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/*
|
||||
* Decodes a base64 string
|
||||
*
|
||||
* @param src Pointer to null-terminated source
|
||||
* @param dst Pointer to output buffer
|
||||
* @param dst_len Length of above. No more than this is written to the
|
||||
* output buffer
|
||||
* @param actual_len Pointer to value to receive actual length of decoded data
|
||||
* @return 0 for success, 1 for an invalid input string
|
||||
*
|
||||
* The following notes apply to this implementation:-
|
||||
* - Embedded padding is supported, provided it only occurs at the end
|
||||
* of a quantum as described in RFC4648(4). This allows concatenated
|
||||
* encodings to be fed into the decoder.
|
||||
* - Padding of the last quantum is assumed if not provided.
|
||||
* - Excess padding of the last quantum is ignored.
|
||||
*
|
||||
* Only dst_len bytes at most are written to the output. The length
|
||||
* returned in actual_len however represents how much buffer is needed for
|
||||
* a correct result. This may be more than dst_len, and enables the caller
|
||||
* to detect a potential buffer overflow
|
||||
*/
|
||||
int
|
||||
base64_decode(const char *src, char *dst, size_t dst_len, size_t *actual_len);
|
||||
|
||||
/*
|
||||
* Encodes a buffer as base64
|
||||
*
|
||||
* @param src Pointer to source
|
||||
* @param src_len Length of above.
|
||||
* @param dst Pointer to output buffer for null-terminated string
|
||||
* @param dst_len Length of above. No more than this is written to the
|
||||
* output buffer
|
||||
* @return Number of source characters processed
|
||||
*
|
||||
* The following notes apply to this implementation:-
|
||||
* - Padding of the last quantum is always written if the number of
|
||||
* source bytes is not divisible by 3.
|
||||
*
|
||||
* The number of source characters processed is always returned. If
|
||||
* the destination buffer is too small for all the output plus a
|
||||
* terminator, the returned value from this procedure will be less than
|
||||
* src_len. In this case no padding characters will have been written,
|
||||
* and the remaining characters can be converted with more calls to
|
||||
* this procedure.
|
||||
*/
|
||||
size_t
|
||||
base64_encode(const char *src, size_t src_len, char *dst, size_t dst_len);
|
||||
|
||||
#endif /* BASE64_CALLS_H */
|
||||
107
common/defines.h
107
common/defines.h
@ -1,107 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* main define/macro file
|
||||
*/
|
||||
|
||||
#ifndef DEFINES_H
|
||||
#define DEFINES_H
|
||||
|
||||
/* other macros */
|
||||
#undef MIN
|
||||
#define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2))
|
||||
#undef MAX
|
||||
#define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2))
|
||||
#undef HIWORD
|
||||
#define HIWORD(in) (((in) & 0xffff0000) >> 16)
|
||||
#undef LOWORD
|
||||
#define LOWORD(in) ((in) & 0x0000ffff)
|
||||
#undef MAKELONG
|
||||
#define MAKELONG(lo, hi) ((((hi) & 0xffff) << 16) | ((lo) & 0xffff))
|
||||
#define UNUSED_VAR(x) ((void) (x))
|
||||
|
||||
/* graphics macros */
|
||||
#define MAKERECT(r, x, y, cx, cy) \
|
||||
{ (r).left = x; (r).top = y; (r).right = (x) + (cx); (r).bottom = (y) + (cy); }
|
||||
#define ISRECTEMPTY(r) (((r).right <= (r).left) || ((r).bottom <= (r).top))
|
||||
#define RECTOFFSET(r, dx, dy) \
|
||||
{ (r).left += dx; (r).top += dy; (r).right += dx; (r).bottom += dy; }
|
||||
#define GETPIXEL8(d, x, y, w) (*(((unsigned char*)d) + ((y) * (w) + (x))))
|
||||
#define GETPIXEL16(d, x, y, w) (*(((unsigned short*)d) + ((y) * (w) + (x))))
|
||||
#define GETPIXEL32(d, x, y, w) (*(((unsigned int*)d) + ((y) * (w) + (x))))
|
||||
#define SETPIXEL8(d, x, y, w, v) \
|
||||
(*(((unsigned char*)d) + ((y) * (w) + (x))) = (v))
|
||||
#define SETPIXEL16(d, x, y, w, v) \
|
||||
(*(((unsigned short*)d) + ((y) * (w) + (x))) = (v))
|
||||
#define SETPIXEL32(d, x, y, w, v) \
|
||||
(*(((unsigned int*)d) + ((y) * (w) + (x))) = (v))
|
||||
#define COLOR8(r, g, b) \
|
||||
( \
|
||||
(((r) >> 5) << 0) | \
|
||||
(((g) >> 5) << 3) | \
|
||||
(((b) >> 6) << 6) \
|
||||
)
|
||||
#define COLOR15(r, g, b) ((((r) >> 3) << 10) | (((g) >> 3) << 5) | ((b) >> 3))
|
||||
#define COLOR16(r, g, b) ((((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3))
|
||||
#define COLOR24RGB(r, g, b) (((r) << 16) | ((g) << 8) | (b))
|
||||
#define COLOR24BGR(r, g, b) (((b) << 16) | ((g) << 8) | (r))
|
||||
#define HRED(c) ((c & 0xff0000) >> 16)
|
||||
#define HGREEN(c) ((c & 0x00ff00) >> 8)
|
||||
#define HBLUE(c) ((c & 0x0000ff))
|
||||
#define HCOLOR(bpp,c) \
|
||||
( \
|
||||
(bpp==8?COLOR8(HRED(c),HGREEN(c),HBLUE(c)): \
|
||||
(bpp==15?COLOR15(HRED(c),HGREEN(c),HBLUE(c)): \
|
||||
(bpp==16?COLOR16(HRED(c),HGREEN(c),HBLUE(c)): \
|
||||
(bpp>=24?COLOR24BGR(HRED(c),HGREEN(c),HBLUE(c)):c) \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
#define SPLITCOLOR15(r, g, b, c) \
|
||||
{ \
|
||||
r = (((c) >> 7) & 0xf8) | (((c) >> 12) & 0x7); \
|
||||
g = (((c) >> 2) & 0xf8) | (((c) >> 8) & 0x7); \
|
||||
b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \
|
||||
}
|
||||
#define SPLITCOLOR16(r, g, b, c) \
|
||||
{ \
|
||||
r = (((c) >> 8) & 0xf8) | (((c) >> 13) & 0x7); \
|
||||
g = (((c) >> 3) & 0xfc) | (((c) >> 9) & 0x3); \
|
||||
b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \
|
||||
}
|
||||
#define SPLITCOLOR32(r, g, b, c) \
|
||||
{ \
|
||||
r = ((c) >> 16) & 0xff; \
|
||||
g = ((c) >> 8) & 0xff; \
|
||||
b = (c) & 0xff; \
|
||||
}
|
||||
/* font macros */
|
||||
#define FONT_DATASIZE_FROM_GEOMETRY(width,height) \
|
||||
((((height) * (((width) + 7) / 8)) + 3) & ~3)
|
||||
#define FONT_DATASIZE(f) FONT_DATASIZE_FROM_GEOMETRY((f->width), (f->height))
|
||||
|
||||
/* use crc for bitmap cache lookups */
|
||||
#define USE_CRC
|
||||
|
||||
#define XR_RGB2BGR(a_ulColor) \
|
||||
(a_ulColor & 0xFF000000) | \
|
||||
((a_ulColor & 0x00FF0000) >> 16) | \
|
||||
(a_ulColor & 0x0000FF00) | \
|
||||
((a_ulColor & 0x000000FF) << 16)
|
||||
|
||||
#endif
|
||||
263
common/fifo.c
263
common/fifo.c
@ -1,263 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Matt Burt 2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/fifo.c
|
||||
* @brief Fifo for storing generic pointers
|
||||
*
|
||||
* Defines an unbounded FIFO-queue for void * pointers
|
||||
*
|
||||
* The stored pointers are called 'items' below.
|
||||
*
|
||||
* Items are stored in groups called 'chunks'. Chunks are linked together
|
||||
* in a chain:-
|
||||
*
|
||||
* +-------------+ +--------+ +--------+ +--------+
|
||||
* | first_chunk |--->| next |--->| next |--->| NULL |<-+
|
||||
* | last_chunk |-+ +--------+ +--------+ +--------+ |
|
||||
* | . . . | | | item.0 | | item.0 | | item.0 | |
|
||||
* +-------------+ | | ... | | ... | | ... | |
|
||||
* | | item.n | | item.n | | item.n | |
|
||||
* | +--------+ +--------+ +--------+ |
|
||||
* | |
|
||||
* +------------------------------------------+
|
||||
*
|
||||
* This allows items to be added to the FIFO by allocating blocks
|
||||
* as each one fills up.
|
||||
*
|
||||
* The code to read from the FIFO de-allocates blocks as each one is
|
||||
* consumed.
|
||||
*
|
||||
* There is always at least one chunk in the FIFO.
|
||||
*/
|
||||
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "fifo.h"
|
||||
|
||||
#define ITEMS_PER_CHUNK 31
|
||||
|
||||
struct chunk
|
||||
{
|
||||
struct chunk *next;
|
||||
void *items[ITEMS_PER_CHUNK];
|
||||
};
|
||||
|
||||
struct fifo
|
||||
{
|
||||
struct chunk *first_chunk;
|
||||
struct chunk *last_chunk;
|
||||
/** Next address to write in 'last_chunk' */
|
||||
unsigned short writer;
|
||||
/** Next address to read in 'first_chunk' */
|
||||
unsigned short reader;
|
||||
/** Item destructor function, or NULL */
|
||||
fifo_item_destructor item_destructor;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
struct fifo *
|
||||
fifo_create(fifo_item_destructor item_destructor)
|
||||
{
|
||||
struct fifo *result = NULL;
|
||||
struct chunk *cptr = (struct chunk *)malloc(sizeof(struct chunk));
|
||||
if (cptr != NULL)
|
||||
{
|
||||
/* 'next' pointer in last block is always NULL */
|
||||
cptr->next = NULL;
|
||||
result = (struct fifo *)malloc(sizeof(struct fifo));
|
||||
if (result == NULL)
|
||||
{
|
||||
free(cptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
result->first_chunk = cptr;
|
||||
result->last_chunk = cptr;
|
||||
result->writer = 0;
|
||||
result->reader = 0;
|
||||
result->item_destructor = item_destructor;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* Internal function to call the destructor function on all items in the fifo
|
||||
*
|
||||
* @param self fifo. Can't be NULL
|
||||
* @param closure Additional argument to destructor function
|
||||
*/
|
||||
static void
|
||||
call_item_destructor(struct fifo *self, void *closure)
|
||||
{
|
||||
if (self->item_destructor != NULL)
|
||||
{
|
||||
struct chunk *cptr = self->first_chunk;
|
||||
unsigned int i = self->reader;
|
||||
|
||||
// Process all the chunks up to the last one
|
||||
while (cptr != self->last_chunk)
|
||||
{
|
||||
(*self->item_destructor)(cptr->items[i++], closure);
|
||||
if (i == ITEMS_PER_CHUNK)
|
||||
{
|
||||
cptr = cptr->next;
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Process all the items in the last chunk
|
||||
while (i < self->writer)
|
||||
{
|
||||
(*self->item_destructor)(cptr->items[i++], closure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
fifo_delete(struct fifo *self, void *closure)
|
||||
{
|
||||
if (self != NULL)
|
||||
{
|
||||
call_item_destructor(self, closure);
|
||||
|
||||
// Now free all the chunks
|
||||
struct chunk *cptr = self->first_chunk;
|
||||
while (cptr != NULL)
|
||||
{
|
||||
struct chunk *next = cptr->next;
|
||||
free(cptr);
|
||||
cptr = next;
|
||||
}
|
||||
|
||||
free(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
fifo_clear(struct fifo *self, void *closure)
|
||||
{
|
||||
if (self != NULL)
|
||||
{
|
||||
call_item_destructor(self, closure);
|
||||
|
||||
// Now free all the chunks except the last one
|
||||
struct chunk *cptr = self->first_chunk;
|
||||
while (cptr->next != NULL)
|
||||
{
|
||||
struct chunk *next = cptr->next;
|
||||
free(cptr);
|
||||
cptr = next;
|
||||
}
|
||||
|
||||
// Re-initialise fifo fields
|
||||
self->first_chunk = cptr;
|
||||
self->last_chunk = cptr;
|
||||
self->reader = 0;
|
||||
self->writer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
fifo_add_item(struct fifo *self, void *item)
|
||||
{
|
||||
int rv = 0;
|
||||
if (self != NULL && item != NULL)
|
||||
{
|
||||
if (self->writer == ITEMS_PER_CHUNK)
|
||||
{
|
||||
// Add another chunk to the chain
|
||||
struct chunk *cptr;
|
||||
cptr = (struct chunk *)malloc(sizeof(struct chunk));
|
||||
if (cptr == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
cptr->next = NULL;
|
||||
self->last_chunk->next = cptr;
|
||||
self->last_chunk = cptr;
|
||||
self->writer = 0;
|
||||
}
|
||||
|
||||
self->last_chunk->items[self->writer++] = item;
|
||||
rv = 1;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void *
|
||||
fifo_remove_item(struct fifo *self)
|
||||
{
|
||||
void *item = NULL;
|
||||
if (self != NULL)
|
||||
{
|
||||
// More than one chunk in the fifo?
|
||||
if (self->first_chunk != self->last_chunk)
|
||||
{
|
||||
/* We're not reading the last chunk. There
|
||||
* must be something in the fifo */
|
||||
item = self->first_chunk->items[self->reader++];
|
||||
|
||||
/* At the end of this chunk? */
|
||||
if (self->reader == ITEMS_PER_CHUNK)
|
||||
{
|
||||
struct chunk *old_chunk = self->first_chunk;
|
||||
self->first_chunk = old_chunk->next;
|
||||
free(old_chunk);
|
||||
self->reader = 0;
|
||||
}
|
||||
}
|
||||
else if (self->reader < self->writer)
|
||||
{
|
||||
/* We're reading the last chunk */
|
||||
item = self->first_chunk->items[self->reader++];
|
||||
if (self->reader == self->writer)
|
||||
{
|
||||
// fifo is now empty. We can reset the pointers
|
||||
// to prevent unnecessary allocations in the future.
|
||||
self->reader = 0;
|
||||
self->writer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
int
|
||||
fifo_is_empty(struct fifo *self)
|
||||
{
|
||||
return (self == NULL ||
|
||||
(self->first_chunk == self->last_chunk &&
|
||||
self->reader == self->writer));
|
||||
}
|
||||
@ -1,98 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Laxmikant Rashinkar 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/fifo.h
|
||||
* @brief Fifo for storing generic pointers
|
||||
*
|
||||
* Declares an unbounded FIFO-queue for void * pointers
|
||||
*/
|
||||
|
||||
#ifndef _FIFO_H
|
||||
#define _FIFO_H
|
||||
|
||||
struct fifo;
|
||||
|
||||
/**
|
||||
* Function used by fifo_clear()/fifo_delete() to destroy items
|
||||
*
|
||||
* @param item Item being deleted
|
||||
* @param closure Additional argument to function
|
||||
*
|
||||
* Use this function to free any allocated storage (e.g. if the items
|
||||
* are dynamically allocated)
|
||||
*/
|
||||
typedef void (*fifo_item_destructor)(void *item, void *closure);
|
||||
|
||||
/**
|
||||
* Create new fifo
|
||||
*
|
||||
* @param item_destructor Destructor for fifo items, or NULL for none
|
||||
* @return fifo, or NULL if no memory
|
||||
*/
|
||||
struct fifo *
|
||||
fifo_create(fifo_item_destructor item_destructor);
|
||||
|
||||
/**
|
||||
* Delete an existing fifo
|
||||
*
|
||||
* Any existing entries on the fifo are passed in order to the
|
||||
* item destructor specified when the fifo was created.
|
||||
*
|
||||
* @param self fifo to delete (may be NULL)
|
||||
* @param closure Additional parameter for fifo item destructor
|
||||
*/
|
||||
void
|
||||
fifo_delete(struct fifo *self, void *closure);
|
||||
|
||||
/**
|
||||
* Clear(empty) an existing fifo
|
||||
*
|
||||
* Any existing entries on the fifo are passed in order to the
|
||||
* item destructor specified when the fifo was created.
|
||||
*
|
||||
* @param self fifo to clear (may be NULL)
|
||||
* @param closure Additional parameter for fifo item destructor
|
||||
*/
|
||||
void
|
||||
fifo_clear(struct fifo *self, void *closure);
|
||||
|
||||
/** Add an item to a fifo
|
||||
* @param self fifo
|
||||
* @param item Item to add
|
||||
* @return 1 if successful, 0 for no memory, or tried to add NULL
|
||||
*/
|
||||
int
|
||||
fifo_add_item(struct fifo *self, void *item);
|
||||
|
||||
/** Remove an item from a fifo
|
||||
* @param self fifo
|
||||
* @return item if successful, NULL for no items in FIFO
|
||||
*/
|
||||
void *
|
||||
fifo_remove_item(struct fifo *self);
|
||||
|
||||
/** Is fifo empty?
|
||||
*
|
||||
* @param self fifo
|
||||
* @return 1 if fifo is empty, 0 if not
|
||||
*/
|
||||
int
|
||||
fifo_is_empty(struct fifo *self);
|
||||
|
||||
#endif
|
||||
403
common/file.c
403
common/file.c
@ -1,403 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* read a config file
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include "arch.h"
|
||||
#include "os_calls.h"
|
||||
#include "string_calls.h"
|
||||
#include "list.h"
|
||||
#include "file.h"
|
||||
#include "parse.h"
|
||||
|
||||
#define FILE_MAX_LINE_BYTES 2048
|
||||
|
||||
static int
|
||||
file_read_ini_line(struct stream *s, char *text, int text_bytes);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* look up for a section name within str (i.e. pattern [section_name])
|
||||
* if a section name is found, this function return 1 and copy the section
|
||||
* inplace of str. */
|
||||
static int
|
||||
line_lookup_for_section_name(char *str, int str_bytes)
|
||||
{
|
||||
int name_index_start;
|
||||
int index;
|
||||
char c;
|
||||
|
||||
name_index_start = -1;
|
||||
index = 0;
|
||||
while ((c = str[index]) != 0)
|
||||
{
|
||||
if (c == '[')
|
||||
{
|
||||
name_index_start = index + 1;
|
||||
}
|
||||
else if (c == ']' && name_index_start > 0)
|
||||
{
|
||||
if (name_index_start + index >= str_bytes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
for (index = index - name_index_start; index > 0; index--)
|
||||
{
|
||||
str[0] = str[name_index_start];
|
||||
str++;
|
||||
}
|
||||
str[0] = 0;
|
||||
return 1;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error
|
||||
returns 0 if everything is ok
|
||||
returns 1 if problem reading file */
|
||||
static int
|
||||
l_file_read_sections(int fd, int max_file_size, struct list *names)
|
||||
{
|
||||
struct stream *s;
|
||||
char text[FILE_MAX_LINE_BYTES];
|
||||
int len;
|
||||
int rv;
|
||||
|
||||
rv = 0;
|
||||
g_file_seek(fd, 0);
|
||||
g_memset(text, 0, FILE_MAX_LINE_BYTES);
|
||||
list_clear(names);
|
||||
make_stream(s);
|
||||
init_stream(s, max_file_size);
|
||||
len = g_file_read(fd, s->data, max_file_size);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
s->end = s->p + len;
|
||||
while (file_read_ini_line(s, text, FILE_MAX_LINE_BYTES) == 0)
|
||||
{
|
||||
if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0)
|
||||
{
|
||||
list_add_strdup(names, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (len < 0)
|
||||
{
|
||||
rv = 1;
|
||||
}
|
||||
|
||||
free_stream(s);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Read a line in the stream 's', removing comments.
|
||||
* returns error
|
||||
* returns 0 if everything is ok
|
||||
* returns 1 if problem reading file */
|
||||
static int
|
||||
file_read_ini_line(struct stream *s, char *text, int text_bytes)
|
||||
{
|
||||
int i;
|
||||
int skip_to_end;
|
||||
int at_end;
|
||||
char c;
|
||||
|
||||
skip_to_end = 0;
|
||||
|
||||
if (!s_check_rem(s, 1))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
in_uint8(s, c);
|
||||
|
||||
while (c != 10 && c != 13)
|
||||
{
|
||||
/* these mean skip the rest of the line */
|
||||
if (c == '#' || c == ';')
|
||||
{
|
||||
skip_to_end = 1;
|
||||
}
|
||||
|
||||
if (!skip_to_end)
|
||||
{
|
||||
text[i] = c;
|
||||
i++;
|
||||
if (i >= text_bytes)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (s_check_rem(s, 1))
|
||||
{
|
||||
in_uint8(s, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
c = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == 10 || c == 13)
|
||||
{
|
||||
at_end = 0;
|
||||
|
||||
while (c == 10 || c == 13)
|
||||
{
|
||||
if (s_check_rem(s, 1))
|
||||
{
|
||||
in_uint8(s, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
at_end = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!at_end)
|
||||
{
|
||||
s->p--;
|
||||
}
|
||||
}
|
||||
|
||||
text[i] = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error */
|
||||
static int
|
||||
file_split_name_value(char *text, char *name, char *value)
|
||||
{
|
||||
int len;
|
||||
int i;
|
||||
int value_index;
|
||||
int name_index;
|
||||
int on_to;
|
||||
|
||||
value_index = 0;
|
||||
name_index = 0;
|
||||
on_to = 0;
|
||||
name[0] = 0;
|
||||
value[0] = 0;
|
||||
len = g_strlen(text);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (text[i] == '=' && !on_to)
|
||||
{
|
||||
on_to = 1;
|
||||
}
|
||||
else if (on_to)
|
||||
{
|
||||
value[value_index] = text[i];
|
||||
value_index++;
|
||||
value[value_index] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
name[name_index] = text[i];
|
||||
name_index++;
|
||||
name[name_index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
g_strtrim(name, 3); /* trim both right and left */
|
||||
g_strtrim(value, 3); /* trim both right and left */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* return error */
|
||||
static int
|
||||
l_file_read_section(int fd, int max_file_size, const char *section,
|
||||
struct list *names, struct list *values)
|
||||
{
|
||||
struct stream *s;
|
||||
char *data;
|
||||
char *text;
|
||||
char *name;
|
||||
char *value;
|
||||
char *lvalue;
|
||||
int len;
|
||||
int file_size;
|
||||
|
||||
data = (char *) g_malloc(FILE_MAX_LINE_BYTES * 3, 0);
|
||||
text = data;
|
||||
name = text + FILE_MAX_LINE_BYTES;
|
||||
value = name + FILE_MAX_LINE_BYTES;
|
||||
|
||||
file_size = 32 * 1024; /* 32 K file size limit */
|
||||
g_file_seek(fd, 0);
|
||||
g_memset(text, 0, FILE_MAX_LINE_BYTES);
|
||||
list_clear(names);
|
||||
list_clear(values);
|
||||
make_stream(s);
|
||||
init_stream(s, file_size);
|
||||
len = g_file_read(fd, s->data, file_size);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
s->end = s->p + len;
|
||||
while (file_read_ini_line(s, text, FILE_MAX_LINE_BYTES) == 0)
|
||||
{
|
||||
if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0)
|
||||
{
|
||||
if (g_strcasecmp(section, text) == 0)
|
||||
{
|
||||
while (file_read_ini_line(s, text,
|
||||
FILE_MAX_LINE_BYTES) == 0)
|
||||
{
|
||||
if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_strlen(text) > 0)
|
||||
{
|
||||
file_split_name_value(text, name, value);
|
||||
list_add_strdup(names, name);
|
||||
|
||||
if (value[0] == '$')
|
||||
{
|
||||
lvalue = g_getenv(value + 1);
|
||||
|
||||
if (lvalue != 0)
|
||||
{
|
||||
list_add_strdup(values, lvalue);
|
||||
}
|
||||
else
|
||||
{
|
||||
list_add_strdup(values, "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list_add_strdup(values, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
free_stream(s);
|
||||
g_free(data);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free_stream(s);
|
||||
g_free(data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error
|
||||
returns 0 if everything is ok
|
||||
returns 1 if problem reading file */
|
||||
/* 32 K file size limit */
|
||||
int
|
||||
file_read_sections(int fd, struct list *names)
|
||||
{
|
||||
return l_file_read_sections(fd, 32 * 1024, names);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* return error */
|
||||
/* this function should be preferred over file_read_sections because it can
|
||||
read any file size */
|
||||
int
|
||||
file_by_name_read_sections(const char *file_name, struct list *names)
|
||||
{
|
||||
int fd;
|
||||
int file_size;
|
||||
int rv;
|
||||
|
||||
file_size = g_file_get_size(file_name);
|
||||
|
||||
if (file_size < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
fd = g_file_open_ro(file_name);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
rv = l_file_read_sections(fd, file_size, names);
|
||||
g_file_close(fd);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* return error */
|
||||
/* 32 K file size limit */
|
||||
int
|
||||
file_read_section(int fd, const char *section,
|
||||
struct list *names, struct list *values)
|
||||
{
|
||||
return l_file_read_section(fd, 32 * 1024, section, names, values);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* return error */
|
||||
/* this function should be preferred over file_read_section because it can
|
||||
read any file size */
|
||||
int
|
||||
file_by_name_read_section(const char *file_name, const char *section,
|
||||
struct list *names, struct list *values)
|
||||
{
|
||||
int fd;
|
||||
int file_size;
|
||||
int rv;
|
||||
|
||||
file_size = g_file_get_size(file_name);
|
||||
|
||||
if (file_size < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
fd = g_file_open_ro(file_name);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
rv = l_file_read_section(fd, file_size, section, names, values);
|
||||
g_file_close(fd);
|
||||
return rv;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* read a config file
|
||||
*/
|
||||
|
||||
#if !defined(FILE_H)
|
||||
#define FILE_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
int
|
||||
file_read_sections(int fd, struct list *names);
|
||||
int
|
||||
file_by_name_read_sections(const char *file_name, struct list *names);
|
||||
int
|
||||
file_read_section(int fd, const char *section,
|
||||
struct list *names, struct list *values);
|
||||
int
|
||||
file_by_name_read_section(const char *file_name, const char *section,
|
||||
struct list *names, struct list *values);
|
||||
|
||||
#endif
|
||||
100
common/guid.c
100
common/guid.c
@ -1,100 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) 2021 Matt Burt, all xrdp contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/guid.c
|
||||
* @brief GUID manipulation definitions
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include "guid.h"
|
||||
#include "os_calls.h"
|
||||
#include "string_calls.h"
|
||||
|
||||
enum
|
||||
{
|
||||
/* Field offsets in the UUID */
|
||||
E_CLOCK_SEQ_HI_AND_RESERVED = 8,
|
||||
E_TIME_HI_AND_VERSION_MSB = 7,
|
||||
/* UUID versions from RFC4122 section 4.1.3 */
|
||||
E_UUID_VERSION_RANDOM = 4
|
||||
};
|
||||
|
||||
struct guid
|
||||
guid_new(void)
|
||||
{
|
||||
struct guid guid = {0};
|
||||
g_random(guid.g, sizeof(guid.g));
|
||||
/* Show this UUID as conforming to RFC4122 (section 4.1.1) */
|
||||
guid.g[E_CLOCK_SEQ_HI_AND_RESERVED] &= ~0x40; /* Clear bit 6 */
|
||||
guid.g[E_CLOCK_SEQ_HI_AND_RESERVED] |= (char)0x80; /* Set bit 7 */
|
||||
|
||||
guid.g[E_TIME_HI_AND_VERSION_MSB] &= ~0xf0;
|
||||
guid.g[E_TIME_HI_AND_VERSION_MSB] |= (E_UUID_VERSION_RANDOM << 4);
|
||||
|
||||
return guid;
|
||||
}
|
||||
|
||||
void
|
||||
guid_clear(struct guid *guid)
|
||||
{
|
||||
g_memset(&guid->g, '\x00', GUID_SIZE);
|
||||
}
|
||||
|
||||
int
|
||||
guid_is_set(const struct guid *guid)
|
||||
{
|
||||
unsigned int i;
|
||||
int rv = 0;
|
||||
if (guid != NULL)
|
||||
{
|
||||
for (i = 0 ; i < GUID_SIZE; ++i)
|
||||
{
|
||||
if (guid->g[i] != '\x00')
|
||||
{
|
||||
rv = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
const char *guid_to_str(const struct guid *src, char *dest)
|
||||
{
|
||||
const unsigned char *guid = (const unsigned char *)src->g;
|
||||
|
||||
/*
|
||||
* Flipping integers into little-endian
|
||||
* See also: https://devblogs.microsoft.com/oldnewthing/20220928-00/?p=107221
|
||||
*/
|
||||
g_sprintf(dest, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||
guid[3], guid[2], guid[1], guid[0],
|
||||
guid[5], guid[4],
|
||||
guid[7], guid[6],
|
||||
guid[8], guid[9],
|
||||
guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
|
||||
|
||||
return dest;
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2021
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file common/guid.h
|
||||
* @brief GUID manipulation declarations
|
||||
*/
|
||||
|
||||
#ifndef GUID_H
|
||||
#define GUID_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
#define GUID_SIZE 16 /* bytes */
|
||||
#define GUID_STR_SIZE (GUID_SIZE * 2 + 4 + 1) /* w/ 4 hyphens + null terminator */
|
||||
|
||||
|
||||
/**
|
||||
* Use a struct for the guid so we can easily copy by assignment.
|
||||
* We use an array of char so that
|
||||
* we can compare GUIDs with a straight memcmp()
|
||||
*
|
||||
* Some fields of the GUID are in little-endian-order as specified by
|
||||
* [MS-DTYP]. This is at odds with RFC4122 which specifies big-endian
|
||||
* order for all fields.
|
||||
*
|
||||
* Octets RFC4122 field
|
||||
* ------ -------------
|
||||
* 0-3 time_low (little-endian)
|
||||
* 4-5 time_mid (little-endian)
|
||||
* 6-7 time_hi_and_version (little-endian)
|
||||
* 8 clock_seq_hi_and_reserved
|
||||
* 9 clock_seq_low (in order)
|
||||
* 10-15 node
|
||||
*/
|
||||
struct guid
|
||||
{
|
||||
char g[GUID_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get an initialised GUID
|
||||
*
|
||||
* The GUID is compatible with RFC4122 section 4.4.
|
||||
*
|
||||
* @return new GUID
|
||||
*/
|
||||
struct guid guid_new(void);
|
||||
|
||||
/**
|
||||
* Clears an initialised GUID, so guid_is_set() returns true
|
||||
*
|
||||
* @param guid GUID to clear
|
||||
*/
|
||||
void
|
||||
guid_clear(struct guid *guid);
|
||||
|
||||
/**
|
||||
* Checks if a GUID is initialised
|
||||
*
|
||||
* @param guid GUID to check (can be NULL)
|
||||
* @return non-zero if GUID is set
|
||||
*/
|
||||
int
|
||||
guid_is_set(const struct guid *guid);
|
||||
|
||||
/**
|
||||
* Converts a GUID to a string representation
|
||||
*
|
||||
* @param guid GUID to represent
|
||||
* @param dest destionation pointer to at least GUID_STR_SIZE
|
||||
* bytes to store the representation
|
||||
* @return dest is returned for convenience
|
||||
*/
|
||||
const char *guid_to_str(const struct guid *guid, char *dest);
|
||||
|
||||
#endif
|
||||
|
||||
410
common/list.c
410
common/list.c
@ -1,410 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* simple list
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "arch.h"
|
||||
#include "os_calls.h"
|
||||
#include "string_calls.h"
|
||||
#include "list.h"
|
||||
#include "log.h"
|
||||
|
||||
enum
|
||||
{
|
||||
DEFAULT_LIST_SIZE = 10,
|
||||
DEFAULT_GROW_BY_SIZE = 10
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
struct list *
|
||||
list_create_sized(unsigned int size)
|
||||
{
|
||||
struct list *self;
|
||||
|
||||
if (size < DEFAULT_LIST_SIZE)
|
||||
{
|
||||
size = DEFAULT_LIST_SIZE;
|
||||
}
|
||||
self = (struct list *)calloc(sizeof(struct list), 1);
|
||||
if (self != NULL)
|
||||
{
|
||||
self->items = (tbus *)malloc(sizeof(tbus) * size);
|
||||
if (self->items == NULL)
|
||||
{
|
||||
free(self);
|
||||
self = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->grow_by = DEFAULT_GROW_BY_SIZE;
|
||||
self->alloc_size = size;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
struct list *
|
||||
list_create(void)
|
||||
{
|
||||
return list_create_sized(DEFAULT_LIST_SIZE);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
list_delete(struct list *self)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (self == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (self->auto_free)
|
||||
{
|
||||
for (i = 0; i < self->count; i++)
|
||||
{
|
||||
free((void *)self->items[i]);
|
||||
self->items[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
free(self->items);
|
||||
free(self);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static int
|
||||
grow_list(struct list *self)
|
||||
{
|
||||
int rv = 1;
|
||||
unsigned int new_alloc_size = self->alloc_size + self->grow_by;
|
||||
tbus *p = (tbus *)realloc(self->items, sizeof(tbus) * new_alloc_size);
|
||||
if (p == NULL)
|
||||
{
|
||||
rv = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->alloc_size = new_alloc_size;
|
||||
self->items = p;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
list_add_item(struct list *self, tbus item)
|
||||
{
|
||||
if (self->count == self->alloc_size && !grow_list(self))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
self->items[self->count] = item;
|
||||
self->count++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
tbus
|
||||
list_get_item(const struct list *self, int index)
|
||||
{
|
||||
if (index < 0 || index >= self->count)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->items[index];
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
list_clear(struct list *self)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (self->auto_free)
|
||||
{
|
||||
for (i = 0; i < self->count; i++)
|
||||
{
|
||||
free((void *)self->items[i]);
|
||||
self->items[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
self->count = 0;
|
||||
self->grow_by = DEFAULT_GROW_BY_SIZE;
|
||||
self->alloc_size = DEFAULT_LIST_SIZE;
|
||||
self->items = (tbus *)realloc(self->items, sizeof(tbus) * self->alloc_size);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
list_index_of(struct list *self, tbus item)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < self->count; i++)
|
||||
{
|
||||
if (self->items[i] == item)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
list_remove_item(struct list *self, int index)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (index >= 0 && index < self->count)
|
||||
{
|
||||
if (self->auto_free)
|
||||
{
|
||||
free((void *)self->items[index]);
|
||||
self->items[index] = 0;
|
||||
}
|
||||
|
||||
for (i = index; i < (self->count - 1); i++)
|
||||
{
|
||||
self->items[i] = self->items[i + 1];
|
||||
}
|
||||
|
||||
self->count--;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
list_insert_item(struct list *self, int index, tbus item)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (index > self->count)
|
||||
{
|
||||
index = self->count;
|
||||
}
|
||||
else if (index < 0)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
||||
if (self->count == self->alloc_size && !grow_list(self))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Move all the items above this location up one
|
||||
for (i = self->count ; i > index ; --i)
|
||||
{
|
||||
self->items[i] = self->items[i - 1];
|
||||
}
|
||||
|
||||
self->count++;
|
||||
|
||||
self->items[index] = item;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
list_add_strdup(struct list *self, const char *str)
|
||||
{
|
||||
int rv;
|
||||
char *dup;
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
rv = list_add_item(self, (tintptr)str);
|
||||
}
|
||||
else if ((dup = g_strdup(str)) == NULL)
|
||||
{
|
||||
rv = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = list_add_item(self, (tintptr)dup);
|
||||
if (!rv)
|
||||
{
|
||||
g_free(dup);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int
|
||||
list_add_strdup_multi(struct list *self, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int entry_count = self->count;
|
||||
const char *s;
|
||||
int rv = 1;
|
||||
|
||||
va_start(ap, self);
|
||||
while ((s = va_arg(ap, const char *)) != NULL)
|
||||
{
|
||||
if (!list_add_strdup(self, s))
|
||||
{
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
if (rv == 0)
|
||||
{
|
||||
// Remove the additional items we added
|
||||
while (self->count > entry_count)
|
||||
{
|
||||
list_remove_item(self, self->count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* append one list to another using strdup for each item in the list */
|
||||
/* begins copy at start_index, a zero based index on the source list */
|
||||
int
|
||||
list_append_list_strdup(struct list *self, struct list *dest, int start_index)
|
||||
{
|
||||
int index;
|
||||
int rv = 1;
|
||||
int entry_dest_count = dest->count;
|
||||
|
||||
for (index = start_index; index < self->count; index++)
|
||||
{
|
||||
const char *item = (const char *)list_get_item(self, index);
|
||||
if (!list_add_strdup(dest, item))
|
||||
{
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rv == 0)
|
||||
{
|
||||
// Remove the additional items we added
|
||||
while (dest->count > entry_dest_count)
|
||||
{
|
||||
list_remove_item(dest, dest->count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
list_dump_items(struct list *self)
|
||||
{
|
||||
int index;
|
||||
|
||||
if (self->count == 0)
|
||||
{
|
||||
LOG_DEVEL(LOG_LEVEL_TRACE, "List is empty");
|
||||
}
|
||||
|
||||
for (index = 0; index < self->count; index++)
|
||||
{
|
||||
LOG_DEVEL(LOG_LEVEL_TRACE, "%d: %p", index, (void *) list_get_item(self, index));
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Appends a string fragment to a list
|
||||
* @param[in,out] start Pointer to start of fragment (by reference)
|
||||
* @param end Pointer to one past end of fragment
|
||||
* @param list List to append to
|
||||
* @result 1 for success
|
||||
*
|
||||
* In the event of a memory failure, 0 is returned and the list is deleted.
|
||||
*/
|
||||
int
|
||||
split_string_append_fragment(const char **start, const char *end,
|
||||
struct list *list)
|
||||
{
|
||||
const unsigned int len = end - *start;
|
||||
char *copy = (char *)malloc(len + 1);
|
||||
if (copy == NULL)
|
||||
{
|
||||
list_delete(list);
|
||||
return 0;
|
||||
}
|
||||
g_memcpy(copy, *start, len);
|
||||
copy[len] = '\0';
|
||||
if (!list_add_item(list, (tintptr)copy))
|
||||
{
|
||||
g_free(copy);
|
||||
list_delete(list);
|
||||
return 0;
|
||||
}
|
||||
*start = end + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
struct list *
|
||||
split_string_into_list(const char *str, char character)
|
||||
{
|
||||
struct list *result = list_create();
|
||||
if (result == NULL)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
result->auto_free = 1;
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
const char *p;
|
||||
while ((p = g_strchr(str, character)) != NULL)
|
||||
{
|
||||
if (!split_string_append_fragment(&str, p, result))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (*str != '\0')
|
||||
{
|
||||
if (!split_string_append_fragment(&str, str + g_strlen(str), result))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
149
common/list.h
149
common/list.h
@ -1,149 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* simple list
|
||||
*/
|
||||
|
||||
#if !defined(LIST_H)
|
||||
#define LIST_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/* list */
|
||||
struct list
|
||||
{
|
||||
tintptr *items;
|
||||
int count;
|
||||
int alloc_size;
|
||||
int grow_by;
|
||||
int auto_free;
|
||||
};
|
||||
|
||||
struct list *
|
||||
list_create(void);
|
||||
/**
|
||||
* Creates a list with at least the specified number of items
|
||||
* reserved
|
||||
* @param size Number of items to reserve
|
||||
* @return list, or NULL if no memory
|
||||
*/
|
||||
struct list *
|
||||
list_create_sized(unsigned int size);
|
||||
void
|
||||
list_delete(struct list *self);
|
||||
/**
|
||||
* Adds an item to a list
|
||||
* @param self The list
|
||||
* @param item The item to add
|
||||
* @result 0 if a memory allocation failure occurred. In this
|
||||
* case the item is not added
|
||||
*
|
||||
* Memory allocation failures will not occur if the list is
|
||||
* sized appropriately when created.
|
||||
*/
|
||||
int
|
||||
list_add_item(struct list *self, tintptr item);
|
||||
tintptr
|
||||
list_get_item(const struct list *self, int index);
|
||||
void
|
||||
list_clear(struct list *self);
|
||||
int
|
||||
list_index_of(struct list *self, tintptr item);
|
||||
void
|
||||
list_remove_item(struct list *self, int index);
|
||||
/**
|
||||
* Inserts an item into a list
|
||||
* @param self The list
|
||||
* @param index The location to insert the item before
|
||||
* @param item The item to add
|
||||
* @result 0 if a memory allocation failure occurred. In this
|
||||
* case the item is not added
|
||||
*
|
||||
* Memory allocation failures will not occur if the list is
|
||||
* sized appropriately when created.
|
||||
*/
|
||||
int
|
||||
list_insert_item(struct list *self, int index, tintptr item);
|
||||
/**
|
||||
* Adds strings to a list from another list
|
||||
* @param self The source list
|
||||
* @param dest Destination list
|
||||
* @param start_index Index to start on the source list (zero based)
|
||||
*
|
||||
* @result 0 if a memory allocation failure occurred. In this
|
||||
* case the destination list is unaltered.
|
||||
*
|
||||
* Strings from the source list are copied with strdup()
|
||||
* The dest list should have auto_free set, or memory leaks will occur
|
||||
*/
|
||||
int
|
||||
list_append_list_strdup(struct list *self, struct list *dest, int start_index);
|
||||
void
|
||||
list_dump_items(struct list *self);
|
||||
|
||||
/**
|
||||
* Splits a string on a separation character and then returns a list of
|
||||
* the string split by the character, without the character contained within
|
||||
* the pieces.
|
||||
*
|
||||
* The list must be disposed of by the caller.
|
||||
*
|
||||
* @param str String to split.
|
||||
* @param character Character used as the delimiter between strings.
|
||||
* @param start_index Index to start on the source list (zero based)
|
||||
*
|
||||
* @result 0 if a memory allocation failure occurred.
|
||||
*
|
||||
* String fragments in the list are created with strdup()
|
||||
*/
|
||||
struct list *
|
||||
split_string_into_list(const char *str, char character);
|
||||
|
||||
/**
|
||||
* As list_add_item() but for a C string
|
||||
*
|
||||
* This is a convenience function for a common operation
|
||||
* @param self List to append to
|
||||
* @param str String to append
|
||||
*
|
||||
* The passed-in string is strdup'd onto the list, so if auto_free
|
||||
* isn't set, memory leaks will occur.
|
||||
*
|
||||
* A NULL pointer will be added as a NULL entry.
|
||||
*
|
||||
* @result 0 if any memory allocation failure occurred. In this case
|
||||
* the list is unchanged.
|
||||
*/
|
||||
|
||||
int
|
||||
list_add_strdup(struct list *self, const char *str);
|
||||
|
||||
/**
|
||||
* Add multiple strings to a list
|
||||
*
|
||||
* This is a convenience function for a common operation
|
||||
* @param self List to append to
|
||||
* @param ... Strings to append. Terminate the list with a NULL.
|
||||
*
|
||||
* @result 0 if any memory allocation failure occurred. In this case
|
||||
* the list is unchanged.
|
||||
*/
|
||||
|
||||
int
|
||||
list_add_strdup_multi(struct list *self, ...);
|
||||
|
||||
#endif
|
||||
192
common/list16.c
192
common/list16.c
@ -1,192 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* simple list
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include "arch.h"
|
||||
#include "os_calls.h"
|
||||
#include "list16.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
struct list16 *
|
||||
list16_create(void)
|
||||
{
|
||||
struct list16 *self;
|
||||
|
||||
self = (struct list16 *)g_malloc(sizeof(struct list16), 0);
|
||||
list16_init(self);
|
||||
return self;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_delete(struct list16 *self)
|
||||
{
|
||||
if (self == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
list16_deinit(self);
|
||||
g_free(self);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_init(struct list16 *self)
|
||||
{
|
||||
g_memset(self, 0, sizeof(struct list16));
|
||||
self->max_count = 4;
|
||||
self->items = self->mitems;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_deinit(struct list16 *self)
|
||||
{
|
||||
if (self->items != self->mitems)
|
||||
{
|
||||
g_free(self->items);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_add_item(struct list16 *self, tui16 item)
|
||||
{
|
||||
tui16 *p;
|
||||
int i;
|
||||
|
||||
if (self->count >= self->max_count)
|
||||
{
|
||||
i = self->max_count;
|
||||
self->max_count += 4;
|
||||
p = (tui16 *)g_malloc(sizeof(tui16) * self->max_count, 1);
|
||||
g_memcpy(p, self->items, sizeof(tui16) * i);
|
||||
if (self->items != self->mitems)
|
||||
{
|
||||
g_free(self->items);
|
||||
}
|
||||
self->items = p;
|
||||
}
|
||||
|
||||
self->items[self->count] = item;
|
||||
self->count++;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
tui16
|
||||
list16_get_item(struct list16 *self, int index)
|
||||
{
|
||||
if (index < 0 || index >= self->count)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return self->items[index];
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_clear(struct list16 *self)
|
||||
{
|
||||
if (self->items != self->mitems)
|
||||
{
|
||||
g_free(self->items);
|
||||
}
|
||||
self->count = 0;
|
||||
self->max_count = 4;
|
||||
self->items = self->mitems;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
list16_index_of(struct list16 *self, tui16 item)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < self->count; i++)
|
||||
{
|
||||
if (self->items[i] == item)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_remove_item(struct list16 *self, int index)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (index >= 0 && index < self->count)
|
||||
{
|
||||
for (i = index; i < (self->count - 1); i++)
|
||||
{
|
||||
self->items[i] = self->items[i + 1];
|
||||
}
|
||||
|
||||
self->count--;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
list16_insert_item(struct list16 *self, int index, tui16 item)
|
||||
{
|
||||
tui16 *p;
|
||||
int i;
|
||||
|
||||
if (index == self->count)
|
||||
{
|
||||
list16_add_item(self, item);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index >= 0 && index < self->count)
|
||||
{
|
||||
self->count++;
|
||||
|
||||
if (self->count > self->max_count)
|
||||
{
|
||||
i = self->max_count;
|
||||
self->max_count += 4;
|
||||
p = (tui16 *)g_malloc(sizeof(tui16) * self->max_count, 1);
|
||||
g_memcpy(p, self->items, sizeof(tui16) * i);
|
||||
if (self->items != self->mitems)
|
||||
{
|
||||
g_free(self->items);
|
||||
}
|
||||
self->items = p;
|
||||
}
|
||||
|
||||
for (i = (self->count - 2); i >= index; i--)
|
||||
{
|
||||
self->items[i + 1] = self->items[i];
|
||||
}
|
||||
|
||||
self->items[index] = item;
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* simple list
|
||||
*/
|
||||
|
||||
#if !defined(LIST16_H)
|
||||
#define LIST16_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/* list */
|
||||
struct list16
|
||||
{
|
||||
tui16 *items;
|
||||
int count;
|
||||
int max_count;
|
||||
tui16 mitems[4];
|
||||
};
|
||||
|
||||
struct list16 *
|
||||
list16_create(void);
|
||||
void
|
||||
list16_delete(struct list16 *self);
|
||||
void
|
||||
list16_init(struct list16 *self);
|
||||
void
|
||||
list16_deinit(struct list16 *self);
|
||||
void
|
||||
list16_add_item(struct list16 *self, tui16 item);
|
||||
tui16
|
||||
list16_get_item(struct list16 *self, int index);
|
||||
void
|
||||
list16_clear(struct list16 *self);
|
||||
int
|
||||
list16_index_of(struct list16 *self, tui16 item);
|
||||
void
|
||||
list16_remove_item(struct list16 *self, int index);
|
||||
void
|
||||
list16_insert_item(struct list16 *self, int index, tui16 item);
|
||||
|
||||
#endif
|
||||
1199
common/log.c
1199
common/log.c
File diff suppressed because it is too large
Load Diff
464
common/log.h
464
common/log.h
@ -1,464 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "arch.h"
|
||||
#include "defines.h"
|
||||
#include "list.h"
|
||||
|
||||
/* Check the config_ac.h file is included so we know whether to enable the
|
||||
* development macros
|
||||
*/
|
||||
#ifndef CONFIG_AC_H
|
||||
# error config_ac.h not visible in log.h
|
||||
#endif
|
||||
|
||||
/* logging buffer size */
|
||||
#define LOG_BUFFER_SIZE 8192
|
||||
#define LOGGER_NAME_SIZE 50
|
||||
|
||||
/* logging levels */
|
||||
enum logLevels
|
||||
{
|
||||
LOG_LEVEL_ALWAYS = 0,
|
||||
LOG_LEVEL_ERROR, /* for describing non-recoverable error states in a request or method */
|
||||
LOG_LEVEL_WARNING, /* for describing recoverable error states in a request or method */
|
||||
LOG_LEVEL_INFO, /* for low verbosity and high level descriptions of normal operations */
|
||||
LOG_LEVEL_DEBUG, /* for medium verbosity and low level descriptions of normal operations */
|
||||
LOG_LEVEL_TRACE, /* for high verbosity and low level descriptions of normal operations (eg. method or wire tracing) */
|
||||
LOG_LEVEL_NEVER,
|
||||
};
|
||||
|
||||
/* startup return values */
|
||||
enum logReturns
|
||||
{
|
||||
LOG_STARTUP_OK = 0,
|
||||
LOG_ERROR_MALLOC,
|
||||
LOG_ERROR_NULL_FILE,
|
||||
LOG_ERROR_FILE_OPEN,
|
||||
LOG_ERROR_NO_CFG,
|
||||
LOG_ERROR_FILE_NOT_OPEN,
|
||||
LOG_GENERAL_ERROR
|
||||
};
|
||||
|
||||
#define SESMAN_CFG_LOGGING "Logging"
|
||||
#define SESMAN_CFG_LOGGING_LOGGER "LoggingPerLogger"
|
||||
#define SESMAN_CFG_LOG_FILE "LogFile"
|
||||
#define SESMAN_CFG_LOG_LEVEL "LogLevel"
|
||||
#define SESMAN_CFG_LOG_ENABLE_CONSOLE "EnableConsole"
|
||||
#define SESMAN_CFG_LOG_CONSOLE_LEVEL "ConsoleLevel"
|
||||
#define SESMAN_CFG_LOG_ENABLE_SYSLOG "EnableSyslog"
|
||||
#define SESMAN_CFG_LOG_SYSLOG_LEVEL "SyslogLevel"
|
||||
#define SESMAN_CFG_LOG_ENABLE_PID "EnableProcessId"
|
||||
|
||||
/* enable threading */
|
||||
/*#define LOG_ENABLE_THREAD*/
|
||||
|
||||
#ifdef USE_DEVEL_LOGGING
|
||||
|
||||
#define LOG_PER_LOGGER_LEVEL
|
||||
|
||||
/**
|
||||
* @brief Logging macro for messages that are for an XRDP developer to
|
||||
* understand and debug XRDP code.
|
||||
*
|
||||
* Note: all log levels are relevant to help a developer understand XRDP at
|
||||
* different levels of granularity.
|
||||
*
|
||||
* Note: the logging function calls are removed when USE_DEVEL_LOGGING is
|
||||
* NOT defined.
|
||||
*
|
||||
* Note: when the build is configured with --enable-devel-logging, then
|
||||
* the log level can be configured per the source file name or method name
|
||||
* (with the suffix "()") in the [LoggingPerLogger]
|
||||
* section of the configuration file.
|
||||
*
|
||||
* For example:
|
||||
* ```
|
||||
* [LoggingPerLogger]
|
||||
* xrdp.c=DEBUG
|
||||
* main()=WARNING
|
||||
* ```
|
||||
*
|
||||
* @param lvl, the log level
|
||||
* @param msg, the log text as a printf format c-string
|
||||
* @param ... the arguments for the printf format c-string
|
||||
*/
|
||||
#define LOG_DEVEL(log_level, args...) \
|
||||
log_message_with_location(__func__, __FILE__, __LINE__, log_level, args)
|
||||
|
||||
/**
|
||||
* @brief Logging macro for messages that are for a system administrator to
|
||||
* configure and run XRDP on their machine.
|
||||
*
|
||||
* Note: the logging function calls contain additional code location info when
|
||||
* USE_DEVEL_LOGGING is defined.
|
||||
*
|
||||
* @param lvl, the log level
|
||||
* @param msg, the log text as a printf format c-string
|
||||
* @param ... the arguments for the printf format c-string
|
||||
*/
|
||||
#define LOG(log_level, args...) \
|
||||
log_message_with_location(__func__, __FILE__, __LINE__, log_level, args)
|
||||
|
||||
/**
|
||||
* @brief Logging macro for logging the contents of a byte array using a hex
|
||||
* dump format.
|
||||
*
|
||||
* Note: the logging function calls are removed when USE_DEVEL_LOGGING is
|
||||
* NOT defined.
|
||||
*
|
||||
* @param log_level, the log level
|
||||
* @param message, a message prefix for the hex dump. Note: no printf like
|
||||
* formatting is done to this message.
|
||||
* @param buffer, a pointer to the byte array to log as a hex dump
|
||||
* @param length, the length of the byte array to log
|
||||
*/
|
||||
#define LOG_DEVEL_HEXDUMP(log_level, message, buffer, length) \
|
||||
log_hexdump_with_location(__func__, __FILE__, __LINE__, log_level, message, buffer, length)
|
||||
|
||||
/**
|
||||
* @brief Logging macro for logging the contents of a byte array using a hex
|
||||
* dump format.
|
||||
*
|
||||
* @param log_level, the log level
|
||||
* @param message, a message prefix for the hex dump. Note: no printf like
|
||||
* formatting is done to this message.
|
||||
* @param buffer, a pointer to the byte array to log as a hex dump
|
||||
* @param length, the length of the byte array to log
|
||||
*/
|
||||
#define LOG_HEXDUMP(log_level, message, buffer, length) \
|
||||
log_hexdump_with_location(__func__, __FILE__, __LINE__, log_level, message, buffer, length)
|
||||
|
||||
#define LOG_DEVEL_LEAKING_FDS(exe,min,max) log_devel_leaking_fds(exe,min,max)
|
||||
|
||||
#else
|
||||
#define LOG(log_level, args...) log_message(log_level, args)
|
||||
#define LOG_HEXDUMP(log_level, message, buffer, length) \
|
||||
log_hexdump(log_level, message, buffer, length)
|
||||
|
||||
/* Since log_message() returns a value ensure that the elided versions of
|
||||
* LOG_DEVEL and LOG_DEVEL_HEXDUMP also "fake" returning the success value
|
||||
*/
|
||||
#define LOG_DEVEL(log_level, args...) UNUSED_VAR(LOG_STARTUP_OK)
|
||||
#define LOG_DEVEL_HEXDUMP(log_level, message, buffer, length) UNUSED_VAR(LOG_STARTUP_OK)
|
||||
|
||||
#define LOG_DEVEL_LEAKING_FDS(exe,min,max)
|
||||
#endif
|
||||
|
||||
/* Flags values for log_start() */
|
||||
|
||||
/**
|
||||
* Dump the log config on startup
|
||||
*/
|
||||
#define LOG_START_DUMP_CONFIG (1<<0)
|
||||
|
||||
/**
|
||||
* Restart the logging system.
|
||||
*
|
||||
* On a restart, existing files are not closed. This is because the
|
||||
* files may be shared by sub-processes, and the result will not be what the
|
||||
* user expects
|
||||
*/
|
||||
#define LOG_START_RESTART (1<<1)
|
||||
|
||||
#ifdef LOG_PER_LOGGER_LEVEL
|
||||
enum log_logger_type
|
||||
{
|
||||
LOG_TYPE_FILE = 0,
|
||||
LOG_TYPE_FUNCTION,
|
||||
};
|
||||
|
||||
struct log_logger_level
|
||||
{
|
||||
enum logLevels log_level;
|
||||
enum log_logger_type logger_type;
|
||||
char logger_name[LOGGER_NAME_SIZE + 1];
|
||||
};
|
||||
#endif
|
||||
|
||||
struct log_config
|
||||
{
|
||||
const char *program_name; /* Pointer to static storage */
|
||||
char *log_file; /* Dynamically allocated */
|
||||
int fd;
|
||||
enum logLevels log_level;
|
||||
int enable_console;
|
||||
enum logLevels console_level;
|
||||
int enable_syslog;
|
||||
enum logLevels syslog_level;
|
||||
#ifdef LOG_PER_LOGGER_LEVEL
|
||||
struct list *per_logger_level;
|
||||
#endif
|
||||
int dump_on_start;
|
||||
int enable_pid;
|
||||
#ifdef LOG_ENABLE_THREAD
|
||||
pthread_mutex_t log_lock;
|
||||
pthread_mutexattr_t log_lock_attr;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* internal functions, only used in log.c if this ifdef is defined.*/
|
||||
#ifdef LOGINTERNALSTUFF
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Starts the logging subsystem
|
||||
* @param l_cfg logging system configuration
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
enum logReturns
|
||||
internal_log_start(struct log_config *l_cfg);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Shuts down the logging subsystem
|
||||
* @param l_cfg pointer to the logging subsystem to stop
|
||||
*
|
||||
*/
|
||||
enum logReturns
|
||||
internal_log_end(struct log_config *l_cfg);
|
||||
|
||||
/**
|
||||
* Converts a log level to a string
|
||||
* @param lvl, the loglevel
|
||||
* @param str pointer where the string will be stored.
|
||||
*/
|
||||
void
|
||||
internal_log_lvl2str(const enum logLevels lvl, char *str);
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Converts a string to a log level
|
||||
* @param s The string to convert
|
||||
* @return The corresponding level or LOG_LEVEL_DEBUG if error
|
||||
*
|
||||
*/
|
||||
enum logLevels
|
||||
internal_log_text2level(const char *buf);
|
||||
|
||||
/**
|
||||
* A function that init our struct that holds all state and
|
||||
* also init its content.
|
||||
* @return LOG_STARTUP_OK or LOG_ERROR_MALLOC
|
||||
*/
|
||||
struct log_config *
|
||||
internalInitAndAllocStruct(void);
|
||||
|
||||
/**
|
||||
* Print the contents of the logging config to stdout.
|
||||
*/
|
||||
void
|
||||
internal_log_config_dump(struct log_config *config);
|
||||
|
||||
/**
|
||||
* the log function that all files use to log an event.
|
||||
* @param lvl, the loglevel
|
||||
* @param override_destination_level, if true then the destination log level is not used
|
||||
* @param override_log_level, the loglevel instead of the destination log level if override_destination_level is true
|
||||
* @param msg, the logtext.
|
||||
* @param ap, the values for the message format arguments
|
||||
* @return
|
||||
*/
|
||||
enum logReturns
|
||||
internal_log_message(const enum logLevels lvl,
|
||||
const bool_t override_destination_level,
|
||||
const enum logLevels override_log_level,
|
||||
const char *msg,
|
||||
va_list ap);
|
||||
|
||||
/**
|
||||
* @param log_level, the log level
|
||||
* @param override_destination_level, if true then the destination log level is ignored.
|
||||
* @param override_log_level, the log level to use instead of the destination log level
|
||||
* if override_destination_level is true
|
||||
* @return true if at least one log destination will accept a message logged at the given level.
|
||||
*/
|
||||
bool_t
|
||||
internal_log_is_enabled_for_level(const enum logLevels log_level,
|
||||
const bool_t override_destination_level,
|
||||
const enum logLevels override_log_level);
|
||||
|
||||
/**
|
||||
* @param function_name, the function name (typically the __func__ macro)
|
||||
* @param file_name, the file name (typically the __FILE__ macro)
|
||||
* @param[out] log_level_return, the log level to use instead of the destination log level
|
||||
* @return true if the logger location overrides the destination log levels
|
||||
*/
|
||||
bool_t
|
||||
internal_log_location_overrides_level(const char *function_name,
|
||||
const char *file_name,
|
||||
enum logLevels *log_level_return);
|
||||
|
||||
/*End of internal functions*/
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function initialize the log facilities according to the configuration
|
||||
* file, that is described by the in parameter.
|
||||
* @param iniFile
|
||||
* @param applicationName the name that is used in the log for the running
|
||||
* application
|
||||
* @param flags Flags to affect the operation of the call
|
||||
* @return LOG_STARTUP_OK on success
|
||||
*/
|
||||
enum logReturns
|
||||
log_start(const char *iniFile, const char *applicationName,
|
||||
unsigned int flags);
|
||||
|
||||
/**
|
||||
* An alternative log_start where the caller gives the params directly.
|
||||
* @param config
|
||||
* @return
|
||||
*
|
||||
* @post to avoid memory leaks, the config argument must be free'ed using
|
||||
* `log_config_free()`
|
||||
*/
|
||||
enum logReturns
|
||||
log_start_from_param(const struct log_config *src_log_config);
|
||||
|
||||
/**
|
||||
* Sets up a suitable log config for writing to the console only
|
||||
* (i.e. for a utility)
|
||||
*
|
||||
* The config can be customised by the caller before calling
|
||||
* log_start_from_param()
|
||||
*
|
||||
* @param Default log level
|
||||
* @param Log level name, or NULL. This can be used to provide an
|
||||
* override to the default log level, by environment variable or
|
||||
* argument.
|
||||
*
|
||||
* @return pointer to struct log_config.
|
||||
*/
|
||||
struct log_config *
|
||||
log_config_init_for_console(enum logLevels lvl, const char *override_name);
|
||||
|
||||
/**
|
||||
* Read configuration from a file and store the values in the returned
|
||||
* log_config.
|
||||
* @param file
|
||||
* @param applicationName, the application name used in the log events.
|
||||
* @param section_prefix, prefix for the logging sections to parse
|
||||
* @return
|
||||
*/
|
||||
struct log_config *
|
||||
log_config_init_from_config(const char *iniFilename,
|
||||
const char *applicationName,
|
||||
const char *section_prefix);
|
||||
|
||||
/**
|
||||
* Free the memory for the log_config struct.
|
||||
*/
|
||||
enum logReturns
|
||||
log_config_free(struct log_config *config);
|
||||
|
||||
/**
|
||||
* Function that terminates all logging
|
||||
* @return
|
||||
*/
|
||||
enum logReturns
|
||||
log_end(void);
|
||||
|
||||
/**
|
||||
* the log function that all files use to log an event.
|
||||
*
|
||||
* Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly.
|
||||
*
|
||||
* @param lvl, the loglevel
|
||||
* @param msg, the logtext.
|
||||
* @param ...
|
||||
* @return
|
||||
*/
|
||||
enum logReturns
|
||||
log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3);
|
||||
|
||||
enum logReturns
|
||||
log_hexdump(const enum logLevels log_level,
|
||||
const char *msg,
|
||||
const char *p,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* the log function that all files use to log an event,
|
||||
* with the function name and file line.
|
||||
*
|
||||
* Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly.
|
||||
*
|
||||
* @param function_name, the function name (typically the __func__ macro)
|
||||
* @param file_name, the file name (typically the __FILE__ macro)
|
||||
* @param line_number, the line number in the file (typically the __LINE__ macro)
|
||||
* @param lvl, the loglevel
|
||||
* @param msg, the logtext.
|
||||
* @param ...
|
||||
* @return
|
||||
*/
|
||||
enum logReturns
|
||||
log_message_with_location(const char *function_name,
|
||||
const char *file_name,
|
||||
const int line_number,
|
||||
const enum logLevels lvl,
|
||||
const char *msg,
|
||||
...) printflike(5, 6);
|
||||
|
||||
enum logReturns
|
||||
log_hexdump_with_location(const char *function_name,
|
||||
const char *file_name,
|
||||
const int line_number,
|
||||
const enum logLevels log_level,
|
||||
const char *msg,
|
||||
const char *p,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* This function returns the configured file name for the logfile
|
||||
* @param replybuf the buffer where the reply is stored
|
||||
* @param bufsize how big is the reply buffer.
|
||||
* @return
|
||||
*/
|
||||
char *getLogFile(char *replybuf, int bufsize);
|
||||
|
||||
/**
|
||||
* Returns formatted datetime for log
|
||||
* @return
|
||||
*/
|
||||
char *getFormattedDateTime(char *replybuf, int bufsize);
|
||||
|
||||
#ifdef USE_DEVEL_LOGGING
|
||||
/**
|
||||
* Log open file descriptors not cloexec before execing another program
|
||||
*
|
||||
* Used to ensure file descriptors aren't leaking when running
|
||||
* non-privileged executables
|
||||
*
|
||||
* Use the LOG_DEVEL_LEAKING_FDS() macro to invoke this function
|
||||
*
|
||||
* @param exe Executable we're about to launch
|
||||
* @param min Minimum FD to consider
|
||||
* @param max Maximum FD to consider + 1, or -1 for no upper FD
|
||||
*/
|
||||
void
|
||||
log_devel_leaking_fds(const char *exe, int min, int max);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-ERREF : Definitions from [MS-ERREF]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-ERREF are currently correct for v20180912 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_ERREF_H)
|
||||
#define MS_ERREF_H
|
||||
|
||||
/*
|
||||
* NTSTATUS codes (section 2.3)
|
||||
*/
|
||||
enum NTSTATUS
|
||||
{
|
||||
STATUS_SUCCESS = 0x00000000,
|
||||
|
||||
STATUS_NO_MORE_FILES = 0x80000006,
|
||||
|
||||
STATUS_UNSUCCESSFUL = 0xc0000001,
|
||||
STATUS_NO_SUCH_FILE = 0xc000000f,
|
||||
STATUS_ACCESS_DENIED = 0xc0000022,
|
||||
STATUS_OBJECT_NAME_INVALID = 0xc0000033,
|
||||
STATUS_OBJECT_NAME_NOT_FOUND = 0xc0000034,
|
||||
STATUS_SHARING_VIOLATION = 0xc0000043,
|
||||
STATUS_NOT_SUPPORTED = 0xc00000bb
|
||||
};
|
||||
|
||||
#endif /* MS_ERREF_H */
|
||||
@ -1,64 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-FSCC : Definitions from [MS-FSCC]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-FSCC are currently correct for v20190923 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_FSCC_H)
|
||||
#define MS_FSCC_H
|
||||
|
||||
/*
|
||||
* File system ioctl codes (section 2.3)
|
||||
*/
|
||||
#define FSCTL_DELETE_OBJECT_ID 0x900a0
|
||||
|
||||
/*
|
||||
* File information classes (section 2.4)
|
||||
*/
|
||||
enum FS_INFORMATION_CLASS
|
||||
{
|
||||
FileAllocationInformation = 19, /* Set */
|
||||
FileBasicInformation = 4, /* Query, Set */
|
||||
FileBothDirectoryInformation = 3, /* Query */
|
||||
FileDirectoryInformation = 1, /* Query */
|
||||
FileDispositionInformation = 13, /* Set */
|
||||
FileEndOfFileInformation = 20, /* Set */
|
||||
FileFullDirectoryInformation = 2, /* Query */
|
||||
FileNamesInformation = 12, /* Query */
|
||||
FileRenameInformation = 10, /* Set */
|
||||
FileStandardInformation = 5 /* Query */
|
||||
};
|
||||
|
||||
/*
|
||||
* Size of structs above without trailing RESERVED fields (MS-RDPEFS
|
||||
* 2.2.3.3.8)
|
||||
*/
|
||||
#define FILE_BASIC_INFORMATION_SIZE 36
|
||||
#define FILE_STD_INFORMATION_SIZE 22
|
||||
#define FILE_END_OF_FILE_INFORMATION_SIZE 8
|
||||
|
||||
/* Windows file attributes (section 2.6) */
|
||||
#define W_FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define W_FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define W_FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define W_FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
|
||||
#endif /* MS_FSCC_H */
|
||||
|
||||
|
||||
|
||||
@ -1,593 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPBCGR : Definitions from [MS-RDPBCGR]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPBCGR are currently correct for v20190923 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPBCGR_H)
|
||||
#define MS_RDPBCGR_H
|
||||
|
||||
/* RDP Security Negotiation codes */
|
||||
#define RDP_NEG_REQ 0x01 /* MS-RDPBCGR 2.2.1.1.1 */
|
||||
#define RDP_NEG_RSP 0x02 /* MS-RDPBCGR 2.2.1.2.1 */
|
||||
#define RDP_NEG_FAILURE 0x03 /* MS-RDPBCGR 2.2.1.2.2 */
|
||||
#define RDP_CORRELATION_INFO 0x06 /* MS-RDPBCGR 2.2.1.1.2 */
|
||||
|
||||
/* Protocol types codes (2.2.1.1.1, 2.2.1.2.1) */
|
||||
#define PROTOCOL_RDP 0x00000000
|
||||
#define PROTOCOL_SSL 0x00000001
|
||||
#define PROTOCOL_HYBRID 0x00000002
|
||||
#define PROTOCOL_RDSTLS 0x00000004
|
||||
#define PROTOCOL_HYBRID_EX 0x00000008
|
||||
|
||||
/* Negotiation packet flags (2.2.1.2.1) */
|
||||
#define EXTENDED_CLIENT_DATA_SUPPORTED 0x01
|
||||
#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02
|
||||
#define NEGRSP_RESERVED 0x04
|
||||
#define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08
|
||||
#define REDIRECTED_AUTHENTICATION_MODE_SUPPORTED 0x10
|
||||
|
||||
/* RDP Negotiation Failure Codes (2.2.1.2.2) */
|
||||
#define SSL_REQUIRED_BY_SERVER 0x00000001
|
||||
#define SSL_NOT_ALLOWED_BY_SERVER 0x00000002
|
||||
#define SSL_CERT_NOT_ON_SERVER 0x00000003
|
||||
#define INCONSISTENT_FLAGS 0x00000004
|
||||
#define HYBRID_REQUIRED_BY_SERVER 0x00000005
|
||||
#define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER 0x00000006
|
||||
|
||||
/* TS_UD_HEADER: type ((2.2.1.3.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define SEC_TAG_CLI_INFO 0xc001 /* CS_CORE? */
|
||||
#define SEC_TAG_CLI_CRYPT 0xc002 /* CS_SECURITY? */
|
||||
#define SEC_TAG_CLI_CHANNELS 0xc003 /* CS_CHANNELS? */
|
||||
#define SEC_TAG_CLI_4 0xc004 /* CS_CLUSTER? */
|
||||
#define SEC_TAG_CLI_MONITOR 0xc005 /* CS_MONITOR */
|
||||
#define SEC_TAG_CLI_MONITOR_EX 0xc008 /* CS_MONITOR_EX */
|
||||
|
||||
/* Client Core Data: colorDepth, postBeta2ColorDepth (2.2.1.3.2) */
|
||||
#define RNS_UD_COLOR_4BPP 0xCA00
|
||||
#define RNS_UD_COLOR_8BPP 0xCA01
|
||||
#define RNS_UD_COLOR_16BPP_555 0xCA02
|
||||
#define RNS_UD_COLOR_16BPP_565 0xCA03
|
||||
#define RNS_UD_COLOR_24BPP 0xCA04
|
||||
|
||||
/* Client Core Data: supportedColorDepths (2.2.1.3.2) */
|
||||
#define RNS_UD_24BPP_SUPPORT 0x0001
|
||||
#define RNS_UD_16BPP_SUPPORT 0x0002
|
||||
#define RNS_UD_15BPP_SUPPORT 0x0004
|
||||
#define RNS_UD_32BPP_SUPPORT 0x0008
|
||||
|
||||
/* Client Core Data: earlyCapabilityFlags (2.2.1.3.2) */
|
||||
#define RNS_UD_CS_WANT_32BPP_SESSION 0x0002
|
||||
#define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040
|
||||
#define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100
|
||||
|
||||
/* Client Core Data: connectionType (2.2.1.3.2) */
|
||||
#define CONNECTION_TYPE_MODEM 0x01
|
||||
#define CONNECTION_TYPE_BROADBAND_LOW 0x02
|
||||
#define CONNECTION_TYPE_SATELLITE 0x03
|
||||
#define CONNECTION_TYPE_BROADBAND_HIGH 0x04
|
||||
#define CONNECTION_TYPE_WAN 0x05
|
||||
#define CONNECTION_TYPE_LAN 0x06
|
||||
#define CONNECTION_TYPE_AUTODETECT 0x07
|
||||
|
||||
/* TS_UD_CS_NET (2.2.1.3.4) */
|
||||
/* This isn't explicitly named in MS-RDPBCGR */
|
||||
#define MAX_STATIC_CHANNELS 31
|
||||
|
||||
/* Channel definition structure CHANNEL_DEF (2.2.1.3.4.1) */
|
||||
#define CHANNEL_NAME_LEN 7
|
||||
/* These names are also not explicitly defined in MS-RDPBCGR */
|
||||
#define CLIPRDR_SVC_CHANNEL_NAME "cliprdr"
|
||||
#define DRDYNVC_SVC_CHANNEL_NAME "drdynvc"
|
||||
#define RAIL_SVC_CHANNEL_NAME "rail"
|
||||
#define RDPSND_SVC_CHANNEL_NAME "rdpsnd"
|
||||
#define RDPDR_SVC_CHANNEL_NAME "rdpdr"
|
||||
|
||||
/* 2.2.1.3.6 Client Monitor Data */
|
||||
/* monitorCount (4 bytes): A 32-bit, unsigned integer. The number of display */
|
||||
/* monitor definitions in the monitorDefArray field (the maximum allowed is 16). */
|
||||
#define CLIENT_MONITOR_DATA_MAXIMUM_MONITORS 16
|
||||
|
||||
/* 2.2.1.3.6 Client Monitor Data */
|
||||
/* The maximum width of the virtual desktop resulting from the union of the monitors */
|
||||
/* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. Similarly, */
|
||||
/* the maximum height of the virtual desktop resulting from the union of the monitors */
|
||||
/* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. */
|
||||
/* The minimum permitted size of the virtual desktop is 200 x 200 pixels. */
|
||||
#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_WIDTH 0xC8 // 200
|
||||
#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_HEIGHT 0xC8 // 200
|
||||
#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH 0x7FFE // 32766
|
||||
#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT 0x7FFE // 32766
|
||||
|
||||
/* 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */
|
||||
#define TS_MONITOR_PRIMARY 0x00000001
|
||||
|
||||
/* Options field */
|
||||
/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */
|
||||
#define XR_CHANNEL_OPTION_INITIALIZED 0x80000000
|
||||
#define XR_CHANNEL_OPTION_ENCRYPT_RDP 0x40000000
|
||||
#define XR_CHANNEL_OPTION_ENCRYPT_SC 0x20000000
|
||||
#define XR_CHANNEL_OPTION_ENCRYPT_CS 0x10000000
|
||||
#define XR_CHANNEL_OPTION_PRI_HIGH 0x08000000
|
||||
#define XR_CHANNEL_OPTION_PRI_MED 0x04000000
|
||||
#define XR_CHANNEL_OPTION_PRI_LOW 0x02000000
|
||||
#define XR_CHANNEL_OPTION_COMPRESS_RDP 0x00800000
|
||||
#define XR_CHANNEL_OPTION_COMPRESS 0x00400000
|
||||
#define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000
|
||||
#define REMOTE_CONTROL_PERSISTENT 0x00100000
|
||||
|
||||
/* Server Proprietary Certificate (2.2.1.4.3.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define SEC_TAG_PUBKEY 0x0006 /* BB_RSA_KEY_BLOB */
|
||||
#define SEC_TAG_KEYSIG 0x0008 /* BB_SIGNATURE_KEY_BLOB */
|
||||
|
||||
/* Info Packet (TS_INFO_PACKET): flags (2.2.1.11.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_LOGON_AUTO 0x0008
|
||||
#define RDP_LOGON_NORMAL 0x0033
|
||||
#define RDP_COMPRESSION 0x0080
|
||||
#define RDP_LOGON_BLOB 0x0100
|
||||
#define RDP_LOGON_LEAVE_AUDIO 0x2000
|
||||
#define RDP_LOGON_RAIL 0x8000
|
||||
|
||||
/* Extended Info Packet: clientAddress (2.2.1.11.1.1.1) */
|
||||
#define EXTENDED_INFO_MAX_CLIENT_ADDR_LENGTH 80
|
||||
|
||||
/* Extended Info Packet: performanceFlags (2.2.1.11.1.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP5_DISABLE_NOTHING 0x00
|
||||
#define RDP5_NO_WALLPAPER 0x01
|
||||
#define RDP5_NO_FULLWINDOWDRAG 0x02
|
||||
#define RDP5_NO_MENUANIMATIONS 0x04
|
||||
#define RDP5_NO_THEMING 0x08
|
||||
#define RDP5_NO_CURSOR_SHADOW 0x20
|
||||
#define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */
|
||||
|
||||
/* LICENSE_BINARY_BLOB (2.2.1.12.1.2) */
|
||||
#define LICENCE_TAG_USER 0x000f /* BB_CLIENT_USER_NAME_BLOB */
|
||||
#define LICENCE_TAG_HOST 0x0010 /* BB_CLIENT_MACHINE_NAME_BLOB */
|
||||
|
||||
/* Maps to generalCapabilitySet in T.128 page 138 */
|
||||
|
||||
/* Capability Set: capabilitySetType (2.2.1.13.1.1.1) */
|
||||
#define CAPSTYPE_GENERAL 0x0001
|
||||
#define CAPSTYPE_GENERAL_LEN 0x18
|
||||
|
||||
#define CAPSTYPE_BITMAP 0x0002
|
||||
#define CAPSTYPE_BITMAP_LEN 0x1C
|
||||
|
||||
#define CAPSTYPE_ORDER 0x0003
|
||||
#define CAPSTYPE_ORDER_LEN 0x58
|
||||
#define ORDER_CAP_NEGOTIATE 2 /* NEGOTIATEORDERSUPPORT? not used */
|
||||
#define ORDER_CAP_NOSUPPORT 4 /* not used */
|
||||
|
||||
#define CAPSTYPE_BITMAPCACHE 0x0004
|
||||
#define CAPSTYPE_BITMAPCACHE_LEN 0x28
|
||||
|
||||
#define CAPSTYPE_CONTROL 0x0005
|
||||
#define CAPSTYPE_CONTROL_LEN 0x0C
|
||||
|
||||
#define CAPSTYPE_ACTIVATION 0x0007
|
||||
#define CAPSTYPE_ACTIVATION_LEN 0x0C
|
||||
|
||||
#define CAPSTYPE_POINTER 0x0008
|
||||
#define CAPSTYPE_POINTER_LEN 0x0a
|
||||
#define CAPSTYPE_POINTER_MONO_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_SHARE 0x0009
|
||||
#define CAPSTYPE_SHARE_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_COLORCACHE 0x000A
|
||||
#define CAPSTYPE_COLORCACHE_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_SOUND 0x000C
|
||||
|
||||
#define CAPSTYPE_INPUT 0x000D
|
||||
#define CAPSTYPE_INPUT_LEN 0x58
|
||||
|
||||
#define CAPSTYPE_FONT 0x000E
|
||||
#define CAPSTYPE_FONT_LEN 0x04
|
||||
|
||||
#define CAPSTYPE_BRUSH 0x000F
|
||||
#define CAPSTYPE_BRUSH_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_GLYPHCACHE 0x0010
|
||||
#define CAPSTYPE_OFFSCREENCACHE 0x0011
|
||||
|
||||
#define CAPSTYPE_BITMAPCACHE_HOSTSUPPORT 0x0012
|
||||
#define CAPSTYPE_BITMAPCACHE_HOSTSUPPORT_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_BITMAPCACHE_REV2 0x0013
|
||||
#define CAPSTYPE_BITMAPCACHE_REV2_LEN 0x28
|
||||
#define BMPCACHE2_FLAG_PERSIST ((long)1<<31)
|
||||
|
||||
#define CAPSTYPE_VIRTUALCHANNEL 0x0014
|
||||
#define CAPSTYPE_VIRTUALCHANNEL_LEN 0x08
|
||||
|
||||
#define CAPSTYPE_DRAWNINGRIDCACHE 0x0015
|
||||
#define CAPSTYPE_DRAWGDIPLUS 0x0016
|
||||
#define CAPSTYPE_RAIL 0x0017
|
||||
#define CAPSTYPE_WINDOW 0x0018
|
||||
|
||||
#define CAPSSETTYPE_COMPDESK 0x0019
|
||||
#define CAPSSETTYPE_COMPDESK_LEN 0x06
|
||||
|
||||
#define CAPSSETTYPE_MULTIFRAGMENTUPDATE 0x001A
|
||||
#define CAPSSETTYPE_MULTIFRAGMENTUPDATE_LEN 0x08
|
||||
|
||||
#define CAPSETTYPE_LARGE_POINTER 0x001B
|
||||
#define CAPSETTYPE_LARGE_POINTER_LEN 0x06
|
||||
|
||||
#define CAPSETTYPE_SURFACE_COMMANDS 0x001C
|
||||
#define CAPSETTYPE_SURFACE_COMMANDS_LEN 0x0C
|
||||
|
||||
#define CAPSSETTYPE_BITMAP_CODECS 0x001D
|
||||
#define CAPSSETTYPE_BITMAP_CODECS_LEN 0x1C
|
||||
|
||||
#define CAPSTYPE_FRAME_ACKNOWLEDGE 0x001E
|
||||
#define CAPSTYPE_FRAME_ACKNOWLEDGE_LEN 0x08
|
||||
|
||||
/* Control PDU Data: action (2.2.1.15.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_CTL_REQUEST_CONTROL 1 /* CTRLACTION_REQUEST_CONTROL */
|
||||
#define RDP_CTL_GRANT_CONTROL 2
|
||||
#define RDP_CTL_DETACH 3
|
||||
#define RDP_CTL_COOPERATE 4
|
||||
|
||||
/* RDP5 disconnect PDU */
|
||||
/* Set Error Info PDU Data: errorInfo (2.2.5.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define exDiscReasonNoInfo 0x0000
|
||||
#define exDiscReasonAPIInitiatedDisconnect 0x0001
|
||||
#define exDiscReasonAPIInitiatedLogoff 0x0002
|
||||
#define exDiscReasonServerIdleTimeout 0x0003
|
||||
#define exDiscReasonServerLogonTimeout 0x0004
|
||||
#define exDiscReasonReplacedByOtherConnection 0x0005
|
||||
#define exDiscReasonOutOfMemory 0x0006
|
||||
#define exDiscReasonServerDeniedConnection 0x0007
|
||||
#define exDiscReasonServerDeniedConnectionFips 0x0008
|
||||
#define exDiscReasonLicenseInternal 0x0100
|
||||
#define exDiscReasonLicenseNoLicenseServer 0x0101
|
||||
#define exDiscReasonLicenseNoLicense 0x0102
|
||||
#define exDiscReasonLicenseErrClientMsg 0x0103
|
||||
#define exDiscReasonLicenseHwidDoesntMatchLicense 0x0104
|
||||
#define exDiscReasonLicenseErrClientLicense 0x0105
|
||||
#define exDiscReasonLicenseCantFinishProtocol 0x0106
|
||||
#define exDiscReasonLicenseClientEndedProtocol 0x0107
|
||||
#define exDiscReasonLicenseErrClientEncryption 0x0108
|
||||
#define exDiscReasonLicenseCantUpgradeLicense 0x0109
|
||||
#define exDiscReasonLicenseNoRemoteConnections 0x010a
|
||||
|
||||
/* Virtual channel PDU (2.2.6.1) */
|
||||
#define CHANNEL_CHUNK_LENGTH 1600
|
||||
|
||||
/* Channel PDU Header flags (2.2.6.1.1) */
|
||||
/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */
|
||||
#define XR_CHANNEL_FLAG_FIRST 0x00000001
|
||||
#define XR_CHANNEL_FLAG_LAST 0x00000002
|
||||
#define XR_CHANNEL_FLAG_SHOW_PROTOCOL 0x00000010
|
||||
|
||||
/* General Capability Set: osMajorType (2.2.7.1.1) */
|
||||
#define OSMAJORTYPE_UNSPECIFIED 0x0000
|
||||
#define OSMAJORTYPE_WINDOWS 0x0001
|
||||
#define OSMAJORTYPE_OS2 0x0002
|
||||
#define OSMAJORTYPE_MACINTOSH 0x0003
|
||||
#define OSMAJORTYPE_UNIX 0x0004
|
||||
#define OSMAJORTYPE_IOS 0x0005
|
||||
#define OSMAJORTYPE_OSX 0x0006
|
||||
#define OSMAJORTYPE_ANDROID 0x0007
|
||||
#define OSMAJORTYPE_CHROME_OS 0x0008
|
||||
|
||||
/* General Capability Set: osMinorType (2.2.7.1.1) */
|
||||
#define OSMINORTYPE_UNSPECIFIED 0x0000
|
||||
#define OSMINORTYPE_WINDOWS_31X 0x0001
|
||||
#define OSMINORTYPE_WINDOWS_95 0x0002
|
||||
#define OSMINORTYPE_WINDOWS_NT 0x0003
|
||||
#define OSMINORTYPE_OS2_V21 0x0004
|
||||
#define OSMINORTYPE_POWER_PC 0x0005
|
||||
#define OSMINORTYPE_MACINTOSH 0x0006
|
||||
#define OSMINORTYPE_NATIVE_XSERVER 0x0007
|
||||
#define OSMINORTYPE_PSEUDO_XSERVER 0x0008
|
||||
#define OSMINORTYPE_WINDOWS_RT 0x0009
|
||||
|
||||
/* General Capability Set: protocolVersion (2.2.7.1.1) */
|
||||
#define TS_CAPS_PROTOCOLVERSION 0x0200
|
||||
|
||||
/* General Capability Set: extraFlags (2.2.7.1.1) */
|
||||
#define FASTPATH_OUTPUT_SUPPORTED 0x0001
|
||||
#define NO_BITMAP_COMPRESSION_HDR 0x0400
|
||||
#define LONG_CREDENTIALS_SUPPORTED 0x0004
|
||||
#define AUTORECONNECT_SUPPORTED 0x0008
|
||||
#define ENC_SALTED_CHECKSUM 0x0010
|
||||
|
||||
/* Order Capability Set: orderSupportExFlags (2.2.7.1.3) */
|
||||
/* NOTE: XR_ prefixed to avoid conflict with FreeRDP */
|
||||
#define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT 0x0002
|
||||
#define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004
|
||||
|
||||
/* Order Capability Set: orderFlags (2.2.7.1.3) */
|
||||
#define NEGOTIATEORDERSUPPORT 0x0002
|
||||
#define ZEROBOUNDSDELTASUPPORT 0x0008
|
||||
#define COLORINDEXSUPPORT 0x0020
|
||||
#define SOLIDPATTERNBRUSHONLY 0x0040
|
||||
#define ORDERFLAGS_EXTRA_FLAGS 0x0080
|
||||
|
||||
/* Order Capability Set: orderSupport (2.2.7.1.3) */
|
||||
#define TS_NEG_DSTBLT_INDEX 0x00
|
||||
#define TS_NEG_PATBLT_INDEX 0x01
|
||||
#define TS_NEG_SCRBLT_INDEX 0x02
|
||||
#define TS_NEG_MEMBLT_INDEX 0x03
|
||||
#define TS_NEG_MEM3BLT_INDEX 0x04
|
||||
/* 0x05 */
|
||||
/* 0x06 */
|
||||
#define TS_NEG_DRAWNINEGRID_INDEX 0x07
|
||||
#define TS_NEG_LINETO_INDEX 0x08
|
||||
#define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x09
|
||||
/* 0x0A */
|
||||
#define TS_NEG_SAVEBITMAP_INDEX 0x0B
|
||||
/* 0x0C */
|
||||
/* 0x0D */
|
||||
/* 0x0E */
|
||||
#define TS_NEG_MULTIDSTBLT_INDEX 0x0F
|
||||
#define TS_NEG_MULTIPATBLT_INDEX 0x10
|
||||
#define TS_NEG_MULTISCRBLT_INDEX 0x11
|
||||
#define TS_NEG_MULTIOPAQUERECT_INDEX 0x12
|
||||
#define TS_NEG_FAST_INDEX_INDEX 0x13
|
||||
#define TS_NEG_POLYGON_SC_INDEX 0x14
|
||||
#define TS_NEG_POLYGON_CB_INDEX 0x15
|
||||
#define TS_NEG_POLYLINE_INDEX 0x16
|
||||
/* 0x17 */
|
||||
#define TS_NEG_FAST_GLYPH_INDEX 0x18
|
||||
#define TS_NEG_ELLIPSE_SC_INDEX 0x19
|
||||
#define TS_NEG_ELLIPSE_CB_INDEX 0x1A
|
||||
#define TS_NEG_INDEX_INDEX 0x1B
|
||||
/* 0x1C */
|
||||
/* 0x1D */
|
||||
/* 0x1E */
|
||||
/* 0x1F */
|
||||
|
||||
/* Input Capability Set: inputFlags (2.2.7.1.6) */
|
||||
#define INPUT_FLAG_SCANCODES 0x0001
|
||||
#define INPUT_FLAG_MOUSEX 0x0004
|
||||
#define INPUT_FLAG_FASTPATH_INPUT 0x0008
|
||||
#define INPUT_FLAG_UNICODE 0x0010
|
||||
#define INPUT_FLAG_FASTPATH_INPUT2 0x0020
|
||||
#define INPUT_FLAG_UNUSED1 0x0040
|
||||
#define INPUT_FLAG_UNUSED2 0x0080
|
||||
#define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100
|
||||
#define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200
|
||||
|
||||
/* Glyph Cache Capability Set: GlyphSupportLevel (2.2.7.1.8) */
|
||||
#define GLYPH_SUPPORT_NONE 0x0000
|
||||
#define GLYPH_SUPPORT_PARTIAL 0x0001
|
||||
#define GLYPH_SUPPORT_FULL 0x0002
|
||||
#define GLYPH_SUPPORT_ENCODE 0x0003
|
||||
|
||||
/* Desktop Composition Capability Set: CompDeskSupportLevel (2.2.7.2.8) */
|
||||
#define COMPDESK_NOT_SUPPORTED 0x0000
|
||||
#define COMPDESK_SUPPORTED 0x0001
|
||||
|
||||
/* Surface Commands Capability Set: cmdFlags (2.2.7.2.9) */
|
||||
#define SURFCMDS_SETSURFACEBITS 0x00000002
|
||||
#define SURFCMDS_FRAMEMARKER 0x00000010
|
||||
#define SURFCMDS_STREAMSUFRACEBITS 0x00000040
|
||||
|
||||
/* Bitmap Codec: codecGUID (2.2.7.2.10.1.1) */
|
||||
|
||||
/* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589F-AE2D1A87E2D6 */
|
||||
#define XR_CODEC_GUID_NSCODEC \
|
||||
"\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6"
|
||||
|
||||
/* CODEC_GUID_REMOTEFX 76772F12-BD72-4463-AFB3-B73C9C6F7886 */
|
||||
#define XR_CODEC_GUID_REMOTEFX \
|
||||
"\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86"
|
||||
|
||||
/* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */
|
||||
#define XR_CODEC_GUID_IMAGE_REMOTEFX \
|
||||
"\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54"
|
||||
|
||||
/* MFVideoFormat_H264 34363248-0000-0010-8000-00AA00389B71 */
|
||||
#define XR_CODEC_GUID_H264 \
|
||||
"\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71"
|
||||
|
||||
/* CODEC_GUID_JPEG 1BAF4CE6-9EED-430C-869A-CB8B37B66237 */
|
||||
#define XR_CODEC_GUID_JPEG \
|
||||
"\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37"
|
||||
|
||||
/* CODEC_GUID_PNG 0E0C858D-28E0-45DB-ADAA-0F83E57CC560 */
|
||||
#define XR_CODEC_GUID_PNG \
|
||||
"\x8D\x85\x0C\x0E\xE0\x28\xDB\x45\xAD\xAA\x0F\x83\xE5\x7C\xC5\x60"
|
||||
|
||||
/* CODEC_GUID_IGNORE 0C4351A6-3535-42AE-910C-CDFCE5760B58 */
|
||||
#define XR_CODEC_GUID_IGNORE \
|
||||
"\xA6\x51\x43\x0C\x35\x35\xAE\x42\x91\x0C\xCD\xFC\xE5\x76\x0B\x58"
|
||||
|
||||
/* PDU Types (2.2.8.1.1.1.1) */
|
||||
#define PDUTYPE_DEMANDACTIVEPDU 0x1
|
||||
#define PDUTYPE_CONFIRMACTIVEPDU 0x3
|
||||
#define PDUTYPE_DEACTIVATEALLPDU 0x6
|
||||
#define PDUTYPE_DATAPDU 0x7
|
||||
#define PDUTYPE_SERVER_REDIR_PKT 0xA
|
||||
|
||||
#define PDUTYPE_TO_STR(pdu_type) \
|
||||
((pdu_type) == PDUTYPE_DEMANDACTIVEPDU ? "PDUTYPE_DEMANDACTIVEPDU" : \
|
||||
(pdu_type) == PDUTYPE_CONFIRMACTIVEPDU ? "PDUTYPE_CONFIRMACTIVEPDU" : \
|
||||
(pdu_type) == PDUTYPE_DEACTIVATEALLPDU ? "PDUTYPE_DEACTIVATEALLPDU" : \
|
||||
(pdu_type) == PDUTYPE_DATAPDU ? "PDUTYPE_DATAPDU" : \
|
||||
(pdu_type) == PDUTYPE_SERVER_REDIR_PKT ? "PDUTYPE_SERVER_REDIR_PKT" : \
|
||||
"unknown" \
|
||||
)
|
||||
|
||||
/* Share Data Header: pduType2 (2.2.8.1.1.1.2) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_DATA_PDU_UPDATE 2 /* PDUTYPE2_UPDATE */
|
||||
#define RDP_DATA_PDU_CONTROL 20
|
||||
#define RDP_DATA_PDU_POINTER 27
|
||||
#define RDP_DATA_PDU_INPUT 28
|
||||
#define RDP_DATA_PDU_SYNCHRONISE 31
|
||||
#define PDUTYPE2_REFRESH_RECT 33
|
||||
#define RDP_DATA_PDU_PLAY_SOUND 34
|
||||
#define PDUTYPE2_SUPPRESS_OUTPUT 35
|
||||
#define PDUTYPE2_SHUTDOWN_REQUEST 36
|
||||
#define PDUTYPE2_SHUTDOWN_DENIED 37
|
||||
#define RDP_DATA_PDU_LOGON 38
|
||||
#define RDP_DATA_PDU_FONT2 39
|
||||
#define RDP_DATA_PDU_DISCONNECT 47
|
||||
#define PDUTYPE2_MONITOR_LAYOUT_PDU 55
|
||||
|
||||
/* TS_SECURITY_HEADER: flags (2.2.8.1.1.2.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define SEC_CLIENT_RANDOM 0x0001 /* SEC_EXCHANGE_PKT? */
|
||||
#define SEC_ENCRYPT 0x0008
|
||||
#define SEC_LOGON_INFO 0x0040 /* SEC_INFO_PKT */
|
||||
#define SEC_LICENCE_NEG 0x0080 /* SEC_LICENSE_PKT */
|
||||
|
||||
#define SEC_TAG_SRV_INFO 0x0c01 /* SC_CORE */
|
||||
#define SEC_TAG_SRV_CRYPT 0x0c02 /* SC_SECURITY */
|
||||
#define SEC_TAG_SRV_CHANNELS 0x0c03 /* SC_NET? */
|
||||
|
||||
/* Slow-Path Input Event: messageType (2.2.8.1.1.3.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_INPUT_SYNCHRONIZE 0
|
||||
#define RDP_INPUT_CODEPOINT 1
|
||||
#define RDP_INPUT_VIRTKEY 2
|
||||
#define RDP_INPUT_SCANCODE 4
|
||||
#define RDP_INPUT_UNICODE 5
|
||||
#define RDP_INPUT_MOUSE 0x8001
|
||||
#define RDP_INPUT_MOUSEX 0x8002
|
||||
|
||||
/* Keyboard Event: keyboardFlags (2.2.8.1.1.3.1.1.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define KBD_FLAG_RIGHT 0x0001
|
||||
#define KBD_FLAG_EXT 0x0100 /* KBDFLAGS_EXTENDED */
|
||||
#define KBD_FLAG_QUIET 0x1000
|
||||
#define KBD_FLAG_DOWN 0x4000
|
||||
#define KBD_FLAG_UP 0x8000
|
||||
|
||||
/* Mouse Event: pointerFlags (2.2.8.1.1.3.1.1.3) */
|
||||
#define PTRFLAGS_HWHEEL 0x0400
|
||||
#define PTRFLAGS_WHEEL 0x0200
|
||||
#define PTRFLAGS_WHEEL_NEGATIVE 0x0100
|
||||
#define WheelRotationMask 0x01FF
|
||||
#define PTRFLAGS_MOVE 0x0800
|
||||
#define PTRFLAGS_DOWN 0x8000
|
||||
#define PTRFLAGS_BUTTON1 0x1000
|
||||
#define PTRFLAGS_BUTTON2 0x2000
|
||||
#define PTRFLAGS_BUTTON3 0x4000
|
||||
|
||||
/* Extended Mouse Event: pointerFlags (2.2.8.1.1.3.1.1.4) */
|
||||
#define PTRXFLAGS_DOWN 0x8000
|
||||
#define PTRXFLAGS_BUTTON1 0x0001
|
||||
#define PTRXFLAGS_BUTTON2 0x0002
|
||||
|
||||
/* Synchronize Event: toggleFlags (2.2.8.1.1.3.1.1.5) */
|
||||
/* TODO: to be renamed */
|
||||
#define KBD_FLAG_SCROLL 0x0001 /* TS_SYNC_SCROLL_LOCK */
|
||||
#define KBD_FLAG_NUMLOCK 0x0002
|
||||
#define KBD_FLAG_CAPITAL 0x0004
|
||||
#define TS_SYNC_KANA_LOCK 0x0008
|
||||
|
||||
/* Client Fast-Path Input Event PDU 2.2.8.1.2 */
|
||||
#define FASTPATH_INPUT_ENCRYPTED 0x2
|
||||
|
||||
/* Fast-Path Input Event: eventCode (2.2.8.1.2.2) */
|
||||
#define FASTPATH_INPUT_EVENT_SCANCODE 0x0
|
||||
#define FASTPATH_INPUT_EVENT_MOUSE 0x1
|
||||
#define FASTPATH_INPUT_EVENT_MOUSEX 0x2
|
||||
#define FASTPATH_INPUT_EVENT_SYNC 0x3
|
||||
#define FASTPATH_INPUT_EVENT_UNICODE 0x4
|
||||
#define FASTPATH_INPUT_EVENT_QOE_TIMESTAMP 0x6
|
||||
|
||||
/* Fast-Path Keyboard Event: eventHeader (2.2.8.1.2.2.1) */
|
||||
#define FASTPATH_INPUT_KBDFLAGS_RELEASE 0x01
|
||||
#define FASTPATH_INPUT_KBDFLAGS_EXTENDED 0x02
|
||||
#define FASTPATH_INPUT_KBDFLAGS_EXTENDED1 0x04
|
||||
|
||||
/* Slow-Path Graphics Update: updateType (2.2.9.1.1.3.1) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_UPDATE_ORDERS 0
|
||||
#define RDP_UPDATE_BITMAP 1
|
||||
#define RDP_UPDATE_PALETTE 2
|
||||
#define RDP_UPDATE_SYNCHRONIZE 3
|
||||
|
||||
#define GRAPHICS_UPDATE_TYPE_TO_STR(type) \
|
||||
((type) == RDP_UPDATE_ORDERS ? "RDP_UPDATE_ORDERS" : \
|
||||
(type) == RDP_UPDATE_BITMAP ? "RDP_UPDATE_BITMAP" : \
|
||||
(type) == RDP_UPDATE_PALETTE ? "RDP_UPDATE_PALETTE" : \
|
||||
(type) == RDP_UPDATE_SYNCHRONIZE ? "RDP_UPDATE_SYNCHRONIZE" : \
|
||||
"unknown" \
|
||||
)
|
||||
|
||||
/* Server Pointer Update PDU: messageType (2.2.9.1.1.4) */
|
||||
/* TODO: to be renamed */
|
||||
#define RDP_POINTER_SYSTEM 1 /* TS_PTRMSGTYPE_SYSTEM */
|
||||
#define RDP_POINTER_MOVE 3
|
||||
#define RDP_POINTER_COLOR 6
|
||||
#define RDP_POINTER_CACHED 7
|
||||
#define RDP_POINTER_POINTER 8
|
||||
|
||||
/* System Pointer Update: systemPointerType (2.2.9.1.1.4.3) */
|
||||
#define RDP_NULL_POINTER 0
|
||||
#define RDP_DEFAULT_POINTER 0x7F00
|
||||
|
||||
/* Server Fast-Path Update PDU: action (2.2.9.1.2) */
|
||||
#define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0
|
||||
#define FASTPATH_OUTPUT_ACTION_X224 0x3
|
||||
|
||||
/* Server Fast-Path Update PDU: flags (2.2.9.1.2) */
|
||||
#define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1
|
||||
#define FASTPATH_OUTPUT_ENCRYPTED 0x2
|
||||
|
||||
/* Fast-Path Update: updateCode (2.2.9.1.2.1) */
|
||||
#define FASTPATH_UPDATETYPE_ORDERS 0x0
|
||||
#define FASTPATH_UPDATETYPE_BITMAP 0x1
|
||||
#define FASTPATH_UPDATETYPE_PALETTE 0x2
|
||||
#define FASTPATH_UPDATETYPE_SYNCHRONIZE 0x3
|
||||
#define FASTPATH_UPDATETYPE_SURFCMDS 0x4
|
||||
#define FASTPATH_UPDATETYPE_PTR_NULL 0x5
|
||||
#define FASTPATH_UPDATETYPE_PTR_DEFAULT 0x6
|
||||
#define FASTPATH_UPDATETYPE_PTR_POSITION 0x8
|
||||
#define FASTPATH_UPDATETYPE_COLOR 0x9
|
||||
#define FASTPATH_UPDATETYPE_CACHED 0xA
|
||||
#define FASTPATH_UPDATETYPE_POINTER 0xB
|
||||
|
||||
/* Fast-Path Update: fragmentation (2.2.9.1.2.1) */
|
||||
#define FASTPATH_FRAGMENT_SINGLE 0x0
|
||||
#define FASTPATH_FRAGMENT_LAST 0x1
|
||||
#define FASTPATH_FRAGMENT_FIRST 0x2
|
||||
#define FASTPATH_FRAGMENT_NEXT 0x3
|
||||
#define FASTPATH_OUTPUT_COMPRESSION_USED 0x2
|
||||
|
||||
/* Surface Command Type (2.2.9.1.2.1.10.1) */
|
||||
#define CMDTYPE_SET_SURFACE_BITS 0x0001
|
||||
#define CMDTYPE_FRAME_MARKER 0x0004
|
||||
#define CMDTYPE_STREAM_SURFACE_BITS 0x0006
|
||||
|
||||
/* Compression Flags (3.1.8.2.1) */
|
||||
/* TODO: to be renamed, not used anywhere */
|
||||
#define RDP_MPPC_COMPRESSED 0x20
|
||||
#define RDP_MPPC_RESET 0x40
|
||||
#define RDP_MPPC_FLUSH 0x80
|
||||
#define RDP_MPPC_DICT_SIZE 8192 /* RDP 4.0 | MS-RDPBCGR 3.1.8 */
|
||||
|
||||
/* largePointerSupprtFlags (2.2.7.2.7) */
|
||||
#define LARGE_POINTER_FLAG_96x96 0x00000001
|
||||
#define LARGE_POINTER_FLAG_384x384 0x00000002
|
||||
|
||||
#endif /* MS_RDPBCGR_H */
|
||||
@ -1,90 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPECLIP : Definitions from [MS-RDPECLIP]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPECLIP are currently correct for v220210407 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPECLIP_H)
|
||||
#define MS_RDPECLIP_H
|
||||
|
||||
/* Clipboard PDU header message codes 2.2.1 */
|
||||
#define CB_MONITOR_READY 1
|
||||
#define CB_FORMAT_LIST 2
|
||||
#define CB_FORMAT_LIST_RESPONSE 3
|
||||
#define CB_FORMAT_DATA_REQUEST 4
|
||||
#define CB_FORMAT_DATA_RESPONSE 5
|
||||
#define CB_TEMP_DIRECTORY 6
|
||||
#define CB_CLIP_CAPS 7
|
||||
#define CB_FILECONTENTS_REQUEST 8
|
||||
#define CB_FILECONTENTS_RESPONSE 9
|
||||
#define CB_LOCK_CLIPDATA 10
|
||||
#define CB_UNLOCK_CLIPDATA 11
|
||||
|
||||
#define CB_PDUTYPE_TO_STR(pdu_type) \
|
||||
((pdu_type) == CB_MONITOR_READY ? "CB_MONITOR_READY" : \
|
||||
(pdu_type) == CB_FORMAT_LIST ? "CB_FORMAT_LIST" : \
|
||||
(pdu_type) == CB_FORMAT_LIST_RESPONSE ? "CB_FORMAT_LIST_RESPONSE" : \
|
||||
(pdu_type) == CB_FORMAT_DATA_REQUEST ? "CB_FORMAT_DATA_REQUEST" : \
|
||||
(pdu_type) == CB_FORMAT_DATA_RESPONSE ? "CB_FORMAT_DATA_RESPONSE" : \
|
||||
(pdu_type) == CB_TEMP_DIRECTORY ? "CB_TEMP_DIRECTORY" : \
|
||||
(pdu_type) == CB_CLIP_CAPS ? "CB_CLIP_CAPS" : \
|
||||
(pdu_type) == CB_FILECONTENTS_REQUEST ? "CB_FILECONTENTS_REQUEST" : \
|
||||
(pdu_type) == CB_FILECONTENTS_RESPONSE ? "CB_FILECONTENTS_RESPONSE" : \
|
||||
(pdu_type) == CB_LOCK_CLIPDATA ? "CB_LOCK_CLIPDATA" : \
|
||||
(pdu_type) == CB_UNLOCK_CLIPDATA ? "CB_UNLOCK_CLIPDATA" : \
|
||||
"unknown" \
|
||||
)
|
||||
|
||||
/* Clipboard PDU header message flags 2.2.1 */
|
||||
#define CB_RESPONSE_OK 0x0001
|
||||
#define CB_RESPONSE_FAIL 0x0002
|
||||
#define CB_ASCII_NAMES 0x0004
|
||||
|
||||
/* Capability set codes 2.2.2.1.1 */
|
||||
#define CB_CAPSTYPE_GENERAL 1
|
||||
#define CB_CAPS_VERSION_1 1
|
||||
#define CB_CAPS_VERSION_2 2
|
||||
|
||||
/* General capability set general flags 2.2.2.1.1.1 */
|
||||
#define CB_USE_LONG_FORMAT_NAMES 0x00000002
|
||||
#define CB_STREAM_FILECLIP_ENABLED 0x00000004
|
||||
#define CB_FILECLIP_NO_FILE_PATHS 0x00000008
|
||||
#define CB_CAN_LOCK_CLIPDATA 0x00000010
|
||||
|
||||
/* File contents request PDU 2.2.5.3 */
|
||||
/* Note that in the document these do not have a CB_ prefix */
|
||||
#define CB_FILECONTENTS_SIZE 0x00000001
|
||||
#define CB_FILECONTENTS_RANGE 0x00000002
|
||||
|
||||
/* File descriptor structure flags 2.2.5.2.3.1 */
|
||||
/* Note that in the document these do not have a CB_ prefix */
|
||||
#define CB_FD_ATTRIBUTES 0x00000004
|
||||
#define CB_FD_FILESIZE 0x00000040
|
||||
#define CB_FD_WRITESTIME 0x00000020
|
||||
#define CB_FD_PROGRESSUI 0x00004000
|
||||
|
||||
/* File descriptor structure file attributes 2.2.5.2.3.1 */
|
||||
/* Note that in the document these do not have a CB_ prefix */
|
||||
#define CB_FILE_ATTRIBUTE_READONLY 0x00000001
|
||||
#define CB_FILE_ATTRIBUTE_HIDDEN 0x00000002
|
||||
#define CB_FILE_ATTRIBUTE_SYSTEM 0x00000004
|
||||
#define CB_FILE_ATTRIBUTE_DIRECTORY 0x00000010
|
||||
#define CB_FILE_ATTRIBUTE_ARCHIVE 0x00000020
|
||||
#define CB_FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
|
||||
#endif /* MS_RDPECLIP_H */
|
||||
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPEDISP : Definitions from [MS-RDPEDISP]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPEDISP are currently correct for v20201030 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPEDISP_H)
|
||||
#define MS_RDPEDISP_H
|
||||
|
||||
/* Display Control Messages: Display Virtual Channel Extension (2.2.2) */
|
||||
#define DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002
|
||||
#define DISPLAYCONTROL_PDU_TYPE_CAPS 0x00000005
|
||||
|
||||
/* Display Control Monitor Layout (2.2.2.2.1) */
|
||||
#define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001
|
||||
#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_WIDTH 0xC8
|
||||
#define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_HEIGHT 0xC8
|
||||
#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_WIDTH 0x2000
|
||||
#define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_HEIGHT 0x2000
|
||||
|
||||
#define ORIENTATION_LANDSCAPE 0
|
||||
#define ORIENTATION_PORTRAIT 90
|
||||
#define ORIENTATION_LANDSCAPE_FLIPPED 180
|
||||
#define ORIENTATION_PORTRAIT_FLIPPED 270
|
||||
|
||||
/* Display Control Monitor Layout (2.2.2.2.1) */
|
||||
#define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001
|
||||
|
||||
#endif /* MS_RDPEDISP_H */
|
||||
@ -1,128 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPEFS : Definitions from [MS-RDPEFS]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPEFS are currently correct for v20180912 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPEFS_H)
|
||||
#define MS_RDPEFS_H
|
||||
|
||||
/*
|
||||
* RDPDR_HEADER definitions (2.2.1.1)
|
||||
*/
|
||||
|
||||
/* device redirector core component; most of the packets in this protocol */
|
||||
/* are sent under this component ID */
|
||||
#define RDPDR_CTYP_CORE 0x4472
|
||||
|
||||
/* printing component. the packets that use this ID are typically about */
|
||||
/* printer cache management and identifying XPS printers */
|
||||
#define RDPDR_CTYP_PRN 0x5052
|
||||
|
||||
/* Server Announce Request, as specified in section 2.2.2.2 */
|
||||
#define PAKID_CORE_SERVER_ANNOUNCE 0x496E
|
||||
|
||||
/* Client Announce Reply and Server Client ID Confirm, as specified in */
|
||||
/* sections 2.2.2.3 and 2.2.2.6. */
|
||||
#define PAKID_CORE_CLIENTID_CONFIRM 0x4343
|
||||
|
||||
/* Client Name Request, as specified in section 2.2.2.4 */
|
||||
#define PAKID_CORE_CLIENT_NAME 0x434E
|
||||
|
||||
/* Client Device List Announce Request, as specified in section 2.2.2.9 */
|
||||
#define PAKID_CORE_DEVICELIST_ANNOUNCE 0x4441
|
||||
|
||||
/* Server Device Announce Response, as specified in section 2.2.2.1 */
|
||||
#define PAKID_CORE_DEVICE_REPLY 0x6472
|
||||
|
||||
/* Device I/O Request, as specified in section 2.2.1.4 */
|
||||
#define PAKID_CORE_DEVICE_IOREQUEST 0x4952
|
||||
|
||||
/* Device I/O Response, as specified in section 2.2.1.5 */
|
||||
#define PAKID_CORE_DEVICE_IOCOMPLETION 0x4943
|
||||
|
||||
/* Server Core Capability Request, as specified in section 2.2.2.7 */
|
||||
#define PAKID_CORE_SERVER_CAPABILITY 0x5350
|
||||
|
||||
/* Client Core Capability Response, as specified in section 2.2.2.8 */
|
||||
#define PAKID_CORE_CLIENT_CAPABILITY 0x4350
|
||||
|
||||
/* Client Drive Device List Remove, as specified in section 2.2.3.2 */
|
||||
#define PAKID_CORE_DEVICELIST_REMOVE 0x444D
|
||||
|
||||
/* Add Printer Cachedata, as specified in [MS-RDPEPC] section 2.2.2.3 */
|
||||
#define PAKID_PRN_CACHE_DATA 0x5043
|
||||
|
||||
/* Server User Logged On, as specified in section 2.2.2.5 */
|
||||
#define PAKID_CORE_USER_LOGGEDON 0x554C
|
||||
|
||||
/* Server Printer Set XPS Mode, as specified in [MS-RDPEPC] section 2.2.2.2 */
|
||||
#define PAKID_PRN_USING_XPS 0x5543
|
||||
|
||||
/*
|
||||
* Capability header definitions (2.2.1.2)
|
||||
*/
|
||||
|
||||
#define CAP_GENERAL_TYPE 0x0001 /* General cap set - GENERAL_CAPS_SET */
|
||||
#define CAP_PRINTER_TYPE 0x0002 /* Print cap set - PRINTER_CAPS_SET */
|
||||
#define CAP_PORT_TYPE 0x0003 /* Port cap set - PORT_CAPS_SET */
|
||||
#define CAP_DRIVE_TYPE 0x0004 /* Drive cap set - DRIVE_CAPS_SET */
|
||||
#define CAP_SMARTCARD_TYPE 0x0005 /* Smart card cap set - SMARTCARD_CAPS_SET */
|
||||
|
||||
/*
|
||||
* Device announce header (2.2.1.3)
|
||||
*/
|
||||
#define RDPDR_DTYP_SERIAL 0x0001
|
||||
#define RDPDR_DTYP_PARALLEL 0x0002
|
||||
#define RDPDR_DTYP_PRINT 0x0004
|
||||
#define RDPDR_DTYP_FILESYSTEM 0x0008
|
||||
#define RDPDR_DTYP_SMARTCARD 0x0020
|
||||
|
||||
/* Device I/O Request definitions (2.2.1.4) */
|
||||
/* MajorFunction */
|
||||
enum IRP_MJ
|
||||
{
|
||||
IRP_MJ_CREATE = 0x00000000,
|
||||
IRP_MJ_CLOSE = 0x00000002,
|
||||
IRP_MJ_READ = 0x00000003,
|
||||
IRP_MJ_WRITE = 0x00000004,
|
||||
IRP_MJ_DEVICE_CONTROL = 0x0000000E,
|
||||
IRP_MJ_QUERY_VOLUME_INFORMATION = 0x0000000A,
|
||||
IRP_MJ_SET_VOLUME_INFORMATION = 0x0000000B,
|
||||
IRP_MJ_QUERY_INFORMATION = 0x00000005,
|
||||
IRP_MJ_SET_INFORMATION = 0x00000006,
|
||||
IRP_MJ_DIRECTORY_CONTROL = 0x0000000C,
|
||||
IRP_MJ_LOCK_CONTROL = 0x00000011
|
||||
};
|
||||
|
||||
/* MinorFunction */
|
||||
/* Set to zero unless MajorFunction code == IRP_MJ_DIRECTORY_CONTROL */
|
||||
enum IRP_MN
|
||||
{
|
||||
IRP_MN_NONE = 0x00000000, /* Name not in MS docs */
|
||||
IRP_MN_QUERY_DIRECTORY = 0x00000001,
|
||||
IRP_MN_NOTIFY_CHANGE_DIRECTORY = 0x00000002
|
||||
};
|
||||
|
||||
/*
|
||||
* General Capability Set (2.2.2.7.1)
|
||||
*/
|
||||
/* extendedPDU fields */
|
||||
#define RDPDR_USER_LOGGEDON_PDU 0x00000004
|
||||
|
||||
#endif /* MS_RDPEFS_H */
|
||||
@ -1,59 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPEGDI : Definitions from [MS-RDPEGDI]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPEGDI are currently correct for v20180912 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPEGDI_H)
|
||||
#define MS_RDPEGDI_H
|
||||
|
||||
/* Drawing Order: controlFlags (2.2.2.2.1, 2.2.2.2.1.1.2) */
|
||||
#define TS_STANDARD 0x01
|
||||
#define TS_SECONDARY 0x02
|
||||
#define TS_BOUNDS 0x04
|
||||
#define TS_TYPE_CHANGE 0x08
|
||||
#define TS_DELTA_COORDINATES 0x10
|
||||
#define TS_ZERO_BOUNDS_DELTAS 0x20
|
||||
#define TS_ZERO_FIELD_BYTE_BIT0 0x40
|
||||
#define TS_ZERO_FIELD_BYTE_BIT1 0x80
|
||||
|
||||
/* Drawing Order: orderType (2.2.2.2.1.1.2) */
|
||||
/* Should be renamed */
|
||||
#define RDP_ORDER_DESTBLT 0 /* TS_ENC_DSTBLT_ORDER */
|
||||
#define RDP_ORDER_PATBLT 1
|
||||
#define RDP_ORDER_SCREENBLT 2
|
||||
#define RDP_ORDER_LINE 9
|
||||
#define RDP_ORDER_RECT 10
|
||||
#define RDP_ORDER_DESKSAVE 11
|
||||
#define RDP_ORDER_MEMBLT 13
|
||||
#define RDP_ORDER_TRIBLT 14
|
||||
#define RDP_ORDER_POLYLINE 22
|
||||
#define RDP_ORDER_TEXT2 27
|
||||
#define RDP_ORDER_COMPOSITE 37 /* 0x25 - not defined in RDPEGDI */
|
||||
|
||||
/* Secondary Drawing Order Header: orderType (2.2.2.2.1.2.1.1) */
|
||||
#define TS_CACHE_BITMAP_UNCOMPRESSED 0x00
|
||||
#define TS_CACHE_COLOR_TABLE 0x01
|
||||
#define TS_CACHE_BITMAP_COMPRESSED 0x02
|
||||
#define TS_CACHE_GLYPH 0x03
|
||||
#define TS_CACHE_BITMAP_UNCOMPRESSED_REV2 0x04
|
||||
#define TS_CACHE_BITMAP_COMPRESSED_REV2 0x05
|
||||
#define TS_CACHE_BRUSH 0x07
|
||||
#define TS_CACHE_BITMAP_COMPRESSED_REV3 0x08
|
||||
|
||||
#endif /* MS_RDPEGDI_H */
|
||||
@ -1,36 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPELE : Definitions from [MS-RDPELE]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPELE are currently correct for v20180912 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPELE_H)
|
||||
#define MS_RDPELE_H
|
||||
|
||||
/* LicensingMessage (MS-RDPELE 2.2.2) */
|
||||
/* TODO: to be renamed */
|
||||
#define LICENCE_TAG_DEMAND 0x01 /* LICENSE_REQUEST */
|
||||
#define LICENCE_TAG_AUTHREQ 0x02 /* PLATFORM_CHALLENGE */
|
||||
#define LICENCE_TAG_ISSUE 0x03 /* NEW_LICENSE */
|
||||
#define LICENCE_TAG_REISSUE 0x04 /* UPGRADE_LICENSE */
|
||||
#define LICENCE_TAG_PRESENT 0x12 /* LICENSE_INFO */
|
||||
#define LICENCE_TAG_REQUEST 0x13 /* NEW_LICENSE_REQUEST */
|
||||
#define LICENCE_TAG_AUTHRESP 0x15 /* PLATFORM_CHALLENGE_RESPONSE */
|
||||
#define LICENCE_TAG_RESULT 0xff
|
||||
|
||||
#endif /* MS_RDPELE_H */
|
||||
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-RDPERP : Definitions from [MS-RDPERP]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-RDPERP are currently correct for v20190923 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_RDPERP_H)
|
||||
#define MS_RDPERP_H
|
||||
|
||||
/* Window List Capability Set: WndSupportLevel (2.2.1.1.2) */
|
||||
#define TS_WINDOW_LEVEL_NOT_SUPPORTED 0x00000000
|
||||
#define TS_WINDOW_LEVEL_SUPPORTED 0x00000001
|
||||
#define TS_WINDOW_LEVEL_SUPPORTED_EX 0x00000002
|
||||
|
||||
|
||||
#endif /* MS_RDPERP_H */
|
||||
@ -1,79 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* MS-SMB2 : Definitions from [MS-SMB2]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* References to MS-SMB2 are currently correct for v20190923 of that
|
||||
* document
|
||||
*/
|
||||
|
||||
#if !defined(MS_SMB2_H)
|
||||
#define MS_SMB2_H
|
||||
|
||||
/* SMB2 CREATE request values (section 2.2.13) */
|
||||
|
||||
/*
|
||||
* ShareAccess Mask. Currently, this is referred
|
||||
* to in MS-RDPEFS 2.2.1.4.1 as 'SharedAccess' rather than 'ShareAccess'.
|
||||
*/
|
||||
#define SA_FILE_SHARE_READ 0x00000001
|
||||
#define SA_FILE_SHARE_WRITE 0x00000002
|
||||
#define SA_FILE_SHARE_DELETE 0x00000004
|
||||
|
||||
/* CreateDisposition Mask */
|
||||
#define CD_FILE_SUPERSEDE 0x00000000
|
||||
#define CD_FILE_OPEN 0x00000001
|
||||
#define CD_FILE_CREATE 0x00000002
|
||||
#define CD_FILE_OPEN_IF 0x00000003
|
||||
#define CD_FILE_OVERWRITE 0x00000004
|
||||
#define CD_FILE_OVERWRITE_IF 0x00000005
|
||||
|
||||
/* CreateOptions Mask */
|
||||
enum CREATE_OPTIONS
|
||||
{
|
||||
CO_FILE_DIRECTORY_FILE = 0x00000001,
|
||||
CO_FILE_WRITE_THROUGH = 0x00000002,
|
||||
CO_FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020,
|
||||
CO_FILE_DELETE_ON_CLOSE = 0x00001000
|
||||
};
|
||||
|
||||
/*
|
||||
* DesiredAccess Mask (section 2.2.13.1.1)
|
||||
*/
|
||||
|
||||
#define DA_FILE_READ_DATA 0x00000001
|
||||
#define DA_FILE_WRITE_DATA 0x00000002
|
||||
#define DA_FILE_APPEND_DATA 0x00000004
|
||||
#define DA_FILE_READ_EA 0x00000008 /* rd extended attributes */
|
||||
#define DA_FILE_WRITE_EA 0x00000010 /* wr extended attributes */
|
||||
#define DA_FILE_EXECUTE 0x00000020
|
||||
#define DA_FILE_READ_ATTRIBUTES 0x00000080
|
||||
#define DA_FILE_WRITE_ATTRIBUTES 0x00000100
|
||||
#define DA_DELETE 0x00010000
|
||||
#define DA_READ_CONTROL 0x00020000 /* rd security descriptor */
|
||||
#define DA_WRITE_DAC 0x00040000
|
||||
#define DA_WRITE_OWNER 0x00080000
|
||||
#define DA_SYNCHRONIZE 0x00100000
|
||||
#define DA_ACCESS_SYSTEM_SECURITY 0x01000000
|
||||
#define DA_MAXIMUM_ALLOWED 0x02000000
|
||||
#define DA_GENERIC_ALL 0x10000000
|
||||
#define DA_GENERIC_EXECUTE 0x20000000
|
||||
#define DA_GENERIC_WRITE 0x40000000
|
||||
#define DA_GENERIC_READ 0x80000000
|
||||
|
||||
#endif /* MS_SMB2_H */
|
||||
|
||||
|
||||
|
||||
4197
common/os_calls.c
4197
common/os_calls.c
File diff suppressed because it is too large
Load Diff
@ -1,420 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* generic operating system calls
|
||||
*/
|
||||
|
||||
#if !defined(OS_CALLS_H)
|
||||
#define OS_CALLS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
enum proc_exit_reason
|
||||
{
|
||||
E_PXR_STATUS_CODE = 0, ///< 'val' contains exit status
|
||||
E_PXR_SIGNAL, ///< 'val' contains a signal number
|
||||
E_PXR_UNEXPECTED
|
||||
};
|
||||
|
||||
struct proc_exit_status
|
||||
{
|
||||
enum proc_exit_reason reason;
|
||||
int val;
|
||||
};
|
||||
|
||||
struct list;
|
||||
|
||||
#define g_tcp_can_recv g_sck_can_recv
|
||||
#define g_tcp_can_send g_sck_can_send
|
||||
#define g_tcp_recv g_sck_recv
|
||||
#define g_tcp_send g_sck_send
|
||||
#define g_tcp_close g_sck_close
|
||||
#define g_tcp_last_error_would_block g_sck_last_error_would_block
|
||||
#define g_tcp_set_non_blocking g_sck_set_non_blocking
|
||||
#define g_tcp_local_socket g_sck_local_socket
|
||||
#define g_tcp_local_connect g_sck_local_connect
|
||||
#define g_tcp_listen g_sck_listen
|
||||
#define g_tcp_local_bind g_sck_local_bind
|
||||
#define g_tcp_select g_sck_select
|
||||
#define g_close_wait_obj g_delete_wait_obj
|
||||
|
||||
int g_rm_temp_dir(void);
|
||||
void g_init(const char *app_name);
|
||||
void g_deinit(void);
|
||||
void g_printf(const char *format, ...) printflike(1, 2);
|
||||
void g_sprintf(char *dest, const char *format, ...) \
|
||||
printflike(2, 3);
|
||||
int g_snprintf(char *dest, int len, const char *format, ...) \
|
||||
printflike(3, 4);
|
||||
void g_writeln(const char *format, ...) printflike(1, 2);
|
||||
void g_write(const char *format, ...) printflike(1, 2);
|
||||
void g_hexdump(const char *p, int len);
|
||||
int g_getchar(void);
|
||||
int g_tcp_set_no_delay(int sck);
|
||||
int g_tcp_set_keepalive(int sck);
|
||||
int g_tcp_socket(void);
|
||||
int g_sck_set_send_buffer_bytes(int sck, int bytes);
|
||||
int g_sck_get_send_buffer_bytes(int sck, int *bytes);
|
||||
int g_sck_set_recv_buffer_bytes(int sck, int bytes);
|
||||
int g_sck_get_recv_buffer_bytes(int sck, int *bytes);
|
||||
int g_sck_local_socket(void);
|
||||
int g_sck_local_socketpair(int sck[2]);
|
||||
int g_sck_vsock_socket(void);
|
||||
int g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid);
|
||||
void g_sck_close(int sck);
|
||||
int g_tcp_connect(int sck, const char *address, const char *port);
|
||||
int g_sck_local_connect(int sck, const char *port);
|
||||
int g_sck_set_non_blocking(int sck);
|
||||
int g_tcp_bind(int sck, const char *port);
|
||||
int g_sck_local_bind(int sck, const char *port);
|
||||
int g_sck_vsock_bind(int sck, const char *port);
|
||||
int g_sck_vsock_bind_address(int sck, const char *port, const char *address);
|
||||
int g_tcp_bind_address(int sck, const char *port, const char *address);
|
||||
int g_sck_listen(int sck);
|
||||
int g_sck_accept(int sck);
|
||||
int g_sck_recv(int sck, void *ptr, unsigned int len, int flags);
|
||||
int g_sck_send(int sck, const void *ptr, unsigned int len, int flags);
|
||||
/**
|
||||
* Receives data and file descriptors on a unix domain socket
|
||||
*
|
||||
* @param sck - Socket to receive data + file descriptors from
|
||||
* @param ptr - Pointer to buffer for incoming data
|
||||
* @param len - Length of data. Must be > 0
|
||||
* @param[out] fds - Array of file descriptors
|
||||
* @param [in] maxfd - Max number of elements in fds
|
||||
* @param[out] fdcount - Actual number of file descriptors received
|
||||
* @return Bytes received, or < 0 for error.
|
||||
*
|
||||
* If the result is > 0 but less than len, the file descriptors have
|
||||
* been received. Get the rest of the data with normal g_sck_recv() calls.
|
||||
*
|
||||
* fdcount may be more that maxfd. This indicates that more file descriptors
|
||||
* were received than there was space for. The excess file descriptors
|
||||
* are closed and discarded.
|
||||
*/
|
||||
int g_sck_recv_fd_set(int sck, void *ptr, unsigned int len,
|
||||
int fds[], unsigned int maxfd,
|
||||
unsigned int *fdcount);
|
||||
/**
|
||||
* Sends data and file descriptors on a unix domain socket
|
||||
*
|
||||
* @param sck - Socket to send data + file descriptors on
|
||||
* @param ptr - Data to send
|
||||
* @param len - Length of data. Must be > 0
|
||||
* @param fds - Array of file descriptors
|
||||
* @param fdcount - Number of file descriptors
|
||||
* @return Bytes sent, or < 0 for error.
|
||||
*
|
||||
* If the result is > 0 but less than len, the file descriptors have
|
||||
* been sent. Send the rest of the data with normal g_sck_send() calls.
|
||||
*/
|
||||
int g_sck_send_fd_set(int sck, const void *ptr, unsigned int len,
|
||||
int fds[], unsigned int fdcount);
|
||||
int g_sck_last_error_would_block(int sck);
|
||||
int g_sck_socket_ok(int sck);
|
||||
/**
|
||||
* Checks socket writeability with an optional wait
|
||||
*
|
||||
* @param sck - Socket to check
|
||||
* @param millis - Maximum milliseconds to wait for writeability to be true
|
||||
*
|
||||
* @note The wait time may not be reached in the event of an incoming signal
|
||||
* so do not use this call to impose a hard timeout */
|
||||
int g_sck_can_send(int sck, int millis);
|
||||
/**
|
||||
* Checks socket readability with an optional wait
|
||||
*
|
||||
* @param sck - Socket to check
|
||||
* @param millis - Maximum milliseconds to wait for readability to be true
|
||||
*
|
||||
* @note The wait time may not be reached in the event of an incoming signal
|
||||
* so do not use this call to impose a hard timeout */
|
||||
int g_sck_can_recv(int sck, int millis);
|
||||
int g_sck_select(int sck1, int sck2);
|
||||
|
||||
/**
|
||||
* Gets the IP address of a connected peer, if it has one
|
||||
* @param sck File descriptor for peer
|
||||
* @param ip buffer to write IP address to
|
||||
* @param bytes Size of ip buffer. Should be at least MAX_IP_ADDRSTRLEN
|
||||
* @param[out] portptr Optional variable to receive the port number
|
||||
* @return Pointer to IP for convenience
|
||||
*
|
||||
* If the peer has no IP address (for example, it is a Unix Domain Socket),
|
||||
* or the specified buffer is too small, the returned string is ""
|
||||
*/
|
||||
const char *
|
||||
g_sck_get_peer_ip_address(int sck,
|
||||
char *ip, unsigned int bytes,
|
||||
unsigned short *port);
|
||||
/**
|
||||
* Gets a description for a connected peer
|
||||
* @param sck File descriptor for peer
|
||||
* @param desc buffer to write description to
|
||||
* @param bytes Size of description buffer. Should be at least
|
||||
* MAX_PEER_DESCSTRLEN
|
||||
* @return Pointer to desc for convenience
|
||||
*
|
||||
* Unlike g_sck_get_peer_ip_address(), this will return a
|
||||
* description of some sort for any socket type.
|
||||
*/
|
||||
const char *
|
||||
g_sck_get_peer_description(int sck,
|
||||
char *desc, unsigned int bytes);
|
||||
/**
|
||||
* Sleep for the specified number of milli-seconds
|
||||
* @param msecs Milli-seconds
|
||||
*
|
||||
* If a signal is processed, it is possible that this call will
|
||||
* sleep for less than the specified number of milli-seconds. This
|
||||
* is platform-specific
|
||||
*/
|
||||
void g_sleep(int msecs);
|
||||
int g_pipe(int fd[2]);
|
||||
|
||||
tintptr g_create_wait_obj(const char *name);
|
||||
tintptr g_create_wait_obj_from_socket(tintptr socket, int write);
|
||||
void g_delete_wait_obj_from_socket(tintptr wait_obj);
|
||||
int g_set_wait_obj(tintptr obj);
|
||||
int g_reset_wait_obj(tintptr obj);
|
||||
int g_is_wait_obj_set(tintptr obj);
|
||||
int g_delete_wait_obj(tintptr obj);
|
||||
/**
|
||||
* Wait for the specified readable and writeable objs
|
||||
*
|
||||
* The wait finishes when at least one of the objects becomes
|
||||
* readable or writeable
|
||||
*
|
||||
* @param read_objs Array of read objects
|
||||
* @param rcount Number of elements in read_objs
|
||||
* @param write_objs Array of write objects
|
||||
* @param rcount Number of elements in write_objs
|
||||
* @param mstimeout Timeout in milliseconds. < 0 means an infinite timeout.
|
||||
*
|
||||
* @return 0 for success. The objects will need to be polled to
|
||||
* find out what is readable or writeable.
|
||||
*
|
||||
* An mstimeout of zero will return immediately, although
|
||||
* error conditions may be checked for.
|
||||
*/
|
||||
int g_obj_wait(tintptr *read_objs, int rcount, tintptr *write_objs,
|
||||
int wcount, int mstimeout);
|
||||
void g_random(char *data, int len);
|
||||
int g_abs(int i);
|
||||
int g_memcmp(const void *s1, const void *s2, int len);
|
||||
int g_file_open_rw(const char *file_name);
|
||||
int g_file_open_ex(const char *file_name, int aread, int awrite,
|
||||
int acreate, int atrunc);
|
||||
int g_file_open_ro(const char *file_name);
|
||||
int g_file_close(int fd);
|
||||
/**
|
||||
* Returns 1 if a file is open (i.e. the file descriptor is valid)
|
||||
* @param fd File descriptor
|
||||
* @return 1 for file open, 0 for not open
|
||||
*/
|
||||
int g_file_is_open(int fd);
|
||||
int g_file_read(int fd, char *ptr, int len);
|
||||
int g_file_write(int fd, const char *ptr, int len);
|
||||
int g_file_seek(int fd, int offset);
|
||||
int g_file_lock(int fd, int start, int len);
|
||||
int
|
||||
g_file_map(int fd, int aread, int awrite, size_t length, void **addr);
|
||||
int
|
||||
g_munmap(void *addr, size_t length);
|
||||
int g_file_duplicate_on(int fd, int target_fd);
|
||||
int g_file_get_cloexec(int fd);
|
||||
int g_file_set_cloexec(int fd, int status);
|
||||
/**
|
||||
* Get a list of open file descriptors
|
||||
*
|
||||
* @param min Min FD to consider
|
||||
* @param max Max FD to consider (+1), or -1 for no limit
|
||||
* @result Array of file descriptors, in ascending order.
|
||||
*
|
||||
* Call delete_list() on the result when you've finished with it.
|
||||
*/
|
||||
struct list *g_get_open_fds(int min, int max);
|
||||
int g_chmod_hex(const char *filename, int flags);
|
||||
int g_umask_hex(int flags);
|
||||
int g_chown(const char *name, int uid, int gid);
|
||||
int g_mkdir(const char *dirname);
|
||||
char *g_get_current_dir(char *dirname, int maxlen);
|
||||
int g_set_current_dir(const char *dirname);
|
||||
int g_file_exist(const char *filename);
|
||||
int g_file_readable(const char *filename);
|
||||
int g_directory_exist(const char *dirname);
|
||||
int g_executable_exist(const char *dirname);
|
||||
int g_create_dir(const char *dirname);
|
||||
int g_create_path(const char *path);
|
||||
int g_remove_dir(const char *dirname);
|
||||
int g_file_delete(const char *filename);
|
||||
int g_file_get_size(const char *filename);
|
||||
int g_file_get_device_number(const char *filename);
|
||||
int g_file_get_inode_num(const char *filename);
|
||||
long g_load_library(char *in);
|
||||
int g_free_library(long lib);
|
||||
void *g_get_proc_address(long lib, const char *name);
|
||||
int g_system(const char *aexec);
|
||||
char *g_get_strerror(void);
|
||||
int g_get_errno(void);
|
||||
int g_execvp(const char *p1, char *args[]);
|
||||
/**
|
||||
* Issues an execvp() call
|
||||
*
|
||||
* @param file Executable
|
||||
* @param argv Argument list for executable.
|
||||
*
|
||||
* argv does not need to be NULL terminated - the call takes care
|
||||
* of this.
|
||||
*
|
||||
* @return Only if an error has occurred - use g_get_errno() or equivalent
|
||||
*/
|
||||
int g_execvp_list(const char *file, struct list *argv);
|
||||
int g_execlp3(const char *a1, const char *a2, const char *a3);
|
||||
/**
|
||||
* Set an alarm using SIGALRM
|
||||
* @param func Signal handler, or NULL to cancel an alarm
|
||||
* @param secs Number of seconds until an alarm is raised
|
||||
* @return Number of seconds remaining before a previously requested
|
||||
* alarm is raised
|
||||
*/
|
||||
unsigned int g_set_alarm(void (*func)(int), unsigned int secs);
|
||||
/**
|
||||
* Set a handler up for SIGCHLD
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_child_stop(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGSEGV
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler can only be called once, at which point the
|
||||
* default handler is restored. This is to avoid infinite loops
|
||||
*/
|
||||
void g_signal_segfault(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGHUP
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_hang_up(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGINT
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_user_interrupt(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGTERM
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_terminate(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGPIPE
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_pipe(void (*func)(int));
|
||||
/**
|
||||
* Set a handler up for SIGUSR1
|
||||
* @param func signal handler, or NULL to restore the default handler
|
||||
* The handler remains in place until explicitly replaced.
|
||||
*/
|
||||
void g_signal_usr1(void (*func)(int));
|
||||
int g_fork(void);
|
||||
int g_setgid(int pid);
|
||||
int g_initgroups(const char *user);
|
||||
int g_getuid(void);
|
||||
int g_getgid(void);
|
||||
int g_setuid(int pid);
|
||||
int g_setsid(void);
|
||||
int g_getlogin(char *name, unsigned int len);
|
||||
int g_setlogin(const char *name);
|
||||
#ifdef HAVE_SETUSERCONTEXT
|
||||
/** Sets the login user context (BSD systems only)
|
||||
* @param uid UID of suer
|
||||
* @return 0 for success
|
||||
*/
|
||||
int g_set_allusercontext(int uid);
|
||||
#endif
|
||||
int g_waitchild(struct proc_exit_status *e);
|
||||
int g_waitpid(int pid);
|
||||
struct proc_exit_status g_waitpid_status(int pid);
|
||||
/*
|
||||
* Sets the process group ID of the indicated process to the specified value.
|
||||
* (POSIX.1)
|
||||
*
|
||||
* Errors are logged.
|
||||
*
|
||||
* May do nothing if process groups are not supported
|
||||
*/
|
||||
int g_setpgid(int pid, int pgid);
|
||||
void g_clearenv(void);
|
||||
int g_setenv(const char *name, const char *value, int rewrite);
|
||||
char *g_getenv(const char *name);
|
||||
int g_exit(int exit_code);
|
||||
int g_getpid(void);
|
||||
int g_sigterm(int pid);
|
||||
int g_sighup(int pid);
|
||||
int g_getuser_info_by_name(const char *username, int *uid, int *gid,
|
||||
char **shell, char **dir, char **gecos);
|
||||
int g_getuser_info_by_uid(int uid, char **username, int *gid,
|
||||
char **shell, char **dir, char **gecos);
|
||||
int g_getgroup_info(const char *groupname, int *gid);
|
||||
/**
|
||||
* Checks whether a user is in the specified group
|
||||
* @param username Name of user
|
||||
* @param gid GID of group
|
||||
* @param[out] ok Whether user is in group
|
||||
* @return Non-zero if a system error occurred. In this instance OK is not set
|
||||
*
|
||||
* Primary group of username is also checked
|
||||
*/
|
||||
int g_check_user_in_group(const char *username, int gid, int *ok);
|
||||
int g_time1(void);
|
||||
int g_time2(void);
|
||||
int g_time3(void);
|
||||
int g_save_to_bmp(const char *filename, char *data, int stride_bytes,
|
||||
int width, int height, int depth, int bits_per_pixel);
|
||||
void *g_shmat(int shmid);
|
||||
int g_shmdt(const void *shmaddr);
|
||||
int g_gethostname(char *name, int len);
|
||||
int g_mirror_memcpy(void *dst, const void *src, int len);
|
||||
int g_tcp4_socket(void);
|
||||
int g_tcp4_bind_address(int sck, const char *port, const char *address);
|
||||
int g_tcp6_socket(void);
|
||||
int g_tcp6_bind_address(int sck, const char *port, const char *address);
|
||||
int g_no_new_privs(void);
|
||||
void
|
||||
g_qsort(void *base, size_t nitems, size_t size,
|
||||
int (*compar)(const void *, const void *));
|
||||
|
||||
/* glib-style wrappers */
|
||||
#define g_new(struct_type, n_structs) \
|
||||
(struct_type *) malloc(sizeof(struct_type) * (n_structs))
|
||||
#define g_new0(struct_type, n_structs) \
|
||||
(struct_type *) calloc((n_structs), sizeof(struct_type))
|
||||
|
||||
/* remove these when no longer used */
|
||||
#define g_malloc(_size, _zero) (_zero ? calloc(1, _size) : malloc(_size))
|
||||
#define g_free free
|
||||
#define g_memset memset
|
||||
#define g_memcpy memcpy
|
||||
#define g_memmove memmove
|
||||
|
||||
#endif
|
||||
324
common/parse.c
324
common/parse.c
@ -1,324 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) 2021 Matt Burt
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Enforce stream primitive checking
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "arch.h"
|
||||
#include "parse.h"
|
||||
#include "log.h"
|
||||
#include "string_calls.h"
|
||||
#include "unicode_defines.h"
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define out_uint16_le_unchecked(s, v) do \
|
||||
{ \
|
||||
*((s)->p) = (unsigned char)((v) >> 0); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
#else
|
||||
#define out_uint16_le_unchecked(s, v) do \
|
||||
{ \
|
||||
*((unsigned short*)((s)->p)) = (unsigned short)(v); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define in_uint16_le_unchecked(s, v) do \
|
||||
{ \
|
||||
(v) = (unsigned short) \
|
||||
( \
|
||||
(*((unsigned char*)((s)->p + 0)) << 0) | \
|
||||
(*((unsigned char*)((s)->p + 1)) << 8) \
|
||||
); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#else
|
||||
#define in_uint16_le_unchecked(s, v) do \
|
||||
{ \
|
||||
(v) = *((unsigned short*)((s)->p)); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
parser_stream_overflow_check(const struct stream *s, int n, int is_out,
|
||||
const char *file, int line)
|
||||
{
|
||||
/* Sanity checks */
|
||||
if (n < 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_ALWAYS, "%s:%d "
|
||||
"stream primitive called with negative n=%d",
|
||||
file, line, n);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (is_out)
|
||||
{
|
||||
/* Output overflow */
|
||||
if (!s_check_rem_out(s, n))
|
||||
{
|
||||
LOG(LOG_LEVEL_ALWAYS, "%s:%d Stream output buffer overflow. "
|
||||
"Size=%d, pos=%d, requested=%d", file, line,
|
||||
s->size, (int)(s->p - s->data), n);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Input overflow */
|
||||
if (!s_check_rem(s, n))
|
||||
{
|
||||
LOG(LOG_LEVEL_ALWAYS, "%s:%d Stream input buffer overflow. "
|
||||
"Max=%d, pos=%d, requested=%d", file, line,
|
||||
(int)(s->end - s->data), (int)(s->p - s->data), n);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
out_utf8_as_utf16_le_proc(struct stream *s, const char *v,
|
||||
unsigned int vn,
|
||||
const char *file, int line)
|
||||
{
|
||||
// Expansion of S_CHECK_REM_OUT(s, <octet_count>) using passed-in
|
||||
// file and line
|
||||
#ifdef USE_DEVEL_STREAMCHECK
|
||||
int octet_cnt = utf8_as_utf16_word_count(v, vn) * 2;
|
||||
parser_stream_overflow_check(s, octet_cnt, 1, file, line);
|
||||
#endif
|
||||
|
||||
while (vn > 0)
|
||||
{
|
||||
char32_t c32 = utf8_get_next_char(&v, &vn);
|
||||
char16_t low;
|
||||
if (c32 < 0x10000)
|
||||
{
|
||||
low = (char16_t)c32;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Need a surrogate pair */
|
||||
low = LOW_SURROGATE_FROM_C32(c32);
|
||||
char16_t high = HIGH_SURROGATE_FROM_C32(c32);
|
||||
out_uint16_le_unchecked(s, high);
|
||||
}
|
||||
out_uint16_le_unchecked(s, low);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Gets the next Unicode character from a code stream
|
||||
* @param s Stream
|
||||
* @return Unicode character
|
||||
*
|
||||
* Non-characters and illegally coded characters are mapped to
|
||||
* UCS_REPLACEMENT_CHARACTER
|
||||
*
|
||||
* @pre Two bytes are assumed to be available on the stram on entry
|
||||
*/
|
||||
static char32_t
|
||||
get_c32_from_stream(struct stream *s)
|
||||
{
|
||||
char32_t c32 = UCS_REPLACEMENT_CHARACTER; // Assume failure
|
||||
char16_t w;
|
||||
|
||||
in_uint16_le_unchecked(s, w);
|
||||
|
||||
if (IS_HIGH_SURROGATE(w))
|
||||
{
|
||||
if (s_check_rem(s, 2))
|
||||
{
|
||||
char16_t low;
|
||||
in_uint16_le_unchecked(s, low);
|
||||
if (IS_LOW_SURROGATE(low))
|
||||
{
|
||||
/* Valid surrogate pair */
|
||||
char32_t v = C32_FROM_SURROGATE_PAIR(low, w);
|
||||
|
||||
/* Ignore some values which can be successfully encoded
|
||||
* in this way */
|
||||
if (!IS_PLANE_END_NON_CHARACTER(c32))
|
||||
{
|
||||
c32 = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Invalid low surrogate - pop character back */
|
||||
s->p -= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!IS_LOW_SURROGATE(w) &&
|
||||
!IS_PLANE_END_NON_CHARACTER(w) &&
|
||||
!IS_ARABIC_NON_CHARACTER(w))
|
||||
{
|
||||
/* Character from the Basic Multilingual Plane */
|
||||
c32 = (char32_t)w;
|
||||
}
|
||||
|
||||
return c32;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
unsigned int
|
||||
in_utf16_le_fixed_as_utf8_proc(struct stream *s, unsigned int n,
|
||||
char *v, unsigned int vn,
|
||||
const char *file, int line)
|
||||
{
|
||||
unsigned int rv = 0;
|
||||
char32_t c32;
|
||||
char u8str[MAXLEN_UTF8_CHAR];
|
||||
unsigned int u8len;
|
||||
char *saved_s_end = s->end;
|
||||
|
||||
// Expansion of S_CHECK_REM(s, n*2) using passed-in file and line
|
||||
#ifdef USE_DEVEL_STREAMCHECK
|
||||
parser_stream_overflow_check(s, n * 2, 0, file, line);
|
||||
#endif
|
||||
// Temporarily set the stream end pointer to allow us to use
|
||||
// s_check_rem() when reading in UTF-16 words
|
||||
if (s->end - s->p > (int)(n * 2))
|
||||
{
|
||||
s->end = s->p + (int)(n * 2);
|
||||
}
|
||||
|
||||
while (s_check_rem(s, 2))
|
||||
{
|
||||
c32 = get_c32_from_stream(s);
|
||||
|
||||
u8len = utf_char32_to_utf8(c32, u8str);
|
||||
if (u8len + 1 <= vn)
|
||||
{
|
||||
/* Room for this character and a terminator. Add the character */
|
||||
unsigned int i;
|
||||
for (i = 0 ; i < u8len ; ++i)
|
||||
{
|
||||
v[i] = u8str[i];
|
||||
}
|
||||
vn -= u8len;
|
||||
v += u8len;
|
||||
}
|
||||
else if (vn > 1)
|
||||
{
|
||||
/* We've skipped a character, but there's more than one byte
|
||||
* remaining in the output buffer. Mark the output buffer as
|
||||
* full so we don't get a smaller character being squeezed into
|
||||
* the remaining space */
|
||||
vn = 1;
|
||||
}
|
||||
|
||||
rv += u8len;
|
||||
}
|
||||
|
||||
// Restore stream to full length
|
||||
s->end = saved_s_end;
|
||||
|
||||
if (vn > 0)
|
||||
{
|
||||
*v = '\0';
|
||||
}
|
||||
++rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
unsigned int
|
||||
in_utf16_le_fixed_as_utf8_length(struct stream *s, unsigned int n)
|
||||
{
|
||||
char *saved_s_p = s->p;
|
||||
unsigned int rv = in_utf16_le_fixed_as_utf8(s, n, NULL, 0);
|
||||
s->p = saved_s_p;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
unsigned int
|
||||
in_utf16_le_terminated_as_utf8(struct stream *s,
|
||||
char *v, unsigned int vn)
|
||||
{
|
||||
unsigned int rv = 0;
|
||||
char32_t c32;
|
||||
char u8str[MAXLEN_UTF8_CHAR];
|
||||
unsigned int u8len;
|
||||
while (s_check_rem(s, 2))
|
||||
{
|
||||
c32 = get_c32_from_stream(s);
|
||||
if (c32 == 0)
|
||||
{
|
||||
break; // Terminator encountered
|
||||
}
|
||||
|
||||
u8len = utf_char32_to_utf8(c32, u8str);
|
||||
if (u8len + 1 <= vn)
|
||||
{
|
||||
/* Room for this character and a terminator. Add the character */
|
||||
unsigned int i;
|
||||
for (i = 0 ; i < u8len ; ++i)
|
||||
{
|
||||
v[i] = u8str[i];
|
||||
}
|
||||
vn -= u8len;
|
||||
v += u8len;
|
||||
}
|
||||
else if (vn > 1)
|
||||
{
|
||||
/* We've skipped a character, but there's more than one byte
|
||||
* remaining in the output buffer. Mark the output buffer as
|
||||
* full so we don't get a smaller character being squeezed into
|
||||
* the remaining space */
|
||||
vn = 1;
|
||||
}
|
||||
rv += u8len;
|
||||
}
|
||||
|
||||
if (vn > 0)
|
||||
{
|
||||
*v = '\0';
|
||||
}
|
||||
++rv;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
unsigned int
|
||||
in_utf16_le_terminated_as_utf8_length(struct stream *s)
|
||||
{
|
||||
char *saved_s_p = s->p;
|
||||
unsigned int rv = in_utf16_le_terminated_as_utf8(s, NULL, 0);
|
||||
s->p = saved_s_p;
|
||||
return rv;
|
||||
}
|
||||
674
common/parse.h
674
common/parse.h
@ -1,674 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Parsing structs and macros
|
||||
*
|
||||
* based on parse.h from rdesktop
|
||||
* this is a super fast stream method, you bet
|
||||
* needed functions g_malloc, g_free, g_memset, g_memcpy
|
||||
*/
|
||||
|
||||
#if !defined(PARSE_H)
|
||||
#define PARSE_H
|
||||
|
||||
#include "arch.h"
|
||||
#include "log.h"
|
||||
|
||||
/* Check the config_ac.h file is included so we know whether to enable the
|
||||
* development macros
|
||||
*/
|
||||
#ifndef CONFIG_AC_H
|
||||
# error config_ac.h not visible in parse.h
|
||||
#endif
|
||||
|
||||
#if defined(L_ENDIAN)
|
||||
#elif defined(B_ENDIAN)
|
||||
#else
|
||||
#error Unknown endianness.
|
||||
#endif
|
||||
|
||||
/* parser state */
|
||||
struct stream
|
||||
{
|
||||
char *p;
|
||||
char *end;
|
||||
char *data;
|
||||
int size;
|
||||
int pad0;
|
||||
/* offsets of various headers */
|
||||
char *iso_hdr;
|
||||
char *mcs_hdr;
|
||||
char *sec_hdr;
|
||||
char *rdp_hdr;
|
||||
char *channel_hdr;
|
||||
/* other */
|
||||
char *next_packet;
|
||||
struct stream *next;
|
||||
int *source;
|
||||
};
|
||||
|
||||
/** Check arguments to stream primitives
|
||||
*
|
||||
* This adds a function call overhead to every stream primitive and is
|
||||
* intended for development only
|
||||
*
|
||||
* @param s stream
|
||||
* @param n Bytes being requested for input/output
|
||||
* @param is_out (0=input, !0=output)
|
||||
* @param file __file__for caller
|
||||
* @param line __line__ for caller
|
||||
*
|
||||
* On any kind of violation a message is output and the program is
|
||||
* aborted.
|
||||
*/
|
||||
void
|
||||
parser_stream_overflow_check(const struct stream *s, int n, int is_out,
|
||||
const char *file, int line);
|
||||
|
||||
#ifdef USE_DEVEL_STREAMCHECK
|
||||
# define S_CHECK_REM(s,n) \
|
||||
parser_stream_overflow_check((s), (n), 0, __FILE__, __LINE__)
|
||||
# define S_CHECK_REM_OUT(s,n) \
|
||||
parser_stream_overflow_check((s), (n), 1, __FILE__, __LINE__)
|
||||
#else
|
||||
# define S_CHECK_REM(s,n)
|
||||
# define S_CHECK_REM_OUT(s,n)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copies a UTF-8 string to a stream as little-endian UTF-16
|
||||
*
|
||||
* @param s Stream
|
||||
* @param v UTF-8 string
|
||||
* @param vn Length of UTF-8 string.
|
||||
* @param file Caller location (from __FILE__)
|
||||
* @param line Caller location (from __LINE__)
|
||||
*
|
||||
* Caller is expected to check there is room for the result in s
|
||||
*/
|
||||
void
|
||||
out_utf8_as_utf16_le_proc(struct stream *s, const char *v,
|
||||
unsigned int vn,
|
||||
const char *file, int line);
|
||||
|
||||
#define out_utf8_as_utf16_le(s,v,vn) \
|
||||
out_utf8_as_utf16_le_proc((s), (v), (vn), __FILE__, __LINE__)
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copies a fixed-size little-endian UTF-16 string from a stream as UTF-8
|
||||
*
|
||||
* @param s Stream
|
||||
* @param n Number of 16-bit words to copy
|
||||
* @param v Pointer to result buffer
|
||||
* @param vn Max size of result buffer
|
||||
*
|
||||
* @return number of characters which would be written to v, INCLUDING
|
||||
* an additional terminator. This can be used to check for a buffer
|
||||
* overflow. A terminator is added whether or not the input
|
||||
* includes one.
|
||||
*
|
||||
* Output is unconditionally NULL-terminated.
|
||||
* Input is not checked for NULLs - these are copied verbatim
|
||||
*/
|
||||
unsigned int
|
||||
in_utf16_le_fixed_as_utf8_proc(struct stream *s, unsigned int n,
|
||||
char *v, unsigned int vn,
|
||||
const char *file, int line);
|
||||
|
||||
#define in_utf16_le_fixed_as_utf8(s,n,v,vn) \
|
||||
in_utf16_le_fixed_as_utf8_proc((s), (n), (v), (vn), __FILE__, __LINE__)
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Returns the size of the buffer needed to store a fixed-size
|
||||
* little-endian UTF-16 string in a stream as a UTF-8 string
|
||||
*
|
||||
* @param s Stream
|
||||
* @param n Number of 16-bit words to consider
|
||||
* @return number of characters needed to store the UTF-8 string. This
|
||||
* includes a terminator, which is written whether the parsed
|
||||
* string includes one or not.
|
||||
* @post Stream position is not moved between start and end of this call
|
||||
*/
|
||||
unsigned int
|
||||
in_utf16_le_fixed_as_utf8_length(struct stream *s, unsigned int n);
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Copies a terminated little-endian UTF-16 string from a stream as UTF-8
|
||||
*
|
||||
* @param s Stream
|
||||
* @param v Pointer to result buffer
|
||||
* @param vn Max size of result buffer
|
||||
*
|
||||
* @return number of characters which would be written to v, INCLUDING
|
||||
* the terminator. This can be used to check for a buffer overflow.
|
||||
*
|
||||
* Output is unconditionally NULL-terminated.
|
||||
* Input processing stops when a NULL is encountered, or the end of the buffer
|
||||
* is reached.
|
||||
*/
|
||||
unsigned int
|
||||
in_utf16_le_terminated_as_utf8(struct stream *s,
|
||||
char *v, unsigned int vn);
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* Returns the size of the buffer needed to store a terminated
|
||||
* little-endian UTF-16 string in a stream as a terminated UTF-8 string
|
||||
*
|
||||
* @param s Stream
|
||||
* @return number of characters needed to store the UTF-8 string,
|
||||
* including the terminator
|
||||
* @post Stream position is not moved between start and end of this call
|
||||
*
|
||||
* Input processing stops when a NULL is encountered, or the end of the buffer
|
||||
* is reached.
|
||||
*/
|
||||
unsigned int
|
||||
in_utf16_le_terminated_as_utf8_length(struct stream *s);
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_check_rem(s, n) ((s)->p + (n) <= (s)->end)
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @returns true if there are at least n bytes remaining in the stream,
|
||||
* else false and logs an error message
|
||||
*/
|
||||
#define s_check_rem_and_log(s, n, msg_prefix) \
|
||||
( s_check_rem((s), (n)) ? \
|
||||
1 : \
|
||||
LOG(LOG_LEVEL_ERROR, \
|
||||
"%s Not enough bytes in the stream: expected %d, remaining %d", \
|
||||
(msg_prefix), (n), s_rem(s)) \
|
||||
&& 0 )
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_check_rem_out(s, n) ((s)->p + (n) <= (s)->data + (s)->size)
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @returns true if there are at least n bytes remaining in the stream,
|
||||
* else false and logs an error message
|
||||
*/
|
||||
#define s_check_rem_out_and_log(s, n, msg_prefix) \
|
||||
( s_check_rem_out((s), (n)) ? \
|
||||
1 : \
|
||||
LOG(LOG_LEVEL_ERROR, \
|
||||
"%s Not enough bytes in the stream: expected %d, remaining %d", \
|
||||
(msg_prefix), (n), s_rem_out(s)) \
|
||||
&& 0 )
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_check_end(s) ((s)->p == (s)->end)
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @returns true if there are exactly 0 bytes remaining in the stream,
|
||||
* else false and logs an error message
|
||||
*/
|
||||
#define s_check_end_and_log(s, msg_prefix) \
|
||||
( s_check_end((s)) ? \
|
||||
1 : \
|
||||
LOG(LOG_LEVEL_ERROR, \
|
||||
"%s Expected to be at the end of the stream, " \
|
||||
"but there are %d bytes remaining", \
|
||||
(msg_prefix), s_rem(s)) \
|
||||
&& 0 )
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_rem(s) ((int) ((s)->end - (s)->p))
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_rem_out(s) ((int) ((s)->data + (s)->size - (s)->p))
|
||||
|
||||
/******************************************************************************/
|
||||
#define make_stream(s) \
|
||||
(s) = (struct stream*)g_malloc(sizeof(struct stream), 1)
|
||||
|
||||
/******************************************************************************/
|
||||
#define init_stream(s, v) do \
|
||||
{ \
|
||||
if ((v) > (s)->size) \
|
||||
{ \
|
||||
g_free((s)->data); \
|
||||
(s)->data = (char*)g_malloc((v), 0); \
|
||||
(s)->size = (v); \
|
||||
} \
|
||||
(s)->p = (s)->data; \
|
||||
(s)->end = (s)->data; \
|
||||
(s)->next_packet = 0; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define free_stream(s) do \
|
||||
{ \
|
||||
if ((s) != 0) \
|
||||
{ \
|
||||
g_free((s)->data); \
|
||||
} \
|
||||
g_free((s)); \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_push_layer(s, h, n) do \
|
||||
{ \
|
||||
(s)->h = (s)->p; \
|
||||
(s)->p += (n); \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_pop_layer(s, h) \
|
||||
(s)->p = (s)->h
|
||||
|
||||
/******************************************************************************/
|
||||
#define s_mark_end(s) \
|
||||
(s)->end = (s)->p
|
||||
|
||||
#define in_sint8(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 1); \
|
||||
(v) = *((signed char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint8(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 1); \
|
||||
(v) = *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
/******************************************************************************/
|
||||
#define in_uint8_peek(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 1); \
|
||||
v = *s->p; \
|
||||
} while (0)
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define in_sint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 2); \
|
||||
(v) = (signed short) \
|
||||
( \
|
||||
(*((unsigned char*)((s)->p + 0)) << 0) | \
|
||||
(*((unsigned char*)((s)->p + 1)) << 8) \
|
||||
); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#else
|
||||
#define in_sint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 2); \
|
||||
(v) = *((signed short*)((s)->p)); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define in_uint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 2); \
|
||||
(v) = (unsigned short) \
|
||||
( \
|
||||
(*((unsigned char*)((s)->p + 0)) << 0) | \
|
||||
(*((unsigned char*)((s)->p + 1)) << 8) \
|
||||
); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#else
|
||||
#define in_uint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 2); \
|
||||
(v) = *((unsigned short*)((s)->p)); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint16_be(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 2); \
|
||||
(v) = *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
(v) <<= 8; \
|
||||
(v) |= *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define in_uint32_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 4); \
|
||||
(v) = (unsigned int) \
|
||||
( \
|
||||
(*((unsigned char*)((s)->p + 0)) << 0) | \
|
||||
(*((unsigned char*)((s)->p + 1)) << 8) | \
|
||||
(*((unsigned char*)((s)->p + 2)) << 16) | \
|
||||
(*((unsigned char*)((s)->p + 3)) << 24) \
|
||||
); \
|
||||
(s)->p += 4; \
|
||||
} while (0)
|
||||
#else
|
||||
#define in_uint32_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 4); \
|
||||
(v) = *((unsigned int*)((s)->p)); \
|
||||
(s)->p += 4; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define in_uint64_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 8); \
|
||||
(v) = (tui64) \
|
||||
( \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 0)))) << 0) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 1)))) << 8) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 2)))) << 16) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 3)))) << 24) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 4)))) << 32) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 5)))) << 40) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 6)))) << 48) | \
|
||||
(((tui64)(*((unsigned char*)((s)->p + 7)))) << 56) \
|
||||
); \
|
||||
(s)->p += 8; \
|
||||
} while (0)
|
||||
#else
|
||||
#define in_uint64_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 8); \
|
||||
(v) = *((tui64*)((s)->p)); \
|
||||
(s)->p += 8; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint32_be(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), 4); \
|
||||
(v) = *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
(v) <<= 8; \
|
||||
(v) |= *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
(v) <<= 8; \
|
||||
(v) |= *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
(v) <<= 8; \
|
||||
(v) |= *((unsigned char*)((s)->p)); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint8(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 1); \
|
||||
*((s)->p) = (unsigned char)(v); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define out_uint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 2); \
|
||||
*((s)->p) = (unsigned char)((v) >> 0); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
#else
|
||||
#define out_uint16_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 2); \
|
||||
*((unsigned short*)((s)->p)) = (unsigned short)(v); \
|
||||
(s)->p += 2; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint16_be(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 2); \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 0); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define out_uint32_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 4); \
|
||||
*((s)->p) = (unsigned char)((v) >> 0); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 16); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 24); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
#else
|
||||
#define out_uint32_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 4); \
|
||||
*((unsigned int*)((s)->p)) = (v); \
|
||||
(s)->p += 4; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#if defined(B_ENDIAN) || defined(NEED_ALIGN)
|
||||
#define out_uint64_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 8); \
|
||||
*((s)->p) = (unsigned char)((v) >> 0); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 16); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 24); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 32); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 40); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 48); \
|
||||
(s)->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 56); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
#else
|
||||
#define out_uint64_le(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 8); \
|
||||
*((tui64*)((s)->p)) = (v); \
|
||||
(s)->p += 8; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint32_be(s, v) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), 4); \
|
||||
*((s)->p) = (unsigned char)((v) >> 24); \
|
||||
s->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 16); \
|
||||
s->p++; \
|
||||
*((s)->p) = (unsigned char)((v) >> 8); \
|
||||
s->p++; \
|
||||
*((s)->p) = (unsigned char)(v); \
|
||||
(s)->p++; \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint8p(s, v, n) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), (n)); \
|
||||
(v) = (s)->p; \
|
||||
(s)->p += (n); \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint8a(s, v, n) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), (n)); \
|
||||
g_memcpy((v), (s)->p, (n)); \
|
||||
(s)->p += (n); \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define in_uint8s(s, n) do \
|
||||
{ \
|
||||
S_CHECK_REM((s), (n)); \
|
||||
(s)->p += (n); \
|
||||
} while (0);
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint8p(s, v, n) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), (n)); \
|
||||
g_memcpy((s)->p, (v), (n)); \
|
||||
(s)->p += (n); \
|
||||
} while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint8a(s, v, n) \
|
||||
out_uint8p((s), (v), (n))
|
||||
|
||||
/******************************************************************************/
|
||||
#define out_uint8s(s, n) do \
|
||||
{ \
|
||||
S_CHECK_REM_OUT((s), (n)); \
|
||||
g_memset((s)->p, 0, (n)); \
|
||||
(s)->p += (n); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* @brief allocate a new stream
|
||||
*
|
||||
* @param _s opaque handle to the new stream
|
||||
* @param _l length of new stream
|
||||
******************************************************************************/
|
||||
#define xstream_new(_s, _l) \
|
||||
do \
|
||||
{ \
|
||||
make_stream((_s)); \
|
||||
init_stream((_s), (_l)); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief release a previously allocated stream
|
||||
*
|
||||
* @param _s opaque handle returned by stream_new()
|
||||
*****************************************************************************/
|
||||
#define xstream_free(_s) free_stream(_s)
|
||||
|
||||
#define xstream_skip_u8(_s, _n) in_uint8s(_s, _n)
|
||||
|
||||
#define xstream_rd_u8(_s, _var) in_uint8(_s, _var)
|
||||
#define xstream_rd_u16_le(_s, _var) in_uint16_le(_s, _var)
|
||||
#define xstream_rd_u32_le(_s, _var) in_uint32_le(_s, _var)
|
||||
|
||||
#define xstream_rd_s8_le(_s, _var) in_sint8(_s, _var)
|
||||
#define xstream_rd_s16_le(_s, _var) in_sint16_le(_s, _var)
|
||||
#define xstream_rd_s32_le(_s, _var) TODO
|
||||
|
||||
#define xstream_wr_u8(_s, _var) out_uint8(_s, _var)
|
||||
#define xstream_wr_u16_le(_s, _var) out_uint16_le(_s, _var)
|
||||
#define xstream_wr_u32_le(_s, _var) out_uint32_le(_s, _var)
|
||||
|
||||
#define xstream_wr_s8(_s, _var) TODO
|
||||
#define xstream_wr_s16_le(_s, _var) TODO
|
||||
#define xstream_wr_s32_le(_s, _var) TODO
|
||||
|
||||
#define xstream_rd_u64_le(_s, _v) \
|
||||
do \
|
||||
{ \
|
||||
_v = \
|
||||
(tui64)(*((unsigned char *)_s->p)) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 1))) << 8) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 2))) << 16) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 3))) << 24) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 4))) << 32) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 5))) << 40) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 6))) << 48) | \
|
||||
(((tui64) (*(((unsigned char *)_s->p) + 7))) << 56); \
|
||||
_s->p += 8; \
|
||||
} while (0)
|
||||
|
||||
#define xstream_wr_u64_le(_s, _v) \
|
||||
do \
|
||||
{ \
|
||||
*(((unsigned char *) _s->p) + 0) = (unsigned char) ((_v >> 0) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 1) = (unsigned char) ((_v >> 8) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 2) = (unsigned char) ((_v >> 16) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 3) = (unsigned char) ((_v >> 24) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 4) = (unsigned char) ((_v >> 32) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 5) = (unsigned char) ((_v >> 40) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 6) = (unsigned char) ((_v >> 48) & 0xff); \
|
||||
*(((unsigned char *) _s->p) + 7) = (unsigned char) ((_v >> 56) & 0xff); \
|
||||
_s->p += 8; \
|
||||
} while (0)
|
||||
|
||||
/* copy data into stream */
|
||||
#define xstream_copyin(_s, _dest, _len) \
|
||||
do \
|
||||
{ \
|
||||
g_memcpy((_s)->p, (_dest), (_len)); \
|
||||
(_s)->p += (_len); \
|
||||
} while (0)
|
||||
|
||||
/* copy data out of stream */
|
||||
#define xstream_copyout(_dest, _s, _len) \
|
||||
do \
|
||||
{ \
|
||||
g_memcpy((_dest), (_s)->p, (_len)); \
|
||||
(_s)->p += (_len); \
|
||||
} while (0)
|
||||
|
||||
#define xstream_rd_string(_dest, _s, _len) \
|
||||
do \
|
||||
{ \
|
||||
g_memcpy((_dest), (_s)->p, (_len)); \
|
||||
(_s)->p += (_len); \
|
||||
} while (0)
|
||||
|
||||
#define xstream_wr_string(_s, _src, _len) \
|
||||
do \
|
||||
{ \
|
||||
g_memcpy((_s)->p, (_src), (_len)); \
|
||||
(_s)->p += (_len); \
|
||||
} while (0)
|
||||
|
||||
#define xstream_len(_s) (int) ((_s)->p - (_s)->data)
|
||||
#define xstream_seek(_s, _len) (_s)->p += (_len)
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,75 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2016
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* region, from pixman.h
|
||||
*/
|
||||
|
||||
#ifndef PIXMAN_PIXMAN_H__
|
||||
#define PIXMAN_PIXMAN_H__
|
||||
|
||||
typedef int pixman_bool_t;
|
||||
|
||||
struct pixman_region16_data
|
||||
{
|
||||
long size;
|
||||
long numRects;
|
||||
};
|
||||
|
||||
struct pixman_box16
|
||||
{
|
||||
signed short x1, y1, x2, y2;
|
||||
};
|
||||
|
||||
struct pixman_region16
|
||||
{
|
||||
struct pixman_box16 extents;
|
||||
struct pixman_region16_data *data;
|
||||
};
|
||||
|
||||
enum _pixman_region_overlap_t
|
||||
{
|
||||
PIXMAN_REGION_OUT,
|
||||
PIXMAN_REGION_IN,
|
||||
PIXMAN_REGION_PART
|
||||
};
|
||||
|
||||
typedef enum _pixman_region_overlap_t pixman_region_overlap_t;
|
||||
|
||||
typedef struct pixman_region16_data pixman_region16_data_t;
|
||||
typedef struct pixman_box16 pixman_box16_t;
|
||||
typedef struct pixman_region16 pixman_region16_t;
|
||||
|
||||
/* creation/destruction */
|
||||
void pixman_region_init (pixman_region16_t *region);
|
||||
void pixman_region_init_rect (pixman_region16_t *region, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
void pixman_region_fini (pixman_region16_t *region);
|
||||
pixman_bool_t pixman_region_union (pixman_region16_t *new_reg,
|
||||
pixman_region16_t *reg1,
|
||||
pixman_region16_t *reg2);
|
||||
pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d,
|
||||
pixman_region16_t *reg_m,
|
||||
pixman_region16_t *reg_s);
|
||||
pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg,
|
||||
pixman_region16_t *reg1,
|
||||
pixman_region16_t *reg2);
|
||||
pixman_box16_t *pixman_region_rectangles (pixman_region16_t *region,
|
||||
int *n_rects);
|
||||
pixman_bool_t pixman_region_not_empty (pixman_region16_t *region);
|
||||
pixman_box16_t *pixman_region_extents (pixman_region16_t *region);
|
||||
|
||||
#endif
|
||||
@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2008 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation, and that the name of
|
||||
* Red Hat, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior
|
||||
* permission. Red Hat, Inc. makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
|
||||
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Soren Sandmann <sandmann@redhat.com>
|
||||
*/
|
||||
|
||||
/* taken from pixman 0.34
|
||||
altered to compile without all of pixman */
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "config_ac.h"
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "pixman-region.h"
|
||||
|
||||
#if !defined(UINT32_MAX)
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
#if !defined(INT16_MIN)
|
||||
#define INT16_MIN (-32767-1)
|
||||
#endif
|
||||
#if !defined(INT16_MAX)
|
||||
#define INT16_MAX (32767)
|
||||
#endif
|
||||
|
||||
#define PIXMAN_EXPORT
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2))
|
||||
#define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2))
|
||||
|
||||
typedef pixman_box16_t box_type_t;
|
||||
typedef pixman_region16_data_t region_data_type_t;
|
||||
typedef pixman_region16_t region_type_t;
|
||||
typedef signed int overflow_int_t;
|
||||
|
||||
#define PREFIX(x) pixman_region##x
|
||||
|
||||
#define PIXMAN_REGION_MAX INT16_MAX
|
||||
#define PIXMAN_REGION_MIN INT16_MIN
|
||||
|
||||
#define FUNC "func"
|
||||
|
||||
#define critical_if_fail(expr)
|
||||
|
||||
int _pixman_log_error(const char *func, const char *format, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "pixman-region.c"
|
||||
|
||||
147
common/rail.h
147
common/rail.h
@ -1,147 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2012-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(_RAIL_H)
|
||||
#define _RAIL_H
|
||||
|
||||
/*
|
||||
ORDER_TYPE_WINDOW
|
||||
WINDOW_ORDER_TYPE_WINDOW
|
||||
WINDOW_ORDER_ICON
|
||||
WINDOW_ORDER_CACHED_ICON
|
||||
WINDOW_ORDER_STATE_DELETED
|
||||
WINDOW_ORDER_STATE_NEW on
|
||||
WINDOW_ORDER_STATE_NEW off
|
||||
WINDOW_ORDER_TYPE_NOTIFY
|
||||
WINDOW_ORDER_STATE_DELETED
|
||||
WINDOW_ORDER_STATE_NEW on
|
||||
WINDOW_ORDER_STATE_NEW off
|
||||
WINDOW_ORDER_TYPE_DESKTOP
|
||||
WINDOW_ORDER_FIELD_DESKTOP_NONE on
|
||||
WINDOW_ORDER_FIELD_DESKTOP_NONE off
|
||||
*/
|
||||
|
||||
/* Window Order Header Flags */
|
||||
#define WINDOW_ORDER_TYPE_WINDOW 0x01000000
|
||||
#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000
|
||||
#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000
|
||||
#define WINDOW_ORDER_STATE_NEW 0x10000000
|
||||
#define WINDOW_ORDER_STATE_DELETED 0x20000000
|
||||
#define WINDOW_ORDER_FIELD_OWNER 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_STYLE 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_SHOW 0x00000010
|
||||
#define WINDOW_ORDER_FIELD_TITLE 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000
|
||||
#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000
|
||||
#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000
|
||||
#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000
|
||||
#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800
|
||||
#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000
|
||||
#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400
|
||||
#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100
|
||||
#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000
|
||||
#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200
|
||||
#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000
|
||||
#define WINDOW_ORDER_ICON 0x40000000
|
||||
#define WINDOW_ORDER_CACHED_ICON 0x80000000
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020
|
||||
|
||||
struct rail_icon_info
|
||||
{
|
||||
int bpp;
|
||||
int width;
|
||||
int height;
|
||||
int cmap_bytes;
|
||||
int mask_bytes;
|
||||
int data_bytes;
|
||||
char *mask;
|
||||
char *cmap;
|
||||
char *data;
|
||||
};
|
||||
|
||||
struct rail_window_rect
|
||||
{
|
||||
short left;
|
||||
short top;
|
||||
short right;
|
||||
short bottom;
|
||||
};
|
||||
|
||||
struct rail_notify_icon_infotip
|
||||
{
|
||||
int timeout;
|
||||
int flags;
|
||||
char *text;
|
||||
char *title;
|
||||
};
|
||||
|
||||
struct rail_window_state_order
|
||||
{
|
||||
int owner_window_id;
|
||||
int style;
|
||||
int extended_style;
|
||||
int show_state;
|
||||
char *title_info;
|
||||
int client_offset_x;
|
||||
int client_offset_y;
|
||||
int client_area_width;
|
||||
int client_area_height;
|
||||
int rp_content;
|
||||
int root_parent_handle;
|
||||
int window_offset_x;
|
||||
int window_offset_y;
|
||||
int window_client_delta_x;
|
||||
int window_client_delta_y;
|
||||
int window_width;
|
||||
int window_height;
|
||||
int num_window_rects;
|
||||
struct rail_window_rect *window_rects;
|
||||
int visible_offset_x;
|
||||
int visible_offset_y;
|
||||
int num_visibility_rects;
|
||||
struct rail_window_rect *visibility_rects;
|
||||
};
|
||||
|
||||
struct rail_notify_state_order
|
||||
{
|
||||
int version;
|
||||
char *tool_tip;
|
||||
struct rail_notify_icon_infotip infotip;
|
||||
int state;
|
||||
int icon_cache_entry;
|
||||
int icon_cache_id;
|
||||
struct rail_icon_info icon_info;
|
||||
};
|
||||
|
||||
struct rail_monitored_desktop_order
|
||||
{
|
||||
int active_window_id;
|
||||
int num_window_ids;
|
||||
int *window_ids;
|
||||
};
|
||||
|
||||
#endif
|
||||
1537
common/ssl_calls.c
1537
common/ssl_calls.c
File diff suppressed because it is too large
Load Diff
@ -1,115 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
* Copyright (C) Idan Freiberg 2013-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(SSL_CALLS_H)
|
||||
#define SSL_CALLS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/* Incomplete types */
|
||||
struct ssl_tls;
|
||||
struct trans;
|
||||
|
||||
int
|
||||
ssl_init(void);
|
||||
int
|
||||
ssl_finish(void);
|
||||
void *
|
||||
ssl_rc4_info_create(void);
|
||||
void
|
||||
ssl_rc4_info_delete(void *rc4_info);
|
||||
void
|
||||
ssl_rc4_set_key(void *rc4_info, const char *key, int len);
|
||||
void
|
||||
ssl_rc4_crypt(void *rc4_info, char *data, int len);
|
||||
void *
|
||||
ssl_sha1_info_create(void);
|
||||
void
|
||||
ssl_sha1_info_delete(void *sha1_info);
|
||||
void
|
||||
ssl_sha1_clear(void *sha1_info);
|
||||
void
|
||||
ssl_sha1_transform(void *sha1_info, const char *data, int len);
|
||||
void
|
||||
ssl_sha1_complete(void *sha1_info, char *data);
|
||||
void *
|
||||
ssl_md5_info_create(void);
|
||||
void
|
||||
ssl_md5_info_delete(void *md5_info);
|
||||
void
|
||||
ssl_md5_clear(void *md5_info);
|
||||
void
|
||||
ssl_md5_transform(void *md5_info, const char *data, int len);
|
||||
void
|
||||
ssl_md5_complete(void *md5_info, char *data);
|
||||
void *
|
||||
ssl_des3_encrypt_info_create(const char *key, const char *ivec);
|
||||
void *
|
||||
ssl_des3_decrypt_info_create(const char *key, const char *ivec);
|
||||
void
|
||||
ssl_des3_info_delete(void *des3);
|
||||
int
|
||||
ssl_des3_encrypt(void *des3, int length, const char *in_data, char *out_data);
|
||||
int
|
||||
ssl_des3_decrypt(void *des3, int length, const char *in_data, char *out_data);
|
||||
void *
|
||||
ssl_hmac_info_create(void);
|
||||
void
|
||||
ssl_hmac_info_delete(void *hmac);
|
||||
void
|
||||
ssl_hmac_sha1_init(void *hmac, const char *data, int len);
|
||||
void
|
||||
ssl_hmac_transform(void *hmac, const char *data, int len);
|
||||
void
|
||||
ssl_hmac_complete(void *hmac, char *data, int len);
|
||||
int
|
||||
ssl_mod_exp(char *out, int out_len, const char *in, int in_len,
|
||||
const char *mod, int mod_len, const char *exp, int exp_len);
|
||||
int
|
||||
ssl_gen_key_xrdp1(int key_size_in_bits, const char *exp, int exp_len,
|
||||
char *mod, int mod_len, char *pri, int pri_len);
|
||||
|
||||
/* xrdp_tls.c */
|
||||
struct ssl_tls *
|
||||
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
|
||||
int
|
||||
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
|
||||
const char *tls_ciphers);
|
||||
int
|
||||
ssl_tls_disconnect(struct ssl_tls *self);
|
||||
void
|
||||
ssl_tls_delete(struct ssl_tls *self);
|
||||
int
|
||||
ssl_tls_read(struct ssl_tls *tls, char *data, int length);
|
||||
int
|
||||
ssl_tls_write(struct ssl_tls *tls, const char *data, int length);
|
||||
int
|
||||
ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis);
|
||||
const char *
|
||||
ssl_get_version(const struct ssl_tls *ssl);
|
||||
const char *
|
||||
ssl_get_cipher_name(const struct ssl_tls *ssl);
|
||||
int
|
||||
ssl_get_protocols_from_string(const char *str, long *ssl_protocols);
|
||||
const char *
|
||||
get_openssl_version();
|
||||
tintptr
|
||||
ssl_get_rwo(const struct ssl_tls *ssl);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,406 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2020
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* generic string handling calls
|
||||
*/
|
||||
|
||||
#if !defined(STRING_CALLS_H)
|
||||
#define STRING_CALLS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
/**
|
||||
* Map a character to a string value
|
||||
*
|
||||
* This structure is used by g_format_info_string() to specify the
|
||||
* string which could be output for %'ch', where ch is a character
|
||||
*/
|
||||
struct info_string_tag
|
||||
{
|
||||
char ch;
|
||||
const char *val;
|
||||
};
|
||||
|
||||
#define INFO_STRING_END_OF_LIST { '\0', NULL }
|
||||
|
||||
/**
|
||||
* Map a bitmask to a string value
|
||||
*
|
||||
*
|
||||
* This structure is used by g_bitmask_to_str() to specify the
|
||||
* string for each bit in the bitmask
|
||||
*/
|
||||
struct bitmask_string
|
||||
{
|
||||
int mask;
|
||||
const char *str;
|
||||
};
|
||||
|
||||
#define BITMASK_STRING_END_OF_LIST { 0, NULL }
|
||||
|
||||
/**
|
||||
* Map a bitmask to a char value
|
||||
*
|
||||
*
|
||||
* This structure is used by g_bitmask_to_charstr() to specify the
|
||||
* char for each bit in the bitmask
|
||||
*/
|
||||
struct bitmask_char
|
||||
{
|
||||
int mask;
|
||||
char c;
|
||||
};
|
||||
|
||||
#define BITMASK_CHAR_END_OF_LIST { 0, '\0' }
|
||||
|
||||
enum
|
||||
{
|
||||
// See g_sig2text()
|
||||
// Must be able to hold "SIG#%d" for INT_MIN
|
||||
//
|
||||
// ((sizeof(int) * 5 + 1) / 2) provides a very slight overestimate of
|
||||
// the bytes requires to store a decimal expansion of 'int':-
|
||||
// sizeof INT_MAX display bytes ((sizeof(int) * 5 + 1)
|
||||
// (int) needed / 2)
|
||||
// ------ ------- ------------- ---------------------------
|
||||
// 1 127 3 3
|
||||
// 2 32767 5 5
|
||||
// 3 8388607 7 8
|
||||
// 4 2147483637 10 10
|
||||
// 8 9*(10**18) 19 20
|
||||
// 16 2*(10**38) 39 40
|
||||
// 32 6*(10**76) 77 80
|
||||
MAXSTRSIGLEN = (3 + 1 + 1 + ((sizeof(int) * 5 + 1) / 2) + 1)
|
||||
};
|
||||
|
||||
/*
|
||||
* Significant Universal Character Set (Unicode) characters
|
||||
*/
|
||||
enum
|
||||
{
|
||||
UCS_WHITE_SQUARE = 0x25a1,
|
||||
UCS_REPLACEMENT_CHARACTER = 0xfffd
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes a format string for general info
|
||||
*
|
||||
* @param[out] dest Destination buffer
|
||||
* @param[in] len Length of buffer, including space for a terminator
|
||||
* @param[in] format Format string to process
|
||||
* @param[in] map Array of struct info_string_tag.
|
||||
*
|
||||
* Where a '%<ch>' is encountered in the format string, the map is scanned
|
||||
* and the corresponding string is copied instead of '%<ch>'.
|
||||
*
|
||||
* '%%' is always replaced with a single '%' in the output. %<ch> strings
|
||||
* not present in the map are ignored.
|
||||
*
|
||||
* The map is terminated with INFO_STRING_END_OF_LIST
|
||||
*
|
||||
* Caller can check for buffer truncation by comparing the result with
|
||||
* the buffer length (as in snprintf())
|
||||
*/
|
||||
unsigned int
|
||||
g_format_info_string(char *dest, unsigned int len,
|
||||
const char *format,
|
||||
const struct info_string_tag map[]);
|
||||
|
||||
|
||||
/**
|
||||
* Converts a boolean to a string for output
|
||||
*
|
||||
* @param[in] value Value to convert
|
||||
* @return String representation
|
||||
*/
|
||||
const char *
|
||||
g_bool2text(int value);
|
||||
|
||||
/**
|
||||
* Converts a string to a boolean value
|
||||
*
|
||||
* @param[in] s String to convert
|
||||
* @return machine representation
|
||||
*/
|
||||
int
|
||||
g_text2bool(const char *s);
|
||||
|
||||
/**
|
||||
* Joins an array of strings into a single string.
|
||||
*
|
||||
* Note: The joiner is placed between each source string. The joiner is not
|
||||
* placed after the last source string. If there is only one source string,
|
||||
* then the result string will be equal to the source string.
|
||||
*
|
||||
* Note: any content that is present in dest will be overwritten with the new
|
||||
* joined string.
|
||||
*
|
||||
* Note: If the destination array is not large enough to hold the entire
|
||||
* contents of the joined string, then the joined string will be truncated
|
||||
* to fit in the destination array.
|
||||
*
|
||||
* @param[out] dest The destination array to write the joined string into.
|
||||
* @param[in] dest_len The max number of characters to write to the destination
|
||||
* array including the terminating null. Must be > 0
|
||||
* @param[in] joiner The string to concatenate between each source string.
|
||||
* The joiner string may be NULL which is processed as a zero length string.
|
||||
* @param[in] src An array of strings to join. The array must be non-null.
|
||||
* Array items may be NULL and are processed as zero length strings.
|
||||
* @param[in] src_len The number of strings to join in the src array. Must be > 0
|
||||
* @return A pointer to the beginning of the joined string (ie. returns dest).
|
||||
*/
|
||||
char *
|
||||
g_strnjoin(char *dest, int dest_len, const char *joiner, const char *src[], int src_len);
|
||||
|
||||
/**
|
||||
* Converts a binary array into a hux dump suitable for displaying to a user.
|
||||
*
|
||||
* The format of the hex dump is:
|
||||
* 0000 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ................
|
||||
* /\ /\ /\
|
||||
* | | |
|
||||
* | | ascii representation of bytes
|
||||
* | hex representation of bytes
|
||||
* offset from beginning of the byte array in hex
|
||||
*
|
||||
* Note: the ascii representation uses '.' for all non-printable
|
||||
* characters (eg. below 32 or above 127).
|
||||
*
|
||||
* Note: the string contains embedded new lines, but is not new line terminated.
|
||||
*
|
||||
* @param[in] src Value to convert
|
||||
* @param[in] len The number of bytes in src to convert
|
||||
* @return string containing the hex dump that must be free'd by the caller
|
||||
*/
|
||||
char *
|
||||
g_bytes_to_hexdump(const char *src, int len);
|
||||
|
||||
/**
|
||||
* Extracts the display number from an X11 display string
|
||||
*
|
||||
* @param Display string (i.e. g_getenv("DISPLAY"))
|
||||
*
|
||||
* @result <0 if the string could not be parsed, or >=0 for a display number
|
||||
*/
|
||||
int
|
||||
g_get_display_num_from_display(const char *display_text);
|
||||
|
||||
/**
|
||||
* Converts a bitmask into a string for output purposes
|
||||
*
|
||||
* Similar to g_bitmask_to_charstr(), but tokens are strings, separated
|
||||
* by delimiters.
|
||||
*
|
||||
* @param bitmask Bitmask to convert
|
||||
* @param bitdefs Definitions for strings for bits
|
||||
* @param delim Delimiter to use between strings
|
||||
* @param buff Output buff
|
||||
* @param bufflen Length of buff, including terminator '`\0'
|
||||
*
|
||||
* @return Total length excluding terminator which would be written, as
|
||||
* in snprintf(). Can be used to check for overflow
|
||||
*
|
||||
* @note Any undefined bits in the bitmask are appended to the output as
|
||||
* a hexadecimal constant.
|
||||
*/
|
||||
int
|
||||
g_bitmask_to_str(int bitmask, const struct bitmask_string bitdefs[],
|
||||
char delim, char *buff, int bufflen);
|
||||
|
||||
/***
|
||||
* Converts a string containing a series of tokens to a bitmask.
|
||||
*
|
||||
* Similar to g_charstr_to_bitmask(), but tokens are strings, separated
|
||||
* by delimiters.
|
||||
*
|
||||
* @param str Input string
|
||||
* @param bitdefs Array mapping tokens to bitmask values
|
||||
* @param delim Delimiter for tokens in str
|
||||
* @param[out] unrecognised Buffer for any unrecognised tokens
|
||||
* @param unrecognised_len Length of unrecognised including '\0';
|
||||
* @return bitmask value for recognised tokens
|
||||
*/
|
||||
int
|
||||
g_str_to_bitmask(const char *str, const struct bitmask_string bitdefs[],
|
||||
const char *delim, char *unrecognised,
|
||||
int unrecognised_len);
|
||||
|
||||
/**
|
||||
* Converts a bitmask into a string for output purposes
|
||||
*
|
||||
* Similar to g_bitmask_to_str(), but tokens are individual characters, and
|
||||
* there are no delimiters.
|
||||
*
|
||||
* @param bitmask Bitmask to convert
|
||||
* @param bitdefs Definitions for strings for bits
|
||||
* @param buff Output buff
|
||||
* @param bufflen Length of buff, including terminator '`\0'
|
||||
* @param[out] rest Any unused bits which weren't covered by bitdefs.
|
||||
* May be NULL.
|
||||
*
|
||||
* @return Total length excluding terminator which would be written, as
|
||||
* in snprintf(). Can be used to check for overflow
|
||||
*
|
||||
* @note Any undefined bits in the bitmask are appended to the output as
|
||||
* a hexadecimal constant.
|
||||
*/
|
||||
int
|
||||
g_bitmask_to_charstr(int bitmask, const struct bitmask_char bitdefs[],
|
||||
char *buff, int bufflen, int *rest);
|
||||
|
||||
/***
|
||||
* Converts a string containing a series of characters to a bitmask.
|
||||
*
|
||||
* Similar to g_str_to_bitmask(), but tokens are individual characters, and
|
||||
* there are no delimiters.
|
||||
*
|
||||
* @param str Input string
|
||||
* @param bitdefs Array mapping tokens to bitmask values
|
||||
* @param delim Delimiter for tokens in str
|
||||
* @param[out] unrecognised Buffer for any unrecognised tokens
|
||||
* @param unrecognised_len Length of unrecognised including '\0';
|
||||
* @return bitmask value for recognised tokens
|
||||
*/
|
||||
int
|
||||
g_charstr_to_bitmask(const char *str, const struct bitmask_char bitdefs[],
|
||||
char *unrecognised, int unrecognised_len);
|
||||
|
||||
int g_strlen(const char *text);
|
||||
char *g_strchr(const char *text, int c);
|
||||
char *g_strrchr(const char *text, int c);
|
||||
char *g_strnchr(const char *text, int c, int len);
|
||||
char *g_strcpy(char *dest, const char *src);
|
||||
char *g_strncpy(char *dest, const char *src, int len);
|
||||
char *g_strcat(char *dest, const char *src);
|
||||
char *g_strncat(char *dest, const char *src, int len);
|
||||
char *g_strdup(const char *in);
|
||||
char *g_strndup(const char *in, const unsigned int maxlen);
|
||||
int g_strcmp(const char *c1, const char *c2);
|
||||
int g_strncmp(const char *c1, const char *c2, int len);
|
||||
int g_strncmp_d(const char *c1, const char *c2, const char delim, int len);
|
||||
int g_strcasecmp(const char *c1, const char *c2);
|
||||
int g_strncasecmp(const char *c1, const char *c2, int len);
|
||||
int g_atoi(const char *str);
|
||||
|
||||
/**
|
||||
* Extends g_atoi(), Converts decimal and hexadecimal number String to integer
|
||||
*
|
||||
* Prefix hexadecimal numbers with '0x'
|
||||
*
|
||||
* @param str String to convert to an integer
|
||||
* @return int Integer expression of a string
|
||||
*/
|
||||
int g_atoix(const char *str);
|
||||
int g_htoi(char *str);
|
||||
int g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str,
|
||||
int bytes_out_str);
|
||||
int g_pos(const char *str, const char *to_find);
|
||||
char *g_strstr(const char *haystack, const char *needle);
|
||||
|
||||
/** trim spaces and tabs, anything <= space
|
||||
*
|
||||
* @param str (assumed to be UTF-8)
|
||||
* @param trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through
|
||||
* @return != 0 - trim_flags not recognised
|
||||
* this will always shorten the string or not change it */
|
||||
int g_strtrim(char *str, int trim_flags);
|
||||
|
||||
/**
|
||||
* Maps a signal number to a string, i.e. SIGHUP -> "SIGHUP"
|
||||
*
|
||||
* @param signum Signal number
|
||||
* @param sigstr buffer for result
|
||||
* @return sigstr, for convenience
|
||||
*
|
||||
* Buffer is assumed to be at least MAXSTRSIGLEN
|
||||
*
|
||||
* The string "SIG#<num>" is returned for unrecognised signums
|
||||
*/
|
||||
char *g_sig2text(int signum, char sigstr[]);
|
||||
|
||||
/**
|
||||
* Get the next Unicode character from a UTF-8 string
|
||||
*
|
||||
* @param utf8str_ref UTF 8 string [by reference]
|
||||
* @param len_ref Length of string [by reference] or NULL
|
||||
* @return Unicode character
|
||||
*
|
||||
* On return, utf8str and len are updated to point past the decoded character.
|
||||
* Unrecognised characters are mapped to UCS_REPLACEMENT_CHARACTER
|
||||
*
|
||||
* len is not needed if your utf8str has a terminator, or is known to
|
||||
* be well-formed.
|
||||
*/
|
||||
char32_t
|
||||
utf8_get_next_char(const char **utf8str_ref, unsigned int *len_ref);
|
||||
|
||||
/**
|
||||
* Convert a Unicode character to UTF-8
|
||||
* @param c32 Unicode character
|
||||
* @param u8str buffer containing at least MAXLEN_UTF8_CHAR bytes for result
|
||||
* @return Number of bytes written to u8str. Can be NULL if only the
|
||||
* length is needed.
|
||||
*
|
||||
* The bytes written to u8str are unterminated
|
||||
*/
|
||||
#define MAXLEN_UTF8_CHAR 4
|
||||
unsigned int
|
||||
utf_char32_to_utf8(char32_t c32, char *u8str);
|
||||
|
||||
/**
|
||||
* Returns the number of Unicode characters in a UTF-8 string
|
||||
* @param utf8str UTF-8 string
|
||||
* @result Number of Unicode characters in the string (terminator not included)
|
||||
*/
|
||||
unsigned int
|
||||
utf8_char_count(const char *utf8str);
|
||||
|
||||
/**
|
||||
* Returns the number of UTF-16 words required to store a UTF-8 string
|
||||
* @param utf8str UTF-8 string
|
||||
* @param len Length of UTF-8 string
|
||||
* @result number of words to store UTF-8 string as UTF-16.
|
||||
*/
|
||||
unsigned int
|
||||
utf8_as_utf16_word_count(const char *utf8str, unsigned int len);
|
||||
|
||||
/**
|
||||
* Add a Unicode character into a UTF-8 string
|
||||
* @param utf8str Pointer to UTF-8 string
|
||||
* @param len Length of buffer for UTF-8 string (includes NULL)
|
||||
* @param c32 character to add
|
||||
* @param index Where to add the codepoint
|
||||
* @return 1 for success, 0 if no character was inserted
|
||||
*
|
||||
* This routine has to parse the string as it goes, so can be slow.
|
||||
*/
|
||||
int
|
||||
utf8_add_char_at(char *utf8str, unsigned int len, char32_t c32,
|
||||
unsigned int index);
|
||||
|
||||
/**
|
||||
* Remove a Unicode character from a UTF-8 string
|
||||
* @param utf8str Pointer to UTF-8 string
|
||||
* @param index Where to remove the codepoint from (0-based)
|
||||
* @return Character removed, or 0 if no character was removed
|
||||
*
|
||||
* This routine has to parse the string as it goes, so can be slow.
|
||||
*/
|
||||
char32_t
|
||||
utf8_remove_char_at(char *utf8str, unsigned int index);
|
||||
|
||||
#endif
|
||||
@ -1,229 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* thread calls
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#elif defined(__APPLE__)
|
||||
#include <pthread.h>
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <dispatch/time.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
#endif
|
||||
#include "arch.h"
|
||||
#include "thread_calls.h"
|
||||
#include "os_calls.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error */
|
||||
#if defined(_WIN32)
|
||||
int
|
||||
tc_thread_create(unsigned long (__stdcall *start_routine)(void *), void *arg)
|
||||
{
|
||||
int rv = 0;
|
||||
DWORD thread_id = 0;
|
||||
HANDLE thread = (HANDLE)0;
|
||||
|
||||
/* CreateThread returns handle or zero on error */
|
||||
thread = CreateThread(0, 0, start_routine, arg, 0, &thread_id);
|
||||
rv = !thread;
|
||||
CloseHandle(thread);
|
||||
return rv;
|
||||
}
|
||||
#else
|
||||
int
|
||||
tc_thread_create(void *(* start_routine)(void *), void *arg)
|
||||
{
|
||||
int rv = 0;
|
||||
pthread_t thread = (pthread_t)0;
|
||||
|
||||
g_memset(&thread, 0x00, sizeof(pthread_t));
|
||||
|
||||
/* pthread_create returns error */
|
||||
rv = pthread_create(&thread, 0, start_routine, arg);
|
||||
|
||||
if (!rv)
|
||||
{
|
||||
rv = pthread_detach(thread);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
tbus
|
||||
tc_get_threadid(void)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return (tbus)GetCurrentThreadId();
|
||||
#else
|
||||
return (tbus)pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns boolean */
|
||||
int
|
||||
tc_threadid_equal(tbus tid1, tbus tid2)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return tid1 == tid2;
|
||||
#else
|
||||
return pthread_equal((pthread_t)tid1, (pthread_t)tid2);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
tbus
|
||||
tc_mutex_create(void)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return (tbus)CreateMutex(0, 0, 0);
|
||||
#else
|
||||
pthread_mutex_t *lmutex;
|
||||
|
||||
lmutex = (pthread_mutex_t *)g_malloc(sizeof(pthread_mutex_t), 0);
|
||||
pthread_mutex_init(lmutex, 0);
|
||||
return (tbus)lmutex;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
tc_mutex_delete(tbus mutex)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
CloseHandle((HANDLE)mutex);
|
||||
#else
|
||||
pthread_mutex_t *lmutex;
|
||||
|
||||
lmutex = (pthread_mutex_t *)mutex;
|
||||
pthread_mutex_destroy(lmutex);
|
||||
g_free(lmutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
tc_mutex_lock(tbus mutex)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
WaitForSingleObject((HANDLE)mutex, INFINITE);
|
||||
return 0;
|
||||
#else
|
||||
pthread_mutex_lock((pthread_mutex_t *)mutex);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
tc_mutex_unlock(tbus mutex)
|
||||
{
|
||||
int rv = 0;
|
||||
#if defined(_WIN32)
|
||||
ReleaseMutex((HANDLE)mutex);
|
||||
#else
|
||||
|
||||
if (mutex != 0)
|
||||
{
|
||||
rv = pthread_mutex_unlock((pthread_mutex_t *)mutex);
|
||||
}
|
||||
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
tbus
|
||||
tc_sem_create(int init_count)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
HANDLE sem;
|
||||
|
||||
sem = CreateSemaphore(0, init_count, init_count + 10, 0);
|
||||
return (tbus)sem;
|
||||
#elif defined(__APPLE__)
|
||||
dispatch_semaphore_t sem = dispatch_semaphore_create(init_count);
|
||||
return (tbus)sem;
|
||||
#else
|
||||
sem_t *sem = (sem_t *)NULL;
|
||||
|
||||
sem = (sem_t *)g_malloc(sizeof(sem_t), 0);
|
||||
sem_init(sem, 0, init_count);
|
||||
return (tbus)sem;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
tc_sem_delete(tbus sem)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
CloseHandle((HANDLE)sem);
|
||||
#elif defined(__APPLE__)
|
||||
dispatch_release((dispatch_semaphore_t)sem);
|
||||
#else
|
||||
sem_t *lsem;
|
||||
|
||||
lsem = (sem_t *)sem;
|
||||
sem_destroy(lsem);
|
||||
g_free(lsem);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
tc_sem_dec(tbus sem)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
WaitForSingleObject((HANDLE)sem, INFINITE);
|
||||
return 0;
|
||||
#elif defined(__APPLE__)
|
||||
dispatch_semaphore_wait((dispatch_semaphore_t)sem, DISPATCH_TIME_FOREVER);
|
||||
return 0;
|
||||
#else
|
||||
sem_wait((sem_t *)sem);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
tc_sem_inc(tbus sem)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
ReleaseSemaphore((HANDLE)sem, 1, 0);
|
||||
return 0;
|
||||
#elif defined(__APPLE__)
|
||||
dispatch_semaphore_signal((dispatch_semaphore_t)sem);
|
||||
return 0;
|
||||
#else
|
||||
sem_post((sem_t *)sem);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* thread calls
|
||||
*/
|
||||
|
||||
#if !defined(THREAD_CALLS_H)
|
||||
#define THREAD_CALLS_H
|
||||
|
||||
#include "arch.h"
|
||||
|
||||
int
|
||||
tc_thread_create(THREAD_RV (THREAD_CC *start_routine)(void *), void *arg);
|
||||
tbus
|
||||
tc_get_threadid(void);
|
||||
int
|
||||
tc_threadid_equal(tbus tid1, tbus tid2);
|
||||
tbus
|
||||
tc_mutex_create(void);
|
||||
void
|
||||
tc_mutex_delete(tbus mutex);
|
||||
int
|
||||
tc_mutex_lock(tbus mutex);
|
||||
int
|
||||
tc_mutex_unlock(tbus mutex);
|
||||
tbus
|
||||
tc_sem_create(int init_count);
|
||||
void
|
||||
tc_sem_delete(tbus sem);
|
||||
int
|
||||
tc_sem_dec(tbus sem);
|
||||
int
|
||||
tc_sem_inc(tbus sem);
|
||||
|
||||
#endif
|
||||
1079
common/trans.c
1079
common/trans.c
File diff suppressed because it is too large
Load Diff
181
common/trans.h
181
common/trans.h
@ -1,181 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* generic transport
|
||||
*/
|
||||
|
||||
#if !defined(TRANS_H)
|
||||
#define TRANS_H
|
||||
|
||||
#include "arch.h"
|
||||
#include "parse.h"
|
||||
|
||||
#define TRANS_MODE_TCP 1 /* tcp6 if defined, else tcp4 */
|
||||
#define TRANS_MODE_UNIX 2
|
||||
#define TRANS_MODE_VSOCK 3
|
||||
#define TRANS_MODE_TCP4 4 /* tcp4 only */
|
||||
#define TRANS_MODE_TCP6 6 /* tcp6 only */
|
||||
|
||||
#define TRANS_TYPE_LISTENER 1
|
||||
#define TRANS_TYPE_SERVER 2
|
||||
#define TRANS_TYPE_CLIENT 3
|
||||
|
||||
#define TRANS_STATUS_DOWN 0
|
||||
#define TRANS_STATUS_UP 1
|
||||
|
||||
struct trans; /* forward declaration */
|
||||
struct xrdp_tls;
|
||||
|
||||
typedef int (*ttrans_data_in)(struct trans *self);
|
||||
typedef int (*ttrans_conn_in)(struct trans *self,
|
||||
struct trans *new_self);
|
||||
typedef int (*tis_term)(void);
|
||||
typedef int (*trans_recv_proc) (struct trans *self, char *ptr, int len);
|
||||
typedef int (*trans_send_proc) (struct trans *self, const char *data, int len);
|
||||
typedef int (*trans_can_recv_proc) (struct trans *self, int sck, int millis);
|
||||
|
||||
/* optional source info */
|
||||
|
||||
enum xrdp_source
|
||||
{
|
||||
XRDP_SOURCE_NONE = 0,
|
||||
XRDP_SOURCE_CLIENT,
|
||||
XRDP_SOURCE_SESMAN,
|
||||
XRDP_SOURCE_CHANSRV,
|
||||
XRDP_SOURCE_MOD,
|
||||
|
||||
XRDP_SOURCE_MAX_COUNT
|
||||
};
|
||||
|
||||
/*
|
||||
* @brief Provide flow control mechanism for (primarily) xrdp
|
||||
*
|
||||
* There is one of these data structures per-program.
|
||||
*
|
||||
* While input is being read from a 'struct trans' and processed, the
|
||||
* cur_source member is set to the my_source member from the transport.
|
||||
* During this processing, trans_write_copy() may be called to send output
|
||||
* on another struct trans. If this happens, and the output needs to be
|
||||
* buffered, trans_write_copy() can add the number of bytes generated by
|
||||
* the input trans to the source field for the cur_source. This allows us to
|
||||
* see how much output has been buffered for each input source.
|
||||
*
|
||||
* When the program assembles 'struct trans' objects to scan for input
|
||||
* (normally in trans_get_wait_objs()), it is able to see how much buffered
|
||||
* output is registered for each input. Inputs which have too much buffered
|
||||
* output owing are skipped, and not considered for input.
|
||||
*
|
||||
* This provides a simple means of providing back-pressure on an input
|
||||
* where the data it is providing is being processed and then sent out on
|
||||
* a much slower link.
|
||||
*/
|
||||
struct source_info
|
||||
{
|
||||
enum xrdp_source cur_source;
|
||||
int source[XRDP_SOURCE_MAX_COUNT];
|
||||
};
|
||||
|
||||
struct trans
|
||||
{
|
||||
tbus sck; /* socket handle */
|
||||
int mode; /* 1 tcp, 2 unix socket, 3 vsock */
|
||||
int status;
|
||||
int type1; /* 1 listener 2 server 3 client */
|
||||
ttrans_data_in trans_data_in;
|
||||
ttrans_conn_in trans_conn_in;
|
||||
void *callback_data;
|
||||
unsigned int header_size;
|
||||
struct stream *in_s;
|
||||
struct stream *out_s;
|
||||
char *listen_filename;
|
||||
tis_term is_term; /* used to test for exit */
|
||||
struct stream *wait_s;
|
||||
int no_stream_init_on_data_in;
|
||||
int extra_flags; /* user defined */
|
||||
void *extra_data; /* user defined */
|
||||
void (*extra_destructor)(struct trans *); /* user defined */
|
||||
|
||||
struct ssl_tls *tls;
|
||||
const char *ssl_protocol; /* e.g. TLSv1, TLSv1.1, TLSv1.2, unknown */
|
||||
const char *cipher_name; /* e.g. AES256-GCM-SHA384 */
|
||||
trans_recv_proc trans_recv;
|
||||
trans_send_proc trans_send;
|
||||
trans_can_recv_proc trans_can_recv;
|
||||
struct source_info *si;
|
||||
enum xrdp_source my_source;
|
||||
};
|
||||
|
||||
struct trans *
|
||||
trans_create(int mode, int in_size, int out_size);
|
||||
void
|
||||
trans_delete(struct trans *self);
|
||||
void
|
||||
trans_delete_from_child(struct trans *self);
|
||||
int
|
||||
trans_get_wait_objs(struct trans *self, tbus *objs, int *count);
|
||||
int
|
||||
trans_get_wait_objs_rw(struct trans *self,
|
||||
tbus *robjs, int *rcount,
|
||||
tbus *wobjs, int *wcount, int *timeout);
|
||||
int
|
||||
trans_check_wait_objs(struct trans *self);
|
||||
int
|
||||
trans_force_read_s(struct trans *self, struct stream *in_s, int size);
|
||||
int
|
||||
trans_force_write_s(struct trans *self, struct stream *out_s);
|
||||
int
|
||||
trans_force_read(struct trans *self, int size);
|
||||
int
|
||||
trans_force_write(struct trans *self);
|
||||
int
|
||||
trans_write_copy(struct trans *self);
|
||||
int
|
||||
trans_write_copy_s(struct trans *self, struct stream *out_s);
|
||||
/**
|
||||
* Connect the transport to the specified destination
|
||||
*
|
||||
* @param self Transport
|
||||
* @param server Destination server (TCP transports only)
|
||||
* @param port TCP port, or UNIX socket to connect to
|
||||
* @param timeout in milli-seconds for the operation
|
||||
* @return 0 for success
|
||||
*
|
||||
* Multiple connection attempts may be made within the timeout period.
|
||||
*
|
||||
* If the operation is successful, 0 is returned and self->status will
|
||||
* be TRANS_STATUS_UP
|
||||
*/
|
||||
int
|
||||
trans_connect(struct trans *self, const char *server, const char *port,
|
||||
int timeout);
|
||||
int
|
||||
trans_listen_address(struct trans *self, const char *port, const char *address);
|
||||
int
|
||||
trans_listen(struct trans *self, const char *port);
|
||||
struct stream *
|
||||
trans_get_in_s(struct trans *self);
|
||||
struct stream *
|
||||
trans_get_out_s(struct trans *self, int size);
|
||||
int
|
||||
trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
|
||||
long ssl_protocols, const char *tls_ciphers);
|
||||
int
|
||||
trans_shutdown_tls_mode(struct trans *self);
|
||||
int
|
||||
trans_tcp_force_read_s(struct trans *self, struct stream *in_s, int size);
|
||||
|
||||
#endif
|
||||
@ -1,100 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2023
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* @file common/unicode_defines.h
|
||||
*
|
||||
* Defines used internally by the implementations of the Unicode routines
|
||||
*/
|
||||
|
||||
#if !defined(UNICODE_DEFINES_H)
|
||||
#define UNICODE_DEFINES_H
|
||||
|
||||
/**
|
||||
* Is this byte a valid UTF-8 continuation character?
|
||||
*/
|
||||
#define IS_VALID_CONTINUATION_CHAR(c) ((c) >= 0x80 && (c) < 0xc0)
|
||||
|
||||
/**
|
||||
* Is this character one of the end-of-plane non-characters?
|
||||
*
|
||||
* These are U+xFFFE and U+xFFFF for x in (0..10}
|
||||
*/
|
||||
#define IS_PLANE_END_NON_CHARACTER(c32) (((c32) & 0xfffe) == 0xfffe)
|
||||
|
||||
/**
|
||||
* Is this character one of the additional non-characters?
|
||||
*
|
||||
* 32 additional non-charactersare defined in the
|
||||
* "Arabic Presentation Forms-A" Unicode block */
|
||||
#define IS_ARABIC_NON_CHARACTER(c32) ((c32) >= 0xfdd0 && (c32) <= 0xfdef)
|
||||
|
||||
// Invalid characters, based on UTF-8 decoding range
|
||||
//
|
||||
// By 'invalid' we mean characters that should not be encoded or
|
||||
// decoded when switching between UTF-8 and UTF-32
|
||||
//
|
||||
// See "UTF-8 decoder capability and stress test" Markus Kuhn 2015-08-28
|
||||
#define INVALID_UNICODE_0_TO_7F(c) (0) // No invalid characters
|
||||
#define INVALID_UNICODE_80_TO_7FF(c) (0) // No invalid characters
|
||||
#define INVALID_UNICODE_800_TO_FFFF(c) \
|
||||
(((c) >= 0xd800 && (c) <= 0xdfff) || /* Surrogate pairs */ \
|
||||
IS_ARABIC_NON_CHARACTER(c) || \
|
||||
IS_PLANE_END_NON_CHARACTER(c))
|
||||
|
||||
#define INVALID_UNICODE_10000_TO_1FFFFF(c) \
|
||||
(IS_PLANE_END_NON_CHARACTER(c) || (c) > 0x10ffff)
|
||||
|
||||
// Returns true for all 'invalid' Unicode chars
|
||||
#define INVALID_UNICODE(c) \
|
||||
( \
|
||||
INVALID_UNICODE_0_TO_7F(c) || \
|
||||
INVALID_UNICODE_80_TO_7FF(c) || \
|
||||
INVALID_UNICODE_800_TO_FFFF(c) || \
|
||||
INVALID_UNICODE_10000_TO_1FFFFF(c) \
|
||||
)
|
||||
|
||||
/**
|
||||
* Is this character a UTF-16 high surrogate?
|
||||
*/
|
||||
#define IS_HIGH_SURROGATE(u16) (((u16) & 0xfc00) == 0xd800)
|
||||
|
||||
/**
|
||||
* Is this character a UTF-16 low surrogate?
|
||||
*/
|
||||
#define IS_LOW_SURROGATE(u16) (((u16) & 0xfc00) == 0xdc00)
|
||||
|
||||
/**
|
||||
* Extract the UTF-16 high surrogate from a character
|
||||
*/
|
||||
#define HIGH_SURROGATE_FROM_C32(c32) \
|
||||
(((((c32) - 0x10000) >> 10) & 0x3ff) | 0xd800)
|
||||
|
||||
/**
|
||||
* Extract the UTF-16 low surrogate from a character
|
||||
*/
|
||||
#define LOW_SURROGATE_FROM_C32(c32) (((c32) & 0x3ff) | 0xdc00)
|
||||
|
||||
/**
|
||||
* Reconstruct a character from a UTF-16 surrogate pair
|
||||
*
|
||||
* This macro cannot return values higher than 0x10ffff
|
||||
*/
|
||||
#define C32_FROM_SURROGATE_PAIR(low,high) \
|
||||
((char32_t)(((high) & 0x3ff) << 10) + ((low) & 0x3ff) + 0x10000)
|
||||
|
||||
#endif // UNICODE_DEFINES_H
|
||||
@ -1,252 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* xrdp / xserver info / caps
|
||||
*/
|
||||
|
||||
#include "xrdp_constants.h"
|
||||
#include "ms-rdpbcgr.h"
|
||||
|
||||
#if !defined(XRDP_CLIENT_INFO_H)
|
||||
#define XRDP_CLIENT_INFO_H
|
||||
|
||||
/*
|
||||
* 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF)
|
||||
* 2.2.1.3.9.1 Monitor Attributes (TS_MONITOR_ATTRIBUTES)
|
||||
* 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT
|
||||
*/
|
||||
struct monitor_info
|
||||
{
|
||||
/* From 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
int flags;
|
||||
|
||||
/* From [MS-RDPEDISP] 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT, or
|
||||
* [MS-RDPBCGR] 2.2.1.3.9.1 (TS_MONITOR_ATTRIBUTES) */
|
||||
unsigned int physical_width;
|
||||
unsigned int physical_height;
|
||||
unsigned int orientation;
|
||||
unsigned int desktop_scale_factor;
|
||||
unsigned int device_scale_factor;
|
||||
|
||||
/* Derived setting */
|
||||
unsigned int is_primary;
|
||||
};
|
||||
|
||||
/* xrdp keyboard overrids */
|
||||
struct xrdp_keyboard_overrides
|
||||
{
|
||||
int type;
|
||||
int subtype;
|
||||
int layout;
|
||||
};
|
||||
|
||||
struct display_size_description
|
||||
{
|
||||
unsigned int monitorCount; /* 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU: number of monitors detected (max = 16) */
|
||||
struct monitor_info minfo[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data */
|
||||
struct monitor_info minfo_wm[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data, non-negative values */
|
||||
unsigned int session_width;
|
||||
unsigned int session_height;
|
||||
};
|
||||
|
||||
enum client_resize_mode
|
||||
{
|
||||
CRMODE_NONE,
|
||||
CRMODE_SINGLE_SCREEN,
|
||||
CRMODE_MULTI_SCREEN
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the xrdp client
|
||||
*
|
||||
* @note This structure is shared with xorgxrdp. If you change anything
|
||||
* above the 'private to xrdp below this line' comment, you MUST
|
||||
* bump the CLIENT_INFO_CURRENT_VERSION number so that the mismatch
|
||||
* can be detected.
|
||||
*/
|
||||
struct xrdp_client_info
|
||||
{
|
||||
int size; /* bytes for this structure */
|
||||
int version; /* Should be CLIENT_INFO_CURRENT_VERSION */
|
||||
int bpp;
|
||||
/* bitmap cache info */
|
||||
int cache1_entries;
|
||||
int cache1_size;
|
||||
int cache2_entries;
|
||||
int cache2_size;
|
||||
int cache3_entries;
|
||||
int cache3_size;
|
||||
int bitmap_cache_persist_enable; /* 0 or 2 */
|
||||
int bitmap_cache_version; /* ored 1 = original version, 2 = v2, 4 = v3 */
|
||||
/* pointer info */
|
||||
int pointer_cache_entries;
|
||||
/* other */
|
||||
int use_bitmap_comp;
|
||||
int use_bitmap_cache;
|
||||
int op1; /* use smaller bitmap header, non cache */
|
||||
int op2; /* use smaller bitmap header in bitmap cache */
|
||||
int desktop_cache;
|
||||
int use_compact_packets; /* rdp5 smaller packets */
|
||||
char hostname[32];
|
||||
int build;
|
||||
int keylayout;
|
||||
char username[INFO_CLIENT_MAX_CB_LEN];
|
||||
char password[INFO_CLIENT_MAX_CB_LEN];
|
||||
char domain[INFO_CLIENT_MAX_CB_LEN];
|
||||
char program[INFO_CLIENT_MAX_CB_LEN];
|
||||
char directory[INFO_CLIENT_MAX_CB_LEN];
|
||||
int rdp_compression;
|
||||
int rdp_autologin;
|
||||
int crypt_level; /* 1, 2, 3 = low, medium, high */
|
||||
int channels_allowed; /* 0 = no channels 1 = channels */
|
||||
int sound_code; /* 1 = leave sound at server */
|
||||
int is_mce;
|
||||
int rdp5_performanceflags;
|
||||
int brush_cache_code; /* 0 = no cache 1 = 8x8 standard cache
|
||||
2 = arbitrary dimensions */
|
||||
|
||||
int max_bpp;
|
||||
int jpeg; /* non standard bitmap cache v2 cap */
|
||||
int offscreen_support_level;
|
||||
int offscreen_cache_size;
|
||||
int offscreen_cache_entries;
|
||||
int rfx;
|
||||
|
||||
/* CAPSETTYPE_RAIL */
|
||||
int rail_support_level;
|
||||
/* CAPSETTYPE_WINDOW */
|
||||
int wnd_support_level;
|
||||
int wnd_num_icon_caches;
|
||||
int wnd_num_icon_cache_entries;
|
||||
/* codecs */
|
||||
int rfx_codec_id;
|
||||
int rfx_prop_len;
|
||||
char rfx_prop[64];
|
||||
int ns_codec_id;
|
||||
int ns_prop_len;
|
||||
char ns_prop[64];
|
||||
int jpeg_codec_id;
|
||||
int jpeg_prop_len;
|
||||
char jpeg_prop[64];
|
||||
int v3_codec_id;
|
||||
int rfx_min_pixel;
|
||||
char orders[32];
|
||||
int order_flags_ex;
|
||||
int use_bulk_comp;
|
||||
int pointer_flags; /* 0 color, 1 new, 2 no new */
|
||||
int use_fast_path;
|
||||
int require_credentials; /* when true, credentials *must* be passed on cmd line */
|
||||
|
||||
int security_layer; /* 0 = rdp, 1 = tls , 2 = hybrid */
|
||||
int multimon; /* 0 = deny , 1 = allow */
|
||||
struct display_size_description display_sizes;
|
||||
|
||||
int keyboard_type;
|
||||
int keyboard_subtype;
|
||||
|
||||
int png_codec_id;
|
||||
int png_prop_len;
|
||||
char png_prop[64];
|
||||
int vendor_flags[4];
|
||||
int mcs_connection_type;
|
||||
int mcs_early_capability_flags;
|
||||
|
||||
int max_fastpath_frag_bytes;
|
||||
int capture_code;
|
||||
int capture_format;
|
||||
|
||||
char certificate[1024];
|
||||
char key_file[1024];
|
||||
|
||||
/* X11 keyboard layout - inferred from keyboard type/subtype */
|
||||
char model[16];
|
||||
char layout[16];
|
||||
char variant[16];
|
||||
char options[256];
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Private to xrdp below this line */
|
||||
/* ==================================================================== */
|
||||
|
||||
/* codec */
|
||||
int h264_codec_id;
|
||||
int h264_prop_len;
|
||||
char h264_prop[64];
|
||||
|
||||
int use_frame_acks;
|
||||
int max_unacknowledged_frame_count;
|
||||
|
||||
long ssl_protocols;
|
||||
char *tls_ciphers;
|
||||
|
||||
char client_ip[MAX_PEER_ADDRSTRLEN];
|
||||
char client_description[MAX_PEER_DESCSTRLEN];
|
||||
|
||||
int client_os_major;
|
||||
int client_os_minor;
|
||||
|
||||
int no_orders_supported;
|
||||
int use_cache_glyph_v2;
|
||||
int rail_enable;
|
||||
// Mask of reasons why output may be suppressed
|
||||
// (see enum suppress_output_reason)
|
||||
unsigned int suppress_output_mask;
|
||||
|
||||
int enable_token_login;
|
||||
char domain_user_separator[16];
|
||||
|
||||
/* xrdp.override_* values */
|
||||
struct xrdp_keyboard_overrides xrdp_keyboard_overrides;
|
||||
|
||||
/* These values are optionally send over as part of TS_UD_CS_CORE.
|
||||
* They can be used as a fallback for a single monitor session
|
||||
* if physical sizes are not available in the monitor-specific
|
||||
* data */
|
||||
unsigned int session_physical_width; /* in mm */
|
||||
unsigned int session_physical_height; /* in mm */
|
||||
|
||||
int large_pointer_support_flags;
|
||||
int gfx;
|
||||
|
||||
// Can we resize the desktop by using a Deactivation-Reactivation Sequence?
|
||||
enum client_resize_mode client_resize_mode;
|
||||
};
|
||||
|
||||
enum xrdp_encoder_flags
|
||||
{
|
||||
NONE = 0,
|
||||
ENCODE_COMPLETE = 1 << 0,
|
||||
GFX_PROGRESSIVE_RFX = 1 << 1,
|
||||
GFX_H264 = 1 << 2,
|
||||
KEY_FRAME_REQUESTED = 1 << 3
|
||||
};
|
||||
|
||||
/*
|
||||
* Return true if output is suppressed for a particular reason
|
||||
*/
|
||||
#define OUTPUT_SUPPRESSED_FOR_REASON(ci,reason) \
|
||||
(((ci)->suppress_output_mask & (unsigned int)reason) != 0)
|
||||
|
||||
/* yyyymmdd of last incompatible change to xrdp_client_info */
|
||||
/* also used for changes to all the xrdp installed headers */
|
||||
#define CLIENT_INFO_CURRENT_VERSION 20230425
|
||||
|
||||
#endif
|
||||
@ -1,340 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
* Miscellaneous protocol constants
|
||||
*
|
||||
* Copyright (C) Matthew Chapman 1999-2008
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
* Copyright (C) Kevin Zhou 2012
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(XRDP_CONSTANTS_H)
|
||||
#define XRDP_CONSTANTS_H
|
||||
|
||||
/* TCP port for Remote Desktop Protocol */
|
||||
#define TCP_PORT_RDP 3389
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* xrdp constants
|
||||
*
|
||||
* Constants defined in publicly available Microsoft documents are not
|
||||
* stored here, but are stored in the include files ms-*.h, where the name
|
||||
* of the file is the name of the document defining the constant.
|
||||
*
|
||||
* So for example, NTSTATUS values found in [MS-ERREF] are found in
|
||||
* ms-erref.h
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* Size of buffer including terminator for an IP address as returned
|
||||
* by g_sck_get_peer_ip_address(). See POSIX INET6_ADDRSTRLEN
|
||||
*/
|
||||
#define MAX_PEER_ADDRSTRLEN 46
|
||||
|
||||
/**
|
||||
* Size of buffer including terminator for a socket description, as
|
||||
* returned by g_sck_get_peer_description()
|
||||
* Currently the largest is an IPv6 address (INET6_ADDRSTRLEN), plus
|
||||
* []:<port> characters
|
||||
*/
|
||||
#define MAX_PEER_DESCSTRLEN (46 + 2 + 1 + 5)
|
||||
|
||||
#define INFO_CLIENT_NAME_BYTES 32
|
||||
|
||||
/**
|
||||
* Maximum length of a string including the mandatory null terminator
|
||||
* [MS-RDPBCGR] TS_INFO_PACKET(2.2.1.11.1.1)
|
||||
*/
|
||||
#define INFO_CLIENT_MAX_CB_LEN 512
|
||||
|
||||
#define XRDP_MAX_BITMAP_CACHE_ID 3
|
||||
#define XRDP_MAX_BITMAP_CACHE_IDX 2000
|
||||
#define XRDP_BITMAP_CACHE_ENTRIES 2048
|
||||
|
||||
#define XR_MIN_KEY_CODE 8
|
||||
#define XR_MAX_KEY_CODE 256
|
||||
|
||||
/*
|
||||
* Constants come from ITU-T Recommendations
|
||||
*/
|
||||
|
||||
#define ISO_PDU_CR 0xE0 /* X.224 Connection Request */
|
||||
#define ISO_PDU_CC 0xD0 /* X.224 Connection Confirm */
|
||||
#define ISO_PDU_DR 0x80 /* Disconnect Request */
|
||||
#define ISO_PDU_DT 0xF0 /* Data */
|
||||
#define ISO_PDU_ER 0x70 /* Error */
|
||||
|
||||
/* MCS PDU codes (T.125) */
|
||||
#define MCS_EDRQ 1 /* Erect Domain Request */
|
||||
#define MCS_DPUM 8 /* Disconnect Provider Ultimatum */
|
||||
#define MCS_AURQ 10 /* Attach User Request */
|
||||
#define MCS_AUCF 11 /* Attach User Confirm */
|
||||
#define MCS_CJRQ 14 /* Channel Join Request */
|
||||
#define MCS_CJCF 15 /* Channel Join Confirm */
|
||||
#define MCS_SDRQ 25 /* Send Data Request */
|
||||
#define MCS_SDIN 26 /* Send Data Indication */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Constants come from other Microsoft products
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* Sound format constants - see also RFC 2361 and MS-RDPAI */
|
||||
#define WAVE_FORMAT_PCM 0x0001
|
||||
#define WAVE_FORMAT_ADPCM 0x0002
|
||||
#define WAVE_FORMAT_ALAW 0x0006
|
||||
#define WAVE_FORMAT_MULAW 0x0007
|
||||
#define WAVE_FORMAT_MPEGLAYER3 0x0055
|
||||
#define WAVE_FORMAT_OPUS 0x0069
|
||||
#define WAVE_FORMAT_AAC 0xA106
|
||||
|
||||
/* https://technet.microsoft.com/ja-jp/library/aa387685.aspx */
|
||||
#define SEC_RSA_MAGIC 0x31415352 /* RSA1 */
|
||||
|
||||
/* NTSTATUS Values (MS-ERREF 2.3.1) */
|
||||
/* used for RDPDR */
|
||||
/*
|
||||
* not yet sorted out
|
||||
*/
|
||||
|
||||
#define MCS_CONNECT_INITIAL 0x7f65 /* MCS BER: big endian, class=application (0x4000), constructed (0x2000), tag number > 30 (0x1f00), tag number=101 (0x0065) */
|
||||
#define MCS_CONNECT_RESPONSE 0x7f66 /* MCS BER: application 102 */
|
||||
|
||||
#define BER_TAG_BOOLEAN 1
|
||||
#define BER_TAG_INTEGER 2
|
||||
#define BER_TAG_OCTET_STRING 4
|
||||
#define BER_TAG_RESULT 10
|
||||
#define MCS_TAG_DOMAIN_PARAMS 0x30
|
||||
|
||||
#define MCS_GLOBAL_CHANNEL 1003
|
||||
#define MCS_USERCHANNEL_BASE 1001
|
||||
|
||||
/* RDP secure transport constants */
|
||||
/* not used anywhere */
|
||||
#define SEC_RANDOM_SIZE 32
|
||||
#define SEC_MODULUS_SIZE 64
|
||||
#define SEC_PADDING_SIZE 8
|
||||
#define SEC_EXPONENT_SIZE 4
|
||||
|
||||
/* RDP licensing constants */
|
||||
#define LICENCE_TOKEN_SIZE 10
|
||||
#define LICENCE_HWID_SIZE 20
|
||||
#define LICENCE_SIGNATURE_SIZE 16
|
||||
|
||||
|
||||
/* See T.128 */
|
||||
/* not used anywhere */
|
||||
#define RDP_KEYPRESS 0
|
||||
#define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP)
|
||||
|
||||
/* Raster operation masks */
|
||||
#define ROP2_S(rop3) (rop3 & 0xf)
|
||||
#define ROP2_P(rop3) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2))
|
||||
|
||||
#define ROP2_COPY 0xc
|
||||
#define ROP2_XOR 0x6
|
||||
#define ROP2_AND 0x8
|
||||
#define ROP2_NXOR 0x9
|
||||
#define ROP2_OR 0xe
|
||||
|
||||
#define MIX_TRANSPARENT 0
|
||||
#define MIX_OPAQUE 1
|
||||
|
||||
#define TEXT2_VERTICAL 0x04
|
||||
#define TEXT2_IMPLICIT_X 0x20
|
||||
|
||||
/* RDP bitmap cache (version 2) constants */
|
||||
#define BMPCACHE2_C0_CELLS 0x78
|
||||
#define BMPCACHE2_C1_CELLS 0x78
|
||||
#define BMPCACHE2_C2_CELLS 0x150
|
||||
#define BMPCACHE2_NUM_PSTCELLS 0x9f6
|
||||
|
||||
#define PDU_FLAG_FIRST 0x01
|
||||
#define PDU_FLAG_LAST 0x02
|
||||
|
||||
#define RDP_SOURCE "MSTSC"
|
||||
|
||||
/* Keymap flags */
|
||||
#define MapRightShiftMask (1 << 0)
|
||||
#define MapLeftShiftMask (1 << 1)
|
||||
#define MapShiftMask (MapRightShiftMask | MapLeftShiftMask)
|
||||
|
||||
#define MapRightAltMask (1 << 2)
|
||||
#define MapLeftAltMask (1 << 3)
|
||||
#define MapAltGrMask MapRightAltMask
|
||||
|
||||
#define MapRightCtrlMask (1 << 4)
|
||||
#define MapLeftCtrlMask (1 << 5)
|
||||
#define MapCtrlMask (MapRightCtrlMask | MapLeftCtrlMask)
|
||||
|
||||
#define MapRightWinMask (1 << 6)
|
||||
#define MapLeftWinMask (1 << 7)
|
||||
#define MapWinMask (MapRightWinMask | MapLeftWinMask)
|
||||
|
||||
#define MapNumLockMask (1 << 8)
|
||||
#define MapCapsLockMask (1 << 9)
|
||||
|
||||
#define MapLocalStateMask (1 << 10)
|
||||
|
||||
#define MapInhibitMask (1 << 11)
|
||||
|
||||
#define MASK_ADD_BITS(var, mask) (var |= mask)
|
||||
#define MASK_REMOVE_BITS(var, mask) (var &= ~mask)
|
||||
#define MASK_HAS_BITS(var, mask) ((var & mask)>0)
|
||||
#define MASK_CHANGE_BIT(var, mask, active) \
|
||||
(var = ((var & ~mask) | (active ? mask : 0)))
|
||||
|
||||
/* Clipboard constants, "borrowed" from GCC system headers in
|
||||
the w32 cross compiler */
|
||||
|
||||
#define CF_TEXT 1
|
||||
#define CF_BITMAP 2
|
||||
#define CF_METAFILEPICT 3
|
||||
#define CF_SYLK 4
|
||||
#define CF_DIF 5
|
||||
#define CF_TIFF 6
|
||||
#define CF_OEMTEXT 7
|
||||
#define CF_DIB 8
|
||||
#define CF_PALETTE 9
|
||||
#define CF_PENDATA 10
|
||||
#define CF_RIFF 11
|
||||
#define CF_WAVE 12
|
||||
#define CF_UNICODETEXT 13
|
||||
#define CF_ENHMETAFILE 14
|
||||
#define CF_HDROP 15
|
||||
#define CF_LOCALE 16
|
||||
#define CF_MAX 17
|
||||
#define CF_OWNERDISPLAY 128
|
||||
#define CF_DSPTEXT 129
|
||||
#define CF_DSPBITMAP 130
|
||||
#define CF_DSPMETAFILEPICT 131
|
||||
#define CF_DSPENHMETAFILE 142
|
||||
#define CF_PRIVATEFIRST 512
|
||||
#define CF_PRIVATELAST 767
|
||||
#define CF_GDIOBJFIRST 768
|
||||
#define CF_GDIOBJLAST 1023
|
||||
|
||||
/* RDPDR constants */
|
||||
#define RDPDR_MAX_DEVICES 0x10
|
||||
|
||||
/* drawable types */
|
||||
#define WND_TYPE_BITMAP 0
|
||||
#define WND_TYPE_WND 1
|
||||
#define WND_TYPE_SCREEN 2
|
||||
#define WND_TYPE_BUTTON 3
|
||||
#define WND_TYPE_IMAGE 4
|
||||
#define WND_TYPE_EDIT 5
|
||||
#define WND_TYPE_LABEL 6
|
||||
#define WND_TYPE_COMBO 7
|
||||
#define WND_TYPE_SPECIAL 8
|
||||
#define WND_TYPE_LISTBOX 9
|
||||
#define WND_TYPE_OFFSCREEN 10
|
||||
|
||||
/* button states */
|
||||
#define BUTTON_STATE_UP 0
|
||||
#define BUTTON_STATE_DOWN 1
|
||||
|
||||
/* touch gestures */
|
||||
#define TOUCH_TWO_FINGERS_DOWN 0
|
||||
#define TOUCH_TWO_FINGERS_UP 1
|
||||
#define TOUCH_TWO_FINGERS_LEFT 2
|
||||
#define TOUCH_TWO_FINGERS_RIGHT 3
|
||||
|
||||
/* messages */
|
||||
#define WM_PAINT 3
|
||||
#define WM_KEYDOWN 15
|
||||
#define WM_KEYUP 16
|
||||
#define WM_KEYBRD_SYNC 17
|
||||
#define WM_MOUSEMOVE 100
|
||||
#define WM_LBUTTONUP 101
|
||||
#define WM_LBUTTONDOWN 102
|
||||
#define WM_RBUTTONUP 103
|
||||
#define WM_RBUTTONDOWN 104
|
||||
#define WM_BUTTON3UP 105
|
||||
#define WM_BUTTON3DOWN 106
|
||||
#define WM_BUTTON4UP 107
|
||||
#define WM_BUTTON4DOWN 108
|
||||
#define WM_BUTTON5UP 109
|
||||
#define WM_BUTTON5DOWN 110
|
||||
#define WM_BUTTON6UP 111
|
||||
#define WM_BUTTON6DOWN 112
|
||||
#define WM_BUTTON7UP 113
|
||||
#define WM_BUTTON7DOWN 114
|
||||
#define WM_BUTTON8UP 115
|
||||
#define WM_BUTTON8DOWN 116
|
||||
#define WM_BUTTON9UP 117
|
||||
#define WM_BUTTON9DOWN 118
|
||||
|
||||
#define WM_TOUCH_VSCROLL 140
|
||||
#define WM_TOUCH_HSCROLL 141
|
||||
|
||||
#define WM_INVALIDATE 200
|
||||
#define WM_CHANNEL_DATA 201
|
||||
|
||||
#define CB_ITEMCHANGE 300
|
||||
|
||||
#define FASTPATH_MAX_PACKET_SIZE 0x3fff
|
||||
|
||||
#define XR_RDP_SCAN_LSHIFT 42
|
||||
#define XR_RDP_SCAN_ALT 56
|
||||
|
||||
// Since we're not guaranteed to have pixman, copy these directives.
|
||||
#define XRDP_PIXMAN_TYPE_ARGB 2
|
||||
#define XRDP_PIXMAN_TYPE_ABGR 3
|
||||
#define XRDP_PIXMAN_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \
|
||||
((type) << 16) | \
|
||||
((a) << 12) | \
|
||||
((r) << 8) | \
|
||||
((g) << 4) | \
|
||||
((b)))
|
||||
|
||||
#define XRDP_a8b8g8r8 \
|
||||
XRDP_PIXMAN_FORMAT(32, XRDP_PIXMAN_TYPE_ABGR, 8, 8, 8, 8)
|
||||
|
||||
#define XRDP_a8r8g8b8 \
|
||||
XRDP_PIXMAN_FORMAT(32, XRDP_PIXMAN_TYPE_ARGB, 8, 8, 8, 8)
|
||||
|
||||
#define XRDP_r5g6b5 \
|
||||
XRDP_PIXMAN_FORMAT(16, XRDP_PIXMAN_TYPE_ARGB, 0, 5, 6, 5)
|
||||
|
||||
#define XRDP_a1r5g5b5 \
|
||||
XRDP_PIXMAN_FORMAT(16, XRDP_PIXMAN_TYPE_ARGB, 1, 5, 5, 5)
|
||||
|
||||
#define XRDP_r3g3b2 \
|
||||
XRDP_PIXMAN_FORMAT(8, XRDP_PIXMAN_TYPE_ARGB, 0, 3, 3, 2)
|
||||
|
||||
// The last used constant in pixman is 63, so use 64+
|
||||
#define XRDP_nv12 \
|
||||
XRDP_PIXMAN_FORMAT(12, 64, 0, 0, 0, 0)
|
||||
|
||||
#define XRDP_i420 \
|
||||
XRDP_PIXMAN_FORMAT(12, 65, 0, 0, 0, 0)
|
||||
|
||||
#define XRDP_nv12_709fr \
|
||||
XRDP_PIXMAN_FORMAT(12, 66, 0, 0, 0, 0)
|
||||
|
||||
#define XRDP_yuv444_709fr \
|
||||
XRDP_PIXMAN_FORMAT(32, 67, 0, 0, 0, 0)
|
||||
|
||||
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegfx/8131c1bc-1af8-4907-a05a-f72f4581160f
|
||||
#define XRDP_yuv444_v1_stream_709fr \
|
||||
XRDP_PIXMAN_FORMAT(32, 68, 0, 0, 0, 0)
|
||||
|
||||
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegfx/781406c3-5e24-4f2b-b6ff-42b76bf64f6d
|
||||
#define XRDP_yuv444_v2_stream_709fr \
|
||||
XRDP_PIXMAN_FORMAT(32, 69, 0, 0, 0, 0)
|
||||
|
||||
#endif
|
||||
@ -1,147 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2012-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(_RAIL_H)
|
||||
#define _RAIL_H
|
||||
|
||||
/*
|
||||
ORDER_TYPE_WINDOW
|
||||
WINDOW_ORDER_TYPE_WINDOW
|
||||
WINDOW_ORDER_ICON
|
||||
WINDOW_ORDER_CACHED_ICON
|
||||
WINDOW_ORDER_STATE_DELETED
|
||||
WINDOW_ORDER_STATE_NEW on
|
||||
WINDOW_ORDER_STATE_NEW off
|
||||
WINDOW_ORDER_TYPE_NOTIFY
|
||||
WINDOW_ORDER_STATE_DELETED
|
||||
WINDOW_ORDER_STATE_NEW on
|
||||
WINDOW_ORDER_STATE_NEW off
|
||||
WINDOW_ORDER_TYPE_DESKTOP
|
||||
WINDOW_ORDER_FIELD_DESKTOP_NONE on
|
||||
WINDOW_ORDER_FIELD_DESKTOP_NONE off
|
||||
*/
|
||||
|
||||
/* Window Order Header Flags */
|
||||
#define WINDOW_ORDER_TYPE_WINDOW 0x01000000
|
||||
#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000
|
||||
#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000
|
||||
#define WINDOW_ORDER_STATE_NEW 0x10000000
|
||||
#define WINDOW_ORDER_STATE_DELETED 0x20000000
|
||||
#define WINDOW_ORDER_FIELD_OWNER 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_STYLE 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_SHOW 0x00000010
|
||||
#define WINDOW_ORDER_FIELD_TITLE 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000
|
||||
#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000
|
||||
#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000
|
||||
#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000
|
||||
#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800
|
||||
#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000
|
||||
#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400
|
||||
#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100
|
||||
#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000
|
||||
#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200
|
||||
#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000
|
||||
#define WINDOW_ORDER_ICON 0x40000000
|
||||
#define WINDOW_ORDER_CACHED_ICON 0x80000000
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010
|
||||
#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020
|
||||
|
||||
struct rail_icon_info
|
||||
{
|
||||
int bpp;
|
||||
int width;
|
||||
int height;
|
||||
int cmap_bytes;
|
||||
int mask_bytes;
|
||||
int data_bytes;
|
||||
char *mask;
|
||||
char *cmap;
|
||||
char *data;
|
||||
};
|
||||
|
||||
struct rail_window_rect
|
||||
{
|
||||
short left;
|
||||
short top;
|
||||
short right;
|
||||
short bottom;
|
||||
};
|
||||
|
||||
struct rail_notify_icon_infotip
|
||||
{
|
||||
int timeout;
|
||||
int flags;
|
||||
char *text;
|
||||
char *title;
|
||||
};
|
||||
|
||||
struct rail_window_state_order
|
||||
{
|
||||
int owner_window_id;
|
||||
int style;
|
||||
int extended_style;
|
||||
int show_state;
|
||||
char *title_info;
|
||||
int client_offset_x;
|
||||
int client_offset_y;
|
||||
int client_area_width;
|
||||
int client_area_height;
|
||||
int rp_content;
|
||||
int root_parent_handle;
|
||||
int window_offset_x;
|
||||
int window_offset_y;
|
||||
int window_client_delta_x;
|
||||
int window_client_delta_y;
|
||||
int window_width;
|
||||
int window_height;
|
||||
int num_window_rects;
|
||||
struct rail_window_rect *window_rects;
|
||||
int visible_offset_x;
|
||||
int visible_offset_y;
|
||||
int num_visibility_rects;
|
||||
struct rail_window_rect *visibility_rects;
|
||||
};
|
||||
|
||||
struct rail_notify_state_order
|
||||
{
|
||||
int version;
|
||||
char *tool_tip;
|
||||
struct rail_notify_icon_infotip infotip;
|
||||
int state;
|
||||
int icon_cache_entry;
|
||||
int icon_cache_id;
|
||||
struct rail_icon_info icon_info;
|
||||
};
|
||||
|
||||
struct rail_monitored_desktop_order
|
||||
{
|
||||
int active_window_id;
|
||||
int num_window_ids;
|
||||
int *window_ids;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,64 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* names of UNIX sockets for inter-process communication
|
||||
*/
|
||||
|
||||
#if !defined(XRDP_SOCKETS_H)
|
||||
#define XRDP_SOCKETS_H
|
||||
|
||||
/* XRDP_SOCKET_ROOT_PATH must be defined to include this file */
|
||||
#ifdef __cppcheck__
|
||||
/* avoid syntax errors */
|
||||
# define XRDP_SOCKET_ROOT_PATH "/dummy"
|
||||
#elif !defined(XRDP_SOCKET_ROOT_PATH)
|
||||
# error "XRDP_SOCKET_ROOT_PATH must be defined"
|
||||
#endif
|
||||
|
||||
/* Buffer size for code for fullpath declarations
|
||||
*
|
||||
* This needs to fit in the sun_path field of a sockaddr_un. POSIX
|
||||
* does not define this size, so the value below is the lower of
|
||||
* the FreeBSD/OpenBSD/NetBSD(104) and Linux(108) values */
|
||||
#define XRDP_SOCKETS_MAXPATH 104
|
||||
|
||||
/* The socketdir is rooted at XRDP_SOCKET_ROOT_PATH. User-specific
|
||||
* sockets live in a user-specific sub-directory of this called
|
||||
* XRDP_SOCKET_PATH. The sub-directory is the UID of the user */
|
||||
#define XRDP_SOCKET_PATH XRDP_SOCKET_ROOT_PATH "/%d"
|
||||
|
||||
/* Sockets in XRDP_SOCKET_ROOT_PATH */
|
||||
#define SCP_LISTEN_PORT_BASE_STR "sesman.socket"
|
||||
|
||||
/* names of socket files within XRDP_SOCKET_PATH, qualified by
|
||||
* display number */
|
||||
#define XRDP_CHANSRV_BASE_STR "xrdp_chansrv_socket_%d"
|
||||
#define CHANSRV_PORT_OUT_BASE_STR "xrdp_chansrv_audio_out_socket_%d"
|
||||
#define CHANSRV_PORT_IN_BASE_STR "xrdp_chansrv_audio_in_socket_%d"
|
||||
#define CHANSRV_API_BASE_STR "xrdpapi_%d"
|
||||
#define XRDP_X11RDP_BASE_STR "xrdp_display_%d"
|
||||
#define XRDP_DISCONNECT_BASE_STR "xrdp_disconnect_display_%d"
|
||||
|
||||
/* fullpath declarations */
|
||||
#define XRDP_CHANSRV_STR XRDP_SOCKET_PATH "/" XRDP_CHANSRV_BASE_STR
|
||||
#define CHANSRV_PORT_OUT_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_OUT_BASE_STR
|
||||
#define CHANSRV_PORT_IN_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_IN_BASE_STR
|
||||
#define CHANSRV_API_STR XRDP_SOCKET_PATH "/" CHANSRV_API_BASE_STR
|
||||
#define XRDP_X11RDP_STR XRDP_SOCKET_PATH "/" XRDP_X11RDP_BASE_STR
|
||||
#define XRDP_DISCONNECT_STR XRDP_SOCKET_PATH "/" XRDP_DISCONNECT_BASE_STR
|
||||
|
||||
#endif
|
||||
683
configure.ac
683
configure.ac
@ -1,683 +0,0 @@
|
||||
# Process this file with autoconf to produce a configure script
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([xrdp], [0.10.80], [xrdp-devel@googlegroups.com])
|
||||
AC_DEFINE([VERSION_YEAR], 2024, [Copyright year])
|
||||
AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in)
|
||||
AM_INIT_AUTOMAKE([1.7.2 foreign])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_C_CONST
|
||||
LT_INIT
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
if test "x$PKG_CONFIG" = "x"; then
|
||||
AC_MSG_ERROR([please install pkg-config])
|
||||
fi
|
||||
|
||||
AC_CONFIG_SUBDIRS([libpainter librfxcodec])
|
||||
|
||||
# Use silent rules by default if supported by Automake
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
case $host_os in
|
||||
*linux*)
|
||||
linux=yes
|
||||
;;
|
||||
*kfreebsd*)
|
||||
linux=yes # only used in instfiles/ so that’s ok for us for now
|
||||
;;
|
||||
*freebsd*)
|
||||
freebsd=yes
|
||||
;;
|
||||
*netbsd*)
|
||||
netbsd=yes
|
||||
;;
|
||||
*openbsd*)
|
||||
openbsd=yes
|
||||
;;
|
||||
*darwin*)
|
||||
macos=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
|
||||
AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes])
|
||||
AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
|
||||
AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes])
|
||||
AM_CONDITIONAL(MACOS, [test "x$macos" = xyes])
|
||||
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long])
|
||||
AC_CHECK_SIZEOF([void *])
|
||||
|
||||
# runstatedir not available for autoconf <= 2.69
|
||||
if test "x$runstatedir" = "x" ; then
|
||||
runstatedir='${localstatedir}/run'
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([socketdir],
|
||||
[AS_HELP_STRING([--with-socketdir=DIR],
|
||||
[Use directory for UNIX sockets for XRDP sessions (default: RUNSTATEDIR/xrdp)])],
|
||||
[], [with_socketdir="$runstatedir/xrdp"])
|
||||
AC_SUBST([socketdir], [$with_socketdir])
|
||||
|
||||
AC_ARG_WITH([systemdsystemunitdir],
|
||||
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files, no to disable]),
|
||||
[], [
|
||||
if test "x$linux" = xyes; then
|
||||
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$with_systemdsystemunitdir" != xno; then
|
||||
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
|
||||
AC_ARG_ENABLE(tests,
|
||||
AS_HELP_STRING([--enable-tests],
|
||||
[Ensure dependencies for the tests are installed]),
|
||||
[ensure_tests_deps=yes], [])
|
||||
AC_ARG_ENABLE(pam, AS_HELP_STRING([--enable-pam],
|
||||
[Build PAM support (default: yes)]),
|
||||
[], [enable_pam=yes])
|
||||
AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_pam != xyes])
|
||||
AC_ARG_ENABLE(vsock, AS_HELP_STRING([--enable-vsock],
|
||||
[Build AF_VSOCK support (default: no)]),
|
||||
[], [enable_vsock=no])
|
||||
AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--enable-ipv6],
|
||||
[Build IPv6 support (default: no, experimental)]),
|
||||
[], [enable_ipv6=no])
|
||||
AC_ARG_ENABLE(ipv6only, AS_HELP_STRING([--enable-ipv6only],
|
||||
[Build IPv6-only (default: no)]),
|
||||
[], [enable_ipv6only=no])
|
||||
AC_ARG_ENABLE(kerberos, AS_HELP_STRING([--enable-kerberos],
|
||||
[Build kerberos support (prefer --enable-pam if available) (default: no)]),
|
||||
[], [enable_kerberos=no])
|
||||
AC_ARG_ENABLE(bsd, AS_HELP_STRING([--enable-bsd],
|
||||
[Build BSD auth support (default: no)]),
|
||||
[bsd=true], [bsd=false])
|
||||
AM_CONDITIONAL(SESMAN_BSD, [test x$bsd = xtrue])
|
||||
AM_CONDITIONAL(SESMAN_KERBEROS, [test x$enable_kerberos = xyes])
|
||||
AC_ARG_ENABLE(pamuserpass, AS_HELP_STRING([--enable-pamuserpass],
|
||||
[Build PAM userpass support (default: no)]),
|
||||
[], [enable_pamuserpass=no])
|
||||
AM_CONDITIONAL(SESMAN_PAMUSERPASS, [test x$enable_pamuserpass = xyes])
|
||||
AC_ARG_ENABLE(pam-config, AS_HELP_STRING([--enable-pam-config=CONF],
|
||||
[Select PAM config to install: arch, debian, redhat, suse, freebsd, macos, unix
|
||||
(default: autodetect)]))
|
||||
|
||||
# Development options. devel_all is first as this provides a default for
|
||||
# the others
|
||||
AC_ARG_ENABLE(devel_all, AS_HELP_STRING([--enable-devel-all],
|
||||
[Enable all development options (default: no)]),
|
||||
[devel_all=$enableval], [devel_all=no])
|
||||
AC_ARG_ENABLE(devel_debug, AS_HELP_STRING([--enable-devel-debug],
|
||||
[Build exes with no optimisation and debugging symbols (default: no)]),
|
||||
[devel_debug=$enableval], [devel_debug=$devel_all])
|
||||
AM_CONDITIONAL(DEVEL_DEBUG, [test x$devel_debug = xyes ])
|
||||
AC_ARG_ENABLE(devel_logging, AS_HELP_STRING([--enable-devel-logging],
|
||||
[Enable development logging (default: no)]),
|
||||
[devel_logging=$enableval], [devel_logging=$devel_all])
|
||||
AC_ARG_ENABLE(devel_streamcheck, AS_HELP_STRING([--enable-devel-streamcheck],
|
||||
[Add range-check/abort to stream primitives (default: no)]),
|
||||
[devel_streamcheck=$enableval], [devel_streamcheck=$devel_all])
|
||||
|
||||
AC_ARG_ENABLE(neutrinordp, AS_HELP_STRING([--enable-neutrinordp],
|
||||
[Build neutrinordp module (default: no)]),
|
||||
[], [enable_neutrinordp=no])
|
||||
AM_CONDITIONAL(XRDP_NEUTRINORDP, [test x$enable_neutrinordp = xyes])
|
||||
|
||||
AC_ARG_ENABLE(ulalaca, AS_HELP_STRING([--enable-ulalaca],
|
||||
[Build ulalaca module (experimental) (default: no)]),
|
||||
[], [enable_ulalaca=no])
|
||||
AM_CONDITIONAL(XRDP_ULALACA, [test x$enable_ulalaca = xyes])
|
||||
|
||||
AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--enable-jpeg],
|
||||
[Build jpeg module (default: no)]),
|
||||
[], [enable_jpeg=no])
|
||||
AM_CONDITIONAL(XRDP_JPEG, [test x$enable_jpeg = xyes])
|
||||
AC_ARG_ENABLE(tjpeg, AS_HELP_STRING([--enable-tjpeg],
|
||||
[Build turbo jpeg module (default: no)]),
|
||||
[], [enable_tjpeg=no])
|
||||
AM_CONDITIONAL(XRDP_TJPEG, [test x$enable_tjpeg = xyes])
|
||||
AC_ARG_ENABLE(fuse, AS_HELP_STRING([--enable-fuse],
|
||||
[Build fuse(clipboard file / drive redir) (default: no)]),
|
||||
[], [enable_fuse=no])
|
||||
AM_CONDITIONAL(XRDP_FUSE, [test x$enable_fuse = xyes])
|
||||
AC_ARG_ENABLE(xrdpvr, AS_HELP_STRING([--enable-xrdpvr],
|
||||
[Build xrdpvr module (default: no)]),
|
||||
[], [enable_xrdpvr=no])
|
||||
AM_CONDITIONAL(XRDP_XRDPVR, [test x$enable_xrdpvr = xyes])
|
||||
AC_ARG_ENABLE(fdkaac, AS_HELP_STRING([--enable-fdkaac],
|
||||
[Build aac(audio codec) (default: no)]),
|
||||
[], [enable_fdkaac=no])
|
||||
AM_CONDITIONAL(XRDP_FDK_AAC, [test x$enable_fdkaac = xyes])
|
||||
AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus],
|
||||
[Build opus(audio codec) (default: no)]),
|
||||
[], [enable_opus=no])
|
||||
AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes])
|
||||
AC_ARG_ENABLE(mp3lame, AS_HELP_STRING([--enable-mp3lame],
|
||||
[Build lame mp3(audio codec) (default: no)]),
|
||||
[], [enable_mp3lame=no])
|
||||
AM_CONDITIONAL(XRDP_MP3LAME, [test x$enable_mp3lame = xyes])
|
||||
AC_ARG_ENABLE(pixman, AS_HELP_STRING([--enable-pixman],
|
||||
[Use pixman library (default: no)]),
|
||||
[], [enable_pixman=no])
|
||||
AM_CONDITIONAL(XRDP_PIXMAN, [test x$enable_pixman = xyes])
|
||||
|
||||
AC_ARG_ENABLE(painter, AS_HELP_STRING([--disable-painter],
|
||||
[Do not use included painter library (default: no)]),
|
||||
[], [enable_painter=yes])
|
||||
AM_CONDITIONAL(XRDP_PAINTER, [test x$enable_painter = xyes])
|
||||
|
||||
AC_ARG_ENABLE(rfxcodec, AS_HELP_STRING([--disable-rfxcodec],
|
||||
[Do not use included librfxcodec library (default: no)]),
|
||||
[], [enable_rfxcodec=yes])
|
||||
AM_CONDITIONAL(XRDP_RFXCODEC, [test x$enable_rfxcodec = xyes])
|
||||
|
||||
AC_ARG_ENABLE(rdpsndaudin, AS_HELP_STRING([--enable-rdpsndaudin],
|
||||
[Use rdpsnd audio in (default: no)]),
|
||||
[], [enable_rdpsndaudin=no])
|
||||
AM_CONDITIONAL(XRDP_RDPSNDAUDIN, [test x$enable_rdpsndaudin = xyes])
|
||||
|
||||
AC_ARG_ENABLE(utmp, AS_HELP_STRING([--enable-utmp],
|
||||
[Update utmp (default: no)]),
|
||||
[], [enable_utmp=no])
|
||||
AM_CONDITIONAL(XRDP_UTMP, [test x$enable_utmp = xyes])
|
||||
|
||||
AC_ARG_WITH(imlib2, AS_HELP_STRING([--with-imlib2=ARG], [imlib2 library to use for non-BMP backgrounds (ARG=yes/no/<abs-path>)]),,)
|
||||
|
||||
AC_ARG_WITH(freetype2, AS_HELP_STRING([--with-freetype2=ARG], [freetype2 library to use for rendering fonts (ARG=yes/no/<abs-path>)]),,)
|
||||
|
||||
# Obsolete options
|
||||
AC_ARG_ENABLE(xrdpdebug, AS_HELP_STRING([--enable-xrdpdebug],
|
||||
[This option is no longer supported - use --enable-devel-all]))
|
||||
|
||||
if test "x$enable_xrdpdebug" != x; then
|
||||
AC_MSG_ERROR([--enable-xrdpdebug must be replaced with one or more --enable-devel-* options])
|
||||
fi
|
||||
|
||||
# configure compiler options and CFLAGS
|
||||
AX_GCC_FUNC_ATTRIBUTE([format])
|
||||
AX_TYPE_SOCKLEN_T
|
||||
AX_CFLAGS_WARN_ALL
|
||||
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
|
||||
|
||||
AM_COND_IF([LINUX],
|
||||
[AX_APPEND_COMPILE_FLAGS([-Werror])]) # bsd has warnings that have not been fixed yet
|
||||
|
||||
AM_COND_IF([DEVEL_DEBUG],
|
||||
[AX_APPEND_COMPILE_FLAGS([-g -O0])],
|
||||
[AX_APPEND_COMPILE_FLAGS([-O2])])
|
||||
|
||||
# Function setusercontext() is in BSD -lutil but N/A on Solaris or GNU systems
|
||||
AC_SEARCH_LIBS([setusercontext], [util])
|
||||
|
||||
# Define HAVE_XXXXX macros for some system functions
|
||||
AC_CHECK_FUNCS([setusercontext getgrouplist clearenv])
|
||||
|
||||
# The type used by getgrouplist() is the same type used by getgroups()
|
||||
AC_TYPE_GETGROUPS
|
||||
|
||||
# Don't fail without working nasm if rfxcodec is not enabled
|
||||
if test "x$enable_rfxcodec" != xyes; then
|
||||
with_simd=no
|
||||
export with_simd
|
||||
fi
|
||||
|
||||
# Check if -ldl is needed to use dlopen()
|
||||
DLOPEN_LIBS=
|
||||
AC_CHECK_FUNC(dlopen, [],
|
||||
[AC_CHECK_LIB(dl, dlopen, [DLOPEN_LIBS=-ldl])])
|
||||
AC_SUBST(DLOPEN_LIBS)
|
||||
|
||||
# checking for openssl
|
||||
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8], [],
|
||||
[AC_MSG_ERROR([please install libssl-dev or openssl-devel])])
|
||||
|
||||
# look for openssl binary
|
||||
OPENSSL_BIN=`$PKG_CONFIG --variable=exec_prefix openssl`/bin
|
||||
AC_PATH_PROGS([OPENSSL], [openssl], [:], [$OPENSSL_BIN:$PATH])
|
||||
|
||||
# checking for PAM variation
|
||||
# Linux-PAM is used in Linux systems
|
||||
# OpenPAM is used by FreeBSD, NetBSD, DragonFly BSD and OS X
|
||||
# OpenBSD uses BSD Authentication rather than both PAMs
|
||||
AC_CHECK_HEADER([security/_pam_types.h],
|
||||
[AC_DEFINE([HAVE__PAM_TYPES_H], 1, [Using Linux-PAM], [])])
|
||||
AC_CHECK_HEADER([security/pam_constants.h],
|
||||
[AC_DEFINE([HAVE_PAM_CONSTANTS_H], 1, [Using OpenPAM], [])])
|
||||
|
||||
# Find imlib2
|
||||
case "$with_imlib2" in
|
||||
'' | no) AC_MSG_NOTICE([imlib2 will not be supported])
|
||||
use_imlib2=no
|
||||
;;
|
||||
yes)
|
||||
PKG_CHECK_MODULES([IMLIB2], [imlib2 >= 1.4.5],
|
||||
[use_imlib2=yes],
|
||||
[AC_MSG_ERROR([please install libimlib2-dev or imlib2-devel])])
|
||||
;;
|
||||
/*) AC_MSG_CHECKING([for imlib2 in $with_imlib2])
|
||||
if test -d $with_imlib2/lib; then
|
||||
IMLIB2_LIBS="-L$with_imlib2/lib -lImlib2"
|
||||
elif test -d $with_imlib2/lib64; then
|
||||
IMLIB2_LIBS="-L$with_imlib2/lib64 -lImlib2"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find libImlib2 in $with_imlib2])
|
||||
fi
|
||||
|
||||
if test -f $with_imlib2/include/Imlib2.h; then
|
||||
IMLIB2_CFLAGS="-I $with_imlib2/include"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find $with_imlib2/include/Imlib2.h])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST([IMLIB2_LIBS])
|
||||
AC_SUBST([IMLIB2_CFLAGS])
|
||||
use_imlib2=yes
|
||||
;;
|
||||
*) AC_MSG_ERROR([--with-imlib2 needs yes/no or absolute path])
|
||||
esac
|
||||
|
||||
if test x$use_imlib2 = xyes; then
|
||||
AC_DEFINE([USE_IMLIB2],1, [Compile with imlib2 support])
|
||||
fi
|
||||
|
||||
# Find freetype2
|
||||
#
|
||||
# The modversion used by pkgcheck does not correspond to the
|
||||
# freetype2 release. See docs/VERSIONS.TXT in the freetype2
|
||||
# source for a table of correspondences. If you change one
|
||||
# of the below defines, change both.
|
||||
m4_define([FT2_REQUIRED_VERSION], [2_8_0])
|
||||
m4_define([FT2_REQUIRED_MODVERSION], [20.0.14])
|
||||
case "$with_freetype2" in
|
||||
'' | no) AC_MSG_NOTICE([freetype2 will not be supported])
|
||||
use_freetype2=no
|
||||
;;
|
||||
yes)
|
||||
PKG_CHECK_MODULES([FREETYPE2], [freetype2 >= FT2_REQUIRED_MODVERSION],
|
||||
[use_freetype2=yes],
|
||||
[AC_MSG_ERROR([please install version FT2_REQUIRED_VERSION or later of libfreetype6-dev or freetype-devel])])
|
||||
;;
|
||||
/*) AC_MSG_CHECKING([for freetype2 in $with_freetype2])
|
||||
if test -d $with_freetype2/lib; then
|
||||
FREETYPE2_LIBS="-L$with_freetype2/lib -llibfreetype"
|
||||
elif test -d $with_freetype2/lib64; then
|
||||
FREETYPE2_LIBS="-L$with_freetype2/lib64 -llibfreetype"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find libfreetype in $with_freetype2])
|
||||
fi
|
||||
|
||||
if test -f $with_freetype2/include/freetype2/ft2build.h; then
|
||||
FREETYPE2_CFLAGS="-I $with_freetype2/include/freetype2"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find $with_freetype2/include/freetype2/ft2build.h])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST([FREETYPE2_LIBS])
|
||||
AC_SUBST([FREETYPE2_CFLAGS])
|
||||
use_freetype2=yes
|
||||
;;
|
||||
*) AC_MSG_ERROR([--with-freetype2 needs yes/no or absolute path])
|
||||
esac
|
||||
AM_CONDITIONAL([USE_FREETYPE2], [test "x$use_freetype2" = xyes])
|
||||
|
||||
# Check only one auth mechanism is specified, and give it a name
|
||||
auth_cnt=0
|
||||
auth_mech="Builtin"
|
||||
AUTHMOD_OBJ=verify_user.lo
|
||||
AUTHMOD_LIB=-lcrypt
|
||||
if test x$enable_pam = xyes
|
||||
then
|
||||
auth_cnt=`expr $auth_cnt + 1`
|
||||
auth_mech="PAM"
|
||||
AUTHMOD_OBJ=verify_user_pam.lo
|
||||
AUTHMOD_LIB=-lpam
|
||||
fi
|
||||
if test x$bsd = xtrue
|
||||
then
|
||||
auth_cnt=`expr $auth_cnt + 1`
|
||||
auth_mech="BSD"
|
||||
AUTHMOD_OBJ=verify_user_bsd.lo
|
||||
AUTHMOD_LIB=
|
||||
fi
|
||||
if test x$enable_kerberos = xyes
|
||||
then
|
||||
auth_cnt=`expr $auth_cnt + 1`
|
||||
auth_mech="Kerberos"
|
||||
AUTHMOD_OBJ=verify_user_kerberos.lo
|
||||
AUTHMOD_LIB=-lkrb5
|
||||
fi
|
||||
if test x$enable_pamuserpass = xyes
|
||||
then
|
||||
auth_cnt=`expr $auth_cnt + 1`
|
||||
auth_mech="PAM userpass"
|
||||
AUTHMOD_OBJ=verify_user_pam_userpass.lo
|
||||
AUTHMOD_LIB="-lpam -lpam_userpass"
|
||||
fi
|
||||
|
||||
if test $auth_cnt -gt 1
|
||||
then
|
||||
AC_MSG_ERROR([--enable-pam, --enable-bsd, --enable-pamuserpass and --enable-kerberos are mutually exclusive])
|
||||
fi
|
||||
|
||||
AC_SUBST([AUTHMOD_OBJ])
|
||||
AC_SUBST([AUTHMOD_LIB])
|
||||
|
||||
# checking if pam should be autodetected.
|
||||
if test "x$enable_pam" = "xyes"
|
||||
then
|
||||
if test -z "$enable_bsd"
|
||||
then
|
||||
AC_CHECK_HEADER([security/pam_appl.h], [],
|
||||
[AC_MSG_ERROR([please install libpam0g-dev or pam-devel])])
|
||||
fi
|
||||
if test "x$enable_pam_config" = "x"; then
|
||||
PAM_RULES="auto"
|
||||
else
|
||||
pam_config_file="$srcdir/instfiles/pam.d/xrdp-sesman.$enable_pam_config"
|
||||
if test -f "$pam_config_file"; then
|
||||
PAM_RULES="$enable_pam_config"
|
||||
else
|
||||
AC_MSG_ERROR([PAM file "$pam_config_file" is not available])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(PAM_RULES)
|
||||
|
||||
# Add define for development options to config_ac.h
|
||||
AC_DEFINE([CONFIG_AC_H],1, [Allow sources to check config_ac.h is included])
|
||||
if test x$devel_logging = xyes
|
||||
then
|
||||
AC_DEFINE([USE_DEVEL_LOGGING],1,[Enable development logging])
|
||||
fi
|
||||
|
||||
if test x$devel_streamcheck = xyes
|
||||
then
|
||||
AC_DEFINE([USE_DEVEL_STREAMCHECK],1,[Enable development stream checking])
|
||||
fi
|
||||
|
||||
if test "x$enable_vsock" = "xyes"
|
||||
then
|
||||
enable_vsock=yes
|
||||
if test "x$freebsd" = "xyes"
|
||||
then
|
||||
# Determine if we have AF_HYPERV defined (FreeBSD 13+)
|
||||
AC_CHECK_DECL([AF_HYPERV], [AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_HYPERV])], [], [#include <sys/socket.h>])
|
||||
else
|
||||
AC_CHECK_HEADERS([linux/socket.h linux/vm_sockets.h],
|
||||
[AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_VSOCK])],
|
||||
[],
|
||||
[#include <sys/socket.h>])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_ipv6only" = "xyes"
|
||||
then
|
||||
enable_ipv6=yes
|
||||
AC_DEFINE([XRDP_ENABLE_IPV6ONLY],1,[Enable IPv6 only])
|
||||
fi
|
||||
|
||||
if test "x$enable_ipv6" = "xyes"
|
||||
then
|
||||
AC_DEFINE([XRDP_ENABLE_IPV6],1,[Enable IPv6])
|
||||
fi
|
||||
|
||||
AS_IF( [test "x$enable_neutrinordp" = "xyes"] , [PKG_CHECK_MODULES(FREERDP, freerdp >= 1.0.0)] )
|
||||
|
||||
# checking for libjpeg
|
||||
if test "x$enable_jpeg" = "xyes"
|
||||
then
|
||||
AC_CHECK_HEADER([jpeglib.h], [],
|
||||
[AC_MSG_ERROR([please install libjpeg-dev or libjpeg-devel])])
|
||||
fi
|
||||
|
||||
# checking for fuse
|
||||
if test "x$enable_fuse" = "xyes"
|
||||
then
|
||||
PKG_CHECK_MODULES([FUSE], [fuse >= 2.6], [],
|
||||
[AC_MSG_ERROR([please install libfuse-dev or fuse-devel])])
|
||||
fi
|
||||
|
||||
# checking for fdk aac
|
||||
if test "x$enable_fdkaac" = "xyes"
|
||||
then
|
||||
PKG_CHECK_MODULES([FDKAAC], [fdk-aac >= 0.1.0], [],
|
||||
[AC_MSG_ERROR([please install libfdk-aac-dev or fdk-aac-devel])])
|
||||
fi
|
||||
|
||||
# checking for opus
|
||||
if test "x$enable_opus" = "xyes"
|
||||
then
|
||||
AC_CHECK_HEADER([opus/opus.h], [],
|
||||
[AC_MSG_ERROR([please install libopus-dev or opus-devel])])
|
||||
fi
|
||||
|
||||
# checking for lame mp3
|
||||
if test "x$enable_mp3lame" = "xyes"
|
||||
then
|
||||
AC_CHECK_HEADER([lame/lame.h], [],
|
||||
[AC_MSG_ERROR([please install libmp3lame-dev or lamemp3-devel])])
|
||||
fi
|
||||
|
||||
AS_IF( [test "x$enable_pixman" = "xyes"] , [PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.1.0)] )
|
||||
|
||||
# checking for TurboJPEG
|
||||
if test "x$enable_tjpeg" = "xyes"
|
||||
then
|
||||
if test ! -z "$TURBOJPEG_PATH"
|
||||
then
|
||||
# env var TURBOJPEG_PATH has been defined, use that
|
||||
AC_CHECK_HEADER([$TURBOJPEG_PATH/include/turbojpeg.h], [],
|
||||
[AC_MSG_ERROR([could not find TurboJPEG in dir specified by env variable TURBOJPEG_PATH ($TURBOJPEG_PATH)])])
|
||||
|
||||
AC_SUBST(TurboJpegIncDir, ["-I$TURBOJPEG_PATH/include"])
|
||||
AC_SUBST(TurboJpegLibDir, ["-L$TURBOJPEG_PATH/lib -Wl,-rpath -Wl,$TURBOJPEG_PATH/lib"])
|
||||
elif test -e /opt/libjpeg-turbo/lib64
|
||||
then
|
||||
# TurboJPEG has been installed to /opt on a 64 bit m/c
|
||||
AC_SUBST(TurboJpegIncDir, ["-I/opt/libjpeg-turbo/include"])
|
||||
AC_SUBST(TurboJpegLibDir, ["-L/opt/libjpeg-turbo/lib64 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib64"])
|
||||
elif test -e /opt/libjpeg-turbo/lib32
|
||||
then
|
||||
# TurboJPEG has been installed to /opt on a 32 bit m/c
|
||||
AC_SUBST(TurboJpegIncDir, ["-I/opt/libjpeg-turbo/include"])
|
||||
AC_SUBST(TurboJpegLibDir, ["-L/opt/libjpeg-turbo/lib32 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib32"])
|
||||
else
|
||||
# check in default location
|
||||
AC_CHECK_HEADER([/usr/include/turbojpeg.h], [],
|
||||
[AC_MSG_ERROR([please install TurboJPEG ])])
|
||||
AC_SUBST(TurboJpegIncDir, [""])
|
||||
AC_SUBST(TurboJpegLibDir, [""])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_XTRA
|
||||
if test "x$no_x" == "xyes"; then
|
||||
AC_MSG_ERROR([please install libx11-dev or libX11-devel])
|
||||
fi
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
|
||||
# checking for Xfixes
|
||||
AC_CHECK_HEADER([X11/extensions/Xfixes.h], [],
|
||||
[AC_MSG_ERROR([please install libxfixes-dev or libXfixes-devel])],
|
||||
[#include <X11/Xlib.h>])
|
||||
|
||||
# checking for Xrandr
|
||||
AC_CHECK_HEADER([X11/extensions/Xrandr.h], [],
|
||||
[AC_MSG_ERROR([please install libxrandr-dev or libXrandr-devel])],
|
||||
[#include <X11/Xlib.h>])
|
||||
|
||||
if test "x$enable_utmp" = "xyes"
|
||||
then
|
||||
AC_CHECK_HEADERS(utmp.h utmpx.h)
|
||||
|
||||
# Test for non-standard extensions in struct utmpx
|
||||
AXRDP_CHECK_UTMPX_MEMBER_EXISTS([ut_host], [HAVE_UTMPX_UT_HOST])
|
||||
AXRDP_CHECK_UTMPX_MEMBER_EXISTS([ut_exit], [HAVE_UTMPX_UT_EXIT])
|
||||
fi
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# perform unit tests if libcheck and libmocka found
|
||||
perform_unit_tests=yes; # Assume packages will be found
|
||||
if test "x$ensure_tests_deps" == "xyes"; then
|
||||
PKG_CHECK_MODULES([CHECK], [check >= 0.10.0],
|
||||
[],
|
||||
[AC_MSG_ERROR([please install check, the unit test framework])])
|
||||
# Check if cmocka is available - needed for unit testing
|
||||
PKG_CHECK_MODULES([CMOCKA], [cmocka],
|
||||
[],
|
||||
[AC_MSG_ERROR([please install cmocka, the mocking framework])])
|
||||
else
|
||||
PKG_CHECK_MODULES([CHECK], [check >= 0.10.0],
|
||||
[],
|
||||
[perform_unit_tests=no])
|
||||
PKG_CHECK_MODULES([CMOCKA], [cmocka],
|
||||
[],
|
||||
[perform_unit_tests=no])
|
||||
fi
|
||||
|
||||
if test "x$perform_unit_tests" == "xyes"; then
|
||||
AC_MSG_NOTICE([libcheck found, unit tests will be performed])
|
||||
else
|
||||
AC_MSG_NOTICE([libcheck not found, unit tests will be skipped])
|
||||
fi
|
||||
# -- end perform unit tests
|
||||
|
||||
AC_SUBST([moduledir], '${libdir}/xrdp')
|
||||
|
||||
AC_ARG_ENABLE([strict-locations],
|
||||
[AS_HELP_STRING([--enable-strict-locations],
|
||||
[Use standard Autoconf install directories unless overridden
|
||||
(default: use /etc and /var)])],
|
||||
[], [enable_strict_locations=no])
|
||||
|
||||
if test "x$enable_strict_locations" != "xyes"; then
|
||||
sysconfdir="/etc";
|
||||
localstatedir="/var";
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([pamconfdir],
|
||||
[AS_HELP_STRING([--with-pamconfdir=DIR],
|
||||
[Use directory for pam.d config (default: /etc/pam.d)])],
|
||||
[], [with_pamconfdir="$sysconfdir/pam.d"])
|
||||
AC_SUBST([pamconfdir], [$with_pamconfdir])
|
||||
|
||||
PKG_INSTALLDIR
|
||||
|
||||
AC_CHECK_HEADERS([sys/prctl.h uchar.h])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
common/Makefile
|
||||
docs/Makefile
|
||||
docs/man/Makefile
|
||||
fontutils/Makefile
|
||||
genkeymap/Makefile
|
||||
instfiles/default/Makefile
|
||||
instfiles/init.d/Makefile
|
||||
instfiles/Makefile
|
||||
instfiles/pam.d/Makefile
|
||||
instfiles/pulse/Makefile
|
||||
instfiles/rc.d/Makefile
|
||||
keygen/Makefile
|
||||
waitforx/Makefile
|
||||
libipm/Makefile
|
||||
libxrdp/Makefile
|
||||
Makefile
|
||||
mc/Makefile
|
||||
neutrinordp/Makefile
|
||||
ulalaca/Makefile
|
||||
pkgconfig/Makefile
|
||||
pkgconfig/xrdp.pc
|
||||
pkgconfig/xrdp-uninstalled.pc
|
||||
sesman/libsesman/Makefile
|
||||
sesman/chansrv/Makefile
|
||||
sesman/Makefile
|
||||
sesman/sesexec/Makefile
|
||||
sesman/tools/Makefile
|
||||
tests/Makefile
|
||||
tests/common/Makefile
|
||||
tests/libipm/Makefile
|
||||
tests/libxrdp/Makefile
|
||||
tests/memtest/Makefile
|
||||
tests/xrdp/Makefile
|
||||
tools/Makefile
|
||||
tools/devel/Makefile
|
||||
tools/devel/tcp_proxy/Makefile
|
||||
vnc/Makefile
|
||||
xrdpapi/Makefile
|
||||
xrdp/Makefile
|
||||
xrdpvr/Makefile
|
||||
xup/Makefile
|
||||
third_party/Makefile
|
||||
third_party/tomlc99/Makefile
|
||||
])
|
||||
|
||||
AC_REQUIRE_AUX_FILE([tap-driver.sh])
|
||||
AC_OUTPUT
|
||||
|
||||
echo ""
|
||||
echo "xrdp will be compiled with:"
|
||||
echo ""
|
||||
echo " mp3lame $enable_mp3lame"
|
||||
echo " opus $enable_opus"
|
||||
echo " fdkaac $enable_fdkaac"
|
||||
echo " jpeg $enable_jpeg"
|
||||
echo " turbo jpeg $enable_tjpeg"
|
||||
echo " rfxcodec $enable_rfxcodec"
|
||||
echo " painter $enable_painter"
|
||||
echo " pixman $enable_pixman"
|
||||
echo " fuse $enable_fuse"
|
||||
echo " ipv6 $enable_ipv6"
|
||||
echo " ipv6only $enable_ipv6only"
|
||||
echo " vsock $enable_vsock"
|
||||
echo " auth mechanism $auth_mech"
|
||||
echo " rdpsndaudin $enable_rdpsndaudin"
|
||||
echo " utmp support $enable_utmp"
|
||||
if test x$enable_utmp = xyes; then
|
||||
echo " utmpx.ut_host $ac_cv_utmpx_has_ut_host"
|
||||
echo " utmpx.ut_exit $ac_cv_utmpx_has_ut_exit"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo " with imlib2 $use_imlib2"
|
||||
echo " with freetype2 $use_freetype2"
|
||||
|
||||
echo
|
||||
echo " development logging $devel_logging"
|
||||
echo " development streamcheck $devel_streamcheck"
|
||||
echo ""
|
||||
echo " strict_locations $enable_strict_locations"
|
||||
echo " prefix $prefix"
|
||||
echo " exec_prefix $exec_prefix"
|
||||
echo " libdir $libdir"
|
||||
echo " bindir $bindir"
|
||||
echo " sysconfdir $sysconfdir"
|
||||
echo " pamconfdir $pamconfdir"
|
||||
echo " localstatedir $localstatedir"
|
||||
echo " runstatedir $runstatedir"
|
||||
echo " socketdir $socketdir"
|
||||
echo ""
|
||||
echo " unit tests performable $perform_unit_tests"
|
||||
echo ""
|
||||
echo " CFLAGS = $CFLAGS"
|
||||
echo " LDFLAGS = $LDFLAGS"
|
||||
|
||||
# xrdp_configure_options.h will be written to the build directory, not the source directory
|
||||
echo '#define XRDP_CONFIGURE_OPTIONS \' > ./xrdp_configure_options.h
|
||||
./config.status --config | xargs -n 1 | sed -e 's/^/" /' -e 's/$/\\n" \\/' >> ./xrdp_configure_options.h
|
||||
echo '""' >> ./xrdp_configure_options.h
|
||||
@ -1,3 +0,0 @@
|
||||
|
||||
SUBDIRS = \
|
||||
man
|
||||
1
docs/man/.gitignore
vendored
1
docs/man/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.[1-8]
|
||||
@ -1,42 +0,0 @@
|
||||
if USE_FREETYPE2
|
||||
MKFV1_MAN = xrdp-mkfv1.8
|
||||
else
|
||||
MKFV1_MAN =
|
||||
endif
|
||||
|
||||
man_MANS = \
|
||||
xrdp-dis.1 \
|
||||
sesman.ini.5 \
|
||||
xrdp.ini.5 \
|
||||
xrdp.8 \
|
||||
xrdp-chansrv.8 \
|
||||
xrdp-genkeymap.8 \
|
||||
xrdp-keygen.8 \
|
||||
xrdp-sesadmin.8 \
|
||||
xrdp-sesman.8 \
|
||||
xrdp-sesrun.8 \
|
||||
xrdp-dumpfv1.8 \
|
||||
$(MKFV1_MAN)
|
||||
|
||||
EXTRA_DIST = $(man_MANS:=.in)
|
||||
|
||||
SUBST_VARS = sed \
|
||||
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
|
||||
-e 's|@bindir[@]|$(bindir)|g' \
|
||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
-e 's|@localstatedir[@]|$(localstatedir)|g' \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@socketdir[@]|$(socketdir)|g' \
|
||||
-e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \
|
||||
-e 's|@xrdpdatadir[@]|$(datadir)/xrdp|g' \
|
||||
-e 's|@xrdphomeurl[@]|http://www.xrdp.org/|g'
|
||||
|
||||
subst_verbose = $(subst_verbose_@AM_V@)
|
||||
subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@)
|
||||
subst_verbose_0 = @echo " SUBST $@";
|
||||
|
||||
SUFFIXES = .in
|
||||
.in:
|
||||
$(subst_verbose)$(SUBST_VARS) $< > $@
|
||||
|
||||
CLEANFILES = $(man_MANS)
|
||||
@ -1,420 +0,0 @@
|
||||
.\"
|
||||
.TH "sesman.ini" "5" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
\fBsesman.ini\fR \- Configuration file for \fBxrdp-sesman\fR(8)
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBsesman.ini\fR consists of several sections. Each section starts with
|
||||
the section name in square brackets, followed by a list of
|
||||
\fIparameter\fR=\fIvalue\fR lines. Following sections are recognized:
|
||||
|
||||
.TP
|
||||
\fB[Globals]\fR
|
||||
Global configuration
|
||||
|
||||
.TP
|
||||
\fB[Logging]\fR
|
||||
Logging subsystem
|
||||
|
||||
.TP
|
||||
\fB[Sessions]\fR
|
||||
Session management
|
||||
|
||||
.TP
|
||||
\fB[Security]\fR
|
||||
Access control
|
||||
|
||||
.TP
|
||||
\fB[Chansrv]\fR
|
||||
Settings for xrdp-chansrv(8)
|
||||
|
||||
.TP
|
||||
\fB[ChansrvLogging]\fR
|
||||
Logging settings for xrdp-chansrv(8)
|
||||
|
||||
.TP
|
||||
\fB[SessionVariables]\fR
|
||||
Environment variables for the session
|
||||
|
||||
.LP
|
||||
All parameters and values (except for file names and paths) are case
|
||||
insensitive, and are described in detail below. If any parameter is
|
||||
specified more than once, the last entry will be used. Options specified
|
||||
outside their proper section will be \fIignored\fR.
|
||||
|
||||
.SH "GLOBALS"
|
||||
Following parameters can be used in the \fB[Globals]\fR section.
|
||||
|
||||
.TP
|
||||
\fBListenPort\fR=\fIpath-to-socket\fR
|
||||
UNIX domain socket for xrdp-sesman(8) to listen on.
|
||||
.PP
|
||||
.RS
|
||||
The default value of this setting is 'sesman.socket'.
|
||||
.PP
|
||||
An absolute path can be specified by starting this parameter with a '/'.
|
||||
In this instance, the system administrator is responsible for ensuring
|
||||
the socket can only be created by a suitably privileged process.
|
||||
.PP
|
||||
If the parameter does not start with a '/', a name within
|
||||
@socketdir@ is used.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fBEnableUserWindowManager\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables user
|
||||
specific startup script. That is, xrdp-sesman will execute the script
|
||||
specified by \fBUserWindowManager\fR if it exists.
|
||||
|
||||
.TP
|
||||
\fBUserWindowManager\fR=\fIfilename\fR
|
||||
Path of the startup script relative to the user's home directory. If
|
||||
present and enabled by \fBEnableUserWindowManager\fR, that script is
|
||||
executed instead of \fBDefaultWindowManager\fR.
|
||||
|
||||
.TP
|
||||
\fBDefaultWindowManager\fR=\fIfilename\fR
|
||||
Full path or relative path of the default startup script used by xrdp-sesman
|
||||
to start a session. If the path is not a full path, it will be resolved as
|
||||
relative path to \fI@xrdpconfdir@\fR. If not specified, defaults to
|
||||
\fI@xrdpconfdir@/startwm.sh\fR.
|
||||
|
||||
.TP
|
||||
\fBReconnectScript\fR=\fIfilename\fR
|
||||
Full path or relative path if the script which executed when users reconnects
|
||||
to the existing session. If the path is not a full path, it will be resolved as
|
||||
relative path to \fI@xrdpconfdir@\fR. If not specified, defaults to
|
||||
\fI@xrdpconfdir@/reconnectwm.sh\fR.
|
||||
|
||||
.SH "LOGGING"
|
||||
Following parameters can be used in the \fB[Logging]\fR and \fB[ChansrvLogging]\fR
|
||||
sections.
|
||||
|
||||
.TP
|
||||
\fBLogFile\fR=\fIfilename\fR
|
||||
Log file path. It can be either absolute or relative. If not specified,
|
||||
defaults to \fI./sesman.log\fR. If set to \fB<stdout>\fR, log will go to
|
||||
stdout. Use for debugging only\fR
|
||||
|
||||
It is ignored in the [ChansrvLogging] section
|
||||
since the channel server creates one log file per display and instead uses the
|
||||
following log file naming convention \fIxrdp-chansrv.${DISPLAY}.log\fR
|
||||
|
||||
.TP
|
||||
\fBLogLevel\fR=\fIlevel\fR
|
||||
This option can have one of the following values:
|
||||
|
||||
\fBCORE\fR or \fB0\fR \- Log only core messages. Those messages are
|
||||
logged \fIregardless\fR of the selected logging level.
|
||||
|
||||
\fBERROR\fR or \fB1\fR \- Log only error messages.
|
||||
|
||||
\fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages.
|
||||
|
||||
\fBINFO\fR or \fB3\fR \- Log errors, warnings and informational messages.
|
||||
|
||||
\fBDEBUG\fR or \fB4\fR \- Log everything. If xrdp-sesman is compiled in
|
||||
debug mode, this options will output many more low\-level messages.
|
||||
|
||||
.TP
|
||||
\fBEnableSyslog\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to
|
||||
syslog.
|
||||
|
||||
.TP
|
||||
\fBSyslogLevel\fR=\fIlevel\fR
|
||||
Logging level for syslog. It can have the same values as \fBLogLevel\fR.
|
||||
Defaults to \fBDEBUG\fR.
|
||||
|
||||
.TP
|
||||
\fBEnableConsole\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to
|
||||
the console (ie. stdout).
|
||||
|
||||
.TP
|
||||
\fBConsoleLevel\fR=\fIlevel\fR
|
||||
Logging level for the console. It can have the same values as \fBLogLevel\fR.
|
||||
Defaults to \fBDEBUG\fR.
|
||||
|
||||
.TP
|
||||
\fBEnableProcessId\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging the
|
||||
process id in all log messages. Defaults to \fBfalse\fR.
|
||||
|
||||
.SH "SESSIONS"
|
||||
Following parameters can be used in the \fB[Sessions]\fR section.
|
||||
|
||||
.TP
|
||||
\fBX11DisplayOffset\fR=\fInumber\fR
|
||||
The first X display number available for xrdp-sesman. This prevents
|
||||
xrdp-sesman from interfering with real X11 servers. If not specified,
|
||||
defaults to \fI10\fR.
|
||||
|
||||
.TP
|
||||
\fBMaxSessions\fR=\fInumber\fR
|
||||
Sets the maximum number of simultaneous sessions. If not set or set to
|
||||
\fI0\fR, unlimited session are allowed.
|
||||
|
||||
.TP
|
||||
\fBMaxDisplayNumber\fR=\fInumber\fR
|
||||
Sets the maximum number which can be assigned to an X11 $DISPLAY. The
|
||||
default is compatible with IANA TCP port allocations. If you are not
|
||||
allowing TCP connections to your X servers you may safely increase this
|
||||
number.
|
||||
|
||||
.TP
|
||||
\fBKillDisconnected\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed
|
||||
within \fBDisconnectedTimeLimit\fR seconds after the user disconnects.
|
||||
This setting currently only works with xorgxrdp sessions.
|
||||
|
||||
.TP
|
||||
\fBDisconnectedTimeLimit\fR=\fInumber\fR
|
||||
Sets the time limit for \fBKillDisconnected\fR to a value greater than 60.
|
||||
Values less than 60 are to be overridden with 60.
|
||||
This setting currently only works with xorgxrdp sessions.
|
||||
|
||||
.TP
|
||||
\fBIdleTimeLimit\fR=\fInumber\fR
|
||||
Sets the time limit (in seconds) before an idle session is disconnected.
|
||||
Idle means no keyboard inputs and no mouse moves/clicks here.
|
||||
If set to \fI0\fR, idle sessions will never be disconnected by timeout.
|
||||
This works only with xorgxrdp sessions. Moreover, xorgxrdp must be v0.2.9 or later.
|
||||
|
||||
.TP
|
||||
\fBPolicy\fR=\fI[Default|Separate|{UBDI}]\fR
|
||||
Session allocation policy. Used to decide when to allocate a
|
||||
new session. Set to one of the following values:
|
||||
.br
|
||||
|
||||
.RS
|
||||
.HP 12
|
||||
\fBDefault\fR - Currently the same as "UB" for all session types
|
||||
.HP 12
|
||||
\fBSeparate\fR - All sessions are separate. Sessions can never be rejoined,
|
||||
and will need to be cleaned up manually, or automatically by setting other
|
||||
sesman options.
|
||||
.P
|
||||
Alternatively combine one-or-more of the following options
|
||||
.HP 4
|
||||
\fBU\fR - Sessions are separated per user
|
||||
.HP 4
|
||||
\fBB\fR - Sessions are separated by bits-per-pixel
|
||||
.HP 4
|
||||
\fBD\fR - Sessions are separated by initial display size
|
||||
.HP 4
|
||||
\fBI\fR - Sessions are separated by IP address
|
||||
.RE
|
||||
|
||||
.IP
|
||||
Note that the \fBU\fR and \fBB\fR criteria cannot be turned
|
||||
off. \fBDisplaySize\fR refers to the initial geometry of a connection,
|
||||
as actual display sizes can change dynamically.
|
||||
|
||||
.SH "SECURITY"
|
||||
Following parameters can be used in the \fB[Security]\fR section.
|
||||
|
||||
.TP
|
||||
\fBAllowRootLogin\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, enables root login on the
|
||||
terminal server.
|
||||
|
||||
.TP
|
||||
\fBMaxLoginRetry\fR=\fInumber\fR
|
||||
The number of login attempts that are allowed on terminal server. If set
|
||||
to \fI0\fR, unlimited attempts are allowed. If not specified, defaults to
|
||||
\fI3\fR.
|
||||
|
||||
.TP
|
||||
\fBTerminalServerUsers\fR=\fIgroup\fR
|
||||
Only the users belonging to the specified group are allowed to login on
|
||||
terminal server. If unset or set to an invalid or non\-existent group,
|
||||
login for all users is enabled.
|
||||
|
||||
.TP
|
||||
\fBTerminalServerAdmins\fR=\fIgroup\fR
|
||||
\fIThis option is currently ignored!\fR Only members of this group can
|
||||
have session management rights.
|
||||
|
||||
.TP
|
||||
\fBRestrictOutboundClipboard\fR=\fI[all|none|text|file|image]\fR
|
||||
If set to \fBall\fR, will restrict the clipboard
|
||||
outbound from the server, to prevent data copied inside the xrdp session
|
||||
to be pasted in the client. Default value is \fBnone\fR.
|
||||
In addition, you can control text/file/image transfer restrictions
|
||||
respectively. It also accepts comma separated list such as text,file,image.
|
||||
.br
|
||||
|
||||
.br
|
||||
\fBnone\fR - No restriction about copying inbound clipboard data.
|
||||
.br
|
||||
\fBall\fR - Restrict to copy inbound clipboard data.
|
||||
.br
|
||||
\fBtext\fR - Restrict to copy only inbound text clipboard data.
|
||||
.br
|
||||
\fBfile\fR - Restrict to copy only inbound file clipboard data.
|
||||
.br
|
||||
\fBimage\fR - Restrict to copy only inbound image clipboard data.
|
||||
.br
|
||||
|
||||
To keep compatibility, the following aliases are also available.
|
||||
.br
|
||||
\fBtrue\fR - an alias of \fBall\fR.
|
||||
.br
|
||||
\fBfalse\fR - an alias of \fBnone\fR.
|
||||
.br
|
||||
\fByes\fR - an alias of \fBall\fR.
|
||||
|
||||
.TP
|
||||
\fBRestrictInboundClipboard\fR=\fI[none|all|text|file|image]\fR
|
||||
If set to \fBall\fR, will restrict the clipboard
|
||||
inbound from the client, to prevent data copied inside the client
|
||||
to be pasted in the xrdp session. Default value is \fBnone\fR.
|
||||
In addition, you can control text/file/image transfer restrictions
|
||||
respectively. It also accepts comma separated list such as text,file,image.
|
||||
.br
|
||||
|
||||
.br
|
||||
\fBnone\fR - No restriction about copying inbound clipboard data.
|
||||
.br
|
||||
\fBall\fR - Restrict to copy inbound clipboard data.
|
||||
.br
|
||||
\fBtext\fR - Restrict to copy only inbound text clipboard data.
|
||||
.br
|
||||
\fBfile\fR - Restrict to copy only inbound file clipboard data.
|
||||
.br
|
||||
\fBimage\fR - Restrict to copy only inbound image clipboard data.
|
||||
.br
|
||||
|
||||
To keep compatibility, the following aliases are also available.
|
||||
.br
|
||||
\fBtrue\fR - an alias of \fBall\fR.
|
||||
.br
|
||||
\fBfalse\fR - an alias of \fBnone\fR.
|
||||
.br
|
||||
\fByes\fR - an alias of \fBall\fR.
|
||||
|
||||
.TP
|
||||
\fBAlwaysGroupCheck\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, require group membership even
|
||||
if the group specified in \fBTerminalServerUsers\fR doesn't exist.
|
||||
|
||||
.TP
|
||||
\fBAllowAlternateShell\fR=\fI[true|false]\fR
|
||||
If set to \fB0\fR, \fBfalse\fR or \fBno\fR, prevent usage of alternate shells by users.
|
||||
|
||||
.TP
|
||||
\fBXorgNoNewPrivileges\fR=\fI[true|false]\fR
|
||||
Only applicable on Linux. If set to \fB0\fR, \fBfalse\fR or \fBno\fR, do
|
||||
not use the kernel's \fIno_new_privs\fR restriction when invoking the Xorg
|
||||
X11 server. The use of \fIno_new_privs\fR is intended to prevent issues due
|
||||
to a setuid Xorg executable. However, if a kernel security module (such as
|
||||
AppArmor) is used to confine xrdp, \fIno_new_privs\fR may interfere with
|
||||
transitions between confinement domains.
|
||||
|
||||
.TP
|
||||
\fBSessionSockdirGroup\fR=\fIgroup\fR
|
||||
Sets the group owner of the directories containing session sockets. This
|
||||
is normally the GID of the xrdp process so xrdp can connect to user sessions.
|
||||
|
||||
.SH "X11 SERVER"
|
||||
Following parameters can be used in the \fB[Xvnc]\fR and
|
||||
\fB[Xorg]\fR sections.
|
||||
|
||||
.TP
|
||||
\fBparam\fR=\fIstring\fR
|
||||
Multiple \fIparam\fR lines are supported. This first line specifies the
|
||||
path to the X11 server executable. Following lines specify command line
|
||||
arguments passed to the X11 server.
|
||||
|
||||
.SH "CHANSRV"
|
||||
Following parameters can be used in the \fB[Chansrv]\fR section.
|
||||
|
||||
.TP
|
||||
\fBFuseMountName\fR=\fIstring\fR
|
||||
Directory for drive redirection.
|
||||
Created if it doesn't exist. If not specified, defaults to \fIxrdp_client\fR.
|
||||
If first character is not a '/', this is relative to $HOME.
|
||||
.P
|
||||
.RS
|
||||
The following substitutions are made in this string:-
|
||||
%U - Username
|
||||
%u - Numeric UID
|
||||
%d - Numeric display number (ex 10)
|
||||
%D - Display environment variable (ex :10.0)
|
||||
%% - Percent character
|
||||
.HP 3
|
||||
1) The directory path permissions MUST be configured correctly by
|
||||
the system administrator or the system itself - xrdp-chansrv will not
|
||||
do this for you (although it will create the final directories owned by
|
||||
the user).
|
||||
.HP 3
|
||||
2) The desktop may not automatically display a link for the redirected
|
||||
drive. To fix this, consult the docs for your chosen desktop.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fBFileUmask\fR=\fImode\fR
|
||||
Additional umask to apply to files in the \fBFuseMountName\fR directory.
|
||||
The default value of 077 prevents other users on the system from reading
|
||||
files on your redirected drives. This may not be appropriate for all
|
||||
environments, and so you can change this value to allow other users to
|
||||
access your remote files if required.
|
||||
|
||||
.TP
|
||||
\fBEnableFuseMount\fR=\fI[true|false]\fR
|
||||
Defaults to \fItrue\fR.
|
||||
Set to \fIfalse\fR to disable xrdp-chansrv's use of the FUSE system
|
||||
feature, even if it has been built with this feature enabled.
|
||||
.P
|
||||
.RS
|
||||
Setting this value to \fIfalse\fR will disable the following application
|
||||
features:-
|
||||
.P
|
||||
- drive redirection
|
||||
.P
|
||||
- copying-and-pasting of files
|
||||
.RE
|
||||
.TP
|
||||
\fBUseNautilus3FlistFormat\fR=\fI[false|true]\fR
|
||||
Defaults to \fIfalse\fR.
|
||||
Set to \fItrue\fR to make file copy-paste compatible with Nautilus from
|
||||
GNOME 3 versions later than 3.29.92. Do not use this for any other reason.
|
||||
|
||||
This setting will be removed in a later version of xrdp, when GNOME 3 is
|
||||
no longer supported.
|
||||
|
||||
.TP
|
||||
\fBSoundNumSilentFramesAAC\fR=\fInumber\fR
|
||||
Sets the \fInumber\fR of silent frames which are sent to client before close
|
||||
message is sent, when AAC is selected. If set to 0, no silent frame is sent.
|
||||
If not specified, defaults to \fI4\fR.
|
||||
|
||||
.TP
|
||||
\fBSoundNumSilentFramesMP3\fR=\fInumber\fR
|
||||
Sets the \fInumber\fR of silent frames which are sent to client before close
|
||||
message is sent, when MP3 is selected. If set to 0, no silent frame is sent.
|
||||
If not specified, defaults to \fI2\fR.
|
||||
|
||||
.TP
|
||||
\fBSoundMsecDoNotSend\fR=\fInumber\fR
|
||||
Sets the duration(msec). Sound data is not send to client during \fInumber\fR
|
||||
millisecond(s) after close message is sent, when AAC/MP3 is selected.
|
||||
If set to 0, all the data is sent. If not specified, defaults to \fI1000\fR.
|
||||
|
||||
.SH "SESSIONS VARIABLES"
|
||||
All entries in the \fB[SessionVariables]\fR section are set as
|
||||
environment variables in the user's session.
|
||||
|
||||
.SH "FILES"
|
||||
@sysconfdir@/xrdp/sesman.ini
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp-sesman (8),
|
||||
.BR xrdp-sesrun (8),
|
||||
.BR xrdp (8),
|
||||
.BR xrdp.ini (5)
|
||||
|
||||
For more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,62 +0,0 @@
|
||||
.TH "xrdp\-chansrv" "8" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
\fBxrdp\-chansrv\fR \- \fBxrdp\fR channel server
|
||||
|
||||
.SH "SYNTAX"
|
||||
.B xrdp\-chansrv
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBxrdp\-chansrv\fR is the \fBxrdp\fR(8) channel server, which manages the Remote Desktop Protocol (RDP) sub-channels.
|
||||
.PP
|
||||
This program is only forked internally by \fBxrdp\-sesman\fP(8).
|
||||
.PP
|
||||
Currently \fBxrdp\-chansrv\fP knows about the following channels:
|
||||
.RS 8
|
||||
.TP
|
||||
.B cliprdr
|
||||
Clipboard Redirection
|
||||
.TP
|
||||
.B rdpsnd
|
||||
Remote Desktop Protocol Sound
|
||||
.TP
|
||||
.B rdpdr
|
||||
Remote Desktop Protocol Device Redirection
|
||||
.TP
|
||||
.B rail
|
||||
Remote Applications Integrated Locally
|
||||
.TP
|
||||
.B drdynvc
|
||||
Dynamic Virtual Channel
|
||||
.RE
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.I CHANSRV_LOG_PATH
|
||||
Path to the location where the log file is stored. If not specified,
|
||||
$\fBXDG_DATA_HOME/xrdp\fP or \fB$HOME/.local/share/xrdp\fP is used instead.
|
||||
.TP
|
||||
.I DISPLAY
|
||||
X11 display number. Must be specified.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @sysconfdir@/xrdp/sesman.ini
|
||||
Contains some settings for this program.
|
||||
.TP
|
||||
.I @socketdir@/xrdp_chansrv_socket_*
|
||||
UNIX socket used by external programs to implement channels.
|
||||
.TP
|
||||
.I @socketdir@/xrdp_api_*
|
||||
UNIX socket used by \fBxrdp\-chansrv\fP to communicate with \fBxrdp\-sesman\fP.
|
||||
.TP
|
||||
.I xrdp-chansrv.%s.log
|
||||
Log file used by \fBxrdp\-chansrv\fP(8). \fB%s\fP is display number. See the
|
||||
description of \fBCHANSRV_LOG_PATH\fP above for the file's location.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp\-sesman (8),
|
||||
.BR sesman.ini (5).
|
||||
|
||||
For more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,27 +0,0 @@
|
||||
.TH "xrdp-dis" "1" "@PACKAGE_VERSION@" "xrdp team"
|
||||
.SH NAME
|
||||
xrdp\-dis \- xrdp disconnect utility
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B xrdp\-dis
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBxrdp\-dis\fP is run with no parameters to disconnect your xrdp session.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B DISPLAY
|
||||
to get the default host and display number.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @socketdir@/xrdp_disconnect_display_*
|
||||
UNIX socket used to communicate the disconnect request to xorgxrdp.
|
||||
|
||||
.SH KNOWN ISSUES
|
||||
.TP
|
||||
This utility doesn't support disconnecting Xvnc sessions so far.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR xrdp (8).
|
||||
@ -1,58 +0,0 @@
|
||||
.TH "xrdp-dumpfv1" "8" "@PACKAGE_VERSION@" "xrdp team"
|
||||
.SH NAME
|
||||
xrdp\-dumpfv1 \- Display content of .fv1 font files
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fBxrdp-dumpfv1\fR [ options ] fv1_file
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBxrdp\-dumpfv1\fP can be used to display the contents of an fv1 file.
|
||||
|
||||
.SH OPTIONS
|
||||
A summary of options is included below.
|
||||
|
||||
One of \fB\-i\fR, \fB\-t\fR, or \fB\-c\fR must be specified.
|
||||
.TP
|
||||
\fB\-i\fR
|
||||
Displays general information about the fv1 file.
|
||||
|
||||
.TP
|
||||
\fB\-t\fR
|
||||
Displays a CSV table of all the glyphs in the font. This table can be
|
||||
imported into a spreadsheet program for further manipulation.
|
||||
|
||||
.TP
|
||||
\fB\-c\fR <character>
|
||||
Displays detailed information about a particular glyph in the font,
|
||||
including a representation of the bitmap for the glyph.
|
||||
|
||||
Specify the character using one of the following strings:
|
||||
|
||||
\fBU+<hex>\fR - Unicode character, e.g. \fBU+25\fR for a percentage symbol (%).
|
||||
|
||||
\fB@<char>\fR - Unicode character, e.g. \fB@%\fR for a percentage symbol.
|
||||
|
||||
\fBnumber\fR - Unicode value as an integer, e.g. \fB37\fR for a
|
||||
percentage symbol
|
||||
|
||||
Note that the row numbers shown in the font data are relative to the
|
||||
natural font baseline. If comparing two fonts, be aware that when the
|
||||
glyph is drawn, the row number may be affected by the global descender
|
||||
value for the font (displayed with \fB\-i\fR).
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fBxrdp\-dumpfv1 -i @xrdpdatadir@/sans-10.fv1\fR
|
||||
Displays global information about the sans 10 font file distributed with xrdp.
|
||||
|
||||
.TP
|
||||
\fBxrdp\-dumpfv1 -c @'*' @xrdpdatadir@/sans-10.fv1\fR
|
||||
Displays information about the asterisk symbol in the sans 10 font file distributed with xrdp.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR xrdp\-mkfv1(8).
|
||||
|
||||
More info on \fBxrdp\fR can be found on the
|
||||
.UR @xrdphomeurl@
|
||||
xrdp homepage
|
||||
.UE
|
||||
@ -1,73 +0,0 @@
|
||||
.TH "xrdp\-genkeymap" "8" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.de URL
|
||||
. \\$2 \(laURL: \\$1 \(ra\\$3
|
||||
..
|
||||
.if \n[.g] .mso www.tmac
|
||||
|
||||
.SH "NAME"
|
||||
\fBxrdp\-genkeymap\fR \- key map generator for XRDP
|
||||
|
||||
.SH "SYNTAX"
|
||||
.B xrdp\-genkeymap
|
||||
.I file
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBxrdp\-genkeymap\fR extracts the key map used by the currently running X session to generated a mapping from Remote Desktop Protocol (RDP) key codes to X keysyms and Unicode code points.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I outfile
|
||||
The key map information is stored in the file named \fIoutfile\fP.
|
||||
|
||||
.SH "FILES"
|
||||
.TP
|
||||
.I @sysconfdir@/xrdp/km-XXXXXXXX.ini
|
||||
Files containing the keyboard mapping for language \fIXXXXXXXX\fP, which is a 8 digit hexadecimal number identifying the country and language code.
|
||||
.RS 8
|
||||
.TP
|
||||
.B 00000405
|
||||
cs Czech
|
||||
.TP
|
||||
.B 00000407
|
||||
de German
|
||||
.TP
|
||||
.B 00000409
|
||||
en-us US English
|
||||
.TP
|
||||
.B 0000040c
|
||||
fr French
|
||||
.TP
|
||||
.B 00000410
|
||||
it Italian
|
||||
.TP
|
||||
.B 00000416
|
||||
br Portuguese (Brazil)
|
||||
.TP
|
||||
.B 00000419
|
||||
ru Russian
|
||||
.TP
|
||||
.B 0000041d
|
||||
se Swedish
|
||||
.TP
|
||||
.B 00000809
|
||||
en-uk UK English
|
||||
.RE
|
||||
|
||||
.SH "AUTHORS"
|
||||
Jay Sorg <jsorg71@users.sourceforge.net>
|
||||
.br
|
||||
Simone Fedele <ilsimo@users.sourceforge.net>
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp (8),
|
||||
.BR setxkbmap (1),
|
||||
.BR unicode (7)
|
||||
.PP
|
||||
Description of Keyboard Input mapping on the
|
||||
.UR https://github.com/FreeRDP/FreeRDP/wiki/Keyboard
|
||||
FreeRDP wiki
|
||||
.UE
|
||||
.PP
|
||||
For more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,44 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\"-
|
||||
.\" Copyright © 2007, 2008 Vincent Bernat <bernat@debian.org>
|
||||
.\" License: GPL-2+
|
||||
.\"-
|
||||
.TH xrdp\-keygen 8 "@PACKAGE_VERSION@" "xrdp team"
|
||||
.SH NAME
|
||||
xrdp\-keygen \- xrdp RSA key generation utility
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B xrdp\-keygen xrdp
|
||||
< \fIoutfile\fP | \fBauto\fP >
|
||||
.br
|
||||
.B xrdp\-keygen test
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBxrdp\-keygen\fP generates the file
|
||||
.I @sysconfdir@/xrdp/rsakeys.ini
|
||||
which contains the RSA key pair used to perform authentication to
|
||||
remote clients. The public key is self-signed.
|
||||
|
||||
.SH OPTIONS
|
||||
This program takes one of the following options:
|
||||
.TP
|
||||
\fBxrdp\fP \fIoutfile\fP
|
||||
Generate a new key pair.
|
||||
The key data is stored in the file named \fIoutfile\fP.
|
||||
.br
|
||||
If \fBauto\fP is used as \fIoutfile\fP, the default file \fI@sysconfdir@/xrdp/rsakeys.ini\fP gets created if it does not yet exists.
|
||||
.TP
|
||||
.B test
|
||||
Generate a test key pair and print information to standard output.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @sysconfdir@/xrdp/rsakeys.ini
|
||||
RSA public and private key pair used to identify this XRDP server.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR xrdp (8),
|
||||
.BR xrdp\-sesman (8).
|
||||
|
||||
.SH AUTHOR
|
||||
This manual page was originally written by Vincent Bernat <bernat@luffy.cx>.
|
||||
@ -1,81 +0,0 @@
|
||||
.TH "xrdp-mkfv1" "8" "@PACKAGE_VERSION@" "xrdp team"
|
||||
.SH NAME
|
||||
xrdp\-mkfv1 \- Create .fv1 font files from other font files
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fBxrdp-mkfv1\fR [ options ] font_file fv1_file
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBxrdp\-mkfv1\fP can be used to convert a font file such as a TrueType
|
||||
font to a fv1 file.
|
||||
|
||||
.SH OPTIONS
|
||||
A summary of options is included below.
|
||||
|
||||
.TP
|
||||
\fB\-n\fR <font_name>
|
||||
Give the font a name, which is stored in the font header.
|
||||
|
||||
The default is to use the font family name from the source font.
|
||||
|
||||
.TP
|
||||
\fB\-p\fR <number>
|
||||
Set the point size of the font. A fixed DPI value of 96 is used for
|
||||
converting this value into a pixel size.
|
||||
|
||||
The default value for this option is '10'.
|
||||
|
||||
.TP
|
||||
\fB\-m\fR <glyph>
|
||||
Set the limit on the glyphs stored in the font file. The argument is the last
|
||||
glyph stored in the font file.
|
||||
|
||||
Specify the glyph using one of the following strings:
|
||||
|
||||
\fBU+<hex>\fR - Unicode character, e.g. \fBU+25\fR for a percentage symbol (%).
|
||||
|
||||
\fB@<char>\fR - Unicode character, e.g. \fB@%\fR for a percentage symbol.
|
||||
|
||||
\fBnumber\fR - Unicode value as an integer, e.g. \fB37\fR for a
|
||||
percentage symbol
|
||||
|
||||
The default value for this option is 'U+4DFF'.
|
||||
|
||||
.TP
|
||||
\fB\-C\fR
|
||||
When used with the "DejaVu Sans" font at a point-size of 10, a small
|
||||
number of glyphs are assigned a different x-offset than they have
|
||||
when the original Windows font generation program is used.
|
||||
|
||||
This switch can be used to preserve the original x-offsets for glyphs in
|
||||
the range U+0020 - U+00FF when a 10 point DajaVu Sans font is generated.
|
||||
|
||||
Use one of the following arguments to this option:-
|
||||
|
||||
\fBauto\fR - Automatic mode. Offsets are preserved if a "DajaVu Sans" 10-point font is converted.
|
||||
|
||||
\fBon / true / yes\fR - Preserve offsets if automatic font detection does not work.
|
||||
|
||||
\fBoff / false / no\fR - Do not tamper with the offsets generated by the program.
|
||||
|
||||
The default value of this switch is \fRauto\fR.
|
||||
|
||||
To see the effects of this switch, set the \fBMKFV1_LOG_LEVEL\fR environment
|
||||
variable to \fBinfo\fR before running the program.
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fBxrdp-mkfv1 -p18 /path/to/DejaVuSans.ttf ./sans-18.fv1\fR
|
||||
Generate an 18-point Deja Sans font.
|
||||
|
||||
.TP
|
||||
\fBxrdp-mkfv1 -C off -p10 /path/to/DejaVuSans.ttf ./sans-10.fv1\fR
|
||||
Generate a 10-point DajaVu Sans font using natural offsets.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR xrdp\-dumpfv1(8).
|
||||
|
||||
More info on \fBxrdp\fR can be found on the
|
||||
.UR @xrdphomeurl@
|
||||
xrdp homepage
|
||||
.UE
|
||||
@ -1,56 +0,0 @@
|
||||
.TH "xrdp-sesadmin" "8" "@PACKAGE_VERSION@" "xrdp team"
|
||||
.SH NAME
|
||||
xrdp\-sesadmin \- console XRDP sessions administration tool
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B xrdp\-sesadmin
|
||||
.RI [ options ]
|
||||
.BI -c= command
|
||||
|
||||
.SH DESCRIPTION
|
||||
This manual page documents briefly the
|
||||
.B xrdp\-sesadmin
|
||||
command.
|
||||
.PP
|
||||
\fBxrdp\-sesadmin\fP is a console program to administer running XRDP sessions.
|
||||
|
||||
.SH OPTIONS
|
||||
A summary of options is included below.
|
||||
.TP
|
||||
.BI \-u= username
|
||||
Retained for compatibility, but ignored.
|
||||
|
||||
.TP
|
||||
.BI \-p= password
|
||||
Retained for compatibility, but ignored.
|
||||
|
||||
.TP
|
||||
.BI \-i= port
|
||||
The sesman \fIUNIX domain socket\fP to connect to.
|
||||
Defaults to \fBsesman.socket\fP.
|
||||
If no path is specified for the socket, a default of @socketdir@ is used.
|
||||
|
||||
.TP
|
||||
.BI \-c= command
|
||||
Specifies the \fIcommand\fP to execute on the server.
|
||||
Valid commands are:
|
||||
.RS 4
|
||||
.TP
|
||||
.B list
|
||||
List active sessions for the current user.
|
||||
.TP
|
||||
.BI kill: sid
|
||||
Kills the session specified the given \fIsession id\fP.
|
||||
(not yet implemented).
|
||||
.RE
|
||||
|
||||
.SH FILES
|
||||
xrdp\-sesadmin.log
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR xrdp (8).
|
||||
|
||||
More info on \fBxrdp\fR can be found on the
|
||||
.UR @xrdphomeurl@
|
||||
xrdp homepage
|
||||
.UE
|
||||
@ -1,88 +0,0 @@
|
||||
.TH "xrdp\-sesman" "8" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
xrdp\-sesman \- \fBxrdp\fR(8) session manager
|
||||
|
||||
.SH "SYNTAX"
|
||||
.B xrdp\-sesman
|
||||
\-\-kill
|
||||
.br
|
||||
.B xrdp\-sesman
|
||||
\-\-reload
|
||||
.br
|
||||
.B xrdp\-sesman
|
||||
\-\-help
|
||||
.br
|
||||
.B xrdp\-sesman
|
||||
\-\-version
|
||||
.br
|
||||
.B xrdp\-sesman
|
||||
[\-\-nodaemon] [\-\-dump\-config] [\-\-config /path/to/sesman.ini]
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBxrdp\-sesman\fR is \fBxrdp\fR(8) session manager.
|
||||
.br
|
||||
It manages user sessions by authenticating the user and starting the appropriate Xserver.
|
||||
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
\fB\-k\fR, \fB\-\-kill\fR
|
||||
Kills running \fBxrdp\-sesman\fR daemon.
|
||||
.TP
|
||||
\fB\-r\fR, \fB\-\-reload\fR
|
||||
Reloads running \fBxrdp\-sesman\fR daemon.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Output help information and exit.
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Output version information and exit.
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-nodaemon\fR
|
||||
Starts \fBxrdp\-sesman\fR in foreground instead of starting it as a daemon.
|
||||
.TP
|
||||
\fB\-\-dump\-config\fR
|
||||
Print the configuration on stdout before starting the daemon.
|
||||
The default is not to do this.
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR
|
||||
Specify a path to a different \fIsesman.ini\fR file. This option is intended
|
||||
to be used primarily for testing or for unusual configurations.
|
||||
.P
|
||||
.RS
|
||||
If you use this option, be aware that you will have to have a
|
||||
\fB@sysconfdir@/xrdp/sesman.ini\fR in place too, as a few elements of
|
||||
the system (notably \fBxrdp(8)\fR and \fBxrdp\-chansrv(8)\fR) will want
|
||||
to read it.
|
||||
.RE
|
||||
.SH "SIGNALS"
|
||||
.TP
|
||||
\fBSIGHUP\fR
|
||||
Causes \fBxrdp\-sesman\fR to reload its configuration. Needed if you're
|
||||
not running \fBxrdp\-sesman\fR as a daemon.
|
||||
.SH "FILES"
|
||||
@sbindir@/xrdp\-sesman
|
||||
.br
|
||||
@bindir@/xrdp\-sesrun
|
||||
.br
|
||||
@sysconfdir@/xrdp/sesman.ini
|
||||
.br
|
||||
@localstatedir@/log/xrdp\-sesman.log
|
||||
.br
|
||||
@localstatedir@/run/xrdp\-sesman.pid
|
||||
.br
|
||||
@socketdir@/sesman.socket
|
||||
|
||||
.SH "AUTHORS"
|
||||
Jay Sorg <jsorg71@users.sourceforge.net>
|
||||
.br
|
||||
Simone Fedele <ilsimo@users.sourceforge.net>
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR sesman.ini (5),
|
||||
.BR xrdp\-sesrun (8),
|
||||
.BR xrdp (8),
|
||||
.BR xrdp.ini (5)
|
||||
|
||||
for more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,108 +0,0 @@
|
||||
.TH "xrdp\-sesrun" "8" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
\fBxrdp\-sesrun\fR \- \fBxrdp\-sesman\fR(8) session launcher
|
||||
|
||||
.SH "SYNTAX"
|
||||
.B xrdp\-sesrun
|
||||
.I --help
|
||||
.br
|
||||
|
||||
.B xrdp\-sesrun
|
||||
.I [ options ] [ username ]
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBxrdp\-sesrun\fR starts a session using \fBxrdp\-sesman\fR(8).
|
||||
.br
|
||||
This is a tool useful for testing. It simply behaves like xrdp when some
|
||||
user logs in a new session and authenticates, thus starting a new session.
|
||||
|
||||
Default values for the options are set at compile-time. Run the utility with
|
||||
the '--help' option to see what the defaults are for your installation.
|
||||
|
||||
If no username is used, the current username is used, and no password
|
||||
needs to be provided. In this instance, it is important that any necessary
|
||||
authentication tokens for a GUI session (e.g. a Kerberos ticket) have
|
||||
already been acquired.
|
||||
|
||||
If a username is provided, a password must also be provided. In this instance
|
||||
the utility prompts for a password if neither \fB-p\fR or \fB-F\fR is used.
|
||||
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
.B -g <width>x<height>
|
||||
Set session geometry.
|
||||
.br
|
||||
Note that most configurations will resize the session on connection, so this
|
||||
option may not do what you expect.
|
||||
.TP
|
||||
.B -b <bits-per-pixel>
|
||||
Set session bits-per-pixel (colour depth). Some session types (i.e. Xorg)
|
||||
will ignore this setting.
|
||||
.TP
|
||||
.B -t <session-type>
|
||||
Session type - one of Xorg or Xvnc. Alternatively, for testing
|
||||
only, use the numeric session code.
|
||||
.TP
|
||||
.B -D <directory>
|
||||
Directory to run the new session in. Defaults to $HOME for the specified user.
|
||||
.TP
|
||||
.B -S <shell>
|
||||
Specify an alternate shell to run, instead of the default window manager.
|
||||
.TP
|
||||
.B -p <password>
|
||||
Password for user. USE FOR TESTING ONLY - the password will be visible
|
||||
in the output of the \fBps\fR command.
|
||||
.TP
|
||||
.B -F <file-descriptor>
|
||||
Specify a file descriptor (normally 0) to read the password in from. This
|
||||
is a secure way to pass the password in to the utility.
|
||||
.TP
|
||||
.B -c <sesman-ini>
|
||||
Specify a different sesman.ini file. This file is used to find out how to
|
||||
connect to \fBxrdp\-sesman\fR.
|
||||
|
||||
.SH "ENVIRONMENT"
|
||||
.TP
|
||||
.I SESRUN_LOG_LEVEL
|
||||
Override the default logging level. One of "error", "warn", "info",
|
||||
"debug", "trace" or a number 1-5.
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
.B
|
||||
xrdp-sesrun
|
||||
Create a default session for the current user.
|
||||
.TP
|
||||
.B
|
||||
xrdp-sesrun -F 0 user1 <passwd.txt
|
||||
Create a default session for user \fBuser1\fR with a password from
|
||||
a file
|
||||
.TP
|
||||
.B
|
||||
xrdp-sesrun -t Xvnc -S /usr/bin/xterm user1
|
||||
Create an extremely minimal Xvnc session for user \fBuser1\fR. This
|
||||
could be useful for debugging why the standard session is not starting
|
||||
properly. Note you would need to install the \fBxterm\fR utility
|
||||
first. The \fBgnome\-terminal\fR utility probably won't work here.
|
||||
|
||||
.SH "FILES"
|
||||
@sbindir@/xrdp\-sesman
|
||||
.br
|
||||
@bindir@/xrdp\-sesrun
|
||||
.br
|
||||
@sysconfdir@/xrdp/sesman.ini
|
||||
|
||||
.SH "AUTHORS"
|
||||
Jay Sorg <jsorg71@users.sourceforge.net>
|
||||
.br
|
||||
Simone Fedele <ilsimo@users.sourceforge.net>
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp\-sesman (8),
|
||||
.BR sesman.ini (5),
|
||||
.BR xrdp (8),
|
||||
.BR xrdp.ini (5)
|
||||
|
||||
For more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,79 +0,0 @@
|
||||
.TH "xrdp" "8" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
\fBxrdp\fR \- a Remote Desktop Protocol (RDP) server
|
||||
|
||||
.SH "SYNTAX"
|
||||
.B xrdp
|
||||
\-\-kill
|
||||
.br
|
||||
.B xrdp
|
||||
\-\-help
|
||||
.br
|
||||
.B xrdp
|
||||
\-\-version
|
||||
.br
|
||||
.B xrdp
|
||||
[\-\-nodaemon] [\-\-port port] [\-\-fork] [\-\-dump\-config] [\-\-config /path/to/xrdp.ini]
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
\fBxrdp\fR is a Remote Desktop Protocol (RDP) Server.
|
||||
.br
|
||||
Unlike Windows NT/2000/2003 server, \fBxrdp\fR will not display a Windows desktop but an X window desktop to the user.
|
||||
|
||||
It can also be used as a VNC\->RDP bridge.
|
||||
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
\fB\-k\fR, \fB\-\-kill\fR
|
||||
Kill running \fBxrdp\fR daemon.
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Output help information and exit.
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Output version information and exit.
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-nodaemon\fR
|
||||
Start \fBxrdp\fR in foreground instead of starting it as a daemon.
|
||||
.TP
|
||||
\fB\-p\fR, \fB\-\-port\fR
|
||||
Specify TCP port to listen to. This overrides \fIport\fR setting in
|
||||
\fIxrdp.ini\fR file.
|
||||
.TP
|
||||
\fB\-f\fR, \fB\-\-fork\fR
|
||||
Fork a new process on a new connection. If not enabled, use a new thread
|
||||
for every connection. This overrides \fIfork\fR setting in
|
||||
\fIxrdp.ini\fR file.
|
||||
.TP
|
||||
\fB\-\-dump\-config\fR
|
||||
Print the configuration on stdout before starting the daemon.
|
||||
The default is not to do this.
|
||||
.TP
|
||||
\fB\-c\fR, \fB\-\-config\fR
|
||||
Specify a path to a different \fIxrdp.ini\fR file. This option is intended
|
||||
to be used primarily for testing or for unusual configurations.
|
||||
|
||||
|
||||
.SH "FILES"
|
||||
@sbindir@/xrdp
|
||||
.br
|
||||
@sysconfdir@/xrdp/xrdp.ini
|
||||
.br
|
||||
@localstatedir@/log/xrdp.log
|
||||
.br
|
||||
@localstatedir@/run/xrdp.pid
|
||||
|
||||
.SH "AUTHORS"
|
||||
Jay Sorg <jsorg71@users.sourceforge.net>
|
||||
.br
|
||||
Simone Fedele <ilsimo@users.sourceforge.net>
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp.ini (5),
|
||||
.BR sesman (8),
|
||||
.BR sesman.ini (5),
|
||||
.BR sesrun (8)
|
||||
|
||||
for more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,405 +0,0 @@
|
||||
.TH "xrdp.ini" "5" "@PACKAGE_VERSION@" "xrdp team" ""
|
||||
.SH "NAME"
|
||||
\fBxrdp.ini\fR \- Configuration file for \fBxrdp\fR(8)
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
This is the man page for \fBxrdp.ini\fR, \fBxrdp\fR(8) configuration file.
|
||||
It is composed by a number of sections, each one composed by a section name, enclosed by square brackets, followed by a list of \fI<parameter>\fR=\fI<value>\fR lines.
|
||||
|
||||
\fBxrdp.ini\fR supports the following sections:
|
||||
|
||||
.TP
|
||||
\fB[Globals]\fP \- sets some global configuration settings for \fBxrdp\fR(8).
|
||||
|
||||
.TP
|
||||
\fB[Logging]\fP \- logging subsystem parameters
|
||||
|
||||
.TP
|
||||
\fB[Channels]\fP \- channel subsystem parameters
|
||||
|
||||
.LP
|
||||
All options and values (except for file names and paths) are case insensitive, and are described in detail below.
|
||||
|
||||
.SH "GLOBALS"
|
||||
The options to be specified in the \fB[Globals]\fR section are the following:
|
||||
|
||||
.TP
|
||||
\fBautorun\fP=\fIsession_name\fP
|
||||
Section name for automatic login. If set and the client supplies valid
|
||||
username and password, the user will be logged in automatically using the
|
||||
connection specified by \fIsession_name\fP.
|
||||
|
||||
If \fIsession_name\fP is empty, the \fBLOGIN DOMAIN\fR from the client
|
||||
with be used to select the section. If no domain name is supplied, the
|
||||
first suitable section will be used for automatic login.
|
||||
|
||||
.TP
|
||||
\fBbitmap_cache\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables bitmap caching in \fBxrdp\fR(8).
|
||||
|
||||
.TP
|
||||
\fBbitmap_compression\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables bitmap compression in \fBxrdp\fR(8).
|
||||
|
||||
.TP
|
||||
\fBbulk_compression\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables compression of bulk data in \fBxrdp\fR(8).
|
||||
|
||||
.TP
|
||||
\fBcertificate\fP=\fI/path/to/certificate\fP
|
||||
.TP
|
||||
\fBkey_file\fP=\fI/path/to/private_key\fP
|
||||
Set location of TLS certificate and private key. They must be written in PEM format.
|
||||
If not specified, defaults to \fB@sysconfdir@/xrdp/cert.pem\fP, \fB@sysconfdir@/xrdp/key.pem\fP.
|
||||
|
||||
This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP.
|
||||
|
||||
.TP
|
||||
\fBchannel_code\fP=\fI[true|false]\fP
|
||||
If set to \fB0\fR, \fBfalse\fR or \fBno\fR this option disables all channels \fBxrdp\fR(8).
|
||||
See section \fBCHANNELS\fP below for more fine grained options.
|
||||
|
||||
.TP
|
||||
\fBcrypt_level\fP=\fI[low|medium|high|fips]\fP
|
||||
.\" <http://blogs.msdn.com/b/openspecification/archive/2011/12/08/encryption-negotiation-in-rdp-connection.aspx>
|
||||
Regulate encryption level of Standard RDP Security.
|
||||
This parameter is effective only if \fBsecurity_layer\fP is set to \fBrdp\fP or \fBnegotiate\fP.
|
||||
|
||||
Encryption in Standard RDP Security is controlled by two settings: \fIEncryption Level\fP
|
||||
and \fIEncryption Method\fP. The only supported \fIEncryption Method\fP are \fB40BIT_ENCRYPTION\fP
|
||||
and \fB128BIT_ENCRYPTION\fP. \fB56BIT_ENCRYPTION\fP is not supported.
|
||||
This option controls the \fIEncryption Level\fP:
|
||||
.RS 8
|
||||
.TP
|
||||
.B low
|
||||
All data sent from the client to the server is protected by encryption based on
|
||||
the maximum key strength supported by the client.
|
||||
.I This is the only level that the traffic sent by the server to client is not encrypted.
|
||||
.TP
|
||||
.B medium
|
||||
All data sent between the client and the server is protected by encryption based on
|
||||
the maximum key strength supported by the client (client compatible).
|
||||
.TP
|
||||
.B high
|
||||
All data sent between the client and the server is protected by encryption based on
|
||||
the server's maximum key strength (sever compatible).
|
||||
.TP
|
||||
.B fips
|
||||
All data sent between the client and server is protected using Federal Information
|
||||
Processing Standard 140-1 validated encryption methods.
|
||||
.I This level is required for Windows clients (mstsc.exe) if the client's group policy
|
||||
.I enforces FIPS-compliance mode.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fBfork\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR for each incoming connection \fBxrdp\fR(8) forks a sub-process instead of using threads.
|
||||
|
||||
.TP
|
||||
\fBhidelogwindow\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP will not show a window for log messages.
|
||||
If not specified, defaults to \fBfalse\fP.
|
||||
|
||||
.TP
|
||||
\fBmax_bpp\fP=\fI[8|15|16|24|32]\fP
|
||||
Limit the color depth by specifying the maximum number of bits per pixel.
|
||||
If not specified or set to \fB0\fP, unlimited.
|
||||
|
||||
.TP
|
||||
\fBpamerrortxt\fP=\fIerror_text\fP
|
||||
Specify additional text displayed to user if authentication fails. The maximum length is \fB256\fP.
|
||||
|
||||
The use of 'pam' in the name of this option is historic
|
||||
|
||||
.TP
|
||||
\fBport\fP=\fIport\fP
|
||||
Specify TCP port and interface to listen on for incoming connections.
|
||||
Specifying only the port means that xrdp will listen on all interfaces.
|
||||
The default port for RDP is \fB3389\fP.
|
||||
Multiple address:port instances must be separated by spaces or commas. Check the .ini file for examples.
|
||||
Specifying interfaces requires said interfaces to be UP before xrdp starts.
|
||||
|
||||
.TP
|
||||
\fBenable_token_login\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP will scan the user name provided by the
|
||||
client for the ASCII field separator character (0x1F). It will then copy over what is after the
|
||||
separator as the password supplied by the user and treats it as autologon. If not specified,
|
||||
defaults to \fBfalse\fP.
|
||||
|
||||
.TP
|
||||
\fBdomain_user_separator\fP=\fBseparator\fP
|
||||
If specified the domain name supplied by the client is appended to the username separated
|
||||
by \fBseparator\fP.
|
||||
|
||||
.TP
|
||||
\fBrequire_credentials\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP requires clients to include username and
|
||||
password initial connection phase. In other words, xrdp doesn't allow clients to show login
|
||||
screen if set to true. If not specified, defaults to \fBfalse\fP.
|
||||
|
||||
.TP
|
||||
\fBsecurity_layer\fP=\fI[tls|rdp|negotiate]\fP
|
||||
Regulate security methods. If not specified, defaults to \fBnegotiate\fP.
|
||||
.RS 8
|
||||
.TP
|
||||
.B tls
|
||||
Enhanced RDP Security is used. All security operations (encryption, decryption, data integrity
|
||||
verification, and server authentication) are implemented by TLS.
|
||||
|
||||
.TP
|
||||
.B rdp
|
||||
Standard RDP Security, which is not safe from man-in-the-middle attack, is used. The encryption level
|
||||
of Standard RDP Security is controlled by \fBcrypt_level\fP.
|
||||
|
||||
.TP
|
||||
.B negotiate
|
||||
Negotiate these security methods with clients.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fBssl_protocols\fP=\fI[SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3]\fP
|
||||
Enables the specified SSL/TLS protocols. Each value should be separated by comma.
|
||||
SSLv2 is always disabled. At least one protocol should be given to accept TLS connections.
|
||||
This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP.
|
||||
|
||||
.TP
|
||||
\fBtcp_keepalive\fP=\fI[true|false]\fP
|
||||
Regulate if the listening socket uses socket option \fBSO_KEEPALIVE\fP.
|
||||
If set to \fB1\fP, \fBtrue\fP or \fByes\fP and the network connection disappears
|
||||
without closing messages, the connection will be closed.
|
||||
|
||||
.TP
|
||||
\fBtcp_nodelay\fP=\fI[true|false]\fP
|
||||
Regulate if the listening socket uses socket option \fBTCP_NODELAY\fP.
|
||||
If set to \fB1\fP, \fBtrue\fP or \fByes\fP, no buffering will be performed in the TCP stack.
|
||||
|
||||
.TP
|
||||
\fBtcp_send_buffer_bytes\fP=\fIbuffer_size\fP
|
||||
.TP
|
||||
\fBtcp_recv_buffer_bytes\fP=\fIbuffer_size\fP
|
||||
Specify send/recv buffer sizes in bytes. The default value depends on
|
||||
the operating system. It is recommended not to set these on systems with
|
||||
dynamic TCP buffer sizing
|
||||
|
||||
.TP
|
||||
\fBtls_ciphers\fP=\fIcipher_suite\fP
|
||||
Specifies TLS cipher suite. The format of this parameter is equivalent
|
||||
to which \fBopenssl\fP(1) ciphers subcommand accepts.
|
||||
|
||||
(ex. $ openssl ciphers 'HIGH:!ADH:!SHA1')
|
||||
|
||||
This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP.
|
||||
|
||||
.TP
|
||||
\fBuse_fastpath\fP=\fI[input|output|both|none]\fP
|
||||
If not specified, defaults to \fBnone\fP.
|
||||
|
||||
.TP
|
||||
\fBblack\fP=\fI000000\fP
|
||||
.TP
|
||||
\fBgrey\fP=\fIc0c0c0\fP
|
||||
.TP
|
||||
\fBdark_grey\fP=\fI808080\fP
|
||||
.TP
|
||||
\fBblue\fP=\fI0000ff\fP
|
||||
.TP
|
||||
\fBdark_blue\fP=\fI00007f\fP
|
||||
.TP
|
||||
\fBwhite\fP=\fIffffff\fP
|
||||
.TP
|
||||
\fBred\fP=\fIff0000\fP
|
||||
.TP
|
||||
\fBgreen\fP=\fI00ff00\fP
|
||||
.TP
|
||||
\fBbackground\fP=\fI000000\fP
|
||||
These options override the colors used internally by \fBxrdp\fP(8) to draw the login and log windows.
|
||||
Colors are defined using a hexadecimal (hex) notation for the combination of Red, Green, and Blue color values (RGB).
|
||||
The lowest value that can be given to one of the light sources is 0 (hex 00).
|
||||
The highest value is 255 (hex FF).
|
||||
.TP
|
||||
\fBfv1_select\fP=\fI130:sans-18.fv1,0:sans-10.fv1\fP
|
||||
Selects a default fv1 font.
|
||||
This parameter is a comma-separated list of DPI:name pairs. The list
|
||||
is scanned from left-to-right. The font used is the first font whose DPI
|
||||
value is less-than-or-equal to the vertical DPI of the monitor used for
|
||||
the login screen.
|
||||
.TP
|
||||
\fBdefault_dpi\fP=\fI96\fP
|
||||
Default DPI used for a monitor if the client does not send physical
|
||||
size information.
|
||||
|
||||
|
||||
.SH "LOGGING"
|
||||
The following parameters can be used in the \fB[Logging]\fR section:
|
||||
|
||||
.TP
|
||||
\fBLogFile\fR=\fI@localstatedir@/log/xrdp.log\fR
|
||||
This options contains the path to logfile. It can be either absolute or relative. If set to \fB<stdout>\fR, log will go to stdout. Use for debugging only\fR
|
||||
|
||||
.TP
|
||||
\fBLogLevel\fR=\fIlevel\fR
|
||||
This option can have one of the following values:
|
||||
|
||||
\fBCORE\fR or \fB0\fR \- Log only core messages. these messages are _always_ logged, regardless the logging level selected.
|
||||
|
||||
\fBERROR\fR or \fB1\fR \- Log only error messages
|
||||
|
||||
\fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages
|
||||
|
||||
\fBINFO\fR or \fB3\fR \- Logs errors, warnings and informational messages
|
||||
|
||||
\fBDEBUG\fR or \fB4\fR \- Log everything. If \fBxrdp-sesman\fR is compiled in debug mode, this options will output many more low\-level message, useful for developers
|
||||
|
||||
.TP
|
||||
\fBEnableSyslog\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables logging to syslog. Otherwise syslog is disabled.
|
||||
|
||||
.TP
|
||||
\fBSyslogLevel\fR=\fIlevel\fR
|
||||
This option sets the logging level for syslog. It can have the same values of \fBLogLevel\fR. If \fBSyslogLevel\fR is greater than \fBLogLevel\fR, its value is lowered to that of \fBLogLevel\fR.
|
||||
|
||||
.TP
|
||||
\fBEnableConsole\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to the console (ie. stdout).
|
||||
|
||||
.TP
|
||||
\fBConsoleLevel\fR=\fIlevel\fR
|
||||
Logging level for the console. It can have the same values as \fBLogLevel\fR. Defaults to \fBDEBUG\fR.
|
||||
|
||||
.TP
|
||||
\fBEnableProcessId\fR=\fI[true|false]\fR
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging the process id in all log messages. Defaults to \fBfalse\fR.
|
||||
|
||||
.SH "CHANNELS"
|
||||
The Remote Desktop Protocol supports several channels, which are used to transfer additional data like sound, clipboard data and others.
|
||||
Channel names not listed here will be blocked by \fBxrdp\fP.
|
||||
Not all channels are supported in all cases, so setting a value to \fItrue\fP is a prerequisite, but does not force its use.
|
||||
.br
|
||||
Channels can also be enabled or disabled on a per connection basis by prefixing each setting with \fBchannel.\fP in the channel section.
|
||||
|
||||
.TP
|
||||
\fBrdpdr\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for device redirection is allowed.
|
||||
|
||||
.TP
|
||||
\fBrdpsnd\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for sound is allowed.
|
||||
|
||||
.TP
|
||||
\fBdrdynvc\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel to initiate additional dynamic virtual channels is allowed.
|
||||
|
||||
.TP
|
||||
\fBcliprdr\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for clipboard redirection is allowed.
|
||||
|
||||
.TP
|
||||
\fBrail\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for remote applications integrated locally (RAIL) is allowed.
|
||||
|
||||
.TP
|
||||
\fBxrdpvr\fP=\fI[true|false]\fP
|
||||
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for XRDP Video streaming is allowed.
|
||||
|
||||
.SH "CONNECTIONS"
|
||||
A connection section is made of a section name, enclosed in square brackets, and the following entries:
|
||||
|
||||
.TP
|
||||
\fBname\fR=\fI<session name>\fR
|
||||
The name displayed in \fBxrdp\fR(8) login window's combo box.
|
||||
|
||||
.TP
|
||||
\fBlib\fR=\fI../vnc/libvnc.so\fR
|
||||
Sets the library to be used with this connection.
|
||||
|
||||
.TP
|
||||
\fBusername\fR=\fI<username>\fR|\fI{base64}<base64-encoded-username>\fR|\fIask\fR
|
||||
Specifies the username used for authenticating in the connection.
|
||||
If set to \fIask\fR, user name should be provided in the login window.
|
||||
|
||||
If the username includes comment out symbols such as '#', or ';', the username can be
|
||||
provided in base64 form prefixing "{base64}".
|
||||
|
||||
.TP
|
||||
\fBpassword\fR=\fI<password>\fR|\fI{base64}<base64-encoded-password>\fR|\fIask\fR
|
||||
Specifies the password used for authenticating in the connection.
|
||||
If set to \fIask\fR, password should be provided in the login window.
|
||||
|
||||
This parameter can be provided in base64 form as well as username. See also examples below.
|
||||
|
||||
.TP
|
||||
\fBip\fR=\fI127.0.0.1\fR
|
||||
Specifies the ip address of the host to connect to.
|
||||
|
||||
.TP
|
||||
\fBport\fR=\fI<number>\fR|\fI\-1\fR
|
||||
Specifies the port number to connect to. If set to \fI\-1\fR, the default port for the specified library is used.
|
||||
|
||||
.TP
|
||||
\fBxserverbpp\fR=\fI<number>\fR
|
||||
Specifies color depth of the backend X server. The default is the color
|
||||
depth of the client. Only Xvnc uses that setting. Xorg runs at
|
||||
\fI24\fR bpp.
|
||||
|
||||
.TP
|
||||
\fBdisabled_encodings_mask\fR=\fI<number>\fR
|
||||
Set this bitmask to a non-zero value to prevent \fBxrdp\fR(8) requesting
|
||||
some features from the Xvnc server. You should only need to set this
|
||||
to a non-zero value to work around bugs in your Xvnc server. The bit
|
||||
values supported for a particular release of \fBxrdp\fR(8) are documented in
|
||||
\fBxrdp.ini\fR.
|
||||
|
||||
.TP
|
||||
\fBcode\fR=\fI<number>\fR|\fI0\fR
|
||||
Specifies the session type. The default, \fI0\fR, is Xvnc,
|
||||
and \fI20\fR is Xorg with xorgxrdp modules.
|
||||
|
||||
.TP
|
||||
\fBchansrvport\fR=\fBDISPLAY(\fR\fIn\fR\fB)\fR|\fI/path/to/domain-socket\fR
|
||||
Asks xrdp to connect to a manually started \fBxrdp-chansrv\fR instance.
|
||||
This can be useful if you wish to use to use xrdp to connect to a VNC session
|
||||
which has been started other than by \fBxrdp-sesman\fR, as you can then make
|
||||
use of \fBxrdp\-chansrv\fR facilities in the VNC session.
|
||||
|
||||
The first form of this setting is recommended, replacing \fIn\fR with the
|
||||
X11 display number of the session.
|
||||
|
||||
.SH "EXAMPLES"
|
||||
This is an example \fBxrdp.ini\fR:
|
||||
|
||||
.nf
|
||||
[Globals]
|
||||
bitmap_cache=true
|
||||
bitmap_compression=true
|
||||
|
||||
[Xorg]
|
||||
name=Xorg
|
||||
lib=libxup.so
|
||||
username=ask
|
||||
password=ask
|
||||
ip=127.0.0.1
|
||||
port=-1
|
||||
code=20
|
||||
|
||||
[vnc-any]
|
||||
name=vnc-any
|
||||
lib=libvnc.so
|
||||
ip=ask
|
||||
port=ask5900
|
||||
username=na
|
||||
password={base64}cGFzc3dvcmQhCg==
|
||||
.fi
|
||||
|
||||
.SH "FILES"
|
||||
@sysconfdir@/xrdp/xrdp.ini
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR xrdp (8),
|
||||
.BR xrdp\-chansrv (8),
|
||||
.BR xrdp\-sesman (8),
|
||||
.BR xrdp\-sesrun (8),
|
||||
.BR sesman.ini (5)
|
||||
|
||||
For more info on \fBxrdp\fR see
|
||||
.UR @xrdphomeurl@
|
||||
.UE
|
||||
@ -1,34 +0,0 @@
|
||||
EXTRA_DIST = windows
|
||||
|
||||
# Some programs need freetype2 to build
|
||||
if USE_FREETYPE2
|
||||
MKFV1 = xrdp-mkfv1
|
||||
else
|
||||
MKFV1 =
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/common \
|
||||
$(FREETYPE2_CFLAGS)
|
||||
|
||||
bin_PROGRAMS = \
|
||||
$(MKFV1) \
|
||||
xrdp-dumpfv1
|
||||
|
||||
xrdp_mkfv1_SOURCES = \
|
||||
mkfv1.c \
|
||||
fv1.c \
|
||||
fv1.h
|
||||
|
||||
xrdp_mkfv1_LDADD = \
|
||||
$(top_builddir)/common/libcommon.la \
|
||||
$(FREETYPE2_LIBS)
|
||||
|
||||
xrdp_dumpfv1_SOURCES = \
|
||||
dumpfv1.c \
|
||||
fv1.c \
|
||||
fv1.h
|
||||
|
||||
xrdp_dumpfv1_LDADD = \
|
||||
$(top_builddir)/common/libcommon.la
|
||||
@ -1,87 +0,0 @@
|
||||
The fv1 font format has the following characteristics:-
|
||||
|
||||
1) Bitmap fonts (i.e. pixels are on or off)
|
||||
2) 96 DPI is assumed
|
||||
3) Glyphs from U+0020 up to a pre-defined limit are stored in the file.
|
||||
At the time of writing this limit is U+4DFF. To change the limit
|
||||
requires a change to xrdp/xrdp_types.h and (potentially)
|
||||
fontutils/mkfv1.c
|
||||
4) Font format is header, plus a variable data area for each glyph.
|
||||
|
||||
The intention (over time) is to build support for the freetype2 library
|
||||
directly into xrdp. This will allow for modern font features like
|
||||
anti-aliasing and kerning to be supported.
|
||||
|
||||
General Info
|
||||
------------
|
||||
All numeric values are 2 octets, and stored in twos-complement
|
||||
little-endian format.
|
||||
|
||||
Dimensions are all measured in pixels.
|
||||
|
||||
Font header
|
||||
-----------
|
||||
|
||||
signature 4 octets File signature - "FNT1"
|
||||
font~name 32 octets Null-terminated if less that 32 octets long
|
||||
point_size 2 octets Assumes 96 DPI.
|
||||
style 2 octets Unused. Set to 1.
|
||||
body_height 2 octets Line spacing for font.
|
||||
min_descender 2 octets The common lowest descender value in the font
|
||||
glyphs (A few glyphs may be lower than
|
||||
this). Used to calculate where the font baseline
|
||||
is in relation to the text box for the font.
|
||||
<padding> 4 octets Set to zero.
|
||||
|
||||
Older fonts, generated for xrdp v.0.9x and earlier, have zero values
|
||||
for the body_height and min_descender. For these fonts, the body height is
|
||||
calculated as (-baseline + 1) for the first glyph, and the glyphs are
|
||||
all offset so that a min_descender of 0 works OK.
|
||||
|
||||
Glyph data
|
||||
----------
|
||||
The header is followed by a number of glyphs representing U+0020 upwards. The
|
||||
glyphs have a variable size. The format of each glyph is as follows:-
|
||||
|
||||
width 2 octets Width of character data
|
||||
height 2 octets Height of character data
|
||||
baseline 2 octets Offset from font baseline to 1st row of glyph data
|
||||
offset 2 octets Space before glyph is drawn (can be -ve)
|
||||
inc_by 2 octets Total width of glyph + spacing. The width of
|
||||
a string is obtained by adding up all the inc_by
|
||||
fields for all the glyphs
|
||||
data <variable> Bitmap data.
|
||||
|
||||
Bitmap data is laid out in rows from top to bottom. Within each row the
|
||||
most significant bit of each octet is on the left. Row data is padded
|
||||
to the nearest octet (e.g. a 14 bit width would be padded by 2 bits to
|
||||
16 bits (2 octets). The total data is padded out with between 0 and 3
|
||||
octets to end on a 4-octet boundary.
|
||||
|
||||
Example glyph:-
|
||||
|
||||
Glyph : U+0067
|
||||
Width : 12
|
||||
Height : 18
|
||||
Baseline : -13
|
||||
Offset : 1
|
||||
Inc By : 15
|
||||
Data :
|
||||
-13: ...XXXXX..XX 1F 30
|
||||
-12: ..XXXXXXXXXX 3F F0
|
||||
-11: .XXX....XXXX 70 F0
|
||||
-10: XXX......XXX E0 70
|
||||
-9: XX........XX C0 30
|
||||
-8: XX........XX C0 30
|
||||
-7: XX........XX C0 30
|
||||
-6: XX........XX C0 30
|
||||
-5: XX........XX C0 30
|
||||
-4: XXX......XXX E0 70
|
||||
-3: .XXX....XXXX 70 F0
|
||||
-2: ..XXXXXXXXXX 3F F0
|
||||
-1: ...XXXXX..XX 1F 30
|
||||
+0: ..........XX 00 30
|
||||
+1: .........XXX 00 70
|
||||
+2: ..X.....XXX. 20 E0
|
||||
+3: ..XXXXXXXX.. 3F C0
|
||||
+4: ...XXXXXX... 1F 80
|
||||
@ -1,413 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2022
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* fonts
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "list.h"
|
||||
#include "os_calls.h"
|
||||
#include "parse.h"
|
||||
#include "string_calls.h"
|
||||
#include "fv1.h"
|
||||
|
||||
/**
|
||||
* What the program is doing
|
||||
*/
|
||||
enum program_mode
|
||||
{
|
||||
PM_UNSPECIFIED = 0,
|
||||
PM_INFO,
|
||||
PM_GLYPH_INFO_TABLE,
|
||||
PM_SHOW_CHAR
|
||||
};
|
||||
|
||||
/**
|
||||
* Parsed program arguments
|
||||
*/
|
||||
struct program_args
|
||||
{
|
||||
const char *font_file;
|
||||
enum program_mode mode;
|
||||
int ucode; /* Unicode character to display in 'c' mode */
|
||||
};
|
||||
|
||||
/**************************************************************************//**
|
||||
* Parses the program args
|
||||
*
|
||||
* @param argc Passed to main
|
||||
* @param @argv Passed to main
|
||||
* @param pa program_pargs structure for resulting values
|
||||
* @return !=0 for success
|
||||
*/
|
||||
static int
|
||||
parse_program_args(int argc, char *argv[], struct program_args *pa)
|
||||
{
|
||||
int params_ok = 1;
|
||||
int opt;
|
||||
|
||||
pa->font_file = NULL;
|
||||
pa->mode = PM_UNSPECIFIED;
|
||||
pa->ucode = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "c:it")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'i':
|
||||
if (pa->mode == PM_UNSPECIFIED)
|
||||
{
|
||||
pa->mode = PM_INFO;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Can't have two modes set");
|
||||
params_ok = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
if (pa->mode == PM_UNSPECIFIED)
|
||||
{
|
||||
pa->mode = PM_GLYPH_INFO_TABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Can't have two modes set");
|
||||
params_ok = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
if (pa->mode == PM_UNSPECIFIED)
|
||||
{
|
||||
pa->mode = PM_SHOW_CHAR;
|
||||
if (toupper(optarg[0]) == 'U' && optarg[1] == '+')
|
||||
{
|
||||
char *hex = g_strdup(optarg);
|
||||
hex[0] = '0';
|
||||
hex[1] = 'x';
|
||||
pa->ucode = g_atoix(hex);
|
||||
g_free(hex);
|
||||
}
|
||||
else if (optarg[0] == '@')
|
||||
{
|
||||
pa->ucode = optarg[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
pa->ucode = g_atoix(optarg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Can't have two modes set");
|
||||
params_ok = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt);
|
||||
params_ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc <= optind)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "No font file specified");
|
||||
params_ok = 0;
|
||||
}
|
||||
else if ((argc - optind) > 1)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Unexpected arguments after font file");
|
||||
params_ok = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pa->font_file = argv[optind];
|
||||
}
|
||||
|
||||
return params_ok;
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Displays information about a font file
|
||||
*
|
||||
* @param fv1 loaded font file
|
||||
*/
|
||||
static void
|
||||
display_font_file_info(const struct fv1_file *fv1)
|
||||
{
|
||||
g_printf("Font name : %s\n", fv1->font_name);
|
||||
g_printf("Point size (%d DPI) : %d\n", FV1_DEVICE_DPI, fv1->point_size);
|
||||
g_printf("Style : %d\n", fv1->style);
|
||||
if (fv1->body_height == 0 && fv1->glyphs->count > 0)
|
||||
{
|
||||
const struct fv1_glyph *g =
|
||||
(const struct fv1_glyph *)fv1->glyphs->items[0];
|
||||
g_printf("Body height : %d (from 1st glyph)\n", -g->baseline + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printf("Body height : %d\n", fv1->body_height);
|
||||
}
|
||||
g_printf("Descender : %d\n", fv1->min_descender);
|
||||
|
||||
if (fv1->glyphs->count == 0)
|
||||
{
|
||||
g_printf("\nFile contains no glyphs\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printf("Min glyph index : U+%04X\n", FV1_MIN_CHAR);
|
||||
g_printf("Max glyph index : U+%04X\n", FV1_GLYPH_END(fv1) - 1);
|
||||
|
||||
/* Work out the statistics */
|
||||
unsigned short max_width = 0;
|
||||
int max_width_ucode = 0;
|
||||
unsigned short max_height = 0;
|
||||
int max_height_ucode = 0;
|
||||
short min_baseline = 0;
|
||||
int min_baseline_ucode = 0;
|
||||
short min_offset = 0;
|
||||
int min_offset_ucode = 0;
|
||||
short max_offset = 0;
|
||||
int max_offset_ucode = 0;
|
||||
unsigned short max_inc_by = 0;
|
||||
int max_inc_by_ucode = 0;
|
||||
|
||||
/* Derived quantities */
|
||||
short min_y_descender = SHRT_MAX;
|
||||
int min_y_descender_ucode = 0;
|
||||
int max_datasize = -1;
|
||||
int max_datasize_ucode = 0;
|
||||
|
||||
/* Loop and output macros */
|
||||
#define SET_MIN(ucode,field,val) \
|
||||
if ((field) < (val)) \
|
||||
{ \
|
||||
val = (field); \
|
||||
val##_ucode = (ucode); \
|
||||
}
|
||||
|
||||
#define SET_MAX(ucode,field,val) \
|
||||
if ((field) > (val)) \
|
||||
{ \
|
||||
val = (field); \
|
||||
val##_ucode = (ucode); \
|
||||
}
|
||||
|
||||
#define OUTPUT_INFO(string, val) \
|
||||
if (val##_ucode > 0) \
|
||||
{ \
|
||||
g_printf(string, val, val##_ucode); \
|
||||
}
|
||||
int u;
|
||||
for (u = FV1_MIN_CHAR ; u < FV1_GLYPH_END(fv1); ++u)
|
||||
{
|
||||
const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u);
|
||||
if (g != NULL)
|
||||
{
|
||||
short y_descender = - (g->baseline + g->height);
|
||||
int datasize = FONT_DATASIZE(g);
|
||||
|
||||
SET_MAX(u, g->width, max_width);
|
||||
SET_MAX(u, g->height, max_height);
|
||||
SET_MIN(u, g->baseline, min_baseline);
|
||||
SET_MIN(u, g->offset, min_offset);
|
||||
SET_MAX(u, g->offset, max_offset);
|
||||
SET_MAX(u, g->inc_by, max_inc_by);
|
||||
SET_MIN(u, y_descender, min_y_descender);
|
||||
SET_MAX(u, datasize, max_datasize);
|
||||
}
|
||||
}
|
||||
|
||||
OUTPUT_INFO("Max glyph width : %d (U+%04X)\n", max_width);
|
||||
OUTPUT_INFO("Max glyph height : %d (U+%04X)\n", max_height);
|
||||
OUTPUT_INFO("Min glyph y-baseline : %d (U+%04X)\n", min_baseline);
|
||||
OUTPUT_INFO("Min glyph y-descender : %d (U+%04X)\n", min_y_descender);
|
||||
OUTPUT_INFO("Min glyph x-offset : %d (U+%04X)\n", min_offset);
|
||||
OUTPUT_INFO("Max glyph x-offset : %d (U+%04X)\n", max_offset);
|
||||
OUTPUT_INFO("Max glyph x-inc_by : %d (U+%04X)\n", max_inc_by);
|
||||
OUTPUT_INFO("Max glyph datasize : %d (U+%04X)\n", max_datasize);
|
||||
|
||||
#undef SET_MIN
|
||||
#undef SET_MAX
|
||||
#undef OUTPUT_INFO
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Display info in a table about all the glyphs
|
||||
* @param fv1 font file
|
||||
*/
|
||||
static void
|
||||
display_glyph_info_table(const struct fv1_file *fv1)
|
||||
{
|
||||
int u;
|
||||
g_printf("character,width,height,baseline,offset,inc_by,datasize\n");
|
||||
|
||||
for (u = FV1_MIN_CHAR; u < FV1_GLYPH_END(fv1); ++u)
|
||||
{
|
||||
const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u);
|
||||
if (g != NULL)
|
||||
{
|
||||
int datasize = FONT_DATASIZE(g);
|
||||
g_printf("%d,%hu,%hu,%hd,%hd,%hu,%d\n",
|
||||
u, g->width, g->height, g->baseline,
|
||||
g->offset, g->inc_by, datasize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Converts a font data row to a printable string
|
||||
*
|
||||
* @param rowdata Pointer to the first byte of the row data
|
||||
* @param width Number of pixels in the row
|
||||
* @param out Output buffer. Must be sized by the caller to be at
|
||||
* least width+1 bytes
|
||||
*/
|
||||
static void
|
||||
row_to_str(const unsigned char *rowdata, int width, char *out)
|
||||
{
|
||||
int x;
|
||||
int mask = 1 << 7;
|
||||
for (x = 0 ; x < width ; ++x)
|
||||
{
|
||||
out[x] = ((*rowdata & mask) != 0) ? 'X' : '.';
|
||||
mask >>= 1;
|
||||
if (mask == 0)
|
||||
{
|
||||
mask = 1 << 7;
|
||||
++rowdata;
|
||||
}
|
||||
}
|
||||
out[width] = '\0';
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Display info about a specific glyph
|
||||
* @param ucode Unicode character value
|
||||
* @param g Glyph
|
||||
*/
|
||||
static void
|
||||
display_glyph_info(int ucode, const struct fv1_glyph *g)
|
||||
{
|
||||
|
||||
char *row_buffer = (char *)g_malloc(g->width + 1, 0);
|
||||
if (row_buffer == NULL)
|
||||
{
|
||||
g_printf("<No memory>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printf("Glyph : U+%04X\n", ucode);
|
||||
g_printf(" Width : %d\n", g->width);
|
||||
g_printf(" Height : %d\n", g->height);
|
||||
g_printf(" Baseline : %d\n", g->baseline);
|
||||
g_printf(" Offset : %d\n", g->offset);
|
||||
g_printf(" Inc By : %d\n", g->inc_by);
|
||||
|
||||
g_printf(" Data :\n");
|
||||
int y;
|
||||
const unsigned char *dataptr = g->data;
|
||||
|
||||
for (y = 0 ; y < g->height; ++y)
|
||||
{
|
||||
row_to_str(dataptr, g->width, row_buffer);
|
||||
g_printf(" %+3d: %s\n", y + g->baseline, row_buffer);
|
||||
dataptr += (g->width + 7) / 8;
|
||||
}
|
||||
g_free(row_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Main
|
||||
*
|
||||
* @param argc Argument count
|
||||
* @param argv Arguments
|
||||
*/
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct fv1_file *fv1 = NULL;
|
||||
struct log_config *logging;
|
||||
struct program_args pa;
|
||||
int rv = 1;
|
||||
|
||||
logging = log_config_init_for_console(LOG_LEVEL_WARNING,
|
||||
g_getenv("DUMPFV1_LOG_LEVEL"));
|
||||
log_start_from_param(logging);
|
||||
log_config_free(logging);
|
||||
|
||||
if (parse_program_args(argc, argv, &pa) &&
|
||||
(fv1 = fv1_file_load(pa.font_file)) != NULL)
|
||||
{
|
||||
switch (pa.mode)
|
||||
{
|
||||
case PM_INFO:
|
||||
display_font_file_info(fv1);
|
||||
rv = 0;
|
||||
break;
|
||||
|
||||
case PM_GLYPH_INFO_TABLE:
|
||||
display_glyph_info_table(fv1);
|
||||
rv = 0;
|
||||
break;
|
||||
|
||||
case PM_SHOW_CHAR:
|
||||
if (pa.ucode < FV1_MIN_CHAR)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Value for -c must be at least U+%04X",
|
||||
FV1_MIN_CHAR);
|
||||
}
|
||||
else if (pa.ucode >= FV1_GLYPH_END(fv1))
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR,
|
||||
"Value for -c must be less than U+%04X",
|
||||
FV1_GLYPH_END(fv1));
|
||||
}
|
||||
else
|
||||
{
|
||||
const struct fv1_glyph *g =
|
||||
(const struct fv1_glyph *)
|
||||
list_get_item(fv1->glyphs, pa.ucode - FV1_MIN_CHAR);
|
||||
display_glyph_info(pa.ucode, g);
|
||||
rv = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(LOG_LEVEL_ERROR, "Specify one of '-i' or '-c'");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fv1_file_free(fv1);
|
||||
log_end();
|
||||
|
||||
return rv;
|
||||
}
|
||||
352
fontutils/fv1.c
352
fontutils/fv1.c
@ -1,352 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2022
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file fontutils/fv1.c
|
||||
* @brief Definitions relating to fv1 font files
|
||||
*/
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "list.h"
|
||||
#include "os_calls.h"
|
||||
#include "parse.h"
|
||||
#include "string_calls.h"
|
||||
#include "fv1.h"
|
||||
|
||||
const static char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'};
|
||||
|
||||
/*****************************************************************************/
|
||||
struct fv1_glyph *
|
||||
fv1_alloc_glyph(int ucode,
|
||||
unsigned short width,
|
||||
unsigned short height)
|
||||
{
|
||||
int datasize = FONT_DATASIZE_FROM_GEOMETRY(width, height);
|
||||
struct fv1_glyph *glyph = NULL;
|
||||
char ucode_str[16] = {'\0'};
|
||||
if (ucode < 0)
|
||||
{
|
||||
g_snprintf(ucode_str, sizeof(ucode_str), "Glyph");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf(ucode_str, sizeof(ucode_str), "Glyph:U+%04X", ucode);
|
||||
}
|
||||
|
||||
if (datasize < 0 || datasize > FV1_MAX_GLYPH_DATASIZE)
|
||||
{
|
||||
|
||||
/* shouldn't happen */
|
||||
LOG(LOG_LEVEL_ERROR, "%s - datasize %d out of bounds",
|
||||
ucode_str, datasize);
|
||||
}
|
||||
else
|
||||
{
|
||||
glyph = (struct fv1_glyph *)
|
||||
g_malloc( offsetof(struct fv1_glyph, data) + datasize, 1);
|
||||
|
||||
if (glyph == NULL)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "%s - out of memory", ucode_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
glyph->width = width;
|
||||
glyph->height = height;
|
||||
}
|
||||
}
|
||||
|
||||
return glyph;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
struct fv1_file *
|
||||
fv1_file_create(void)
|
||||
{
|
||||
struct fv1_file *fv1 = (struct fv1_file *)g_new0(struct fv1_file, 1);
|
||||
if (fv1 == NULL)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "fv1_file_create - out of memory");
|
||||
}
|
||||
else
|
||||
{
|
||||
fv1->style = 1; /* Unused at present - compatibility value */
|
||||
fv1->glyphs = list_create();
|
||||
fv1->glyphs->auto_free = 1;
|
||||
}
|
||||
return fv1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static void
|
||||
add_glyphs_from_stream(struct fv1_file *fv1, struct stream *s)
|
||||
{
|
||||
unsigned short width;
|
||||
unsigned short height;
|
||||
int datasize;
|
||||
|
||||
struct fv1_glyph *glyph;
|
||||
|
||||
while (s_check_rem(s, 4))
|
||||
{
|
||||
in_sint16_le(s, width);
|
||||
in_sint16_le(s, height);
|
||||
|
||||
datasize = FONT_DATASIZE_FROM_GEOMETRY(width, height);
|
||||
|
||||
if (datasize < 0 || datasize > FV1_MAX_GLYPH_DATASIZE)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR,
|
||||
"Font:%s Glyph:%d - datasize %d out of bounds",
|
||||
fv1->font_name, FV1_GLYPH_END(fv1), datasize);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!s_check_rem(s, 6 + 6 + datasize))
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR,
|
||||
"Font:%s Glyph:%d - not enough data for glyph",
|
||||
fv1->font_name, FV1_GLYPH_END(fv1));
|
||||
break;
|
||||
}
|
||||
|
||||
if ((glyph = fv1_alloc_glyph(FV1_GLYPH_END(fv1), width, height)) == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
in_sint16_le(s, glyph->baseline);
|
||||
in_sint16_le(s, glyph->offset);
|
||||
in_sint16_le(s, glyph->inc_by);
|
||||
in_uint8s(s, 6);
|
||||
|
||||
in_uint8a(s, glyph->data, datasize);
|
||||
|
||||
list_add_item(fv1->glyphs, (tintptr)glyph);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
struct fv1_file *
|
||||
fv1_file_load(const char *filename)
|
||||
{
|
||||
struct fv1_file *fv1 = NULL;
|
||||
|
||||
if (!g_file_exist(filename))
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Can't find font file %s", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
int file_size = g_file_get_size(filename);
|
||||
if (file_size < FV1_MIN_FILE_SIZE || file_size > FV1_MAX_FILE_SIZE)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Font file %s has bad size %d",
|
||||
filename, file_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct stream *s;
|
||||
int fd;
|
||||
make_stream(s);
|
||||
init_stream(s, file_size + 1024);
|
||||
fd = g_file_open_ro(filename);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Can't open font file %s", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
int b = g_file_read(fd, s->data, file_size + 1024);
|
||||
g_file_close(fd);
|
||||
|
||||
if (b < FV1_MIN_FILE_SIZE)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Font file %s is too small",
|
||||
filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
char sig[sizeof(FV1_SIGNATURE)];
|
||||
s->end = s->data + b;
|
||||
in_uint8a(s, sig, sizeof(FV1_SIGNATURE));
|
||||
if (g_memcmp(sig, FV1_SIGNATURE, sizeof(sig)) != 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR,
|
||||
"Font file %s has wrong signature",
|
||||
filename);
|
||||
}
|
||||
else if ((fv1 = fv1_file_create()) != NULL)
|
||||
{
|
||||
in_uint8a(s, fv1->font_name, FV1_MAX_FONT_NAME_SIZE);
|
||||
fv1->font_name[FV1_MAX_FONT_NAME_SIZE] = '\0';
|
||||
in_uint16_le(s, fv1->point_size);
|
||||
in_uint16_le(s, fv1->style);
|
||||
in_uint16_le(s, fv1->body_height);
|
||||
in_uint16_le(s, fv1->min_descender);
|
||||
in_uint8s(s, 4);
|
||||
|
||||
add_glyphs_from_stream(fv1, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free_stream(s);
|
||||
}
|
||||
}
|
||||
|
||||
return fv1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void
|
||||
fv1_file_free(struct fv1_file *fv1)
|
||||
{
|
||||
if (fv1 != NULL)
|
||||
{
|
||||
list_delete(fv1->glyphs);
|
||||
g_free(fv1);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
write_stream(int fd, struct stream *s)
|
||||
{
|
||||
const char *p = s->data;
|
||||
int rv = 1;
|
||||
|
||||
while (p < s->end)
|
||||
{
|
||||
int len = g_file_write(fd, p, s->end - p);
|
||||
if (len <= 0)
|
||||
{
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
p += len;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
fv1_file_save(const struct fv1_file *fv1, const char *filename)
|
||||
{
|
||||
int fd;
|
||||
struct fv1_glyph *blank_glyph; /* Needed for bad characters */
|
||||
|
||||
fd = g_file_open_ex(filename, 0, 1, 1, 1);
|
||||
int rv = 1;
|
||||
if (fd < 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Unable to open %s for writing [%s]", filename,
|
||||
g_get_strerror());
|
||||
}
|
||||
else
|
||||
{
|
||||
struct stream *s;
|
||||
make_stream(s);
|
||||
init_stream(s, 1024);
|
||||
|
||||
/* Write the header */
|
||||
out_uint8a(s, FV1_SIGNATURE, sizeof(FV1_SIGNATURE));
|
||||
int len = g_strlen(fv1->font_name);
|
||||
if (len > FV1_MAX_FONT_NAME_SIZE)
|
||||
{
|
||||
len = FV1_MAX_FONT_NAME_SIZE;
|
||||
}
|
||||
out_uint8a(s, fv1->font_name, len);
|
||||
while (len++ < FV1_MAX_FONT_NAME_SIZE)
|
||||
{
|
||||
out_uint8(s, '\0');
|
||||
}
|
||||
out_uint16_le(s, fv1->point_size);
|
||||
out_uint16_le(s, fv1->style);
|
||||
out_uint16_le(s, fv1->body_height);
|
||||
out_uint16_le(s, fv1->min_descender);
|
||||
out_uint8a(s, "\0\0\0\0", 4);
|
||||
s_mark_end(s);
|
||||
if (!write_stream(fd, s))
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Unable to write file header [%s]",
|
||||
g_get_strerror());
|
||||
}
|
||||
else if ((blank_glyph = fv1_alloc_glyph(-1, 0, 0)) == NULL)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Unable to allocate blank glyph");
|
||||
}
|
||||
else
|
||||
{
|
||||
int u;
|
||||
|
||||
for (u = FV1_MIN_CHAR; u < FV1_GLYPH_END(fv1); ++u)
|
||||
{
|
||||
const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u);
|
||||
int datasize;
|
||||
if (g == NULL)
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING, "Glyph %d is not set", u);
|
||||
g = blank_glyph;
|
||||
}
|
||||
else
|
||||
{
|
||||
datasize = FONT_DATASIZE(g);
|
||||
if (datasize > FV1_MAX_GLYPH_DATASIZE)
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
"glyph %d datasize %d exceeds max of %d"
|
||||
" - glyph will be blank",
|
||||
u, datasize, FV1_MAX_GLYPH_DATASIZE);
|
||||
g = blank_glyph;
|
||||
}
|
||||
}
|
||||
init_stream(s, 16 + FONT_DATASIZE(g));
|
||||
out_uint16_le(s, g->width);
|
||||
out_uint16_le(s, g->height);
|
||||
out_uint16_le(s, g->baseline);
|
||||
out_uint16_le(s, g->offset);
|
||||
out_uint16_le(s, g->inc_by);
|
||||
out_uint8a(s, "\0\0\0\0\0\0", 6);
|
||||
out_uint8a(s, g->data, FONT_DATASIZE(g));
|
||||
s_mark_end(s);
|
||||
|
||||
if (!write_stream(fd, s))
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Unable to write glyph %d [%s]",
|
||||
u, g_get_strerror());
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_free(blank_glyph);
|
||||
|
||||
rv = (u == FV1_GLYPH_END(fv1)) ? 0 : 1;
|
||||
}
|
||||
free_stream(s);
|
||||
g_file_close(fd);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
100
fontutils/fv1.h
100
fontutils/fv1.h
@ -1,100 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2022
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file fontutils/fv1.h
|
||||
* @brief Definitions relating to fv1 font files
|
||||
*/
|
||||
#if !defined(FV1_H)
|
||||
#define FV1_H
|
||||
|
||||
struct list;
|
||||
|
||||
#define FV1_DEVICE_DPI 96
|
||||
|
||||
#define FV1_MIN_CHAR 0x20 /* First character value in file */
|
||||
|
||||
#define FV1_MIN_FILE_SIZE 48
|
||||
#define FV1_MAX_FILE_SIZE (10 * 1024 * 1024)
|
||||
#define FV1_MAX_FONT_NAME_SIZE 32
|
||||
|
||||
#define FV1_MAX_GLYPH_DATASIZE 512
|
||||
|
||||
struct fv1_glyph
|
||||
{
|
||||
unsigned short width; /* Width of glyph */
|
||||
unsigned short height; /* Height of glyph */
|
||||
short baseline; /* Offset from cursor pos to 1st row of glyph */
|
||||
short offset; /* Space before glyph (can be -ve) */
|
||||
unsigned short inc_by; /* Total width of glyph + spacing */
|
||||
/* Standard C++ does not yet support C99 flexible array members */
|
||||
#ifdef __cplusplus
|
||||
unsigned char data[1];
|
||||
#else
|
||||
unsigned char data[];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct fv1_file
|
||||
{
|
||||
char font_name[FV1_MAX_FONT_NAME_SIZE + 1];
|
||||
short point_size; /* Input point size (for reference) */
|
||||
short style;
|
||||
short body_height; /* Body height (pixels) */
|
||||
short min_descender; /* Min descender of the glyphs in the font */
|
||||
struct list *glyphs; /* Glyphs are struct fv1_glyph * */
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a glyph pointer for a unicode character
|
||||
*/
|
||||
#define FV1_GET_GLYPH(fv1,ucode) \
|
||||
(((ucode) < FV1_MIN_CHAR) \
|
||||
? NULL \
|
||||
: (struct fv1_glyph *)list_get_item(fv1->glyphs, (ucode) - FV1_MIN_CHAR))
|
||||
|
||||
/**
|
||||
* First glyph not in file
|
||||
*/
|
||||
#define FV1_GLYPH_END(fv1) (fv1->glyphs->count + FV1_MIN_CHAR)
|
||||
|
||||
struct fv1_file *
|
||||
fv1_file_load(const char *filename);
|
||||
|
||||
void
|
||||
fv1_file_free(struct fv1_file *);
|
||||
|
||||
struct fv1_file *
|
||||
fv1_file_create(void);
|
||||
|
||||
struct fv1_glyph *
|
||||
fv1_alloc_glyph(int ucode, /* Unicode character for error reporting if known */
|
||||
unsigned short width,
|
||||
unsigned short height);
|
||||
|
||||
enum fv1_realloc_mode
|
||||
{
|
||||
FV1_AT_TOP,
|
||||
FV1_AT_BOTTOM
|
||||
};
|
||||
|
||||
int
|
||||
fv1_file_save(const struct fv1_file *fv1, const char *filename);
|
||||
|
||||
#endif
|
||||
@ -1,585 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2012
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
/* See the FT2 documentation - this builds an error table */
|
||||
#undef FTERRORS_H_
|
||||
#define FT_ERRORDEF( e, v, s ) { e, s },
|
||||
#define FT_ERROR_START_LIST {
|
||||
#define FT_ERROR_END_LIST { 0, NULL } };
|
||||
|
||||
static const struct
|
||||
{
|
||||
int err_code;
|
||||
const char *err_msg;
|
||||
} ft_errors[] =
|
||||
#include <freetype/fterrors.h>
|
||||
#ifdef __cppcheck__
|
||||
// avoid syntaxError by providing the array contents
|
||||
{};
|
||||
#endif
|
||||
|
||||
|
||||
#include "arch.h"
|
||||
#include "defines.h"
|
||||
#include "log.h"
|
||||
#include "os_calls.h"
|
||||
#include "string_calls.h"
|
||||
|
||||
#include "fv1.h"
|
||||
|
||||
#define DEFAULT_POINT_SIZE 10
|
||||
#define DEFAULT_MAX_CHAR 0x4dff
|
||||
|
||||
/**
|
||||
* sans10 compatibility choices
|
||||
*/
|
||||
enum sans10_compat
|
||||
{
|
||||
S10_OFF = 0,
|
||||
S10_ON,
|
||||
S10_AUTO
|
||||
};
|
||||
|
||||
/**
|
||||
* Parsed program arguments
|
||||
*/
|
||||
struct program_args
|
||||
{
|
||||
const char *input_file;
|
||||
const char *output_file;
|
||||
char font_name[FV1_MAX_FONT_NAME_SIZE + 1];
|
||||
unsigned short point_size;
|
||||
/** Last character value in file */
|
||||
unsigned int max_ucode;
|
||||
/** Are we generating san10 in compatibility mode? */
|
||||
enum sans10_compat sans10_compatibility;
|
||||
};
|
||||
|
||||
struct x_dimensions
|
||||
{
|
||||
unsigned short width;
|
||||
short offset;
|
||||
unsigned short inc_by;
|
||||
};
|
||||
|
||||
/**
|
||||
* Table of some character settings in the original sans-10.fv1 font
|
||||
*/
|
||||
static const struct x_dimensions
|
||||
original_sans10_data[] =
|
||||
{
|
||||
/* 0x20 - 0x3f */
|
||||
{1, 0, 4}, {1, 2, 5}, {3, 1, 5}, {9, 1, 11},
|
||||
{7, 1, 8}, {11, 0, 12}, {9, 1, 11}, {1, 1, 3},
|
||||
{3, 1, 5}, {3, 1, 5}, {7, 0, 7}, {9, 1, 11},
|
||||
{2, 1, 4}, {3, 1, 5}, {1, 2, 4}, {4, 0, 4},
|
||||
{6, 1, 8}, {5, 2, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {6, 1, 8}, {1, 2, 4}, {2, 1, 4},
|
||||
{8, 1, 11}, {8, 1, 11}, {8, 1, 11}, {5, 1, 7},
|
||||
/* 0x40 - 0x5f */
|
||||
{11, 1, 13}, {9, 0, 9}, {7, 1, 9}, {7, 1, 9},
|
||||
{8, 1, 10}, {6, 1, 8}, {5, 1, 7}, {8, 1, 10},
|
||||
{8, 1, 10}, {1, 1, 3}, {3, -1, 3}, {7, 1, 8},
|
||||
{6, 1, 7}, {9, 1, 11}, {8, 1, 10}, {8, 1, 10},
|
||||
{6, 1, 8}, {8, 1, 10}, {7, 1, 8}, {7, 1, 9},
|
||||
{7, 0, 7}, {8, 1, 10}, {9, 0, 9}, {11, 0, 11},
|
||||
{8, 0, 8}, {7, 0, 7}, {8, 1, 10}, {3, 1, 5},
|
||||
{4, 0, 4}, {3, 1, 5}, {8, 1, 11}, {7, 0, 7},
|
||||
/* 0x60 - 0x7f */
|
||||
{3, 1, 7}, {6, 1, 8}, {6, 1, 8}, {5, 1, 7},
|
||||
{6, 1, 8}, {6, 1, 8}, {4, 0, 4}, {6, 1, 8},
|
||||
{6, 1, 8}, {1, 1, 3}, {2, 0, 3}, {6, 1, 7},
|
||||
{1, 1, 3}, {11, 1, 13}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {6, 1, 8}, {4, 1, 5}, {5, 1, 7},
|
||||
{4, 0, 5}, {6, 1, 8}, {7, 0, 7}, {9, 0, 9},
|
||||
{7, 0, 7}, {7, 0, 7}, {5, 1, 7}, {5, 2, 8},
|
||||
{1, 2, 4}, {5, 2, 8}, {8, 1, 11}, {7, 1, 8},
|
||||
/* 0x80 - 0x9f */
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
{7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8},
|
||||
/* 0xa0 - 0xbf */
|
||||
{1, 0, 4}, {1, 2, 5}, {6, 1, 8}, {7, 0, 8},
|
||||
{7, 0, 8}, {7, 1, 8}, {1, 2, 4}, {5, 1, 7},
|
||||
{3, 2, 7}, {9, 2, 13}, {5, 1, 6}, {6, 1, 8},
|
||||
{8, 1, 11}, {3, 1, 5}, {9, 2, 13}, {4, 1, 7},
|
||||
{4, 1, 7}, {9, 1, 11}, {4, 1, 5}, {4, 1, 5},
|
||||
{3, 2, 7}, {7, 1, 8}, {6, 1, 8}, {1, 1, 4},
|
||||
{3, 2, 7}, {3, 1, 5}, {5, 1, 6}, {6, 1, 8},
|
||||
{12, 1, 13}, {11, 1, 13}, {12, 1, 13}, {5, 1, 7},
|
||||
/* 0xc0 - 0xdf */
|
||||
{9, 0, 9}, {9, 0, 9}, {9, 0, 9}, {9, 0, 9},
|
||||
{9, 0, 9}, {9, 0, 9}, {12, 0, 13}, {7, 1, 9},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{2, 0, 3}, {2, 1, 3}, {5, -1, 3}, {3, 0, 3},
|
||||
{9, 0, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10},
|
||||
{8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {7, 2, 11},
|
||||
{8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10},
|
||||
{8, 1, 10}, {7, 0, 7}, {6, 1, 8}, {6, 1, 8},
|
||||
/* 0xe0 - 0xff */
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {6, 1, 8}, {11, 1, 13}, {5, 1, 7},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{3, 0, 3}, {3, 1, 3}, {5, -1, 3}, {3, 0, 3},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {8, 1, 11},
|
||||
{6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8},
|
||||
{6, 1, 8}, {7, 0, 7}, {6, 1, 8}, {7, 0, 7}
|
||||
};
|
||||
|
||||
|
||||
/**************************************************************************//**
|
||||
* Parses a unicode character value
|
||||
*
|
||||
* @param str String containing value
|
||||
* @return Resulting character value
|
||||
*/
|
||||
static unsigned int
|
||||
parse_ucode_name(const char *str)
|
||||
{
|
||||
unsigned int rv;
|
||||
if (toupper(str[0]) == 'U' && str[1] == '+')
|
||||
{
|
||||
char *hex = g_strdup(str);
|
||||
hex[0] = '0';
|
||||
hex[1] = 'x';
|
||||
rv = g_atoix(hex);
|
||||
g_free(hex);
|
||||
}
|
||||
else if (str[0] == '@')
|
||||
{
|
||||
rv = str[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = g_atoix(str);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Parses the program args
|
||||
*
|
||||
* @param argc Passed to main
|
||||
* @param @argv Passed to main
|
||||
* @param pa program_pargs structure for resulting values
|
||||
* @return !=0 for success
|
||||
*/
|
||||
static int
|
||||
parse_program_args(int argc, char *argv[], struct program_args *pa)
|
||||
{
|
||||
int params_ok = 1;
|
||||
int opt;
|
||||
|
||||
pa->input_file = NULL;
|
||||
pa->output_file = NULL;
|
||||
pa->font_name[0] = '\0';
|
||||
pa->point_size = DEFAULT_POINT_SIZE;
|
||||
pa->max_ucode = DEFAULT_MAX_CHAR;
|
||||
pa->sans10_compatibility = S10_AUTO;
|
||||
|
||||
while ((opt = getopt(argc, argv, "n:p:m:C:")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'n':
|
||||
g_snprintf(pa->font_name, FV1_MAX_FONT_NAME_SIZE + 1, "%s",
|
||||
optarg);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
pa->point_size = g_atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
pa->max_ucode = parse_ucode_name(optarg);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
if (toupper(optarg[0]) == 'A')
|
||||
{
|
||||
pa->sans10_compatibility = S10_AUTO;
|
||||
}
|
||||
else if (g_text2bool(optarg))
|
||||
{
|
||||
pa->sans10_compatibility = S10_ON;
|
||||
}
|
||||
else
|
||||
{
|
||||
pa->sans10_compatibility = S10_OFF;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt);
|
||||
params_ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (pa->max_ucode < FV1_MIN_CHAR)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "-m argument must be at least %d",
|
||||
FV1_MIN_CHAR);
|
||||
params_ok = 0;
|
||||
}
|
||||
|
||||
switch (argc - optind)
|
||||
{
|
||||
case 0:
|
||||
LOG(LOG_LEVEL_ERROR, "No input file specified");
|
||||
params_ok = 0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
LOG(LOG_LEVEL_ERROR, "No output file specified");
|
||||
params_ok = 0;
|
||||
break;
|
||||
case 2:
|
||||
pa->input_file = argv[optind];
|
||||
pa->output_file = argv[optind + 1];
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(LOG_LEVEL_ERROR, "Unexpected arguments after output file");
|
||||
params_ok = 0;
|
||||
}
|
||||
|
||||
return params_ok;
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Checks whether the specified glyph row is blank
|
||||
* @param g Glyph
|
||||
* @param row Row number between 0 and g->height - 1
|
||||
* @result Boolean
|
||||
*/
|
||||
static int
|
||||
is_blank_glyph_row(const struct fv1_glyph *g, unsigned int row)
|
||||
{
|
||||
if (g->width == 0 || row >= g->height)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const unsigned int glyph_row_size = ((g->width + 7) / 8);
|
||||
const unsigned char *dataptr = g->data + (row * glyph_row_size);
|
||||
const unsigned int masks[] =
|
||||
{ 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
|
||||
|
||||
/* Check for set pixels in all the leading bytes */
|
||||
unsigned int x;
|
||||
for (x = g->width ; x > 8 ; x -= 8)
|
||||
{
|
||||
if (*dataptr++ != 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Use a single test to check the pixels in the last byte */
|
||||
return ((*dataptr & masks[x - 1]) == 0);
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Returns a string for a freetype2 error
|
||||
* @param error Freetype2 error code
|
||||
* @param buff Pointer to buffer for error string
|
||||
* @param bufflen Length of above
|
||||
*/
|
||||
static void
|
||||
get_ft_error(FT_Error error, char *buff, unsigned int bufflen)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
unsigned int i;
|
||||
for (i = 0 ; i < (sizeof(ft_errors) / sizeof(ft_errors[0])); ++i)
|
||||
{
|
||||
if (ft_errors[i].err_code == error)
|
||||
{
|
||||
errstr = ft_errors[i].err_msg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (errstr != NULL)
|
||||
{
|
||||
g_snprintf(buff, bufflen, "[%s]", errstr);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf(buff, bufflen,
|
||||
"[errorcode %d (no description)]", (int)error);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Implement sans10 compatibility for a glyph
|
||||
*
|
||||
* The original Windows font generator made a few different choices for the
|
||||
* character x offset than freetype2 does. These are particularly noticeable
|
||||
* with a small font.
|
||||
*
|
||||
* This routine checks the glyph, and implements the original offset size
|
||||
* for popular English characters, which are all that the user will probably
|
||||
* be displaying with xrdp v0.9.x
|
||||
*
|
||||
* @param g Glyph to check
|
||||
*/
|
||||
static void
|
||||
implement_sans10_compatibility(struct fv1_glyph *g, unsigned int ucode)
|
||||
{
|
||||
const unsigned int max_index =
|
||||
sizeof(original_sans10_data) / sizeof(original_sans10_data[0]);
|
||||
|
||||
if (ucode < FV1_MIN_CHAR || ucode >= max_index + FV1_MIN_CHAR)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const struct x_dimensions *d =
|
||||
&original_sans10_data[ucode - FV1_MIN_CHAR];
|
||||
|
||||
if (g->offset != d->offset)
|
||||
{
|
||||
if (g->width != d->width)
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
"Can't set compatibility offset for U+%04X: width %d != %d",
|
||||
ucode, g->width, d->width);
|
||||
}
|
||||
else if (g->inc_by != d->inc_by)
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
"Can't set compatibility offset for U+%04X: inc_by %d != %d",
|
||||
ucode, g->inc_by, d->inc_by);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LOG_LEVEL_INFO,
|
||||
"Changing compatibility offset for U+%04X: from %d to %d",
|
||||
ucode, g->offset, d->offset);
|
||||
}
|
||||
|
||||
g->offset = d->offset;
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Converts a freetype 2 bitmap to a fv1 glyph
|
||||
* @param ft_glyph Freetype2 glyph. Must be a monochrome bitmap
|
||||
* @param ucode Unicode character for error reporting
|
||||
* @param pa Program args
|
||||
* @return fv1 glyph, or NULL for error
|
||||
*/
|
||||
static struct fv1_glyph *
|
||||
convert_mono_glyph(FT_GlyphSlot ft_glyph, unsigned int ucode,
|
||||
const struct program_args *pa)
|
||||
{
|
||||
short width = ft_glyph->bitmap.width;
|
||||
short height = ft_glyph->bitmap.rows;
|
||||
struct fv1_glyph *g;
|
||||
|
||||
/* Number of bytes in a glyph row */
|
||||
const unsigned int glyph_row_size = ((width + 7) / 8);
|
||||
|
||||
if ((g = fv1_alloc_glyph(ucode, width, height)) != NULL)
|
||||
{
|
||||
g->baseline = -(ft_glyph->metrics.horiBearingY / 64);
|
||||
g->offset = ft_glyph->metrics.horiBearingX / 64;
|
||||
g->inc_by = ft_glyph->metrics.horiAdvance / 64;
|
||||
|
||||
if (FONT_DATASIZE(g) > 0)
|
||||
{
|
||||
const unsigned char *srcptr = ft_glyph->bitmap.buffer;
|
||||
unsigned char *dstptr = g->data;
|
||||
unsigned int y;
|
||||
|
||||
for (y = 0; y < g->height; ++y)
|
||||
{
|
||||
g_memcpy(dstptr, srcptr, glyph_row_size);
|
||||
dstptr += glyph_row_size;
|
||||
srcptr += ft_glyph->bitmap.pitch;
|
||||
}
|
||||
|
||||
/* Optimise the glyph by removing any blank lines at the bottom
|
||||
* and top */
|
||||
if (g->width > 0)
|
||||
{
|
||||
while (g->height > 0 &&
|
||||
is_blank_glyph_row(g, g->height - 1))
|
||||
{
|
||||
--g->height;
|
||||
}
|
||||
|
||||
y = 0;
|
||||
while (y < g->height && is_blank_glyph_row(g, y))
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (y > 0)
|
||||
{
|
||||
g->baseline += y;
|
||||
g->height -= y;
|
||||
g_memmove(g->data, g->data + (y * glyph_row_size),
|
||||
g->height * glyph_row_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pa->sans10_compatibility != S10_OFF)
|
||||
{
|
||||
implement_sans10_compatibility(g, ucode);
|
||||
}
|
||||
|
||||
return g;
|
||||
}
|
||||
|
||||
/**************************************************************************//**
|
||||
* Main
|
||||
*
|
||||
* @param argc Argument count
|
||||
* @param argv Arguments
|
||||
*/
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
FT_Library library = NULL; /* handle to library */
|
||||
FT_Face face = NULL; /* handle to face object */
|
||||
FT_Error error;
|
||||
struct fv1_glyph *g;
|
||||
struct program_args pa;
|
||||
struct log_config *logging;
|
||||
int rv = 1;
|
||||
|
||||
logging = log_config_init_for_console(LOG_LEVEL_WARNING,
|
||||
g_getenv("MKFV1_LOG_LEVEL"));
|
||||
log_start_from_param(logging);
|
||||
log_config_free(logging);
|
||||
|
||||
struct fv1_file *fv1 = fv1_file_create();
|
||||
|
||||
if (fv1 == NULL)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "Memory allocation failure");
|
||||
}
|
||||
else if (parse_program_args(argc, argv, &pa))
|
||||
{
|
||||
char errstr[128];
|
||||
|
||||
if ((error = FT_Init_FreeType(&library)) != 0)
|
||||
{
|
||||
get_ft_error(error, errstr, sizeof(errstr));
|
||||
LOG(LOG_LEVEL_ERROR, "Error initializing freetype library %s",
|
||||
errstr);
|
||||
}
|
||||
else if ((error = FT_New_Face(library, pa.input_file, 0, &face)) != 0)
|
||||
{
|
||||
get_ft_error(error, errstr, sizeof(errstr));
|
||||
LOG(LOG_LEVEL_ERROR, "Error loading font file %s %s",
|
||||
pa.input_file, errstr);
|
||||
}
|
||||
else if ((error = FT_Set_Char_Size(face, 0,
|
||||
pa.point_size * 64,
|
||||
FV1_DEVICE_DPI, 0)) != 0)
|
||||
{
|
||||
get_ft_error(error, errstr, sizeof(errstr));
|
||||
LOG(LOG_LEVEL_ERROR, "Error setting point size to %u %s",
|
||||
pa.point_size, errstr);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *fname =
|
||||
(pa.font_name[0] != '\0') ? pa.font_name :
|
||||
(face->family_name != NULL) ? face->family_name :
|
||||
/* Default */ "";
|
||||
|
||||
g_snprintf(fv1->font_name, FV1_MAX_FONT_NAME_SIZE + 1, "%s", fname);
|
||||
fv1->point_size = pa.point_size;
|
||||
fv1->body_height = face->size->metrics.height / 64;
|
||||
fv1->min_descender = face->size->metrics.descender / 64;
|
||||
|
||||
if (pa.sans10_compatibility == S10_AUTO)
|
||||
{
|
||||
if (g_strcmp(fv1->font_name, "DejaVu Sans") == 0 &&
|
||||
fv1->point_size == 10)
|
||||
{
|
||||
pa.sans10_compatibility = S10_ON;
|
||||
}
|
||||
else
|
||||
{
|
||||
pa.sans10_compatibility = S10_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int u;
|
||||
for (u = FV1_MIN_CHAR; u <= pa.max_ucode; ++u)
|
||||
{
|
||||
/* retrieve glyph index from character code */
|
||||
FT_UInt glyph_index = FT_Get_Char_Index(face, u);
|
||||
|
||||
/* load glyph image into the slot (erase previous one) */
|
||||
error = FT_Load_Glyph(face, glyph_index,
|
||||
FT_LOAD_RENDER | FT_LOAD_TARGET_MONO);
|
||||
if (error)
|
||||
{
|
||||
get_ft_error(error, errstr, sizeof(errstr));
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
"Unable to get bitmap for U+%04X %s", u, errstr);
|
||||
g = NULL;
|
||||
}
|
||||
else if (face->glyph->format != FT_GLYPH_FORMAT_BITMAP ||
|
||||
face->glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO)
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
"Internal error; U+%04X was not loaded as a bitmap",
|
||||
u);
|
||||
g = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
g = convert_mono_glyph(face->glyph, u, &pa);
|
||||
}
|
||||
list_add_item(fv1->glyphs, (tintptr)g);
|
||||
}
|
||||
|
||||
rv = fv1_file_save(fv1, pa.output_file);
|
||||
}
|
||||
}
|
||||
|
||||
FT_Done_FreeType(library);
|
||||
fv1_file_free(fv1);
|
||||
log_end();
|
||||
|
||||
return rv;
|
||||
}
|
||||
1
fontutils/windows/.gitignore
vendored
1
fontutils/windows/.gitignore
vendored
@ -1 +0,0 @@
|
||||
!Makefile
|
||||
@ -1,17 +0,0 @@
|
||||
|
||||
OBJS = fontdump.obj os_calls.obj
|
||||
|
||||
#CFLAGS = -O2 -I../common
|
||||
CFLAGS = -O2 -I../common -DUNICODE -D_UNICODE
|
||||
LDFLAGS = -W -efontdump.exe
|
||||
|
||||
all: fontdump1
|
||||
|
||||
fontdump1: $(OBJS)
|
||||
$(CC) $(LDFLAGS) $(OBJS)
|
||||
|
||||
clean:
|
||||
del $(OBJS) fontdump.exe *.tds
|
||||
|
||||
os_calls.obj: ../common/os_calls.c
|
||||
$(CC) $(CFLAGS) -c ../common/os_calls.c
|
||||
@ -1,536 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2012
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "os_calls.h"
|
||||
#include "arch.h"
|
||||
|
||||
static HINSTANCE g_instance = 0;
|
||||
static HWND g_wnd = 0;
|
||||
static HWND g_lb = 0;
|
||||
static HWND g_exit_button = 0;
|
||||
static HWND g_go_button = 0;
|
||||
static HWND g_font_list = 0;
|
||||
static char g_font_name[512] = "";
|
||||
static int g_font_size = 10;
|
||||
static HFONT g_font = 0;
|
||||
static int g_running = 0;
|
||||
|
||||
#define FONT_DATASIZE(_w, _h) (((_h * ((_w + 7) / 8)) + 3) & ~3)
|
||||
|
||||
/*****************************************************************************/
|
||||
int
|
||||
check_messages(void)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
|
||||
{
|
||||
GetMessage(&msg, NULL, 0, 0);
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
msg(char *msg1, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char text1[512];
|
||||
|
||||
va_start(ap, msg1);
|
||||
vsnprintf(text1, 511, msg1, ap);
|
||||
SendMessageA(g_lb, LB_ADDSTRING, 0, (LPARAM)text1);
|
||||
va_end(ap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
show_last_error(void)
|
||||
{
|
||||
LPVOID lpMsgBuf = NULL;
|
||||
DWORD len;
|
||||
len = FormatMessageA(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, GetLastError(),
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPSTR)&lpMsgBuf, 0, NULL);
|
||||
if (len > 0)
|
||||
{
|
||||
msg("GetLastError - %s", lpMsgBuf);
|
||||
LocalFree(lpMsgBuf);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
font_dump(void)
|
||||
{
|
||||
HDC dc;
|
||||
HDC dc1;
|
||||
RECT rect;
|
||||
HBRUSH brush;
|
||||
HGDIOBJ saved;
|
||||
HBITMAP bitmap;
|
||||
BITMAPINFO bi;
|
||||
char *bits;
|
||||
ABC abc;
|
||||
SIZE sz;
|
||||
char filename[256];
|
||||
TCHAR text[256];
|
||||
char zero1;
|
||||
char *bmtext;
|
||||
int bmtextindex;
|
||||
int fd;
|
||||
int x1;
|
||||
int strlen1;
|
||||
int index1;
|
||||
int index2;
|
||||
int len;
|
||||
int pixel;
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
int width;
|
||||
int height;
|
||||
int roller;
|
||||
int outlen;
|
||||
tui8 b1;
|
||||
short x2;
|
||||
|
||||
if (g_running)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_running = 1;
|
||||
msg("starting");
|
||||
g_font_name[0] = 0;
|
||||
SendMessageA(g_font_list, WM_GETTEXT, 255, (LPARAM)g_font_name);
|
||||
|
||||
if (g_strlen(g_font_name) == 0)
|
||||
{
|
||||
msg("error font not set");
|
||||
g_running = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
dc = GetDC(g_wnd);
|
||||
height = -MulDiv(g_font_size, GetDeviceCaps(dc, LOGPIXELSY), 72);
|
||||
g_font = CreateFontA(height, 0, 0, 0, FW_DONTCARE, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, g_font_name);
|
||||
ReleaseDC(g_wnd, dc);
|
||||
|
||||
if (g_font == 0)
|
||||
{
|
||||
msg("error - Font creation failed");
|
||||
}
|
||||
|
||||
zero1 = 0;
|
||||
g_snprintf(filename, 255, "%s-%d.fv1", g_font_name, g_font_size);
|
||||
msg("creating file %s", filename);
|
||||
g_file_delete(filename);
|
||||
fd = g_file_open_rw(filename);
|
||||
g_file_write(fd, "FNT1", 4);
|
||||
strlen1 = g_strlen(g_font_name);
|
||||
g_file_write(fd, g_font_name, strlen1);
|
||||
x1 = strlen1;
|
||||
|
||||
while (x1 < 32)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
x1++;
|
||||
}
|
||||
|
||||
x2 = g_font_size; /* font size */
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
x2 = 1; /* style */
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* pad */
|
||||
index1 = 0;
|
||||
|
||||
while (index1 < 8)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
index1++;
|
||||
}
|
||||
|
||||
for (x1 = 32; x1 < 0x4e00; x1++)
|
||||
{
|
||||
check_messages();
|
||||
dc = GetWindowDC(g_wnd);
|
||||
saved = SelectObject(dc, g_font);
|
||||
|
||||
if (!GetCharABCWidths(dc, x1, x1, &abc))
|
||||
{
|
||||
show_last_error();
|
||||
}
|
||||
|
||||
text[0] = (TCHAR)x1;
|
||||
text[1] = 0;
|
||||
|
||||
if (!GetTextExtentPoint32(dc, text, 1, &sz))
|
||||
{
|
||||
show_last_error();
|
||||
}
|
||||
|
||||
SelectObject(dc, saved);
|
||||
ReleaseDC(g_wnd, dc);
|
||||
|
||||
if ((sz.cx > 0) && (sz.cy > 0))
|
||||
{
|
||||
dc = GetWindowDC(g_wnd);
|
||||
saved = SelectObject(dc, g_font);
|
||||
SetBkColor(dc, RGB(255, 255, 255));
|
||||
|
||||
if (!ExtTextOut(dc, 50, 50, ETO_OPAQUE, 0, text, 1, 0))
|
||||
{
|
||||
show_last_error();
|
||||
}
|
||||
|
||||
SelectObject(dc, saved);
|
||||
ReleaseDC(g_wnd, dc);
|
||||
Sleep(10);
|
||||
/* width */
|
||||
x2 = abc.abcB;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* height */
|
||||
x2 = sz.cy;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* baseline */
|
||||
x2 = -sz.cy;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* offset */
|
||||
x2 = abc.abcA;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* incby */
|
||||
x2 = sz.cx;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* pad */
|
||||
index1 = 0;
|
||||
|
||||
while (index1 < 6)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
index1++;
|
||||
}
|
||||
|
||||
dc = GetWindowDC(g_wnd);
|
||||
rect.left = 50 + abc.abcA;
|
||||
rect.top = 50;
|
||||
rect.right = rect.left + abc.abcB;
|
||||
rect.bottom = rect.top + sz.cy;
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
width = (abc.abcB + 7) & (~7);
|
||||
height = sz.cy;
|
||||
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
|
||||
bi.bmiHeader.biWidth = width;
|
||||
bi.bmiHeader.biHeight = height;
|
||||
bi.bmiHeader.biPlanes = 1;
|
||||
bi.bmiHeader.biBitCount = 32;
|
||||
bitmap = CreateDIBSection(dc, &bi, DIB_RGB_COLORS, (void *)&bits, 0, 0);
|
||||
|
||||
if (bitmap == 0)
|
||||
{
|
||||
msg("error - CreateDIBSection failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(bits, 0, width * height * 4);
|
||||
dc1 = CreateCompatibleDC(dc);
|
||||
SelectObject(dc1, bitmap);
|
||||
|
||||
if (!BitBlt(dc1, 0, 0, width, height, dc, rect.left, rect.top, SRCCOPY))
|
||||
{
|
||||
show_last_error();
|
||||
}
|
||||
|
||||
bmtext = (char *)g_malloc(width * height + 16, 1);
|
||||
bmtextindex = 0;
|
||||
|
||||
for (index1 = (height - 1); index1 >= 0; index1--)
|
||||
{
|
||||
for (index2 = 0; index2 < width; index2++)
|
||||
{
|
||||
pixel = ((int *)bits)[index1 * width + index2];
|
||||
red = (pixel >> 16) & 0xff;
|
||||
green = (pixel >> 8) & 0xff;
|
||||
blue = (pixel >> 0) & 0xff;
|
||||
|
||||
if (red == 0 && green == 0 && blue == 0)
|
||||
{
|
||||
bmtext[bmtextindex] = '1';
|
||||
bmtextindex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
bmtext[bmtextindex] = '0';
|
||||
bmtextindex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outlen = 0;
|
||||
b1 = 0;
|
||||
roller = 0;
|
||||
len = g_strlen(bmtext);
|
||||
|
||||
for (index2 = 0; index2 < len; index2++)
|
||||
{
|
||||
if (bmtext[index2] == '1')
|
||||
{
|
||||
switch (roller)
|
||||
{
|
||||
case 0:
|
||||
b1 = b1 | 0x80;
|
||||
break;
|
||||
case 1:
|
||||
b1 = b1 | 0x40;
|
||||
break;
|
||||
case 2:
|
||||
b1 = b1 | 0x20;
|
||||
break;
|
||||
case 3:
|
||||
b1 = b1 | 0x10;
|
||||
break;
|
||||
case 4:
|
||||
b1 = b1 | 0x08;
|
||||
break;
|
||||
case 5:
|
||||
b1 = b1 | 0x04;
|
||||
break;
|
||||
case 6:
|
||||
b1 = b1 | 0x02;
|
||||
break;
|
||||
case 7:
|
||||
b1 = b1 | 0x01;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
roller++;
|
||||
|
||||
if (roller == 8)
|
||||
{
|
||||
roller = 0;
|
||||
g_file_write(fd, &b1, 1);
|
||||
outlen++;
|
||||
b1 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
while ((outlen % 4) != 0)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
outlen++;
|
||||
}
|
||||
|
||||
free(bmtext);
|
||||
DeleteDC(dc1);
|
||||
DeleteObject(bitmap);
|
||||
}
|
||||
|
||||
if (sz.cx != (long)(abc.abcA + abc.abcB + abc.abcC))
|
||||
{
|
||||
msg("error - width not right 1");
|
||||
}
|
||||
|
||||
brush = CreateSolidBrush(RGB(255, 255, 255));
|
||||
FillRect(dc, &rect, brush);
|
||||
DeleteObject(brush);
|
||||
ReleaseDC(g_wnd, dc);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* write out a blank glyph here */
|
||||
/* width */
|
||||
x2 = 1;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* height */
|
||||
x2 = 1;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* baseline */
|
||||
x2 = 0;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* offset */
|
||||
x2 = 0;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* incby */
|
||||
x2 = 1;
|
||||
g_file_write(fd, (char *)&x2, 2);
|
||||
/* pad */
|
||||
index1 = 0;
|
||||
|
||||
while (index1 < 6)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
index1++;
|
||||
}
|
||||
|
||||
/* blank bitmap */
|
||||
index1 = 0;
|
||||
|
||||
while (index1 < 4)
|
||||
{
|
||||
g_file_write(fd, &zero1, 1);
|
||||
index1++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_file_close(fd);
|
||||
msg("done");
|
||||
g_running = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static LRESULT CALLBACK
|
||||
wnd_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HBRUSH brush;
|
||||
RECT rect;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
BeginPaint(hWnd, &ps);
|
||||
brush = CreateSolidBrush(RGB(255, 255, 255));
|
||||
rect = ps.rcPaint;
|
||||
FillRect(ps.hdc, &rect, brush);
|
||||
DeleteObject(brush);
|
||||
EndPaint(hWnd, &ps);
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
DestroyWindow(g_wnd);
|
||||
g_wnd = 0;
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
case WM_TIMER:
|
||||
KillTimer(g_wnd, 1);
|
||||
font_dump();
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
|
||||
if ((HWND)lParam == g_exit_button)
|
||||
{
|
||||
PostMessage(g_wnd, WM_CLOSE, 0, 0);
|
||||
}
|
||||
else if ((HWND)lParam == g_go_button)
|
||||
{
|
||||
while (SendMessage(g_lb, LB_GETCOUNT, 0, 0) > 0)
|
||||
{
|
||||
SendMessage(g_lb, LB_DELETESTRING, 0, 0);
|
||||
}
|
||||
|
||||
SetTimer(g_wnd, 1, 1000, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
create_window(void)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
DWORD style;
|
||||
int left;
|
||||
int top;
|
||||
|
||||
ZeroMemory(&wc, sizeof(wc));
|
||||
wc.lpfnWndProc = wnd_proc; /* points to window procedure */
|
||||
/* name of window class */
|
||||
wc.lpszClassName = _T("fontdump");
|
||||
wc.hCursor = LoadCursor(0, IDC_ARROW);
|
||||
|
||||
/* Register the window class. */
|
||||
if (!RegisterClass(&wc))
|
||||
{
|
||||
return 0; /* Failed to register window class */
|
||||
}
|
||||
|
||||
style = WS_OVERLAPPED | WS_CAPTION | WS_POPUP | WS_MINIMIZEBOX |
|
||||
WS_SYSMENU | WS_SIZEBOX | WS_MAXIMIZEBOX;
|
||||
left = GetSystemMetrics(SM_CXSCREEN) / 2 - 640 / 2;
|
||||
top = GetSystemMetrics(SM_CYSCREEN) / 2 - 480 / 2;
|
||||
g_wnd = CreateWindow(wc.lpszClassName, _T("fontdump"),
|
||||
style, left, top, 640, 480,
|
||||
(HWND) NULL, (HMENU) NULL, g_instance,
|
||||
(LPVOID) NULL);
|
||||
style = WS_CHILD | WS_VISIBLE | WS_BORDER;
|
||||
g_lb = CreateWindow(_T("LISTBOX"), _T("LISTBOX1"), style,
|
||||
200, 10, 400, 400, g_wnd, 0, g_instance, 0);
|
||||
style = WS_CHILD | WS_VISIBLE;
|
||||
g_exit_button = CreateWindow(_T("BUTTON"), _T("Exit"), style,
|
||||
540, 410, 75, 25, g_wnd, 0, g_instance, 0);
|
||||
g_go_button = CreateWindow(_T("BUTTON"), _T("Go"), style,
|
||||
440, 410, 75, 25, g_wnd, 0, g_instance, 0);
|
||||
style = WS_CHILD | WS_VISIBLE | CBS_DROPDOWN;
|
||||
g_font_list = CreateWindow(_T("COMBOBOX"), _T("COMBOBOX1"), style,
|
||||
50, 250, 125, 125, g_wnd, 0, g_instance, 0);
|
||||
ShowWindow(g_wnd, SW_SHOWNORMAL);
|
||||
PostMessage(g_wnd, WM_SETFONT, (WPARAM)g_font, 0);
|
||||
SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Tahoma");
|
||||
SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"DejaVu Serif");
|
||||
SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"DejaVu Sans");
|
||||
SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Arial");
|
||||
SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Comic Sans MS");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
main_loop(void)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return (int)(msg.wParam);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int WINAPI
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
g_instance = hInstance;
|
||||
create_window();
|
||||
return main_loop();
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
EXTRA_DIST = \
|
||||
dump-keymaps.sh \
|
||||
readme.txt
|
||||
|
||||
AM_CFLAGS = $(X_CFLAGS)
|
||||
|
||||
bin_PROGRAMS = \
|
||||
xrdp-genkeymap
|
||||
|
||||
xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c
|
||||
|
||||
xrdp_genkeymap_LDFLAGS = \
|
||||
$(X_LIBS)
|
||||
|
||||
xrdp_genkeymap_LDADD = \
|
||||
$(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
|
||||
@ -1,56 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! command -v setxkbmap >/dev/null
|
||||
then
|
||||
echo "error, setxkbmap not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# English - US 'en-us' 0x00000409
|
||||
setxkbmap -model pc104 -layout us
|
||||
./xrdp-genkeymap ../instfiles/km-00000409.ini
|
||||
|
||||
# English - US 'dvorak' 0x00010409
|
||||
setxkbmap -model pc104 -layout dvorak
|
||||
./xrdp-genkeymap ../instfiles/km-00010409.ini
|
||||
|
||||
# English - US 'dvp' 0x19360409
|
||||
OLD_SETTINGS=$(setxkbmap -query -verbose 4 | sed "s/^\([a-z]\+\):\s*\(.*\)$/-\1 \2/;s/^-options/-option \"\" -option/;s/,/ -option /g" | xargs -d \\n)
|
||||
setxkbmap -rules xfree86 -model pc105 -layout us -variant dvp -option "" -option compose:102 -option caps:shift -option numpad:sg -option numpad:shift3 -option keypad:hex -option keypad:atm -option kpdl:semi -option lv3:ralt_alt
|
||||
./xrdp-genkeymap ../instfiles/km-19360409.ini
|
||||
setxkbmap ${OLD_SETTINGS}
|
||||
|
||||
# English - UK 'en-GB' 0x00000809
|
||||
setxkbmap -model pc105 -layout gb
|
||||
./xrdp-genkeymap ../instfiles/km-00000809.ini
|
||||
|
||||
# German 'de' 0x00000407
|
||||
setxkbmap -model pc104 -layout de
|
||||
./xrdp-genkeymap ../instfiles/km-00000407.ini
|
||||
|
||||
# Italian 'it' 0x00000410
|
||||
setxkbmap -model pc104 -layout it
|
||||
./xrdp-genkeymap ../instfiles/km-00000410.ini
|
||||
|
||||
# Japanese 'jp' 0x00000411
|
||||
setxkbmap -model pc105 -layout jp -variant OADG109A
|
||||
./xrdp-genkeymap ../instfiles/km-00000411.ini
|
||||
|
||||
# Polish 'pl' 0x00000415
|
||||
setxkbmap -model pc104 -layout pl
|
||||
./xrdp-genkeymap ../instfiles/km-00000415.ini
|
||||
|
||||
# Russia 'ru' 0x00000419
|
||||
setxkbmap -model pc104 -layout ru
|
||||
./xrdp-genkeymap ../instfiles/km-00000419.ini
|
||||
|
||||
# Sweden 'se' 0x0000041d
|
||||
setxkbmap -model pc104 -layout se
|
||||
./xrdp-genkeymap ../instfiles/km-0000041d.ini
|
||||
|
||||
# Portuguese -PT 'pt-pt' 0x00000816
|
||||
setxkbmap -model pc104 -layout pt
|
||||
./xrdp-genkeymap ../instfiles/km-00000816.ini
|
||||
|
||||
# set back to en-us
|
||||
setxkbmap -model pc104 -layout us
|
||||
@ -1,161 +0,0 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
|
||||
/*
|
||||
* evdev-map.c
|
||||
* Copyright (C) Michał Górny 2014 <mgorny@gentoo.org>
|
||||
*
|
||||
* You may redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License, as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* main.cc is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with main.cc. If not, write to:
|
||||
* The Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301, USA
|
||||
*
|
||||
* xfree86(base)->evdev keycode mapping
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
int xfree86_to_evdev[137 - 8 + 1] =
|
||||
{
|
||||
/* MDSW */ 203,
|
||||
/* ESC */ 9,
|
||||
/* AE01 */ 10,
|
||||
/* AE02 */ 11,
|
||||
/* AE03 */ 12,
|
||||
/* AE04 */ 13,
|
||||
/* AE05 */ 14,
|
||||
/* AE06 */ 15,
|
||||
/* AE07 */ 16,
|
||||
/* AE08 */ 17,
|
||||
/* AE09 */ 18,
|
||||
/* AE10 */ 19,
|
||||
/* AE11 */ 20,
|
||||
/* AE12 */ 21,
|
||||
/* BKSP */ 22,
|
||||
/* TAB */ 23,
|
||||
/* AD01 */ 24,
|
||||
/* AD02 */ 25,
|
||||
/* AD03 */ 26,
|
||||
/* AD04 */ 27,
|
||||
/* AD05 */ 28,
|
||||
/* AD06 */ 29,
|
||||
/* AD07 */ 30,
|
||||
/* AD08 */ 31,
|
||||
/* AD09 */ 32,
|
||||
/* AD10 */ 33,
|
||||
/* AD11 */ 34,
|
||||
/* AD12 */ 35,
|
||||
/* RTRN */ 36,
|
||||
/* LCTL */ 37,
|
||||
/* AC01 */ 38,
|
||||
/* AC02 */ 39,
|
||||
/* AC03 */ 40,
|
||||
/* AC04 */ 41,
|
||||
/* AC05 */ 42,
|
||||
/* AC06 */ 43,
|
||||
/* AC07 */ 44,
|
||||
/* AC08 */ 45,
|
||||
/* AC09 */ 46,
|
||||
/* AC10 */ 47,
|
||||
/* AC11 */ 48,
|
||||
/* TLDE */ 49,
|
||||
/* LFSH */ 50,
|
||||
/* BKSL */ 51,
|
||||
/* AB01 */ 52,
|
||||
/* AB02 */ 53,
|
||||
/* AB03 */ 54,
|
||||
/* AB04 */ 55,
|
||||
/* AB05 */ 56,
|
||||
/* AB06 */ 57,
|
||||
/* AB07 */ 58,
|
||||
/* AB08 */ 59,
|
||||
/* AB09 */ 60,
|
||||
/* AB10 */ 61,
|
||||
/* RTSH */ 62,
|
||||
/* KPMU */ 63,
|
||||
/* LALT */ 64,
|
||||
/* SPCE */ 65,
|
||||
/* CAPS */ 66,
|
||||
/* FK01 */ 67,
|
||||
/* FK02 */ 68,
|
||||
/* FK03 */ 69,
|
||||
/* FK04 */ 70,
|
||||
/* FK05 */ 71,
|
||||
/* FK06 */ 72,
|
||||
/* FK07 */ 73,
|
||||
/* FK08 */ 74,
|
||||
/* FK09 */ 75,
|
||||
/* FK10 */ 76,
|
||||
/* NMLK */ 77,
|
||||
/* SCLK */ 78,
|
||||
/* KP7 */ 79,
|
||||
/* KP8 */ 80,
|
||||
/* KP9 */ 81,
|
||||
/* KPSU */ 82,
|
||||
/* KP4 */ 83,
|
||||
/* KP5 */ 84,
|
||||
/* KP6 */ 85,
|
||||
/* KPAD */ 86,
|
||||
/* KP1 */ 87,
|
||||
/* KP2 */ 88,
|
||||
/* KP3 */ 89,
|
||||
/* KP0 */ 90,
|
||||
/* KPDL */ 91,
|
||||
/* SYRQ */ 107,
|
||||
/* II5D */ 0,
|
||||
/* LSGT */ 94,
|
||||
/* FK11 */ 95,
|
||||
/* FK12 */ 96,
|
||||
/* HOME */ 110,
|
||||
/* UP */ 111,
|
||||
/* PGUP */ 112,
|
||||
/* LEFT */ 113,
|
||||
/* II65 */ 0,
|
||||
/* RGHT */ 114,
|
||||
/* END */ 115,
|
||||
/* DOWN */ 116,
|
||||
/* PGDN */ 117,
|
||||
/* INS */ 118,
|
||||
/* DELE */ 119,
|
||||
/* KPEN */ 104,
|
||||
/* RCTL */ 105,
|
||||
/* PAUS */ 127,
|
||||
/* PRSC */ 107,
|
||||
/* KPDV */ 106,
|
||||
/* RALT */ 108,
|
||||
/* BRK */ 419,
|
||||
/* LWIN */ 133,
|
||||
/* RWIN */ 134,
|
||||
/* MENU */ 0,
|
||||
/* FK13 */ 191,
|
||||
/* FK14 */ 192,
|
||||
/* FK15 */ 193,
|
||||
/* FK16 */ 194,
|
||||
/* FK17 */ 195,
|
||||
/* KPDC */ 0,
|
||||
/* LVL3 */ 92,
|
||||
/* ALT */ 204,
|
||||
/* KPEQ */ 125,
|
||||
/* SUPR */ 206,
|
||||
/* HYPR */ 207,
|
||||
/* XFER */ 0,
|
||||
/* I02 */ 0,
|
||||
/* NFER */ 0,
|
||||
/* I04 */ 0,
|
||||
/* AE13 */ 132,
|
||||
/* I06 */ 0,
|
||||
/* I07 */ 0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
@ -1,172 +0,0 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
|
||||
/*
|
||||
* genkeymap.c
|
||||
* Copyright (C) Ádám Wallner 2008 <wallner@bitbaro.hu>
|
||||
*
|
||||
* You may redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License, as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* main.cc is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with main.cc. If not, write to:
|
||||
* The Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301, USA
|
||||
|
||||
Updated Jay Sorg 2009
|
||||
|
||||
cs Czech 0x405
|
||||
de German 0x407
|
||||
en-us US English 0x409
|
||||
fr French 0x40c
|
||||
it Italian 0x410
|
||||
br Portuguese (Brazil) 0x416
|
||||
ru Russian 0x419
|
||||
se Swedish 0x41d
|
||||
en-uk UK English 0x809
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include <config_ac.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <locale.h>
|
||||
|
||||
extern int xfree86_to_evdev[137 - 8 + 1];
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *programname;
|
||||
char text[256];
|
||||
char *displayname = NULL;
|
||||
char *outfname;
|
||||
const char *sections[8] =
|
||||
{
|
||||
"noshift", "shift", "altgr", "shiftaltgr",
|
||||
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"
|
||||
};
|
||||
int states[8] = {0, 1, 0x80, 0x81, 2, 0x82, 3, 0x83};
|
||||
int i;
|
||||
int idx;
|
||||
int char_count;
|
||||
int nbytes = 0;
|
||||
int unicode;
|
||||
Display *dpy;
|
||||
KeySym ks;
|
||||
FILE *outf;
|
||||
XKeyPressedEvent e;
|
||||
wchar_t wtext[256];
|
||||
XkbDescPtr kbdesc;
|
||||
char *symatom;
|
||||
int is_evdev;
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
programname = argv[0];
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s out_filename\n", programname);
|
||||
fprintf(stderr, "Example: %s /etc/xrdp/km-00000409.ini\n", programname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
outfname = argv[1];
|
||||
dpy = XOpenDisplay(displayname);
|
||||
|
||||
if (!dpy)
|
||||
{
|
||||
fprintf(stderr, "%s: unable to open display '%s'\n",
|
||||
programname, XDisplayName(displayname));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check whether evdev is used */
|
||||
kbdesc = XkbAllocKeyboard();
|
||||
if (!kbdesc)
|
||||
{
|
||||
fprintf(stderr, "%s: unable to allocate keyboard desc\n",
|
||||
programname);
|
||||
XCloseDisplay(dpy);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (XkbGetNames(dpy, XkbKeycodesNameMask, kbdesc) != Success)
|
||||
{
|
||||
fprintf(stderr, "%s: unable to obtain keycode name for keyboard\n",
|
||||
programname);
|
||||
XkbFreeKeyboard(kbdesc, 0, True);
|
||||
XCloseDisplay(dpy);
|
||||
return 1;
|
||||
}
|
||||
|
||||
symatom = XGetAtomName(dpy, kbdesc->names->keycodes);
|
||||
is_evdev = !strncmp(symatom, "evdev", 5);
|
||||
XFree(symatom);
|
||||
XkbFreeKeyboard(kbdesc, 0, True);
|
||||
|
||||
outf = fopen(outfname, "w");
|
||||
|
||||
if (outf == NULL)
|
||||
{
|
||||
fprintf(stderr, "%s: unable to create file '%s'\n", programname, outfname);
|
||||
XCloseDisplay(dpy);
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(&e, 0, sizeof(e));
|
||||
e.type = KeyPress;
|
||||
e.serial = 16;
|
||||
e.send_event = True;
|
||||
e.display = dpy;
|
||||
e.same_screen = True;
|
||||
|
||||
for (idx = 0; idx < 8; idx++) /* Sections and states */
|
||||
{
|
||||
fprintf(outf, "[%s]\n", sections[idx]);
|
||||
e.state = states[idx];
|
||||
|
||||
for (i = 8; i < 137; i++) /* Keycodes */
|
||||
{
|
||||
if (is_evdev)
|
||||
{
|
||||
e.keycode = xfree86_to_evdev[i - 8];
|
||||
}
|
||||
else
|
||||
{
|
||||
e.keycode = i;
|
||||
}
|
||||
nbytes = XLookupString(&e, text, 255, &ks, NULL);
|
||||
text[nbytes] = 0;
|
||||
char_count = mbstowcs(wtext, text, 255);
|
||||
unicode = 0;
|
||||
|
||||
if (char_count == 1)
|
||||
{
|
||||
unicode = wtext[0];
|
||||
}
|
||||
|
||||
fprintf(outf, "Key%d=%d:%d\n", i, (int) ks, unicode);
|
||||
}
|
||||
|
||||
if (idx != 7)
|
||||
{
|
||||
fprintf(outf, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
XCloseDisplay(dpy);
|
||||
fclose(outf);
|
||||
return 0;
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
Creating a new keymap file.
|
||||
---------------------------
|
||||
|
||||
The names of the files are of the format;
|
||||
|
||||
km-xxxxxxxx.ini
|
||||
|
||||
where the xxxxxxxx is replaced by the hex number of the layout of interest.
|
||||
|
||||
The files have 8 sections;
|
||||
|
||||
[noshift], [shift], [altgr], [shiftaltgr], [capslock], [capslockaltgr],
|
||||
[shiftcapslock], [shiftcapslockaltgr]
|
||||
|
||||
In each section there are multiple lines for each key.
|
||||
|
||||
An example line looks like;
|
||||
|
||||
Key10=49:49
|
||||
|
||||
In this line, 10 is the X11 scancode, the first 49 is the keysym value,
|
||||
the second 49 if the unicode value of the key. This is the definition
|
||||
for the 'noshift' '1' key on a en-us keyboard. In this case, the keysym
|
||||
and the unicode value are the same.
|
||||
|
||||
Here is an example where they are not;
|
||||
|
||||
This is the definition for the backspace key;
|
||||
Key22=65288:8
|
||||
|
||||
And this is the star on the keypad;
|
||||
Key63=65450:42
|
||||
|
||||
To create a new file run "xrdp-genkeymap <filename>"
|
||||
|
||||
Example: ./xrdp-genkeymap /etc/xrdp/km-00000409.ini
|
||||
|
||||
Note: You need to have enough rights to be able to write to the
|
||||
/etc/xrdp directory.
|
||||
|
||||
Alternatively, create the keymap file in a directory of your choice, then
|
||||
copy or move it over to /etc/xrdp using sudo/su.
|
||||
|
||||
72
index.html
Normal file
72
index.html
Normal file
@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>xrdp by neutrinolabs</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<section class="page-header">
|
||||
<h1 class="project-name">xrdp</h1>
|
||||
<h2 class="project-tagline">an open-source Remote Desktop Protocol server</h2>
|
||||
<a href="https://github.com/neutrinolabs/xrdp" class="btn">View on GitHub</a>
|
||||
<a href="https://github.com/neutrinolabs/xrdp/releases" class="btn">View xrdp releases</a>
|
||||
<a href="https://github.com/neutrinolabs/xorgxrdp/releases" class="btn">View xorgxrdp releases</a>
|
||||
</section>
|
||||
|
||||
<section class="main-content">
|
||||
<h2>
|
||||
<a id="overview" class="anchor" href="#overview" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Overview</h2>
|
||||
|
||||
<p>xrdp provides a graphical login to remote machines using RDP (Microsoft Remote Desktop Protocol). xrdp accepts connections from variety of RDP clients: FreeRDP, rdesktop, NeutrinoRDP and Microsoft Remote Desktop Client (for Windows, macOS, iOS and Android).</p>
|
||||
|
||||
<p>As Windows-to-Windows Remote Desktop can, xrdp supports not only graphics remoting but also</p>
|
||||
|
||||
<ul>
|
||||
<li>two-way clipboard transfer (text, bitmap, file)</li>
|
||||
<li>audio redirection</li>
|
||||
<li>drive redirection (mount local client drives on remote machine)</li>
|
||||
</ul>
|
||||
|
||||
<p>RDP transport is encrypted using TLS by default.</p>
|
||||
|
||||
<p><img src="https://github.com/neutrinolabs/xrdp/raw/gh-pages/xrdp_demo.gif" alt="demo"></p>
|
||||
|
||||
<h2>
|
||||
<a id="contact" class="anchor" href="#contact" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Contact</h2>
|
||||
|
||||
<ul>
|
||||
<li>Google Groups:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://groups.google.com/forum/#!forum/xrdp-users">Users Group</a> (<a href="mailto:xrdp-users@googlegroups.com">xrdp-users@googlegroups.com</a>)</li>
|
||||
<li>
|
||||
<a href="https://groups.google.com/forum/#!forum/xrdp-devel">Development Group</a> (<a href="mailto:xrdp-devel@googlegroups.com">xrdp-devel@googlegroups.com</a>)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="https://gitter.im/neutrinolabs/xrdp">Gitter Chat</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>
|
||||
<a id="credits" class="anchor" href="#credits" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Credits</h2>
|
||||
|
||||
<ul>
|
||||
<li>Author: Jay Sorg (<a href="https://github.com/jsorg71" class="user-mention">@jsorg71</a>)</li>
|
||||
</ul>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span class="site-footer-owner"><a href="https://github.com/neutrinolabs/xrdp">xrdp</a> is maintained by <a href="https://github.com/neutrinolabs">neutrinolabs</a>.</span>
|
||||
|
||||
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
|
||||
</footer>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
112
index_files/css.css
Normal file
112
index_files/css.css
Normal file
@ -0,0 +1,112 @@
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* cyrillic-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
|
||||
}
|
||||
/* cyrillic */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||
}
|
||||
/* greek-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+1F00-1FFF;
|
||||
}
|
||||
/* greek */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0370-03FF;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
77
index_files/ga.js
Normal file
77
index_files/ga.js
Normal file
@ -0,0 +1,77 @@
|
||||
(function(){var E;function Aa(a,b){switch(b){case 0:return""+a;case 1:return 1*a;case 2:return!!a;case 3:return 1E3*a}return a}function Ba(a){return"function"==typeof a}function Ca(a){return void 0!=a&&-1<(a.constructor+"").indexOf("String")}function F(a,b){return void 0==a||"-"==a&&!b||""==a}function Da(a){if(!a||""==a)return"";for(;a&&-1<" \n\r\t".indexOf(a.charAt(0));)a=a.substring(1);for(;a&&-1<" \n\r\t".indexOf(a.charAt(a.length-1));)a=a.substring(0,a.length-1);return a}
|
||||
function Ea(){return Math.round(2147483647*Math.random())}function Fa(){}function G(a,b){if(encodeURIComponent instanceof Function)return b?encodeURI(a):encodeURIComponent(a);H(68);return escape(a)}function I(a){a=a.split("+").join(" ");if(decodeURIComponent instanceof Function)try{return decodeURIComponent(a)}catch(b){H(17)}else H(68);return unescape(a)}var Ga=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)};
|
||||
function Ia(a,b){if(a){var c=J.createElement("script");c.type="text/javascript";c.async=!0;c.src=a;c.id=b;var d=J.getElementsByTagName("script")[0];d.parentNode.insertBefore(c,d);return c}}function K(a){return a&&0<a.length?a[0]:""}function L(a){var b=a?a.length:0;return 0<b?a[b-1]:""}var nf=function(){this.prefix="ga.";this.values={}};nf.prototype.set=function(a,b){this.values[this.prefix+a]=b};nf.prototype.get=function(a){return this.values[this.prefix+a]};
|
||||
nf.prototype.contains=function(a){return void 0!==this.get(a)};function Ka(a){0==a.indexOf("www.")&&(a=a.substring(4));return a.toLowerCase()}
|
||||
function La(a,b){var c,d={url:a,protocol:"http",host:"",path:"",R:new nf,anchor:""};if(!a)return d;c=a.indexOf("://");0<=c&&(d.protocol=a.substring(0,c),a=a.substring(c+3));c=a.search("/|\\?|#");if(0<=c)d.host=a.substring(0,c).toLowerCase(),a=a.substring(c);else return d.host=a.toLowerCase(),d;c=a.indexOf("#");0<=c&&(d.anchor=a.substring(c+1),a=a.substring(0,c));c=a.indexOf("?");0<=c&&(Na(d.R,a.substring(c+1)),a=a.substring(0,c));d.anchor&&b&&Na(d.R,d.anchor);a&&"/"==a.charAt(0)&&(a=a.substring(1));
|
||||
d.path=a;return d}
|
||||
function Oa(a,b){function c(a){var b=(a.hostname||"").split(":")[0].toLowerCase(),c=(a.protocol||"").toLowerCase(),c=1*a.port||("http:"==c?80:"https:"==c?443:"");a=a.pathname||"";0==a.indexOf("/")||(a="/"+a);return[b,""+c,a]}var d=b||J.createElement("a");d.href=J.location.href;var e=(d.protocol||"").toLowerCase(),f=c(d),Be=d.search||"",k=e+"//"+f[0]+(f[1]?":"+f[1]:"");0==a.indexOf("//")?a=e+a:0==a.indexOf("/")?a=k+a:a&&0!=a.indexOf("?")?0>a.split("/")[0].indexOf(":")&&(a=k+f[2].substring(0,f[2].lastIndexOf("/"))+
|
||||
"/"+a):a=k+f[2]+(a||Be);d.href=a;e=c(d);return{protocol:(d.protocol||"").toLowerCase(),host:e[0],port:e[1],path:e[2],Oa:d.search||"",url:a||""}}function Na(a,b){function c(b,c){a.contains(b)||a.set(b,[]);a.get(b).push(c)}for(var d=Da(b).split("&"),e=0;e<d.length;e++)if(d[e]){var f=d[e].indexOf("=");0>f?c(d[e],"1"):c(d[e].substring(0,f),d[e].substring(f+1))}}
|
||||
function Pa(a,b){if(F(a)||"["==a.charAt(0)&&"]"==a.charAt(a.length-1))return"-";var c=J.domain;return a.indexOf(c+(b&&"/"!=b?b:""))==(0==a.indexOf("http://")?7:0==a.indexOf("https://")?8:0)?"0":a};var Qa=0;function Ra(a,b,c){1<=Qa||1<=100*Math.random()||ld()||(a=["utmt=error","utmerr="+a,"utmwv=5.6.7","utmn="+Ea(),"utmsp=1"],b&&a.push("api="+b),c&&a.push("msg="+G(c.substring(0,100))),M.w&&a.push("aip=1"),Sa(a.join("&")),Qa++)};var Ta=0,Ua={};function N(a){return Va("x"+Ta++,a)}function Va(a,b){Ua[a]=!!b;return a}
|
||||
var Wa=N(),Xa=Va("anonymizeIp"),Ya=N(),$a=N(),ab=N(),bb=N(),O=N(),P=N(),cb=N(),db=N(),eb=N(),fb=N(),gb=N(),hb=N(),ib=N(),jb=N(),kb=N(),lb=N(),nb=N(),ob=N(),pb=N(),qb=N(),rb=N(),sb=N(),tb=N(),ub=N(),vb=N(),wb=N(),xb=N(),yb=N(),zb=N(),Ab=N(),Bb=N(),Cb=N(),Db=N(),Eb=N(),Fb=N(!0),Gb=Va("currencyCode"),Hb=Va("page"),Ib=Va("title"),Jb=N(),Kb=N(),Lb=N(),Mb=N(),Nb=N(),Ob=N(),Pb=N(),Qb=N(),Rb=N(),Q=N(!0),Sb=N(!0),Tb=N(!0),Ub=N(!0),Vb=N(!0),Wb=N(!0),Zb=N(!0),$b=N(!0),ac=N(!0),bc=N(!0),cc=N(!0),R=N(!0),dc=N(!0),
|
||||
ec=N(!0),fc=N(!0),gc=N(!0),hc=N(!0),ic=N(!0),jc=N(!0),S=N(!0),kc=N(!0),lc=N(!0),mc=N(!0),nc=N(!0),oc=N(!0),pc=N(!0),qc=N(!0),rc=Va("campaignParams"),sc=N(),tc=Va("hitCallback"),uc=N();N();var vc=N(),wc=N(),xc=N(),yc=N(),zc=N(),Ac=N(),Bc=N(),Cc=N(),Dc=N(),Ec=N(),Fc=N(),Gc=N(),Hc=N(),Ic=N();N();var Mc=N(),Nc=N(),Yb=N(),Jc=N(),Kc=N(),Lc=Va("utmtCookieName"),Cd=Va("displayFeatures"),Oc=N(),of=Va("gtmid"),Oe=Va("uaName"),Pe=Va("uaDomain"),Qe=Va("uaPath"),pf=Va("linkid");var Re=function(){function a(a,c,d){T(qf.prototype,a,c,d)}a("_createTracker",qf.prototype.hb,55);a("_getTracker",qf.prototype.oa,0);a("_getTrackerByName",qf.prototype.u,51);a("_getTrackers",qf.prototype.pa,130);a("_anonymizeIp",qf.prototype.aa,16);a("_forceSSL",qf.prototype.la,125);a("_getPlugin",Pc,120)},Se=function(){function a(a,c,d){T(U.prototype,a,c,d)}Qc("_getName",$a,58);Qc("_getAccount",Wa,64);Qc("_visitCode",Q,54);Qc("_getClientInfo",ib,53,1);Qc("_getDetectTitle",lb,56,1);Qc("_getDetectFlash",
|
||||
jb,65,1);Qc("_getLocalGifPath",wb,57);Qc("_getServiceMode",xb,59);V("_setClientInfo",ib,66,2);V("_setAccount",Wa,3);V("_setNamespace",Ya,48);V("_setAllowLinker",fb,11,2);V("_setDetectFlash",jb,61,2);V("_setDetectTitle",lb,62,2);V("_setLocalGifPath",wb,46,0);V("_setLocalServerMode",xb,92,void 0,0);V("_setRemoteServerMode",xb,63,void 0,1);V("_setLocalRemoteServerMode",xb,47,void 0,2);V("_setSampleRate",vb,45,1);V("_setCampaignTrack",kb,36,2);V("_setAllowAnchor",gb,7,2);V("_setCampNameKey",ob,41);V("_setCampContentKey",
|
||||
tb,38);V("_setCampIdKey",nb,39);V("_setCampMediumKey",rb,40);V("_setCampNOKey",ub,42);V("_setCampSourceKey",qb,43);V("_setCampTermKey",sb,44);V("_setCampCIdKey",pb,37);V("_setCookiePath",P,9,0);V("_setMaxCustomVariables",yb,0,1);V("_setVisitorCookieTimeout",cb,28,1);V("_setSessionCookieTimeout",db,26,1);V("_setCampaignCookieTimeout",eb,29,1);V("_setReferrerOverride",Jb,49);V("_setSiteSpeedSampleRate",Dc,132);a("_trackPageview",U.prototype.Fa,1);a("_trackEvent",U.prototype.F,4);a("_trackPageLoadTime",
|
||||
U.prototype.Ea,100);a("_trackSocial",U.prototype.Ga,104);a("_trackTrans",U.prototype.Ia,18);a("_sendXEvent",U.prototype.ib,78);a("_createEventTracker",U.prototype.ia,74);a("_getVersion",U.prototype.qa,60);a("_setDomainName",U.prototype.B,6);a("_setAllowHash",U.prototype.va,8);a("_getLinkerUrl",U.prototype.na,52);a("_link",U.prototype.link,101);a("_linkByPost",U.prototype.ua,102);a("_setTrans",U.prototype.za,20);a("_addTrans",U.prototype.$,21);a("_addItem",U.prototype.Y,19);a("_clearTrans",U.prototype.ea,
|
||||
105);a("_setTransactionDelim",U.prototype.Aa,82);a("_setCustomVar",U.prototype.wa,10);a("_deleteCustomVar",U.prototype.ka,35);a("_getVisitorCustomVar",U.prototype.ra,50);a("_setXKey",U.prototype.Ca,83);a("_setXValue",U.prototype.Da,84);a("_getXKey",U.prototype.sa,76);a("_getXValue",U.prototype.ta,77);a("_clearXKey",U.prototype.fa,72);a("_clearXValue",U.prototype.ga,73);a("_createXObj",U.prototype.ja,75);a("_addIgnoredOrganic",U.prototype.W,15);a("_clearIgnoredOrganic",U.prototype.ba,97);a("_addIgnoredRef",
|
||||
U.prototype.X,31);a("_clearIgnoredRef",U.prototype.ca,32);a("_addOrganic",U.prototype.Z,14);a("_clearOrganic",U.prototype.da,70);a("_cookiePathCopy",U.prototype.ha,30);a("_get",U.prototype.ma,106);a("_set",U.prototype.xa,107);a("_addEventListener",U.prototype.addEventListener,108);a("_removeEventListener",U.prototype.removeEventListener,109);a("_addDevId",U.prototype.V);a("_getPlugin",Pc,122);a("_setPageGroup",U.prototype.ya,126);a("_trackTiming",U.prototype.Ha,124);a("_initData",U.prototype.initData,
|
||||
2);a("_setVar",U.prototype.Ba,22);V("_setSessionTimeout",db,27,3);V("_setCookieTimeout",eb,25,3);V("_setCookiePersistence",cb,24,1);a("_setAutoTrackOutbound",Fa,79);a("_setTrackOutboundSubdomains",Fa,81);a("_setHrefExamineLimit",Fa,80)};function Pc(a){var b=this.plugins_;if(b)return b.get(a)}
|
||||
var T=function(a,b,c,d){a[b]=function(){try{return void 0!=d&&H(d),c.apply(this,arguments)}catch(a){throw Ra("exc",b,a&&a.name),a;}}},Qc=function(a,b,c,d){U.prototype[a]=function(){try{return H(c),Aa(this.a.get(b),d)}catch(e){throw Ra("exc",a,e&&e.name),e;}}},V=function(a,b,c,d,e){U.prototype[a]=function(f){try{H(c),void 0==e?this.a.set(b,Aa(f,d)):this.a.set(b,e)}catch(Be){throw Ra("exc",a,Be&&Be.name),Be;}}},Te=function(a,b){return{type:b,target:a,stopPropagation:function(){throw"aborted";}}};var Rc=new RegExp(/(^|\.)doubleclick\.net$/i),Sc=function(a,b){return Rc.test(J.location.hostname)?!0:"/"!==b?!1:0!=a.indexOf("www.google.")&&0!=a.indexOf(".google.")&&0!=a.indexOf("google.")||-1<a.indexOf("google.org")?!1:!0},Tc=function(a){var b=a.get(bb),c=a.c(P,"/");Sc(b,c)&&a.stopPropagation()};var Zc=function(){var a={},b={},c=new Uc;this.g=function(a,b){c.add(a,b)};var d=new Uc;this.v=function(a,b){d.add(a,b)};var e=!1,f=!1,Be=!0;this.T=function(){e=!0};this.j=function(a){this.load();this.set(sc,a,!0);a=new Vc(this);e=!1;d.cb(this);e=!0;b={};this.gb();a.Ja()};this.load=function(){e&&(e=!1,this.Ka(),Wc(this),f||(f=!0,c.cb(this),Xc(this),Wc(this)),e=!0)};this.gb=function(){e&&(f?(e=!1,Xc(this),e=!0):this.load())};this.get=function(c){Ua[c]&&this.load();return void 0!==b[c]?b[c]:a[c]};this.set=
|
||||
function(c,d,e){Ua[c]&&this.load();e?b[c]=d:a[c]=d;Ua[c]&&this.gb()};this.Za=function(b){a[b]=this.b(b,0)+1};this.b=function(a,b){var c=this.get(a);return void 0==c||""===c?b:1*c};this.c=function(a,b){var c=this.get(a);return void 0==c?b:c+""};this.Ka=function(){if(Be){var b=this.c(bb,""),c=this.c(P,"/");Sc(b,c)||(a[O]=a[hb]&&""!=b?Yc(b):1,Be=!1)}}};Zc.prototype.stopPropagation=function(){throw"aborted";};
|
||||
var Vc=function(a){var b=this;this.fb=0;var c=a.get(tc);this.Ua=function(){0<b.fb&&c&&(b.fb--,b.fb||c())};this.Ja=function(){!b.fb&&c&&setTimeout(c,10)};a.set(uc,b,!0)};function $c(a,b){b=b||[];for(var c=0;c<b.length;c++){var d=b[c];if(""+a==d||0==d.indexOf(a+"."))return d}return"-"}
|
||||
var bd=function(a,b,c){c=c?"":a.c(O,"1");b=b.split(".");if(6!==b.length||ad(b[0],c))return!1;c=1*b[1];var d=1*b[2],e=1*b[3],f=1*b[4];b=1*b[5];if(!(0<=c&&0<d&&0<e&&0<f&&0<=b))return!1;a.set(Q,c);a.set(Vb,d);a.set(Wb,e);a.set(Zb,f);a.set($b,b);return!0},cd=function(a){var b=a.get(Q),c=a.get(Vb),d=a.get(Wb),e=a.get(Zb),f=a.b($b,1);return[a.b(O,1),void 0!=b?b:"-",c||"-",d||"-",e||"-",f].join(".")},dd=function(a){return[a.b(O,1),a.b(cc,0),a.b(R,1),a.b(dc,0)].join(".")},ed=function(a,b,c){c=c?"":a.c(O,
|
||||
"1");var d=b.split(".");if(4!==d.length||ad(d[0],c))d=null;a.set(cc,d?1*d[1]:0);a.set(R,d?1*d[2]:10);a.set(dc,d?1*d[3]:a.get(ab));return null!=d||!ad(b,c)},fd=function(a,b){var c=G(a.c(Tb,"")),d=[],e=a.get(Fb);if(!b&&e){for(var f=0;f<e.length;f++){var Be=e[f];Be&&1==Be.scope&&d.push(f+"="+G(Be.name)+"="+G(Be.value)+"=1")}0<d.length&&(c+="|"+d.join("^"))}return c?a.b(O,1)+"."+c:null},gd=function(a,b,c){c=c?"":a.c(O,"1");b=b.split(".");if(2>b.length||ad(b[0],c))return!1;b=b.slice(1).join(".").split("|");
|
||||
0<b.length&&a.set(Tb,I(b[0]));if(1>=b.length)return!0;b=b[1].split(-1==b[1].indexOf(",")?"^":",");for(c=0;c<b.length;c++){var d=b[c].split("=");if(4==d.length){var e={};e.name=I(d[1]);e.value=I(d[2]);e.scope=1;a.get(Fb)[d[0]]=e}}return!0},hd=function(a,b){var c=Ue(a,b);return c?[a.b(O,1),a.b(ec,0),a.b(fc,1),a.b(gc,1),c].join("."):""},Ue=function(a){function b(b,e){if(!F(a.get(b))){var f=a.c(b,""),f=f.split(" ").join("%20"),f=f.split("+").join("%20");c.push(e+"="+f)}}var c=[];b(ic,"utmcid");b(nc,"utmcsr");
|
||||
b(S,"utmgclid");b(kc,"utmgclsrc");b(lc,"utmdclid");b(mc,"utmdsid");b(jc,"utmccn");b(oc,"utmcmd");b(pc,"utmctr");b(qc,"utmcct");return c.join("|")},id=function(a,b,c){c=c?"":a.c(O,"1");b=b.split(".");if(5>b.length||ad(b[0],c))return a.set(ec,void 0),a.set(fc,void 0),a.set(gc,void 0),a.set(ic,void 0),a.set(jc,void 0),a.set(nc,void 0),a.set(oc,void 0),a.set(pc,void 0),a.set(qc,void 0),a.set(S,void 0),a.set(kc,void 0),a.set(lc,void 0),a.set(mc,void 0),!1;a.set(ec,1*b[1]);a.set(fc,1*b[2]);a.set(gc,1*b[3]);
|
||||
Ve(a,b.slice(4).join("."));return!0},Ve=function(a,b){function c(a){return(a=b.match(a+"=(.*?)(?:\\|utm|$)"))&&2==a.length?a[1]:void 0}function d(b,c){c?(c=e?I(c):c.split("%20").join(" "),a.set(b,c)):a.set(b,void 0)}-1==b.indexOf("=")&&(b=I(b));var e="2"==c("utmcvr");d(ic,c("utmcid"));d(jc,c("utmccn"));d(nc,c("utmcsr"));d(oc,c("utmcmd"));d(pc,c("utmctr"));d(qc,c("utmcct"));d(S,c("utmgclid"));d(kc,c("utmgclsrc"));d(lc,c("utmdclid"));d(mc,c("utmdsid"))},ad=function(a,b){return b?a!=b:!/^\d+$/.test(a)};var Uc=function(){this.filters=[]};Uc.prototype.add=function(a,b){this.filters.push({name:a,s:b})};Uc.prototype.cb=function(a){try{for(var b=0;b<this.filters.length;b++)this.filters[b].s.call(W,a)}catch(c){}};function jd(a){100!=a.get(vb)&&a.get(Q)%1E4>=100*a.get(vb)&&a.stopPropagation()}function kd(a){ld(a.get(Wa))&&a.stopPropagation()}function md(a){"file:"==J.location.protocol&&a.stopPropagation()}function Ge(a){He()&&a.stopPropagation()}
|
||||
function nd(a){a.get(Ib)||a.set(Ib,J.title,!0);a.get(Hb)||a.set(Hb,J.location.pathname+J.location.search,!0)}function lf(a){a.get(Wa)&&"UA-XXXXX-X"!=a.get(Wa)||a.stopPropagation()};var od=new function(){var a=[];this.set=function(b){a[b]=!0};this.encode=function(){for(var b=[],c=0;c<a.length;c++)a[c]&&(b[Math.floor(c/6)]^=1<<c%6);for(c=0;c<b.length;c++)b[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(b[c]||0);return b.join("")+"~"}};function H(a){od.set(a)};var W=window,J=document,ld=function(a){var b=W._gaUserPrefs;if(b&&b.ioo&&b.ioo()||a&&!0===W["ga-disable-"+a])return!0;try{var c=W.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(d){}return!1},He=function(){return W.navigator&&"preview"==W.navigator.loadPurpose},We=function(a,b){setTimeout(a,b)},pd=function(a){var b=[],c=J.cookie.split(";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c.length;d++){var e=c[d].match(a);e&&b.push(e[1])}return b},X=function(a,b,c,d,e,f){e=
|
||||
ld(e)?!1:Sc(d,c)?!1:He()?!1:!0;e&&((b=mf(b))&&2E3<b.length&&(b=b.substring(0,2E3),H(69)),a=a+"="+b+"; path="+c+"; ",f&&(a+="expires="+(new Date((new Date).getTime()+f)).toGMTString()+"; "),d&&(a+="domain="+d+";"),J.cookie=a)},mf=function(a){if(!a)return a;var b=a.indexOf(";");-1!=b&&(a=a.substring(0,b),H(141));if(!(0<=W.navigator.userAgent.indexOf("Firefox")))return a;a=a.replace(/\n|\r/g," ");for(var b=0,c=a.length;b<c;++b){var d=a.charCodeAt(b)&255;if(10==d||13==d)a=a.substring(0,b)+"?"+a.substring(b+
|
||||
1)}return a};var qd,rd,sd=function(){if(!qd){var a={},b=W.navigator,c=W.screen;a.jb=c?c.width+"x"+c.height:"-";a.P=c?c.colorDepth+"-bit":"-";a.language=(b&&(b.language||b.browserLanguage)||"-").toLowerCase();a.javaEnabled=b&&b.javaEnabled()?1:0;a.characterSet=J.characterSet||J.charset||"-";try{var d;var e=J.documentElement,f=J.body,Be=f&&f.clientWidth&&f.clientHeight,b=[];e&&e.clientWidth&&e.clientHeight&&("CSS1Compat"===J.compatMode||!Be)?b=[e.clientWidth,e.clientHeight]:Be&&(b=[f.clientWidth,f.clientHeight]);
|
||||
d=0>=b[0]||0>=b[1]?"":b.join("x");a.Wa=d}catch(k){H(135)}qd=a}},td=function(){sd();for(var a=qd,b=W.navigator,a=b.appName+b.version+a.language+b.platform+b.userAgent+a.javaEnabled+a.jb+a.P+(J.cookie?J.cookie:"")+(J.referrer?J.referrer:""),b=a.length,c=W.history.length;0<c;)a+=c--^b++;return Yc(a)},ud=function(a){sd();var b=qd;a.set(Lb,b.jb);a.set(Mb,b.P);a.set(Pb,b.language);a.set(Qb,b.characterSet);a.set(Nb,b.javaEnabled);a.set(Rb,b.Wa);if(a.get(ib)&&a.get(jb)){if(!(b=rd)){var c,d,e;d="ShockwaveFlash";
|
||||
if((b=(b=W.navigator)?b.plugins:void 0)&&0<b.length)for(c=0;c<b.length&&!e;c++)d=b[c],-1<d.name.indexOf("Shockwave Flash")&&(e=d.description.split("Shockwave Flash ")[1]);else{d=d+"."+d;try{c=new ActiveXObject(d+".7"),e=c.GetVariable("$version")}catch(f){}if(!e)try{c=new ActiveXObject(d+".6"),e="WIN 6,0,21,0",c.AllowScriptAccess="always",e=c.GetVariable("$version")}catch(Be){}if(!e)try{c=new ActiveXObject(d),e=c.GetVariable("$version")}catch(k){}e&&(e=e.split(" ")[1].split(","),e=e[0]+"."+e[1]+" r"+
|
||||
e[2])}b=e?e:"-"}rd=b;a.set(Ob,rd)}else a.set(Ob,"-")};var vd=function(a){if(Ba(a))this.s=a;else{var b=a[0],c=b.lastIndexOf(":"),d=b.lastIndexOf(".");this.h=this.i=this.l="";-1==c&&-1==d?this.h=b:-1==c&&-1!=d?(this.i=b.substring(0,d),this.h=b.substring(d+1)):-1!=c&&-1==d?(this.l=b.substring(0,c),this.h=b.substring(c+1)):c>d?(this.i=b.substring(0,d),this.l=b.substring(d+1,c),this.h=b.substring(c+1)):(this.i=b.substring(0,d),this.h=b.substring(d+1));this.Xa=a.slice(1);this.Ma=!this.l&&"_require"==this.h;this.J=!this.i&&!this.l&&"_provide"==this.h}},Y=function(){T(Y.prototype,
|
||||
"push",Y.prototype.push,5);T(Y.prototype,"_getPlugin",Pc,121);T(Y.prototype,"_createAsyncTracker",Y.prototype.Sa,33);T(Y.prototype,"_getAsyncTracker",Y.prototype.Ta,34);this.I=new nf;this.eb=[]};E=Y.prototype;E.Na=function(a,b,c){var d=this.I.get(a);if(!Ba(d))return!1;b.plugins_=b.plugins_||new nf;b.plugins_.set(a,new d(b,c||{}));return!0};E.push=function(a){var b=Z.Va.apply(this,arguments),b=Z.eb.concat(b);for(Z.eb=[];0<b.length&&!Z.O(b[0])&&!(b.shift(),0<Z.eb.length););Z.eb=Z.eb.concat(b);return 0};
|
||||
E.Va=function(a){for(var b=[],c=0;c<arguments.length;c++)try{var d=new vd(arguments[c]);d.J?this.O(d):b.push(d)}catch(e){}return b};
|
||||
E.O=function(a){try{if(a.s)a.s.apply(W);else if(a.J)this.I.set(a.Xa[0],a.Xa[1]);else{var b="_gat"==a.i?M:"_gaq"==a.i?Z:M.u(a.i);if(a.Ma){if(!this.Na(a.Xa[0],b,a.Xa[2])){if(!a.Pa){var c=Oa(""+a.Xa[1]);var d=c.protocol,e=J.location.protocol;var f;if(f="https:"==d||d==e?!0:"http:"!=d?!1:"http:"==e)a:{var Be=Oa(J.location.href);if(!(c.Oa||0<=c.url.indexOf("?")||0<=c.path.indexOf("://")||c.host==Be.host&&c.port==Be.port))for(var k="http:"==c.protocol?80:443,Ja=M.S,b=0;b<Ja.length;b++)if(c.host==Ja[b][0]&&
|
||||
(c.port||k)==(Ja[b][1]||k)&&0==c.path.indexOf(Ja[b][2])){f=!0;break a}f=!1}f&&!ld()&&(a.Pa=Ia(c.url))}return!0}}else a.l&&(b=b.plugins_.get(a.l)),b[a.h].apply(b,a.Xa)}}catch(t){}};E.Sa=function(a,b){return M.hb(a,b||"")};E.Ta=function(a){return M.u(a)};var yd=function(){function a(a,b,c,d){void 0==f[a]&&(f[a]={});void 0==f[a][b]&&(f[a][b]=[]);f[a][b][c]=d}function b(a,b,c){if(void 0!=f[a]&&void 0!=f[a][b])return f[a][b][c]}function c(a,b){if(void 0!=f[a]&&void 0!=f[a][b]){f[a][b]=void 0;var c=!0,d;for(d=0;d<Be.length;d++)if(void 0!=f[a][Be[d]]){c=!1;break}c&&(f[a]=void 0)}}function d(a){var b="",c=!1,d,e;for(d=0;d<Be.length;d++)if(e=a[Be[d]],void 0!=e){c&&(b+=Be[d]);for(var c=[],f=void 0,Bd=void 0,Bd=0;Bd<e.length;Bd++)if(void 0!=e[Bd]){f="";1!=
|
||||
Bd&&void 0==e[Bd-1]&&(f+=Bd.toString()+"!");for(var fa=e[Bd],Ke="",Le=void 0,Me=void 0,ga=void 0,Le=0;Le<fa.length;Le++)Me=fa.charAt(Le),ga=k[Me],Ke+=void 0!=ga?ga:Me;f+=Ke;c.push(f)}b+="("+c.join("*")+")";c=!1}else c=!0;return b}var e=this,f=[],Be=["k","v"],k={"'":"'0",")":"'1","*":"'2","!":"'3"};e.Ra=function(a){return void 0!=f[a]};e.A=function(){for(var a="",b=0;b<f.length;b++)void 0!=f[b]&&(a+=b.toString()+d(f[b]));return a};e.Qa=function(a){if(void 0==a)return e.A();for(var b=a.A(),c=0;c<f.length;c++)void 0==
|
||||
f[c]||a.Ra(c)||(b+=c.toString()+d(f[c]));return b};e.f=function(b,c,d){if(!wd(d))return!1;a(b,"k",c,d);return!0};e.o=function(b,c,d){if(!xd(d))return!1;a(b,"v",c,d.toString());return!0};e.getKey=function(a,c){return b(a,"k",c)};e.N=function(a,c){return b(a,"v",c)};e.L=function(a){c(a,"k")};e.M=function(a){c(a,"v")};T(e,"_setKey",e.f,89);T(e,"_setValue",e.o,90);T(e,"_getKey",e.getKey,87);T(e,"_getValue",e.N,88);T(e,"_clearKey",e.L,85);T(e,"_clearValue",e.M,86)};
|
||||
function wd(a){return"string"==typeof a}function xd(a){return!("number"==typeof a||void 0!=Number&&a instanceof Number)||Math.round(a)!=a||isNaN(a)||Infinity==a?!1:!0};var zd=function(a){var b=W.gaGlobal;a&&!b&&(W.gaGlobal=b={});return b},Ad=function(){var a=zd(!0).hid;null==a&&(a=Ea(),zd(!0).hid=a);return a},Dd=function(a){a.set(Kb,Ad());var b=zd();if(b&&b.dh==a.get(O)){var c=b.sid;c&&(a.get(ac)?H(112):H(132),a.set(Zb,c),a.get(Sb)&&a.set(Wb,c));b=b.vid;a.get(Sb)&&b&&(b=b.split("."),a.set(Q,1*b[0]),a.set(Vb,1*b[1]))}};var Ed,Fd=function(a,b,c,d){var e=a.c(bb,""),f=a.c(P,"/");d=void 0!=d?d:a.b(cb,0);a=a.c(Wa,"");X(b,c,f,e,a,d)},Xc=function(a){var b=a.c(bb,"");a.b(O,1);var c=a.c(P,"/"),d=a.c(Wa,"");X("__utma",cd(a),c,b,d,a.get(cb));X("__utmb",dd(a),c,b,d,a.get(db));X("__utmc",""+a.b(O,1),c,b,d);var e=hd(a,!0);e?X("__utmz",e,c,b,d,a.get(eb)):X("__utmz","",c,b,"",-1);(e=fd(a,!1))?X("__utmv",e,c,b,d,a.get(cb)):X("__utmv","",c,b,"",-1)},Wc=function(a){var b=a.b(O,1);if(!bd(a,$c(b,pd("__utma"))))return a.set(Ub,!0),!1;
|
||||
var c=!ed(a,$c(b,pd("__utmb")));a.set(bc,c);id(a,$c(b,pd("__utmz")));gd(a,$c(b,pd("__utmv")));Ed=!c;return!0},Gd=function(a){Ed||0<pd("__utmb").length||(X("__utmd","1",a.c(P,"/"),a.c(bb,""),a.c(Wa,""),1E4),0==pd("__utmd").length&&a.stopPropagation())};var h=0,Jd=function(a){void 0==a.get(Q)?Hd(a):a.get(Ub)&&!a.get(Mc)?Hd(a):a.get(bc)&&Id(a)},Kd=function(a){a.get(hc)&&!a.get(ac)&&(Id(a),a.set(fc,a.get($b)))},Hd=function(a){h++;1<h&&H(137);var b=a.get(ab);a.set(Sb,!0);a.set(Q,Ea()^td(a)&2147483647);a.set(Tb,"");a.set(Vb,b);a.set(Wb,b);a.set(Zb,b);a.set($b,1);a.set(ac,!0);a.set(cc,0);a.set(R,10);a.set(dc,b);a.set(Fb,[]);a.set(Ub,!1);a.set(bc,!1)},Id=function(a){h++;1<h&&H(137);a.set(Wb,a.get(Zb));a.set(Zb,a.get(ab));a.Za($b);a.set(ac,!0);a.set(cc,
|
||||
0);a.set(R,10);a.set(dc,a.get(ab));a.set(bc,!1)};var Ld="daum:q eniro:search_word naver:query pchome:q images.google:q google:q yahoo:p yahoo:q msn:q bing:q aol:query aol:q lycos:q lycos:query ask:q cnn:query virgilio:qs baidu:wd baidu:word alice:qs yandex:text najdi:q seznam:q rakuten:qt biglobe:q goo.ne:MT search.smt.docomo:MT onet:qt onet:q kvasir:q terra:query rambler:query conduit:q babylon:q search-results:q avg:q comcast:q incredimail:q startsiden:q go.mail.ru:q centrum.cz:q 360.cn:q sogou:query tut.by:query globo:q ukr:q so.com:q haosou.com:q auone:q".split(" "),
|
||||
Sd=function(a){if(a.get(kb)&&!a.get(Mc)){var b;b=!F(a.get(ic))||!F(a.get(nc))||!F(a.get(S))||!F(a.get(lc));for(var c={},d=0;d<Md.length;d++){var e=Md[d];c[e]=a.get(e)}(d=a.get(rc))?(H(149),e=new nf,Na(e,d),d=e):d=La(J.location.href,a.get(gb)).R;if("1"!=L(d.get(a.get(ub)))||!b)if(d=Xe(a,d)||Qd(a),d||b||!a.get(ac)||(Pd(a,void 0,"(direct)",void 0,void 0,void 0,"(direct)","(none)",void 0,void 0),d=!0),d&&(a.set(hc,Rd(a,c)),b="(direct)"==a.get(nc)&&"(direct)"==a.get(jc)&&"(none)"==a.get(oc),a.get(hc)||
|
||||
a.get(ac)&&!b))a.set(ec,a.get(ab)),a.set(fc,a.get($b)),a.Za(gc)}},Xe=function(a,b){function c(c,d){d=d||"-";var e=L(b.get(a.get(c)));return e&&"-"!=e?I(e):d}var d=L(b.get(a.get(nb)))||"-",e=L(b.get(a.get(qb)))||"-",f=L(b.get(a.get(pb)))||"-",Be=L(b.get("gclsrc"))||"-",k=L(b.get("dclid"))||"-",Ja=c(ob,"(not set)"),t=c(rb,"(not set)"),Za=c(sb),Ma=c(tb);if(F(d)&&F(f)&&F(k)&&F(e))return!1;var mb=!F(f)&&!F(Be),mb=F(e)&&(!F(k)||mb),Xb=F(Za);if(mb||Xb){var Bd=Nd(a),Bd=La(Bd,!0);(Bd=Od(a,Bd))&&!F(Bd[1]&&
|
||||
!Bd[2])&&(mb&&(e=Bd[0]),Xb&&(Za=Bd[1]))}Pd(a,d,e,f,Be,k,Ja,t,Za,Ma);return!0},Qd=function(a){var b=Nd(a),c=La(b,!0);(b=!(void 0!=b&&null!=b&&""!=b&&"0"!=b&&"-"!=b&&0<=b.indexOf("://")))||(b=c&&-1<c.host.indexOf("google")&&c.R.contains("q")&&"cse"==c.path);if(b)return!1;if((b=Od(a,c))&&!b[2])return Pd(a,void 0,b[0],void 0,void 0,void 0,"(organic)","organic",b[1],void 0),!0;if(b||!a.get(ac))return!1;a:{for(var b=a.get(Bb),d=Ka(c.host),e=0;e<b.length;++e)if(-1<d.indexOf(b[e])){a=!1;break a}Pd(a,void 0,
|
||||
d,void 0,void 0,void 0,"(referral)","referral",void 0,"/"+c.path);a=!0}return a},Od=function(a,b){for(var c=a.get(zb),d=0;d<c.length;++d){var e=c[d].split(":");if(-1<b.host.indexOf(e[0].toLowerCase())){var f=b.R.get(e[1]);if(f&&(f=K(f),!f&&-1<b.host.indexOf("google.")&&(f="(not provided)"),!e[3]||-1<b.url.indexOf(e[3]))){f||H(151);a:{for(var c=f,d=a.get(Ab),c=I(c).toLowerCase(),Be=0;Be<d.length;++Be)if(c==d[Be]){c=!0;break a}c=!1}return[e[2]||e[0],f,c]}}}return null},Pd=function(a,b,c,d,e,f,Be,k,
|
||||
Ja,t){a.set(ic,b);a.set(nc,c);a.set(S,d);a.set(kc,e);a.set(lc,f);a.set(jc,Be);a.set(oc,k);a.set(pc,Ja);a.set(qc,t)},Md=[jc,ic,S,lc,nc,oc,pc,qc],Rd=function(a,b){function c(a){a=(""+a).split("+").join("%20");return a=a.split(" ").join("%20")}function d(c){var d=""+(a.get(c)||"");c=""+(b[c]||"");return 0<d.length&&d==c}if(d(S)||d(lc))return H(131),!1;for(var e=0;e<Md.length;e++){var f=Md[e],Be=b[f]||"-",f=a.get(f)||"-";if(c(Be)!=c(f))return!0}return!1},Td=new RegExp(/^https?:\/\/(www\.)?google(\.com?)?(\.[a-z]{2}t?)?\/?$/i),
|
||||
jf=/^https?:\/\/(r\.)?search\.yahoo\.com?(\.jp)?\/?[^?]*$/i,rf=/^https?:\/\/(www\.)?bing\.com\/?$/i,Nd=function(a){a=Pa(a.get(Jb),a.get(P));try{if(Td.test(a))return H(136),a+"?q=";if(jf.test(a))return H(150),a+"?p=(not provided)";if(rf.test(a))return a+"?q=(not provided)"}catch(b){H(145)}return a};var Ud,Vd,Wd=function(a){Ud=a.c(S,"");Vd=a.c(kc,"")},Xd=function(a){var b=a.c(S,""),c=a.c(kc,"");b!=Ud&&(-1<c.indexOf("ds")?a.set(mc,void 0):!F(Ud)&&-1<Vd.indexOf("ds")&&a.set(mc,Ud))};var Zd=function(a){Yd(a,J.location.href)?(a.set(Mc,!0),H(12)):a.set(Mc,!1)},Yd=function(a,b){if(!a.get(fb))return!1;var c=La(b,a.get(gb)),d=K(c.R.get("__utma")),e=K(c.R.get("__utmb")),f=K(c.R.get("__utmc")),Be=K(c.R.get("__utmx")),k=K(c.R.get("__utmz")),Ja=K(c.R.get("__utmv")),c=K(c.R.get("__utmk"));if(Yc(""+d+e+f+Be+k+Ja)!=c){d=I(d);e=I(e);f=I(f);Be=I(Be);f=$d(d+e+f+Be,k,Ja,c);if(!f)return!1;k=f[0];Ja=f[1]}if(!bd(a,d,!0))return!1;ed(a,e,!0);id(a,k,!0);gd(a,Ja,!0);ae(a,Be,!0);return!0},ce=function(a,
|
||||
b,c){var d;d=cd(a)||"-";var e=dd(a)||"-",f=""+a.b(O,1)||"-",Be=be(a)||"-",k=hd(a,!1)||"-";a=fd(a,!1)||"-";var Ja=Yc(""+d+e+f+Be+k+a),t=[];t.push("__utma="+d);t.push("__utmb="+e);t.push("__utmc="+f);t.push("__utmx="+Be);t.push("__utmz="+k);t.push("__utmv="+a);t.push("__utmk="+Ja);d=t.join("&");if(!d)return b;e=b.indexOf("#");if(c)return 0>e?b+"#"+d:b+"&"+d;c="";f=b.indexOf("?");0<e&&(c=b.substring(e),b=b.substring(0,e));return 0>f?b+"?"+d+c:b+"&"+d+c},$d=function(a,b,c,d){for(var e=0;3>e;e++){for(var f=
|
||||
0;3>f;f++){if(d==Yc(a+b+c))return H(127),[b,c];var Be=b.replace(/ /g,"%20"),k=c.replace(/ /g,"%20");if(d==Yc(a+Be+k))return H(128),[Be,k];Be=Be.replace(/\+/g,"%20");k=k.replace(/\+/g,"%20");if(d==Yc(a+Be+k))return H(129),[Be,k];try{var Ja=b.match("utmctr=(.*?)(?:\\|utm|$)");if(Ja&&2==Ja.length&&(Be=b.replace(Ja[1],G(I(Ja[1]))),d==Yc(a+Be+c)))return H(139),[Be,c]}catch(t){}b=I(b)}c=I(c)}};var de="|",fe=function(a,b,c,d,e,f,Be,k,Ja){var t=ee(a,b);t||(t={},a.get(Cb).push(t));t.id_=b;t.affiliation_=c;t.total_=d;t.tax_=e;t.shipping_=f;t.city_=Be;t.state_=k;t.country_=Ja;t.items_=t.items_||[];return t},ge=function(a,b,c,d,e,f,Be){a=ee(a,b)||fe(a,b,"",0,0,0,"","","");var k;a:{if(a&&a.items_){k=a.items_;for(var Ja=0;Ja<k.length;Ja++)if(k[Ja].sku_==c){k=k[Ja];break a}}k=null}Ja=k||{};Ja.transId_=b;Ja.sku_=c;Ja.name_=d;Ja.category_=e;Ja.price_=f;Ja.quantity_=Be;k||a.items_.push(Ja);return Ja},
|
||||
ee=function(a,b){for(var c=a.get(Cb),d=0;d<c.length;d++)if(c[d].id_==b)return c[d];return null};var he,ie=function(a){if(!he){var b;b=J.location.hash;var c=W.name,d=/^#?gaso=([^&]*)/;if(c=(b=(b=b&&b.match(d)||c&&c.match(d))?b[1]:K(pd("GASO")))&&b.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))Fd(a,"GASO",""+b,0),M._gasoDomain=a.get(bb),M._gasoCPath=a.get(P),a=c[1],Ia("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(a?"prefix="+a+"&":"")+Ea(),"_gasojs");he=!0}};var ae=function(a,b,c){c&&(b=I(b));c=a.b(O,1);b=b.split(".");2>b.length||!/^\d+$/.test(b[0])||(b[0]=""+c,Fd(a,"__utmx",b.join("."),void 0))},be=function(a,b){var c=$c(a.get(O),pd("__utmx"));"-"==c&&(c="");return b?G(c):c},Ye=function(a){try{var b=La(J.location.href,!1),c=decodeURIComponent(L(b.R.get("utm_referrer")))||"";c&&a.set(Jb,c);var d=decodeURIComponent(K(b.R.get("utm_expid")))||"";d&&(d=d.split(".")[0],a.set(Oc,""+d))}catch(e){H(146)}},l=function(a){var b=W.gaData&&W.gaData.expId;b&&a.set(Oc,
|
||||
""+b)};var ke=function(a,b){var c=Math.min(a.b(Dc,0),100);if(a.b(Q,0)%100>=c)return!1;c=Ze()||$e();if(void 0==c)return!1;var d=c[0];if(void 0==d||Infinity==d||isNaN(d))return!1;0<d?af(c)?b(je(c)):b(je(c.slice(0,1))):Ga(W,"load",function(){ke(a,b)},!1);return!0},me=function(a,b,c,d){var e=new yd;e.f(14,90,b.substring(0,500));e.f(14,91,a.substring(0,150));e.f(14,92,""+le(c));void 0!=d&&e.f(14,93,d.substring(0,500));e.o(14,90,c);return e},af=function(a){for(var b=1;b<a.length;b++)if(isNaN(a[b])||Infinity==
|
||||
a[b]||0>a[b])return!1;return!0},le=function(a){return isNaN(a)||0>a?0:5E3>a?10*Math.floor(a/10):5E4>a?100*Math.floor(a/100):41E5>a?1E3*Math.floor(a/1E3):41E5},je=function(a){for(var b=new yd,c=0;c<a.length;c++)b.f(14,c+1,""+le(a[c])),b.o(14,c+1,a[c]);return b},Ze=function(){var a=W.performance||W.webkitPerformance;if(a=a&&a.timing){var b=a.navigationStart;if(0==b)H(133);else return[a.loadEventStart-b,a.domainLookupEnd-a.domainLookupStart,a.connectEnd-a.connectStart,a.responseStart-a.requestStart,
|
||||
a.responseEnd-a.responseStart,a.fetchStart-b,a.domInteractive-b,a.domContentLoadedEventStart-b]}},$e=function(){if(W.top==W){var a=W.external,b=a&&a.onloadT;a&&!a.isValidLoadTime&&(b=void 0);2147483648<b&&(b=void 0);0<b&&a.setPageReadyTime();return void 0==b?void 0:[b]}};var cf=function(a){if(a.get(Sb))try{var b;a:{var c=pd(a.get(Oe)||"_ga");if(c&&!(1>c.length)){for(var d=[],e=0;e<c.length;e++){var f;var Be=c[e].split("."),k=Be.shift();if(("GA1"==k||"1"==k)&&1<Be.length){var Ja=Be.shift().split("-");1==Ja.length&&(Ja[1]="1");Ja[0]*=1;Ja[1]*=1;f={Ya:Ja,$a:Be.join(".")}}else f=void 0;f&&d.push(f)}if(1==d.length){b=d[0].$a;break a}if(0!=d.length){var t=a.get(Pe)||a.get(bb),d=bf(d,(0==t.indexOf(".")?t.substr(1):t).split(".").length,0);if(1==d.length){b=d[0].$a;break a}var Za=
|
||||
a.get(Qe)||a.get(P);(c=Za)?(1<c.length&&"/"==c.charAt(c.length-1)&&(c=c.substr(0,c.length-1)),0!=c.indexOf("/")&&(c="/"+c),Za=c):Za="/";d=bf(d,"/"==Za?1:Za.split("/").length,1);b=d[0].$a;break a}}b=void 0}if(b){var Ma=(""+b).split(".");2==Ma.length&&/[0-9.]/.test(Ma)&&(H(114),a.set(Q,Ma[0]),a.set(Vb,Ma[1]),a.set(Sb,!1))}}catch(mb){H(115)}},bf=function(a,b,c){for(var d=[],e=[],f=128,Be=0;Be<a.length;Be++){var k=a[Be];k.Ya[c]==b?d.push(k):k.Ya[c]==f?e.push(k):k.Ya[c]<f&&(e=[k],f=k.Ya[c])}return 0<d.length?
|
||||
d:e};var kf=/^gtm\d+$/,hf=function(a){var b;b=!!a.b(Cd,1);b&&(H(140),"page"!=a.get(sc)?a.set(Kc,"",!0):(b=a.c(Lc,""),b||(b=(b=a.c($a,""))&&"~0"!=b?kf.test(b)?"__utmt_"+G(a.c(Wa,"")):"__utmt_"+G(b):"__utmt"),0<pd(b).length?a.set(Kc,"",!0):(X(b,"1",a.c(P,"/"),a.c(bb,""),a.c(Wa,""),6E5),0<pd(b).length&&(a.set(Kc,Ea(),!0),a.set(Yb,1,!0),a.set(Jc,Ne()+"/r/__utm.gif?",!0)))))};var U=function(a,b,c){function d(a){return function(b){if((b=b.get(Nc)[a])&&b.length)for(var c=Te(e,a),d=0;d<b.length;d++)b[d].call(e,c)}}var e=this;this.a=new Zc;this.get=function(a){return this.a.get(a)};this.set=function(a,b,c){this.a.set(a,b,c)};this.set(Wa,b||"UA-XXXXX-X");this.set($a,a||"");this.set(Ya,c||"");this.set(ab,Math.round((new Date).getTime()/1E3));this.set(P,"/");this.set(cb,63072E6);this.set(eb,15768E6);this.set(db,18E5);this.set(fb,!1);this.set(yb,50);this.set(gb,!1);this.set(hb,
|
||||
!0);this.set(ib,!0);this.set(jb,!0);this.set(kb,!0);this.set(lb,!0);this.set(ob,"utm_campaign");this.set(nb,"utm_id");this.set(pb,"gclid");this.set(qb,"utm_source");this.set(rb,"utm_medium");this.set(sb,"utm_term");this.set(tb,"utm_content");this.set(ub,"utm_nooverride");this.set(vb,100);this.set(Dc,1);this.set(Ec,!1);this.set(wb,"/__utm.gif");this.set(xb,1);this.set(Cb,[]);this.set(Fb,[]);this.set(zb,Ld.slice(0));this.set(Ab,[]);this.set(Bb,[]);this.B("auto");this.set(Jb,J.referrer);Ye(this.a);this.set(Nc,
|
||||
{hit:[],load:[]});this.a.g("0",Zd);this.a.g("1",Wd);this.a.g("2",Jd);this.a.g("3",cf);this.a.g("4",Sd);this.a.g("5",Xd);this.a.g("6",Kd);this.a.g("7",d("load"));this.a.g("8",ie);this.a.v("A",kd);this.a.v("B",md);this.a.v("C",Ge);this.a.v("D",Jd);this.a.v("E",jd);this.a.v("F",Tc);this.a.v("G",ne);this.a.v("H",lf);this.a.v("I",Gd);this.a.v("J",nd);this.a.v("K",ud);this.a.v("L",Dd);this.a.v("M",l);this.a.v("N",hf);this.a.v("O",d("hit"));this.a.v("P",oe);this.a.v("Q",pe);0===this.get(ab)&&H(111);this.a.T();
|
||||
this.H=void 0};E=U.prototype;E.m=function(){var a=this.get(Db);a||(a=new yd,this.set(Db,a));return a};E.La=function(a){for(var b in a){var c=a[b];a.hasOwnProperty(b)&&this.set(b,c,!0)}};E.K=function(a){if(this.get(Ec))return!1;var b=this,c=ke(this.a,function(c){b.set(Hb,a,!0);b.ib(c)});this.set(Ec,c);return c};E.Fa=function(a){a&&Ca(a)?(H(13),this.set(Hb,a,!0)):"object"===typeof a&&null!==a&&this.La(a);this.H=a=this.get(Hb);this.a.j("page");this.K(a)};
|
||||
E.F=function(a,b,c,d,e){if(""==a||!wd(a)||""==b||!wd(b)||void 0!=c&&!wd(c)||void 0!=d&&!xd(d))return!1;this.set(wc,a,!0);this.set(xc,b,!0);this.set(yc,c,!0);this.set(zc,d,!0);this.set(vc,!!e,!0);this.a.j("event");return!0};E.Ha=function(a,b,c,d,e){var f=this.a.b(Dc,0);1*e===e&&(f=e);if(this.a.b(Q,0)%100>=f)return!1;c=1*(""+c);if(""==a||!wd(a)||""==b||!wd(b)||!xd(c)||isNaN(c)||0>c||0>f||100<f||void 0!=d&&(""==d||!wd(d)))return!1;this.ib(me(a,b,c,d));return!0};
|
||||
E.Ga=function(a,b,c,d){if(!a||!b)return!1;this.set(Ac,a,!0);this.set(Bc,b,!0);this.set(Cc,c||J.location.href,!0);d&&this.set(Hb,d,!0);this.a.j("social");return!0};E.Ea=function(){this.set(Dc,10);this.K(this.H)};E.Ia=function(){this.a.j("trans")};E.ib=function(a){this.set(Eb,a,!0);this.a.j("event")};E.ia=function(a){this.initData();var b=this;return{_trackEvent:function(c,d,e){H(91);b.F(a,c,d,e)}}};E.ma=function(a){return this.get(a)};
|
||||
E.xa=function(a,b){if(a)if(Ca(a))this.set(a,b);else if("object"==typeof a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c])};E.addEventListener=function(a,b){var c=this.get(Nc)[a];c&&c.push(b)};E.removeEventListener=function(a,b){for(var c=this.get(Nc)[a],d=0;c&&d<c.length;d++)if(c[d]==b){c.splice(d,1);break}};E.qa=function(){return"5.6.7"};E.B=function(a){this.get(hb);a="auto"==a?Ka(J.domain):a&&"-"!=a&&"none"!=a?a.toLowerCase():"";this.set(bb,a)};E.va=function(a){this.set(hb,!!a)};
|
||||
E.na=function(a,b){return ce(this.a,a,b)};E.link=function(a,b){if(this.a.get(fb)&&a){var c=ce(this.a,a,b);J.location.href=c}};E.ua=function(a,b){this.a.get(fb)&&a&&a.action&&(a.action=ce(this.a,a.action,b))};
|
||||
E.za=function(){this.initData();var a=this.a,b=J.getElementById?J.getElementById("utmtrans"):J.utmform&&J.utmform.utmtrans?J.utmform.utmtrans:null;if(b&&b.value){a.set(Cb,[]);for(var b=b.value.split("UTM:"),c=0;c<b.length;c++){b[c]=Da(b[c]);for(var d=b[c].split(de),e=0;e<d.length;e++)d[e]=Da(d[e]);"T"==d[0]?fe(a,d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8]):"I"==d[0]&&ge(a,d[1],d[2],d[3],d[4],d[5],d[6])}}};E.$=function(a,b,c,d,e,f,Be,k){return fe(this.a,a,b,c,d,e,f,Be,k)};
|
||||
E.Y=function(a,b,c,d,e,f){return ge(this.a,a,b,c,d,e,f)};E.Aa=function(a){de=a||"|"};E.ea=function(){this.set(Cb,[])};E.wa=function(a,b,c,d){var e=this.a;if(0>=a||a>e.get(yb))a=!1;else if(!b||!c||128<b.length+c.length)a=!1;else{1!=d&&2!=d&&(d=3);var f={};f.name=b;f.value=c;f.scope=d;e.get(Fb)[a]=f;a=!0}a&&this.a.gb();return a};E.ka=function(a){this.a.get(Fb)[a]=void 0;this.a.gb()};E.ra=function(a){return(a=this.a.get(Fb)[a])&&1==a.scope?a.value:void 0};
|
||||
E.Ca=function(a,b,c){12==a&&1==b?this.set(pf,c):this.m().f(a,b,c)};E.Da=function(a,b,c){this.m().o(a,b,c)};E.sa=function(a,b){return this.m().getKey(a,b)};E.ta=function(a,b){return this.m().N(a,b)};E.fa=function(a){this.m().L(a)};E.ga=function(a){this.m().M(a)};E.ja=function(){return new yd};E.W=function(a){a&&this.get(Ab).push(a.toLowerCase())};E.ba=function(){this.set(Ab,[])};E.X=function(a){a&&this.get(Bb).push(a.toLowerCase())};E.ca=function(){this.set(Bb,[])};
|
||||
E.Z=function(a,b,c,d,e){if(a&&b){a=[a,b.toLowerCase()].join(":");if(d||e)a=[a,d,e].join(":");d=this.get(zb);d.splice(c?0:d.length,0,a)}};E.da=function(){this.set(zb,[])};E.ha=function(a){this.a.load();var b=this.get(P),c=be(this.a);this.set(P,a);this.a.gb();ae(this.a,c);this.set(P,b)};E.ya=function(a,b){if(0<a&&5>=a&&Ca(b)&&""!=b){var c=this.get(Fc)||[];c[a]=b;this.set(Fc,c)}};E.V=function(a){a=""+a;if(a.match(/^[A-Za-z0-9]{1,5}$/)){var b=this.get(Ic)||[];b.push(a);this.set(Ic,b)}};E.initData=function(){this.a.load()};
|
||||
E.Ba=function(a){a&&""!=a&&(this.set(Tb,a),this.a.j("var"))};var ne=function(a){"trans"!==a.get(sc)&&500<=a.b(cc,0)&&a.stopPropagation();if("event"===a.get(sc)){var b=(new Date).getTime(),c=a.b(dc,0),d=a.b(Zb,0),c=Math.floor((b-(c!=d?c:1E3*c))/1E3*1);0<c&&(a.set(dc,b),a.set(R,Math.min(10,a.b(R,0)+c)));0>=a.b(R,0)&&a.stopPropagation()}},pe=function(a){"event"===a.get(sc)&&a.set(R,Math.max(0,a.b(R,10)-1))};var qe=function(){var a=[];this.add=function(b,c,d){d&&(c=G(""+c));a.push(b+"="+c)};this.toString=function(){return a.join("&")}},re=function(a,b){(b||2!=a.get(xb))&&a.Za(cc)},se=function(a,b){b.add("utmwv","5.6.7");b.add("utms",a.get(cc));b.add("utmn",Ea());var c=J.location.hostname;F(c)||b.add("utmhn",c,!0);c=a.get(vb);100!=c&&b.add("utmsp",c,!0)},te=function(a,b){b.add("utmht",(new Date).getTime());b.add("utmac",Da(a.get(Wa)));a.get(Oc)&&b.add("utmxkey",a.get(Oc),!0);a.get(vc)&&b.add("utmni",1);
|
||||
a.get(of)&&b.add("utmgtm",a.get(of),!0);var c=a.get(Ic);c&&0<c.length&&b.add("utmdid",c.join("."));ff(a,b);!1!==a.get(Xa)&&(a.get(Xa)||M.w)&&b.add("aip",1);void 0!==a.get(Kc)&&b.add("utmjid",a.c(Kc,""),!0);a.b(Yb,0)&&b.add("utmredir",a.b(Yb,0),!0);M.bb||(M.bb=a.get(Wa));(1<M.ab()||M.bb!=a.get(Wa))&&b.add("utmmt",1);b.add("utmu",od.encode())},ue=function(a,b){for(var c=a.get(Fc)||[],d=[],e=1;e<c.length;e++)c[e]&&d.push(e+":"+G(c[e].replace(/%/g,"%25").replace(/:/g,"%3A").replace(/,/g,"%2C")));d.length&&
|
||||
b.add("utmpg",d.join(","))},ff=function(a,b){function c(a,b){b&&d.push(a+"="+b+";")}var d=[];c("__utma",cd(a));c("__utmz",hd(a,!1));c("__utmv",fd(a,!0));c("__utmx",be(a));b.add("utmcc",d.join("+"),!0)},ve=function(a,b){a.get(ib)&&(b.add("utmcs",a.get(Qb),!0),b.add("utmsr",a.get(Lb)),a.get(Rb)&&b.add("utmvp",a.get(Rb)),b.add("utmsc",a.get(Mb)),b.add("utmul",a.get(Pb)),b.add("utmje",a.get(Nb)),b.add("utmfl",a.get(Ob),!0))},we=function(a,b){a.get(lb)&&a.get(Ib)&&b.add("utmdt",a.get(Ib),!0);b.add("utmhid",
|
||||
a.get(Kb));b.add("utmr",Pa(a.get(Jb),a.get(P)),!0);b.add("utmp",G(a.get(Hb),!0),!0)},xe=function(a,b){for(var c=a.get(Db),d=a.get(Eb),e=a.get(Fb)||[],f=0;f<e.length;f++){var Be=e[f];Be&&(c||(c=new yd),c.f(8,f,Be.name),c.f(9,f,Be.value),3!=Be.scope&&c.f(11,f,""+Be.scope))}F(a.get(wc))||F(a.get(xc),!0)||(c||(c=new yd),c.f(5,1,a.get(wc)),c.f(5,2,a.get(xc)),e=a.get(yc),void 0!=e&&c.f(5,3,e),e=a.get(zc),void 0!=e&&c.o(5,1,e));F(a.get(pf))||(c||(c=new yd),c.f(12,1,a.get(pf)));c?b.add("utme",c.Qa(d),!0):
|
||||
d&&b.add("utme",d.A(),!0)},ye=function(a,b,c){var d=new qe;re(a,c);se(a,d);d.add("utmt","tran");d.add("utmtid",b.id_,!0);d.add("utmtst",b.affiliation_,!0);d.add("utmtto",b.total_,!0);d.add("utmttx",b.tax_,!0);d.add("utmtsp",b.shipping_,!0);d.add("utmtci",b.city_,!0);d.add("utmtrg",b.state_,!0);d.add("utmtco",b.country_,!0);xe(a,d);ve(a,d);we(a,d);(b=a.get(Gb))&&d.add("utmcu",b,!0);c||(ue(a,d),te(a,d));return d.toString()},ze=function(a,b,c){var d=new qe;re(a,c);se(a,d);d.add("utmt","item");d.add("utmtid",
|
||||
b.transId_,!0);d.add("utmipc",b.sku_,!0);d.add("utmipn",b.name_,!0);d.add("utmiva",b.category_,!0);d.add("utmipr",b.price_,!0);d.add("utmiqt",b.quantity_,!0);xe(a,d);ve(a,d);we(a,d);(b=a.get(Gb))&&d.add("utmcu",b,!0);c||(ue(a,d),te(a,d));return d.toString()},Ae=function(a,b){var c=a.get(sc);if("page"==c)c=new qe,re(a,b),se(a,c),xe(a,c),ve(a,c),we(a,c),b||(ue(a,c),te(a,c)),c=[c.toString()];else if("event"==c)c=new qe,re(a,b),se(a,c),c.add("utmt","event"),xe(a,c),ve(a,c),we(a,c),b||(ue(a,c),te(a,c)),
|
||||
c=[c.toString()];else if("var"==c)c=new qe,re(a,b),se(a,c),c.add("utmt","var"),!b&&te(a,c),c=[c.toString()];else if("trans"==c)for(var c=[],d=a.get(Cb),e=0;e<d.length;++e){c.push(ye(a,d[e],b));for(var f=d[e].items_,Be=0;Be<f.length;++Be)c.push(ze(a,f[Be],b))}else"social"==c?b?c=[]:(c=new qe,re(a,b),se(a,c),c.add("utmt","social"),c.add("utmsn",a.get(Ac),!0),c.add("utmsa",a.get(Bc),!0),c.add("utmsid",a.get(Cc),!0),xe(a,c),ve(a,c),we(a,c),ue(a,c),te(a,c),c=[c.toString()]):"feedback"==c?b?c=[]:(c=new qe,
|
||||
re(a,b),se(a,c),c.add("utmt","feedback"),c.add("utmfbid",a.get(Gc),!0),c.add("utmfbpr",a.get(Hc),!0),xe(a,c),ve(a,c),we(a,c),ue(a,c),te(a,c),c=[c.toString()]):c=[];return c},oe=function(a){var b,c=a.get(xb),d=a.get(uc),e=d&&d.Ua,f=0;if(0==c||2==c){var Be=a.get(wb)+"?";b=Ae(a,!0);for(var k=0,Ja=b.length;k<Ja;k++)Sa(b[k],e,Be,!0),f++}if(1==c||2==c)for(b=Ae(a),a=a.c(Jc,""),k=0,Ja=b.length;k<Ja;k++)try{Sa(b[k],e,a),f++}catch(t){t&&Ra(t.name,void 0,t.message)}d&&(d.fb=f)};var Ne=function(){return"https:"==J.location.protocol||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com"},Ce=function(a){this.name="len";this.message=a+"-8192"},De=function(a){this.name="ff2post";this.message=a+"-2036"},Sa=function(a,b,c,d){b=b||Fa;if(d||2036>=a.length)gf(a,b,c);else if(8192>=a.length){if(0<=W.navigator.userAgent.indexOf("Firefox")&&![].reduce)throw new De(a.length);df(a,b)||ef(a,b)||Ee(a,b)||b()}else throw new Ce(a.length);},gf=function(a,b,c){c=c||Ne()+"/__utm.gif?";
|
||||
var d=new Image(1,1);d.src=c+a;d.onload=function(){d.onload=null;d.onerror=null;b()};d.onerror=function(){d.onload=null;d.onerror=null;b()}},ef=function(a,b){if(0!=Ne().indexOf(J.location.protocol))return!1;var c;c=W.XDomainRequest;if(!c)return!1;c=new c;c.open("POST",Ne()+"/p/__utm.gif");c.onerror=function(){b()};c.onload=b;c.send(a);return!0},df=function(a,b){var c=W.XMLHttpRequest;if(!c)return!1;var d=new c;if(!("withCredentials"in d))return!1;d.open("POST",Ne()+"/p/__utm.gif",!0);d.withCredentials=
|
||||
!0;d.setRequestHeader("Content-Type","text/plain");d.onreadystatechange=function(){4==d.readyState&&(b(),d=null)};d.send(a);return!0},Ee=function(a,b){if(!J.body)return We(function(){Ee(a,b)},100),!0;a=encodeURIComponent(a);try{var c=J.createElement('<iframe name="'+a+'"></iframe>')}catch(d){c=J.createElement("iframe"),c.name=a}c.height="0";c.width="0";c.style.display="none";c.style.visibility="hidden";var e=Ne()+"/u/post_iframe.html";Ga(W,"beforeunload",function(){c.src="";c.parentNode&&c.parentNode.removeChild(c)});
|
||||
setTimeout(b,1E3);J.body.appendChild(c);c.src=e;return!0};var qf=function(){this.G=this.w=!1;0==Ea()%1E4&&(H(142),this.G=!0);this.C={};this.D=[];this.U=0;this.S=[["www.google-analytics.com","","/plugins/"]];this._gasoCPath=this._gasoDomain=this.bb=void 0;Re();Se()};E=qf.prototype;E.oa=function(a,b){return this.hb(a,void 0,b)};E.hb=function(a,b,c){b&&H(23);c&&H(67);void 0==b&&(b="~"+M.U++);a=new U(b,a,c);M.C[b]=a;M.D.push(a);return a};E.u=function(a){a=a||"";return M.C[a]||M.hb(void 0,a)};E.pa=function(){return M.D.slice(0)};E.ab=function(){return M.D.length};
|
||||
E.aa=function(){this.w=!0};E.la=function(){this.G=!0};var Fe=function(a){if("prerender"==J.visibilityState)return!1;a();return!0};var M=new qf;var Ha=W._gat;Ha&&Ba(Ha._getTracker)?M=Ha:W._gat=M;var Z=new Y;(function(a){if(!Fe(a)){H(123);var b=!1,c=function(){if(!b&&Fe(a)){b=!0;var d=J,e=c;d.removeEventListener?d.removeEventListener("visibilitychange",e,!1):d.detachEvent&&d.detachEvent("onvisibilitychange",e)}};Ga(J,"visibilitychange",c)}})(function(){var a=W._gaq,b=!1;if(a&&Ba(a.push)&&(b="[object Array]"==Object.prototype.toString.call(Object(a)),!b)){Z=a;return}W._gaq=Z;b&&Z.push.apply(Z,a)});function Yc(a){var b=1,c=0,d;if(a)for(b=0,d=a.length-1;0<=d;d--)c=a.charCodeAt(d),b=(b<<6&268435455)+c+(c<<14),c=b&266338304,b=0!=c?b^c>>21:b;return b};})();
|
||||
90
index_files/style.css
Normal file
90
index_files/style.css
Normal file
@ -0,0 +1,90 @@
|
||||
html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: white;
|
||||
padding: 1.5em 5em;
|
||||
font-family: 'Open Sans', verdana;
|
||||
font-size: 14px;
|
||||
color: black;
|
||||
}
|
||||
h1 {
|
||||
font-weight: 300;
|
||||
font-size: 270%;
|
||||
color: black;
|
||||
margin-bottom: 0;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
h1 span {
|
||||
color: #888;
|
||||
}
|
||||
h1 + p {
|
||||
font-size: 130%;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
h2 {
|
||||
font-weight: 400;
|
||||
font-size: 230%;
|
||||
padding-top: 0.3em;
|
||||
color: black;
|
||||
margin-top: 2.6em;
|
||||
}
|
||||
hr + h2 {
|
||||
margin-top: 2em;
|
||||
}
|
||||
.logo {
|
||||
background-image: url('xrdp_logo_nodarkfill-256x75.png');
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 256px;
|
||||
padding-bottom: 6em;
|
||||
}
|
||||
.mytbl {
|
||||
display: table;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.myrow {
|
||||
display: table-row;
|
||||
}
|
||||
.prop {
|
||||
display: table-cell;
|
||||
text-align: right;
|
||||
padding: 0.2em 0.6em;
|
||||
color: black;
|
||||
white-space: nowrap;
|
||||
}
|
||||
hr {
|
||||
padding: 0;
|
||||
margin: 3em 0 3em 0;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
background-color: #ddd;
|
||||
background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
|
||||
background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
|
||||
background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
|
||||
background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
|
||||
}
|
||||
.prop span {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
padding: 4px 0.7em;
|
||||
}
|
||||
.value {
|
||||
display: table-cell;
|
||||
padding: 0.2em 0.5em;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #446;
|
||||
color: #FF9106;
|
||||
padding: 2px 0.4em;
|
||||
}
|
||||
a:hover {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
}
|
||||
BIN
index_files/xrdp_logo_nodarkfill-256x75.png
Normal file
BIN
index_files/xrdp_logo_nodarkfill-256x75.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@ -1,103 +0,0 @@
|
||||
EXTRA_DIST = \
|
||||
keymap-names.txt \
|
||||
xrdp-sesman.service.in \
|
||||
xrdp.service.in
|
||||
|
||||
#
|
||||
# substitute directories in service file
|
||||
#
|
||||
CLEANFILES= \
|
||||
xrdp-sesman.service \
|
||||
xrdp.service
|
||||
|
||||
SUBST_VARS = sed \
|
||||
-e 's|@sbindir[@]|$(sbindir)|g' \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@localstatedir[@]|$(localstatedir)|g'
|
||||
|
||||
subst_verbose = $(subst_verbose_@AM_V@)
|
||||
subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@)
|
||||
subst_verbose_0 = @echo " SUBST $@";
|
||||
|
||||
SUFFIXES = .in
|
||||
.in:
|
||||
$(subst_verbose)$(SUBST_VARS) $< > $@
|
||||
|
||||
#
|
||||
# files for all platforms
|
||||
#
|
||||
startscriptdir=$(sysconfdir)/xrdp
|
||||
|
||||
dist_startscript_DATA = \
|
||||
km-00000406.ini \
|
||||
km-00000407.ini \
|
||||
km-00000409.ini \
|
||||
km-0000040a.ini \
|
||||
km-0000040b.ini \
|
||||
km-0000040c.ini \
|
||||
km-00000410.ini \
|
||||
km-00000411.ini \
|
||||
km-00000412.ini \
|
||||
km-00000414.ini \
|
||||
km-00000415.ini \
|
||||
km-00000416.ini \
|
||||
km-00000419.ini \
|
||||
km-0000041d.ini \
|
||||
km-00000807.ini \
|
||||
km-00000809.ini \
|
||||
km-0000080a.ini \
|
||||
km-0000080c.ini \
|
||||
km-00000813.ini \
|
||||
km-00000816.ini \
|
||||
km-0000100c.ini \
|
||||
km-00010409.ini \
|
||||
km-19360409.ini
|
||||
|
||||
#
|
||||
# platform specific files
|
||||
#
|
||||
SUBDIRS =
|
||||
if LINUX
|
||||
SUBDIRS += \
|
||||
pam.d \
|
||||
pulse
|
||||
if HAVE_SYSTEMD
|
||||
systemdsystemunit_DATA = \
|
||||
xrdp-sesman.service \
|
||||
xrdp.service
|
||||
else
|
||||
SUBDIRS += \
|
||||
default \
|
||||
init.d
|
||||
endif # HAVE_SYSTEMD
|
||||
endif # LINUX
|
||||
|
||||
if FREEBSD
|
||||
SUBDIRS += \
|
||||
pam.d \
|
||||
rc.d \
|
||||
pulse
|
||||
endif
|
||||
|
||||
if MACOS
|
||||
SUBDIRS += pam.d
|
||||
endif
|
||||
|
||||
#
|
||||
# install-data-hook for each platform
|
||||
# TODO: subst these directories as well as service files
|
||||
#
|
||||
if LINUX
|
||||
# must be tab below
|
||||
install-data-hook:
|
||||
if [ -f $(DESTDIR)$(sysconfdir)/init.d/xrdp ]; then \
|
||||
sed -i 's|__BASE__|$(prefix)|' $(DESTDIR)$(sysconfdir)/init.d/xrdp; \
|
||||
fi
|
||||
endif
|
||||
|
||||
if FREEBSD
|
||||
# must be tab below
|
||||
install-data-hook:
|
||||
sed -i '' 's|%%PREFIX%%|$(prefix)|g' $(DESTDIR)$(sysconfdir)/rc.d/xrdp \
|
||||
$(DESTDIR)$(sysconfdir)/rc.d/xrdp-sesman
|
||||
endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user