├── .cirrus.yml ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── config.yml └── workflows │ ├── build.yml │ ├── coverity.yml │ └── release-tarball.yml ├── .gitignore ├── .gitmodules ├── COPYING ├── Makefile.am ├── NEWS.md ├── README.md ├── SECURITY.md ├── astyle_config.as ├── bootstrap ├── coding_style.md ├── common ├── Makefile.am ├── arch.h ├── base64.c ├── base64.h ├── 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 ├── ms-erref.h ├── ms-fscc.h ├── ms-rdpbcgr.h ├── ms-rdpeclip.h ├── ms-rdpedisp.h ├── ms-rdpefs.h ├── ms-rdpegdi.h ├── ms-rdpele.h ├── ms-rdperp.h ├── ms-smb2.h ├── os_calls.c ├── os_calls.h ├── parse.c ├── parse.h ├── pixman-region.c ├── pixman-region.h ├── pixman-region16.c ├── rail.h ├── scancode.c ├── scancode.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 ├── xrdp_client_info.h ├── xrdp_constants.h ├── xrdp_rail.h ├── xrdp_scancode_defs.h └── xrdp_sockets.h ├── configure.ac ├── docs ├── Makefile.am └── man │ ├── .gitignore │ ├── Makefile.am │ ├── gfx.toml.5.in │ ├── sesman.ini.5.in │ ├── xrdp-chansrv.8.in │ ├── xrdp-dis.1.in │ ├── xrdp-dumpfv1.8.in │ ├── xrdp-genkeymap.8.in │ ├── xrdp-keygen.8.in │ ├── xrdp-km.toml.5.in │ ├── xrdp-mkfv1.8.in │ ├── xrdp-sesadmin.8.in │ ├── xrdp-sesman.8.in │ ├── xrdp-sesrun.8.in │ ├── xrdp.8.in │ └── xrdp.ini.5.in ├── fontutils ├── Makefile.am ├── README_fv1.txt ├── dumpfv1.c ├── fv1.c ├── fv1.h ├── mkfv1.c └── windows │ ├── .gitignore │ ├── Makefile │ └── fontdump.c ├── genkeymap ├── Makefile.am ├── dump-keymaps.sh ├── genkeymap.c └── readme.txt ├── instfiles ├── Makefile.am ├── default │ ├── Makefile.am │ └── xrdp ├── init.d │ ├── Makefile.am │ └── xrdp ├── keymap-names.txt ├── km-00000405.toml ├── km-00000406.toml ├── km-00000407.ini ├── km-00000407.toml ├── km-00000409.toml ├── km-0000040a.toml ├── km-0000040b.toml ├── km-0000040c.toml ├── km-0000040e.toml ├── km-00000410.ini ├── km-00000410.toml ├── km-00000411.ini ├── km-00000411.toml ├── km-00000412.toml ├── km-00000414.toml ├── km-00000415.ini ├── km-00000415.toml ├── km-00000416.toml ├── km-00000419.ini ├── km-00000419.toml ├── km-0000041d.ini ├── km-0000041d.toml ├── km-00000426.toml ├── km-00000807.toml ├── km-00000809.ini ├── km-00000809.toml ├── km-0000080a.toml ├── km-0000080c.toml ├── km-00000813.toml ├── km-00000816.ini ├── km-00000816.toml ├── km-0000100c.toml ├── km-00010409.ini ├── km-00010409.toml ├── km-00010426.toml ├── km-00060409.toml ├── km-19360409.ini ├── km-19360409.toml ├── pam.d │ ├── Makefile.am │ ├── mkpamrules │ ├── xrdp-sesman.arch │ ├── xrdp-sesman.debian │ ├── xrdp-sesman.freebsd │ ├── xrdp-sesman.macos │ ├── xrdp-sesman.redhat │ ├── xrdp-sesman.suse │ ├── xrdp-sesman.system │ └── xrdp-sesman.unix ├── pulse │ ├── Makefile.am │ └── default.pa ├── rc.d │ ├── Makefile.am │ ├── xrdp │ └── xrdp-sesman ├── xrdp-sesman.service.in └── xrdp.service.in ├── keygen ├── Makefile.am ├── keygen.c └── openssl.conf ├── libipm ├── Doxyfile ├── Makefile.am ├── eicp.c ├── eicp.h ├── ercp.c ├── ercp.h ├── libipm.c ├── libipm.h ├── libipm_facilities.h ├── libipm_private.h ├── libipm_recv.c ├── libipm_send.c ├── scp.c ├── scp.h ├── scp_application_types.c ├── scp_application_types.h ├── scp_sync.c └── scp_sync.h ├── libxrdp ├── Makefile.am ├── libxrdp.c ├── libxrdp.h ├── libxrdpinc.h ├── xrdp_bitmap32_compress.c ├── xrdp_bitmap_compress.c ├── xrdp_caps.c ├── xrdp_channel.c ├── xrdp_channel.h ├── xrdp_fastpath.c ├── xrdp_iso.c ├── xrdp_jpeg_compress.c ├── xrdp_mcs.c ├── xrdp_mppc_enc.c ├── xrdp_orders.c ├── xrdp_orders_rail.c ├── xrdp_orders_rail.h ├── xrdp_rdp.c ├── xrdp_sec.c └── xrdp_surface.c ├── m4 ├── .gitignore ├── ax_append_compile_flags.m4 ├── ax_append_flag.m4 ├── ax_cflags_warn_all.m4 ├── ax_check_compile_flag.m4 ├── ax_gcc_func_attribute.m4 ├── ax_require_defined.m4 ├── ax_type_socklen_t.m4 ├── axrdp.m4 └── pkg.m4 ├── mc ├── Makefile.am ├── mc.c └── mc.h ├── neutrinordp ├── Makefile.am ├── xrdp-color.c ├── xrdp-color.h ├── xrdp-neutrinordp.c └── xrdp-neutrinordp.h ├── pkgconfig ├── .gitignore ├── Makefile.am ├── xrdp-uninstalled.pc.in └── xrdp.pc.in ├── scripts ├── install_astyle.sh ├── install_astyle_dependencies_with_apt.sh ├── install_cppcheck.sh ├── install_cppcheck_dependencies_with_apt.sh ├── install_xrdp_build_dependencies_with_apt.sh ├── run_astyle.sh └── run_cppcheck.sh ├── sesman ├── Doxyfile ├── Makefile.am ├── chansrv │ ├── Makefile.am │ ├── audin.c │ ├── audin.h │ ├── chansrv.c │ ├── chansrv.h │ ├── chansrv_common.c │ ├── chansrv_common.h │ ├── chansrv_config.c │ ├── chansrv_config.h │ ├── chansrv_fuse.c │ ├── chansrv_fuse.h │ ├── chansrv_xfs.c │ ├── chansrv_xfs.h │ ├── clipboard-notes.txt │ ├── clipboard.c │ ├── clipboard.h │ ├── clipboard_common.h │ ├── clipboard_file.c │ ├── clipboard_file.h │ ├── devredir.c │ ├── devredir.h │ ├── input.h │ ├── input_ibus.c │ ├── irp.c │ ├── irp.h │ ├── pcsc │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── dumps │ │ │ ├── scard-begin-tranaction.txt │ │ │ ├── scard-connect.txt │ │ │ ├── scard-control.txt │ │ │ ├── scard-disconnect.txt │ │ │ ├── scard-end-tranaction.txt │ │ │ ├── scard-establish-context.txt │ │ │ ├── scard-get-status-change.txt │ │ │ ├── scard-list-readers.txt │ │ │ ├── scard-release-context.txt │ │ │ ├── scard-status.txt │ │ │ └── scard-transmit.txt │ │ ├── wrapper │ │ │ ├── Makefile │ │ │ ├── winscard-func-names.txt │ │ │ ├── winscard-funcs.h │ │ │ ├── winscard.c │ │ │ └── winscard.def │ │ └── xrdp_pcsc.c │ ├── rail.c │ ├── rail.h │ ├── smartcard.c │ ├── smartcard.h │ ├── smartcard_pcsc.c │ ├── smartcard_pcsc.h │ ├── sound.c │ ├── sound.h │ ├── wave-format-server.txt │ ├── xcommon.c │ └── xcommon.h ├── eicp_process.c ├── eicp_process.h ├── ercp_process.c ├── ercp_process.h ├── libsesman │ ├── Makefile.am │ ├── sesman_access.c │ ├── sesman_access.h │ ├── sesman_auth.h │ ├── sesman_clip_restrict.c │ ├── sesman_clip_restrict.h │ ├── sesman_config.c │ ├── sesman_config.h │ ├── verify_user.c │ ├── verify_user_bsd.c │ ├── verify_user_kerberos.c │ ├── verify_user_pam.c │ └── verify_user_pam_userpass.c ├── lock_uds.c ├── lock_uds.h ├── notes.txt ├── pre_session_list.c ├── pre_session_list.h ├── reconnectwm.sh ├── scp_process.c ├── scp_process.h ├── sesexec │ ├── Makefile.am │ ├── eicp_server.c │ ├── eicp_server.h │ ├── env.c │ ├── env.h │ ├── ercp_server.c │ ├── ercp_server.h │ ├── login_info.c │ ├── login_info.h │ ├── sesexec.c │ ├── sesexec.h │ ├── sesexec_discover.c │ ├── sesexec_discover.h │ ├── session.c │ ├── session.h │ ├── sessionrecord.c │ ├── sessionrecord.h │ ├── xauth.c │ ├── xauth.h │ ├── xwait.c │ └── xwait.h ├── sesexec_control.c ├── sesexec_control.h ├── sesman.c ├── sesman.h ├── sesman.ini.in ├── sesman_restart.c ├── sesman_restart.h ├── session_list.c ├── session_list.h ├── sig.c ├── sig.h ├── startwm.sh └── tools │ ├── Makefile.am │ ├── authmod.c │ ├── authtest.c │ ├── dis.c │ ├── sesadmin.c │ ├── sesrun.c │ └── xcon.c ├── tests ├── Makefile.am ├── common │ ├── Makefile.am │ ├── UTF-8-test.txt │ ├── test_base64.c │ ├── test_common.h │ ├── test_common_main.c │ ├── test_fifo_calls.c │ ├── test_guid.c │ ├── test_list16_calls.c │ ├── test_list_calls.c │ ├── test_os_calls.c │ ├── test_os_calls_signals.c │ ├── test_parse.c │ ├── test_scancode.c │ ├── test_ssl_calls.c │ ├── test_string_calls.c │ └── test_string_calls_unicode.c ├── libipm │ ├── Makefile.am │ ├── test_libipm.h │ ├── test_libipm_main.c │ ├── test_libipm_recv_calls.c │ └── test_libipm_send_calls.c ├── libxrdp │ ├── Makefile.am │ ├── test_libxrdp.h │ ├── test_libxrdp_main.c │ ├── test_libxrdp_process_monitor_stream.c │ └── test_xrdp_sec_process_mcs_data_monitors.c ├── memtest │ ├── Makefile.am │ ├── libmem.c │ ├── libmem.h │ └── memtest.c ├── readme.txt └── xrdp │ ├── Makefile.am │ ├── gfx │ ├── gfx.toml │ ├── gfx_codec_h264_only.toml │ ├── gfx_codec_h264_preferred.toml │ ├── gfx_codec_order_undefined.toml │ ├── gfx_codec_rfx_only.toml │ ├── gfx_codec_rfx_preferred.toml │ ├── gfx_codec_rfx_preferred_odd.toml │ ├── gfx_h264_encoder_invalid.toml │ ├── gfx_h264_encoder_openh264.toml │ ├── gfx_h264_encoder_undefined.toml │ ├── gfx_h264_encoder_x264.toml │ └── gfx_missing_h264.toml │ ├── test1.jpg │ ├── test_24bit.bmp │ ├── test_4bit.bmp │ ├── test_8bit.bmp │ ├── test_alpha_blend.png │ ├── test_bitmap_load.c │ ├── test_not4_24bit.bmp │ ├── test_not4_4bit.bmp │ ├── test_not4_8bit.bmp │ ├── test_tconfig.c │ ├── test_xrdp.h │ ├── test_xrdp_egfx.c │ ├── test_xrdp_keymap.c │ ├── test_xrdp_main.c │ └── test_xrdp_region.c ├── third_party ├── COPYING-THIRD-PARTY ├── Makefile.am ├── Makefile.copying ├── README.md ├── copying_third_party.h └── tomlc99 │ ├── .editorconfig │ ├── .gitignore │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── libtoml.pc.sample │ ├── sample.toml │ ├── stdex │ ├── .gitignore │ ├── RUN.sh │ ├── arr1.toml │ ├── arr1.toml.res │ ├── arr2.toml │ ├── arr2.toml.res │ ├── arrtab1.toml │ ├── arrtab1.toml.res │ ├── arrtab2.toml │ ├── arrtab2.toml.res │ ├── arrtab3.toml │ ├── arrtab3.toml.res │ ├── arrtab4.toml │ ├── arrtab4.toml.res │ ├── arrtab5.toml │ ├── arrtab5.toml.res │ ├── arrtab6.toml │ ├── arrtab6.toml.res │ ├── arrtab7.toml │ ├── arrtab7.toml.res │ ├── bool1.toml │ ├── bool1.toml.res │ ├── comment.toml │ ├── comment.toml.res │ ├── float1.toml │ ├── float1.toml.res │ ├── float2.toml │ ├── float2.toml.res │ ├── float3.toml │ ├── float3.toml.res │ ├── float4.toml │ ├── float4.toml.res │ ├── float5.toml │ ├── float5.toml.res │ ├── float6.toml │ ├── float6.toml.res │ ├── inlinetab1.toml │ ├── inlinetab1.toml.res │ ├── inlinetab2.toml │ ├── inlinetab2.toml.res │ ├── inlinetab3.toml │ ├── inlinetab3.toml.res │ ├── int0.toml │ ├── int0.toml.res │ ├── int1.toml │ ├── int1.toml.res │ ├── keys00.toml │ ├── keys00.toml.res │ ├── keys01.toml │ ├── keys01.toml.res │ ├── keys02.toml │ ├── keys02.toml.res │ ├── keys03.toml │ ├── keys03.toml.res │ ├── keys04.toml │ ├── keys04.toml.res │ ├── keys05.toml │ ├── keys05.toml.res │ ├── keys06.toml │ ├── keys06.toml.res │ ├── keys07.toml │ ├── keys07.toml.res │ ├── keys08.toml │ ├── keys08.toml.res │ ├── keys09.toml │ ├── keys09.toml.res │ ├── keys10.toml │ ├── keys10.toml.res │ ├── keys11.toml │ ├── keys11.toml.res │ ├── keys12.toml │ ├── keys12.toml.res │ ├── kvpair0.toml │ ├── kvpair0.toml.res │ ├── kvpair1.toml │ ├── kvpair1.toml.res │ ├── kvpair2.toml │ ├── kvpair2.toml.res │ ├── string0.toml │ ├── string0.toml.res │ ├── string1.toml │ ├── string1.toml.res │ ├── string3.toml │ ├── string3.toml.res │ ├── string4.toml │ ├── string4.toml.res │ ├── string5.toml │ ├── string5.toml.res │ ├── string6.toml │ ├── string6.toml.res │ ├── string7.toml │ ├── string7.toml.res │ ├── string8.toml │ ├── string8.toml.res │ ├── tab01.toml │ ├── tab01.toml.res │ ├── tab02.toml │ ├── tab02.toml.res │ ├── tab03.toml │ ├── tab03.toml.res │ ├── tab04.toml │ ├── tab04.toml.res │ ├── tab05.toml │ ├── tab05.toml.res │ ├── tab06.toml │ ├── tab06.toml.res │ ├── tab07.toml │ ├── tab07.toml.res │ ├── tab08.toml │ ├── tab08.toml.res │ ├── tab09.toml │ ├── tab09.toml.res │ ├── tab10.toml │ ├── tab10.toml.res │ ├── tab11.toml │ ├── tab11.toml.res │ ├── ts1.toml │ ├── ts1.toml.res │ ├── ts2.toml │ ├── ts2.toml.res │ ├── ts3.toml │ ├── ts3.toml.res │ ├── ts4.toml │ ├── ts4.toml.res │ ├── ts5.toml │ └── ts5.toml.res │ ├── test1 │ ├── .gitignore │ ├── README.md │ ├── build.sh │ ├── extra │ │ ├── array_of_tables.toml │ │ ├── inline_array.toml │ │ └── inline_table.toml │ └── run.sh │ ├── test2 │ ├── .gitignore │ ├── Note.txt │ ├── build.sh │ └── run.sh │ ├── toml.c │ ├── toml.h │ ├── toml_cat.c │ ├── toml_json.c │ ├── toml_sample.c │ └── unittest │ ├── Makefile │ └── t1.c ├── tools ├── Makefile.am ├── chkpriv │ ├── Makefile.am │ ├── xrdp-chkpriv.in │ └── xrdp-droppriv.c └── devel │ ├── Makefile.am │ ├── gtcp_proxy │ ├── Makefile │ ├── README.txt │ ├── gtcp-proxy.c │ ├── gtcp.c │ ├── gtcp.h │ └── hexdump.c │ └── tcp_proxy │ ├── Makefile.am │ └── main.c ├── vnc ├── Makefile.am ├── rfb.c ├── rfb.h ├── vnc.c ├── vnc.h ├── vnc_clip.c └── vnc_clip.h ├── vrplayer ├── README.txt ├── decoder.cpp ├── decoder.h ├── demuxmedia.cpp ├── demuxmedia.h ├── dlgabout.cpp ├── dlgabout.h ├── dlgabout.ui ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── mediapacket.cpp ├── mediapacket.h ├── ourinterface.cpp ├── ourinterface.h ├── playaudio.cpp ├── playaudio.h ├── playvideo.cpp ├── playvideo.h └── vrplayer.pro ├── waitforx ├── Makefile.am └── waitforx.c ├── xrdp ├── Makefile.am ├── README.logo ├── ad24b.bmp ├── ad256.bmp ├── cursor0.cur ├── cursor1.cur ├── czech.txt ├── funcs.c ├── gfx.toml ├── lang.c ├── rdp-scan-codes.txt ├── sans-10.fv1 ├── sans-18.fv1 ├── xrdp.c ├── xrdp.h ├── xrdp.ini.in ├── xrdp24b.bmp ├── xrdp256.bmp ├── xrdp_bitmap.c ├── xrdp_bitmap_common.c ├── xrdp_bitmap_load.c ├── xrdp_cache.c ├── xrdp_egfx.c ├── xrdp_egfx.h ├── xrdp_encoder.c ├── xrdp_encoder.h ├── xrdp_encoder_openh264.c ├── xrdp_encoder_openh264.h ├── xrdp_encoder_x264.c ├── xrdp_encoder_x264.h ├── xrdp_font.c ├── xrdp_keyboard.toml ├── xrdp_listen.c ├── xrdp_login_wnd.c ├── xrdp_logo.bmp ├── xrdp_logo.png ├── xrdp_main_utils.c ├── xrdp_mm.c ├── xrdp_mm.h ├── xrdp_painter.c ├── xrdp_process.c ├── xrdp_region.c ├── xrdp_tconfig.c ├── xrdp_tconfig.h ├── xrdp_types.h ├── xrdp_wm.c └── xrdpwin.c ├── xrdp_accel_assist ├── Makefile.am ├── encoder_headers │ ├── nvEncodeAPI_11_0.h │ └── nvEncodeAPI_11_1.h ├── xrdp_accel_assist.c ├── xrdp_accel_assist.h ├── xrdp_accel_assist_egl.c ├── xrdp_accel_assist_egl.h ├── xrdp_accel_assist_glx.c ├── xrdp_accel_assist_glx.h ├── xrdp_accel_assist_nvenc.c ├── xrdp_accel_assist_nvenc.h ├── xrdp_accel_assist_shaders.c ├── xrdp_accel_assist_x11.c └── xrdp_accel_assist_x11.h ├── xrdpapi ├── Makefile.am ├── simple.c ├── vrplayer.c ├── vrplayer.mk ├── xrdp-ssh-agent.c ├── xrdpapi.c └── xrdpapi.h ├── xrdpvr ├── Makefile.am ├── xrdpvr.c ├── xrdpvr.h └── xrdpvr_internal.h └── xup ├── Makefile.am ├── xup.c └── xup.h /.cirrus.yml: -------------------------------------------------------------------------------- 1 | FreeBSD_task: 2 | matrix: 3 | env: 4 | SSL: libressl 5 | matrix: 6 | freebsd_instance: 7 | image_family: freebsd-14-2 8 | prepare_script: 9 | - pkg install -y $SSL git autoconf automake libtool pkgconf opus jpeg-turbo fdk-aac pixman libX11 libXfixes libXrandr libxkbfile nasm fusefs-libs3 check imlib2 freetype2 cmocka ibus 10 | - git submodule update --init --recursive 11 | configure_script: 12 | - ./bootstrap 13 | - 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-ibus --enable-ipv6 --enable-opus --enable-jpeg --enable-fdkaac --enable-painter --enable-pixman --enable-fuse --with-imlib2 --with-freetype2 14 | build_script: 15 | - make -j $(sysctl -n hw.ncpu || echo 4) 16 | check_script: 17 | - make check 18 | install_script: 19 | - make install 20 | test_script: 21 | - /usr/local/sbin/xrdp -v 22 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: xrdp-project 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions 3 | about: If you are new to xrdp and want to ask community for help, raise it as Q&A in discussion. 4 | url: https://github.com/neutrinolabs/xrdp/discussions/new?category=q-a 5 | 6 | -------------------------------------------------------------------------------- /.github/workflows/release-tarball.yml: -------------------------------------------------------------------------------- 1 | name: Generate release tarball 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tag: 7 | description: 'Tag to build' 8 | required: true 9 | 10 | jobs: 11 | build: 12 | name: Generate release tarball (${{ github.event.repository.name }} ${{ github.event.inputs.tag }}) 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Set timestamp 17 | run: echo "timestamp=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV 18 | 19 | - name: Checkout repository 20 | uses: actions/checkout@v4 21 | with: 22 | ref: ${{ github.event.inputs.tag }} 23 | 24 | - name: Install dependencies 25 | run: | 26 | sudo scripts/install_xrdp_build_dependencies_with_apt.sh min amd64 27 | 28 | - name: Run make distcheck 29 | run: | 30 | ./bootstrap 31 | ./configure 32 | make distcheck 33 | 34 | - name: Find generated tarball 35 | id: find_tarball 36 | run: | 37 | TARBALL=$(find . -maxdepth 1 -name "*.tar.gz" | head -n 1) 38 | if [ -z "$TARBALL" ]; then 39 | echo "Error: No tarball found" >&2 40 | exit 1 41 | fi 42 | echo "tarball=$TARBALL" >> $GITHUB_ENV 43 | 44 | - name: Upload Artifact 45 | uses: actions/upload-artifact@v4 46 | with: 47 | name: ${{ github.event.repository.name }}-${{ github.event.inputs.tag }}-${{ env.timestamp }} 48 | path: "${{ env.tarball }}" 49 | if-no-files-found: error 50 | compression-level: 0 51 | retention-days: 7 52 | 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.a 3 | aclocal.m4 4 | AUTHORS 5 | autom4te.cache/ 6 | ChangeLog 7 | compile 8 | config_ac.h 9 | config_ac-h.in 10 | config.guess 11 | config.log 12 | config.status 13 | config.sub 14 | configure 15 | depcomp 16 | .deps/ 17 | fontutils/xrdp-dumpfv1 18 | fontutils/xrdp-mkfv1 19 | genkeymap/xrdp-genkeymap 20 | install-sh 21 | instfiles/pam.d/xrdp-sesman 22 | instfiles/*.service 23 | keygen/xrdp-keygen 24 | *.la 25 | .libs 26 | libtool 27 | *.lo 28 | *.log 29 | ltmain.sh 30 | Makefile 31 | Makefile.in 32 | missing 33 | mkinstalldirs 34 | NEWS 35 | *.o 36 | README 37 | sesman/chansrv/xrdp-chansrv 38 | sesman/sesexec/xrdp-sesexec 39 | sesman/tools/xrdp-authtest 40 | sesman/tools/xrdp-dis 41 | sesman/tools/xrdp-sesadmin 42 | sesman/tools/xrdp-sesrun 43 | sesman/tools/xrdp-sestest 44 | sesman/tools/xrdp-xcon 45 | sesman/xrdp-sesman 46 | sesman/sesman.ini 47 | *.so 48 | stamp-h1 49 | tap-driver.sh 50 | test-driver 51 | tests/common/test_common 52 | tests/libipm/test_libipm 53 | tests/libxrdp/test_libxrdp 54 | tests/memtest/memtest 55 | tests/xrdp/test_xrdp 56 | tools/devel/tcp_proxy/tcp_proxy 57 | tools/chkpriv/xrdp-chkpriv 58 | tools/chkpriv/xrdp-droppriv 59 | *.trs 60 | waitforx/waitforx 61 | xrdp/xrdp 62 | xrdp/xrdp.ini 63 | xrdp_configure_options.h 64 | xrdpapi/xrdp-xrdpapi-simple 65 | .vscode/* 66 | xrdp_accel_assist/xrdp-accel-assist 67 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "librfxcodec"] 2 | path = librfxcodec 3 | url = https://github.com/neutrinolabs/librfxcodec.git 4 | branch = . 5 | ignore = untracked 6 | [submodule "libpainter"] 7 | path = libpainter 8 | url = https://github.com/neutrinolabs/libpainter.git 9 | branch = . 10 | ignore = untracked 11 | [submodule "ulalaca"] 12 | path = ulalaca 13 | url = https://github.com/neutrinolabs/ulalaca-xrdp.git 14 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | AM_DISTCHECK_CONFIGURE_FLAGS = \ 3 | --without-systemdsystemunitdir \ 4 | --enable-strict-locations \ 5 | --enable-tests 6 | 7 | EXTRA_DIST = \ 8 | COPYING \ 9 | README.md \ 10 | NEWS.md \ 11 | astyle_config.as \ 12 | bootstrap \ 13 | coding_style.md \ 14 | m4 \ 15 | vrplayer 16 | 17 | if XRDP_NEUTRINORDP 18 | NEUTRINORDPDIR = neutrinordp 19 | else 20 | NEUTRINORDPDIR = 21 | endif 22 | 23 | if XRDP_XRDPVR 24 | XRDPVRDIR = xrdpvr 25 | else 26 | XRDPVRDIR = 27 | endif 28 | 29 | if XRDP_PAINTER 30 | PAINTERDIR = libpainter 31 | else 32 | PAINTERDIR = 33 | endif 34 | 35 | if XRDP_RFXCODEC 36 | RFXCODECDIR = librfxcodec 37 | else 38 | RFXCODECDIR = 39 | endif 40 | 41 | if XRDP_ULALACA 42 | ULALACADIR = ulalaca 43 | else 44 | ULALACADIR = 45 | endif 46 | 47 | if XRDP_ACCEL 48 | ACCELDIR = xrdp_accel_assist 49 | else 50 | ACCELDIR = 51 | endif 52 | 53 | # This should not be dictionary order but build order 54 | SUBDIRS = \ 55 | third_party \ 56 | third_party/tomlc99 \ 57 | common \ 58 | vnc \ 59 | xup \ 60 | mc \ 61 | $(NEUTRINORDPDIR) \ 62 | libipm \ 63 | libxrdp \ 64 | $(PAINTERDIR) \ 65 | $(RFXCODECDIR) \ 66 | sesman \ 67 | xrdp \ 68 | fontutils \ 69 | keygen \ 70 | waitforx \ 71 | docs \ 72 | instfiles \ 73 | genkeymap \ 74 | xrdpapi \ 75 | pkgconfig \ 76 | $(XRDPVRDIR) \ 77 | $(ULALACADIR) \ 78 | tests \ 79 | tools \ 80 | $(ACCELDIR) 81 | 82 | distclean-local: 83 | -rm -f xrdp_configure_options.h 84 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Please DO NOT report any security issues to public GitHub issue. 6 | 7 | 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. 8 | 9 | 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. 10 | 11 | * [xrdp-core@googlegroups.com](mailto:xrdp-core@googlegroups.com) 12 | 13 | -------------------------------------------------------------------------------- /astyle_config.as: -------------------------------------------------------------------------------- 1 | 2 | # detached brackets 3 | --style=allman 4 | 5 | # 4 spaces, no tabs 6 | --indent=spaces=4 7 | 8 | # for C++ files only 9 | --indent-classes 10 | 11 | # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block. 12 | # The entire case block is indented. 13 | --indent-switches 14 | 15 | # Add extra indentation to namespace blocks. This option has no effect on Java files. 16 | --indent-namespaces 17 | 18 | # Converts tabs into spaces in the non-indentation part of the line. 19 | --convert-tabs 20 | 21 | # requires --convert-tabs to work properly 22 | --indent-preproc-define 23 | 24 | --indent-col1-comments 25 | 26 | --min-conditional-indent=2 27 | 28 | --max-continuation-indent=40 29 | 30 | # Insert space padding around operators. 31 | --pad-oper 32 | 33 | # Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...). 34 | --pad-header 35 | 36 | 37 | # Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for', 'while'...). 38 | --add-braces 39 | 40 | --align-pointer=name 41 | 42 | # Do not retain a backup of the original file. The original file is purged after it is formatted. 43 | --suffix=none 44 | 45 | # For each directory in the command line, process all subdirectories recursively. 46 | --recursive 47 | 48 | # Exclude git submodule directories and generated files. 49 | --exclude=libpainter 50 | --exclude=librfxcodec 51 | --exclude=xrdp_configure_options.h 52 | 53 | # ignore errors from generated files that do not exist 54 | --ignore-exclude-errors 55 | 56 | # Preserve the original file's date and time modified. 57 | --preserve-date 58 | 59 | # Formatted files display mode. Display only the files that have been formatted. 60 | # Do not display files that are unchanged. 61 | --formatted 62 | 63 | --lineend=linux 64 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | command -v autoconf 4 | if ! test $? -eq 0 5 | then 6 | echo "error, install autoconf" 7 | exit 1 8 | fi 9 | 10 | command -v automake 11 | if ! test $? -eq 0 12 | then 13 | echo "error, install automake" 14 | exit 1 15 | fi 16 | 17 | command -v libtool || command -v libtoolize 18 | if ! test $? -eq 0 19 | then 20 | echo "error, install libtool" 21 | exit 1 22 | fi 23 | 24 | command -v pkg-config 25 | if ! test $? -eq 0 26 | then 27 | echo "error, install pkg-config" 28 | exit 1 29 | fi 30 | 31 | if ! test -f libpainter/configure.ac 32 | then 33 | git submodule update --init libpainter 34 | fi 35 | 36 | if ! test -f librfxcodec/configure.ac 37 | then 38 | git submodule update --init librfxcodec 39 | fi 40 | 41 | if ! test -f ulalaca/Makefile.am 42 | then 43 | git submodule update --init ulalaca 44 | fi 45 | 46 | autoreconf -fvi 47 | -------------------------------------------------------------------------------- /common/Makefile.am: -------------------------------------------------------------------------------- 1 | if XRDP_PIXMAN 2 | PIXMAN_SOURCES = 3 | else 4 | PIXMAN_SOURCES = pixman-region16.c pixman-region.h 5 | endif 6 | 7 | EXTRA_DIST = pixman-region.c 8 | 9 | include_HEADERS = \ 10 | ms-erref.h \ 11 | ms-fscc.h \ 12 | ms-rdpbcgr.h \ 13 | ms-rdpeclip.h \ 14 | ms-rdpefs.h \ 15 | ms-rdpegdi.h \ 16 | ms-rdpele.h \ 17 | ms-rdperp.h \ 18 | ms-rdpedisp.h \ 19 | ms-smb2.h \ 20 | xrdp_client_info.h \ 21 | xrdp_constants.h \ 22 | xrdp_rail.h \ 23 | xrdp_scancode_defs.h \ 24 | xrdp_sockets.h 25 | 26 | AM_CPPFLAGS = \ 27 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 28 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 29 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 30 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 31 | -DXRDP_LOG_PATH=\"${localstatedir}/log\" 32 | 33 | if XRDP_NVENC 34 | AM_CPPFLAGS += -DXRDP_NVENC 35 | endif 36 | 37 | # -no-suppress is an automake-specific flag which is needed 38 | # to prevent us missing compiler errors in some circumstances 39 | # (see https://github.com/neutrinolabs/xrdp/pull/1843 ) 40 | AM_CFLAGS = -no-suppress $(OPENSSL_CFLAGS) 41 | 42 | module_LTLIBRARIES = \ 43 | libcommon.la 44 | 45 | libcommon_la_SOURCES = \ 46 | arch.h \ 47 | base64.h \ 48 | base64.c \ 49 | defines.h \ 50 | fifo.c \ 51 | fifo.h \ 52 | file.c \ 53 | file.h \ 54 | guid.c \ 55 | guid.h \ 56 | list.c \ 57 | list.h \ 58 | list16.c \ 59 | list16.h \ 60 | log.c \ 61 | log.h \ 62 | os_calls.c \ 63 | os_calls.h \ 64 | parse.c \ 65 | parse.h \ 66 | rail.h \ 67 | scancode.c \ 68 | scancode.h \ 69 | ssl_calls.c \ 70 | ssl_calls.h \ 71 | string_calls.c \ 72 | string_calls.h \ 73 | thread_calls.c \ 74 | thread_calls.h \ 75 | trans.c \ 76 | trans.h \ 77 | unicode_defines.h \ 78 | $(PIXMAN_SOURCES) 79 | 80 | libcommon_la_LIBADD = \ 81 | -lpthread \ 82 | $(OPENSSL_LIBS) \ 83 | $(DLOPEN_LIBS) 84 | -------------------------------------------------------------------------------- /common/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2014 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * read a config file 19 | */ 20 | 21 | #if !defined(FILE_H) 22 | #define FILE_H 23 | 24 | #include "arch.h" 25 | 26 | int 27 | file_read_sections(int fd, struct list *names); 28 | int 29 | file_by_name_read_sections(const char *file_name, struct list *names); 30 | int 31 | file_read_section(int fd, const char *section, 32 | struct list *names, struct list *values); 33 | int 34 | file_by_name_read_section(const char *file_name, const char *section, 35 | struct list *names, struct list *values); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /common/list16.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2014 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * simple list 19 | */ 20 | 21 | #if !defined(LIST16_H) 22 | #define LIST16_H 23 | 24 | #include "arch.h" 25 | 26 | /* list */ 27 | struct list16 28 | { 29 | tui16 *items; 30 | int count; 31 | int max_count; 32 | tui16 mitems[4]; 33 | }; 34 | 35 | struct list16 * 36 | list16_create(void); 37 | void 38 | list16_delete(struct list16 *self); 39 | /* Initialise a stack-based list16 */ 40 | void 41 | list16_init(struct list16 *self); 42 | /* Free any memory allocated to a list16. 43 | * After this call, list16_init() must be called again to re-use the list */ 44 | void 45 | list16_deinit(struct list16 *self); 46 | /* Returns != 0 if item added successfully */ 47 | int 48 | list16_add_item(struct list16 *self, tui16 item); 49 | tui16 50 | list16_get_item(struct list16 *self, int index); 51 | void 52 | list16_clear(struct list16 *self); 53 | int 54 | list16_index_of(struct list16 *self, tui16 item); 55 | void 56 | list16_remove_item(struct list16 *self, int index); 57 | /* Returns != 0 if item added successfully */ 58 | int 59 | list16_insert_item(struct list16 *self, int index, tui16 item); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /common/ms-erref.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-ERREF : Definitions from [MS-ERREF] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * References to MS-ERREF are currently correct for v20180912 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_ERREF_H) 23 | #define MS_ERREF_H 24 | 25 | /* 26 | * NTSTATUS codes (section 2.3) 27 | */ 28 | enum NTSTATUS 29 | { 30 | STATUS_SUCCESS = 0x00000000, 31 | 32 | STATUS_NO_MORE_FILES = 0x80000006, 33 | 34 | STATUS_UNSUCCESSFUL = 0xc0000001, 35 | STATUS_INFO_LENGTH_MISMATCH = 0xc0000004, 36 | STATUS_NO_SUCH_FILE = 0xc000000f, 37 | STATUS_ACCESS_DENIED = 0xc0000022, 38 | STATUS_OBJECT_NAME_INVALID = 0xc0000033, 39 | STATUS_OBJECT_NAME_NOT_FOUND = 0xc0000034, 40 | STATUS_SHARING_VIOLATION = 0xc0000043, 41 | STATUS_NOT_SUPPORTED = 0xc00000bb 42 | }; 43 | 44 | #endif /* MS_ERREF_H */ 45 | -------------------------------------------------------------------------------- /common/ms-rdpedisp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-RDPEDISP : Definitions from [MS-RDPEDISP] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * References to MS-RDPEDISP are currently correct for v20201030 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_RDPEDISP_H) 23 | #define MS_RDPEDISP_H 24 | 25 | /* Display Control Messages: Display Virtual Channel Extension (2.2.2) */ 26 | #define DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002 27 | #define DISPLAYCONTROL_PDU_TYPE_CAPS 0x00000005 28 | 29 | /* Display Control Monitor Layout (2.2.2.2.1) */ 30 | #define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001 31 | #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_WIDTH 0xC8 32 | #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_HEIGHT 0xC8 33 | #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_WIDTH 0x2000 34 | #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_HEIGHT 0x2000 35 | 36 | #define ORIENTATION_LANDSCAPE 0 37 | #define ORIENTATION_PORTRAIT 90 38 | #define ORIENTATION_LANDSCAPE_FLIPPED 180 39 | #define ORIENTATION_PORTRAIT_FLIPPED 270 40 | 41 | /* Display Control Monitor Layout (2.2.2.2.1) */ 42 | #define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001 43 | 44 | #endif /* MS_RDPEDISP_H */ 45 | -------------------------------------------------------------------------------- /common/ms-rdpele.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-RDPELE : Definitions from [MS-RDPELE] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * References to MS-RDPELE are currently correct for v20180912 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_RDPELE_H) 23 | #define MS_RDPELE_H 24 | 25 | /* LicensingMessage (MS-RDPELE 2.2.2) */ 26 | /* TODO: to be renamed */ 27 | #define LICENCE_TAG_DEMAND 0x01 /* LICENSE_REQUEST */ 28 | #define LICENCE_TAG_AUTHREQ 0x02 /* PLATFORM_CHALLENGE */ 29 | #define LICENCE_TAG_ISSUE 0x03 /* NEW_LICENSE */ 30 | #define LICENCE_TAG_REISSUE 0x04 /* UPGRADE_LICENSE */ 31 | #define LICENCE_TAG_PRESENT 0x12 /* LICENSE_INFO */ 32 | #define LICENCE_TAG_REQUEST 0x13 /* NEW_LICENSE_REQUEST */ 33 | #define LICENCE_TAG_AUTHRESP 0x15 /* PLATFORM_CHALLENGE_RESPONSE */ 34 | #define LICENCE_TAG_RESULT 0xff 35 | 36 | #endif /* MS_RDPELE_H */ 37 | -------------------------------------------------------------------------------- /common/ms-rdperp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-RDPERP : Definitions from [MS-RDPERP] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * References to MS-RDPERP are currently correct for v20190923 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_RDPERP_H) 23 | #define MS_RDPERP_H 24 | 25 | /* Window List Capability Set: WndSupportLevel (2.2.1.1.2) */ 26 | #define TS_WINDOW_LEVEL_NOT_SUPPORTED 0x00000000 27 | #define TS_WINDOW_LEVEL_SUPPORTED 0x00000001 28 | #define TS_WINDOW_LEVEL_SUPPORTED_EX 0x00000002 29 | 30 | 31 | #endif /* MS_RDPERP_H */ 32 | -------------------------------------------------------------------------------- /common/thread_calls.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2014 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * thread calls 19 | */ 20 | 21 | #if !defined(THREAD_CALLS_H) 22 | #define THREAD_CALLS_H 23 | 24 | #include "arch.h" 25 | 26 | int 27 | tc_thread_create(THREAD_RV (THREAD_CC *start_routine)(void *), void *arg); 28 | tbus 29 | tc_get_threadid(void); 30 | int 31 | tc_threadid_equal(tbus tid1, tbus tid2); 32 | tbus 33 | tc_mutex_create(void); 34 | void 35 | tc_mutex_delete(tbus mutex); 36 | int 37 | tc_mutex_lock(tbus mutex); 38 | int 39 | tc_mutex_unlock(tbus mutex); 40 | tbus 41 | tc_sem_create(int init_count); 42 | void 43 | tc_sem_delete(tbus sem); 44 | int 45 | tc_sem_dec(tbus sem); 46 | int 47 | tc_sem_inc(tbus sem); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | man 4 | -------------------------------------------------------------------------------- /docs/man/.gitignore: -------------------------------------------------------------------------------- 1 | *.[1-8] 2 | -------------------------------------------------------------------------------- /docs/man/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = \ 2 | xrdp-dis.1 \ 3 | gfx.toml.5 \ 4 | sesman.ini.5 \ 5 | xrdp.ini.5 \ 6 | xrdp-km.toml.5 \ 7 | xrdp.8 \ 8 | xrdp-chansrv.8 \ 9 | xrdp-genkeymap.8 \ 10 | xrdp-keygen.8 \ 11 | xrdp-sesadmin.8 \ 12 | xrdp-sesman.8 \ 13 | xrdp-sesrun.8 \ 14 | xrdp-dumpfv1.8 15 | 16 | EXTRA_DIST = xrdp-mkfv1.8.in $(man_MANS:=.in) 17 | 18 | if USE_FREETYPE2 19 | man_MANS += xrdp-mkfv1.8 20 | endif 21 | 22 | SUBST_VARS = sed \ 23 | -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ 24 | -e 's|@bindir[@]|$(bindir)|g' \ 25 | -e 's|@sbindir[@]|$(sbindir)|g' \ 26 | -e 's|@localstatedir[@]|$(localstatedir)|g' \ 27 | -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ 28 | -e 's|@sysconfsubdir[@]|$(sysconfsubdir)|g' \ 29 | -e 's|@socketdir[@]|$(socketdir)|g' \ 30 | -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \ 31 | -e 's|@xrdpdatadir[@]|$(datadir)/xrdp|g' \ 32 | -e 's|@xrdphomeurl[@]|http://www.xrdp.org/|g' 33 | 34 | subst_verbose = $(subst_verbose_@AM_V@) 35 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 36 | subst_verbose_0 = @echo " SUBST $@"; 37 | 38 | SUFFIXES = .in 39 | .in: 40 | $(subst_verbose)$(SUBST_VARS) $< > $@ 41 | 42 | CLEANFILES = $(man_MANS) 43 | -------------------------------------------------------------------------------- /docs/man/xrdp-chansrv.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp\-chansrv" "8" "@PACKAGE_VERSION@" "xrdp team" "" 2 | .SH "NAME" 3 | \fBxrdp\-chansrv\fR \- \fBxrdp\fR channel server 4 | 5 | .SH "SYNTAX" 6 | .B xrdp\-chansrv 7 | 8 | .SH "DESCRIPTION" 9 | \fBxrdp\-chansrv\fR is the \fBxrdp\fR(8) channel server, which manages the Remote Desktop Protocol (RDP) sub-channels. 10 | .PP 11 | This program is only forked internally by \fBxrdp\-sesman\fP(8). 12 | .PP 13 | Currently \fBxrdp\-chansrv\fP knows about the following channels: 14 | .RS 8 15 | .TP 16 | .B cliprdr 17 | Clipboard Redirection 18 | .TP 19 | .B rdpsnd 20 | Remote Desktop Protocol Sound 21 | .TP 22 | .B rdpdr 23 | Remote Desktop Protocol Device Redirection 24 | .TP 25 | .B rail 26 | Remote Applications Integrated Locally 27 | .TP 28 | .B drdynvc 29 | Dynamic Virtual Channel 30 | .RE 31 | 32 | .SH ENVIRONMENT 33 | .TP 34 | .I CHANSRV_LOG_PATH 35 | Path to the location where the log file is stored. If not specified, 36 | $\fBXDG_DATA_HOME/xrdp\fP or \fB$HOME/.local/share/xrdp\fP is used instead. 37 | .TP 38 | .I DISPLAY 39 | X11 display number. Must be specified. 40 | 41 | .SH FILES 42 | .TP 43 | .I @sysconfdir@/@sysconfsubdir@/sesman.ini 44 | Contains some settings for this program. 45 | .TP 46 | .I @socketdir@/xrdp_chansrv_socket_* 47 | UNIX socket used by external programs to implement channels. 48 | .TP 49 | .I @socketdir@/xrdp_api_* 50 | UNIX socket used by \fBxrdp\-chansrv\fP to communicate with \fBxrdp\-sesman\fP. 51 | .TP 52 | .I xrdp-chansrv.%s.log 53 | Log file used by \fBxrdp\-chansrv\fP(8). \fB%s\fP is display number. See the 54 | description of \fBCHANSRV_LOG_PATH\fP above for the file's location. 55 | 56 | .SH "SEE ALSO" 57 | .BR xrdp\-sesman (8), 58 | .BR sesman.ini (5). 59 | 60 | For more info on \fBxrdp\fR see 61 | .UR @xrdphomeurl@ 62 | .UE 63 | -------------------------------------------------------------------------------- /docs/man/xrdp-dis.1.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp-dis" "1" "@PACKAGE_VERSION@" "xrdp team" 2 | .SH NAME 3 | xrdp\-dis \- xrdp disconnect utility 4 | 5 | .SH SYNOPSIS 6 | .B xrdp\-dis 7 | 8 | .SH DESCRIPTION 9 | .PP 10 | \fBxrdp\-dis\fP is run with no parameters to disconnect your xrdp session. 11 | 12 | .SH ENVIRONMENT 13 | .TP 14 | .B DISPLAY 15 | to get the default host and display number. 16 | 17 | .SH FILES 18 | .TP 19 | .I @socketdir@/xrdp_disconnect_display_* 20 | UNIX socket used to communicate the disconnect request to xorgxrdp. 21 | 22 | .SH KNOWN ISSUES 23 | .TP 24 | This utility doesn't support disconnecting Xvnc sessions so far. 25 | 26 | .SH SEE ALSO 27 | .BR xrdp (8). 28 | -------------------------------------------------------------------------------- /docs/man/xrdp-dumpfv1.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp-dumpfv1" "8" "@PACKAGE_VERSION@" "xrdp team" 2 | .SH NAME 3 | xrdp\-dumpfv1 \- Display content of .fv1 font files 4 | 5 | .SH SYNOPSIS 6 | \fBxrdp-dumpfv1\fR [ options ] fv1_file 7 | 8 | .SH DESCRIPTION 9 | \fBxrdp\-dumpfv1\fP can be used to display the contents of an fv1 file. 10 | 11 | .SH OPTIONS 12 | A summary of options is included below. 13 | 14 | One of \fB\-i\fR, \fB\-t\fR, or \fB\-c\fR must be specified. 15 | .TP 16 | \fB\-i\fR 17 | Displays general information about the fv1 file. 18 | 19 | .TP 20 | \fB\-t\fR 21 | Displays a CSV table of all the glyphs in the font. This table can be 22 | imported into a spreadsheet program for further manipulation. 23 | 24 | .TP 25 | \fB\-c\fR 26 | Displays detailed information about a particular glyph in the font, 27 | including a representation of the bitmap for the glyph. 28 | 29 | Specify the character using one of the following strings: 30 | 31 | \fBU+\fR - Unicode character, e.g. \fBU+25\fR for a percentage symbol (%). 32 | 33 | \fB@\fR - Unicode character, e.g. \fB@%\fR for a percentage symbol. 34 | 35 | \fBnumber\fR - Unicode value as an integer, e.g. \fB37\fR for a 36 | percentage symbol 37 | 38 | Note that the row numbers shown in the font data are relative to the 39 | natural font baseline. If comparing two fonts, be aware that when the 40 | glyph is drawn, the row number may be affected by the global descender 41 | value for the font (displayed with \fB\-i\fR). 42 | 43 | .SH "EXAMPLES" 44 | .TP 45 | \fBxrdp\-dumpfv1 -i @xrdpdatadir@/sans-10.fv1\fR 46 | Displays global information about the sans 10 font file distributed with xrdp. 47 | 48 | .TP 49 | \fBxrdp\-dumpfv1 -c @'*' @xrdpdatadir@/sans-10.fv1\fR 50 | Displays information about the asterisk symbol in the sans 10 font file distributed with xrdp. 51 | 52 | .SH SEE ALSO 53 | .BR xrdp\-mkfv1(8). 54 | 55 | More info on \fBxrdp\fR can be found on the 56 | .UR @xrdphomeurl@ 57 | xrdp homepage 58 | .UE 59 | -------------------------------------------------------------------------------- /docs/man/xrdp-keygen.8.in: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\"- 3 | .\" Copyright © 2007, 2008 Vincent Bernat 4 | .\" License: GPL-2+ 5 | .\"- 6 | .TH xrdp\-keygen 8 "@PACKAGE_VERSION@" "xrdp team" 7 | .SH NAME 8 | xrdp\-keygen \- xrdp RSA key generation utility 9 | 10 | .SH SYNOPSIS 11 | .B xrdp\-keygen xrdp 12 | < \fIoutfile\fP | \fBauto\fP > 13 | .br 14 | .B xrdp\-keygen test 15 | 16 | .SH DESCRIPTION 17 | \fBxrdp\-keygen\fP generates the file 18 | .I @sysconfdir@/@sysconfsubdir@/rsakeys.ini 19 | which contains the RSA key pair used to perform authentication to 20 | remote clients. The public key is self-signed. 21 | 22 | .SH OPTIONS 23 | This program takes one of the following options: 24 | .TP 25 | \fBxrdp\fP \fIoutfile\fP 26 | Generate a new key pair. 27 | The key data is stored in the file named \fIoutfile\fP. 28 | .br 29 | If \fBauto\fP is used as \fIoutfile\fP, the default file \fI@sysconfdir@/@sysconfsubdir@/rsakeys.ini\fP gets created if it does not yet exists. 30 | .TP 31 | .B test 32 | Generate a test key pair and print information to standard output. 33 | 34 | .SH NOTES 35 | On machines with FIPS enabled, this program will generate an empty file, 36 | and a warning. On these machines, xrdp cannot use Classic RDP encryption. 37 | 38 | .SH FILES 39 | .TP 40 | .I @sysconfdir@/@sysconfsubdir@/rsakeys.ini 41 | RSA public and private key pair used to identify this XRDP server. 42 | 43 | .SH SEE ALSO 44 | .BR xrdp (8), 45 | .BR xrdp\-sesman (8). 46 | 47 | .SH AUTHOR 48 | This manual page was originally written by Vincent Bernat . 49 | -------------------------------------------------------------------------------- /docs/man/xrdp-sesadmin.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp-sesadmin" "8" "@PACKAGE_VERSION@" "xrdp team" 2 | .SH NAME 3 | xrdp\-sesadmin \- console XRDP sessions administration tool 4 | 5 | .SH SYNOPSIS 6 | .B xrdp\-sesadmin 7 | .RI [ options ] 8 | .BI -c= command 9 | 10 | .SH DESCRIPTION 11 | This manual page documents briefly the 12 | .B xrdp\-sesadmin 13 | command. 14 | .PP 15 | \fBxrdp\-sesadmin\fP is a console program to administer running XRDP sessions. 16 | 17 | .SH OPTIONS 18 | A summary of options is included below. 19 | .TP 20 | .BI \-u= username 21 | Retained for compatibility, but ignored. 22 | 23 | .TP 24 | .BI \-p= password 25 | Retained for compatibility, but ignored. 26 | 27 | .TP 28 | .BI \-i= port 29 | The sesman \fIUNIX domain socket\fP to connect to. 30 | Defaults to \fBsesman.socket\fP. 31 | If no path is specified for the socket, a default of @socketdir@ is used. 32 | 33 | .TP 34 | .BI \-c= command 35 | Specifies the \fIcommand\fP to execute on the server. 36 | Valid commands are: 37 | .RS 4 38 | .TP 39 | .B list 40 | List active sessions for the current user. Members of the 41 | \fBTerminalServerAdmins\fR group can view active sessions for all users. 42 | .TP 43 | .BI kill: sid 44 | Kills the session specified the given \fIsession id\fP. 45 | (not yet implemented). 46 | .RE 47 | 48 | .SH FILES 49 | xrdp\-sesadmin.log 50 | 51 | .SH SEE ALSO 52 | .BR xrdp (8). 53 | 54 | More info on \fBxrdp\fR can be found on the 55 | .UR @xrdphomeurl@ 56 | xrdp homepage 57 | .UE 58 | -------------------------------------------------------------------------------- /fontutils/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = windows 2 | 3 | # Some programs need freetype2 to build 4 | if USE_FREETYPE2 5 | MKFV1 = xrdp-mkfv1 6 | else 7 | MKFV1 = 8 | endif 9 | 10 | AM_CPPFLAGS = \ 11 | -I$(top_builddir) \ 12 | -I$(top_srcdir)/common \ 13 | $(FREETYPE2_CFLAGS) 14 | 15 | bin_PROGRAMS = \ 16 | $(MKFV1) \ 17 | xrdp-dumpfv1 18 | 19 | xrdp_mkfv1_SOURCES = \ 20 | mkfv1.c \ 21 | fv1.c \ 22 | fv1.h 23 | 24 | xrdp_mkfv1_LDADD = \ 25 | $(top_builddir)/common/libcommon.la \ 26 | $(FREETYPE2_LIBS) 27 | 28 | xrdp_dumpfv1_SOURCES = \ 29 | dumpfv1.c \ 30 | fv1.c \ 31 | fv1.h 32 | 33 | xrdp_dumpfv1_LDADD = \ 34 | $(top_builddir)/common/libcommon.la 35 | -------------------------------------------------------------------------------- /fontutils/windows/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | -------------------------------------------------------------------------------- /fontutils/windows/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OBJS = fontdump.obj os_calls.obj 3 | 4 | #CFLAGS = -O2 -I../common 5 | CFLAGS = -O2 -I../common -DUNICODE -D_UNICODE 6 | LDFLAGS = -W -efontdump.exe 7 | 8 | all: fontdump1 9 | 10 | fontdump1: $(OBJS) 11 | $(CC) $(LDFLAGS) $(OBJS) 12 | 13 | clean: 14 | del $(OBJS) fontdump.exe *.tds 15 | 16 | os_calls.obj: ../common/os_calls.c 17 | $(CC) $(CFLAGS) -c ../common/os_calls.c 18 | -------------------------------------------------------------------------------- /genkeymap/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | dump-keymaps.sh \ 3 | readme.txt 4 | 5 | AM_CPPFLAGS = \ 6 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 7 | -I$(top_srcdir)/common 8 | 9 | AM_CFLAGS = $(X_CFLAGS) 10 | 11 | bin_PROGRAMS = \ 12 | xrdp-genkeymap 13 | 14 | xrdp_genkeymap_SOURCES = genkeymap.c 15 | 16 | xrdp_genkeymap_LDFLAGS = \ 17 | $(X_LIBS) 18 | 19 | xrdp_genkeymap_LDADD = \ 20 | $(top_builddir)/common/libcommon.la \ 21 | $(X_PRE_LIBS) -lxkbfile -lX11 $(X_EXTRA_LIBS) 22 | -------------------------------------------------------------------------------- /genkeymap/readme.txt: -------------------------------------------------------------------------------- 1 | Keymap file description 2 | ----------------------- 3 | 4 | The keymap files are used by the xrdp login screen, and also when 5 | sending keyboard input to a VNC server. 6 | 7 | The names of the files are of the format; 8 | 9 | km-xxxxxxxx.toml 10 | 11 | where the xxxxxxxx is replaced by the hex number of the layout of interest. 12 | 13 | The contents of the files are documented in xrdp-km.toml(5) 14 | 15 | See also xrdp-genkeymap(8) which describes the utility used to 16 | generate these files. 17 | 18 | Creating a new file 19 | ------------------- 20 | 21 | To create a new file:- 22 | 1) Start an X server 23 | 2) Use the 'setxkbmap' command to get the keyboard configured 24 | for the X server. 25 | 3) Run the 'xrdp-genkeymap' command to extract the keyboard 26 | mappings 27 | 28 | Example: ./xrdp-genkeymap ./km-00000409.toml 29 | 30 | 4) Copy the generated file to /etc/xrdp/ 31 | 32 | Using the X server of your current session may not be a good idea, as 33 | session and window managers can interfere with key bindings. A good option 34 | is to use an 'Xvfb' dummy X server to do this. 35 | 36 | Getting a file added to xrdp 37 | ---------------------------- 38 | 39 | The file dump-keymaps.sh in this directory is used to auto-generate 40 | all keymap files. It runs on Linux currently, but will generate 41 | keymap files suitable for any xrdp platform. 42 | 43 | 1) Add a line towards the end of this file which causes your mapping to 44 | be generated. Use the other lines in this file as a guide. 45 | 2) Run the dump-keymaps.sh script to generate a new file in 46 | instfiles/ 47 | 3) Add your mapping to the list in instfiless/Makefile.am 48 | 4) Submit a pull request to the project containing the above three 49 | changes. 50 | -------------------------------------------------------------------------------- /instfiles/default/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/default 2 | dist_startscript_DATA = xrdp 3 | -------------------------------------------------------------------------------- /instfiles/default/xrdp: -------------------------------------------------------------------------------- 1 | # Do we need to start sesman ? 2 | SESMAN_START=yes 3 | # Do we restart xrdp on upgrade ? If not set to no, any xrdp session will 4 | # be shutdown on upgrade. 5 | # RESTART_ON_UPGRADE=no 6 | -------------------------------------------------------------------------------- /instfiles/init.d/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/init.d 2 | dist_startscript_SCRIPTS = xrdp 3 | -------------------------------------------------------------------------------- /instfiles/pam.d/Makefile.am: -------------------------------------------------------------------------------- 1 | PAM_FILES = \ 2 | xrdp-sesman.arch \ 3 | xrdp-sesman.debian \ 4 | xrdp-sesman.freebsd \ 5 | xrdp-sesman.macos \ 6 | xrdp-sesman.redhat \ 7 | xrdp-sesman.suse \ 8 | xrdp-sesman.system \ 9 | xrdp-sesman.unix 10 | 11 | EXTRA_DIST = $(PAM_FILES) mkpamrules 12 | 13 | CLEANFILES = xrdp-sesman 14 | 15 | if SESMAN_NOPAM 16 | PAMFILE = 17 | else 18 | if SESMAN_PAMUSERPASS 19 | PAMFILE = 20 | else 21 | if SESMAN_KERBEROS 22 | PAMFILE = 23 | else 24 | PAMFILE = xrdp-sesman 25 | endif 26 | endif 27 | endif 28 | 29 | pamddir = $(pamconfdir) 30 | 31 | pamd_DATA = \ 32 | $(PAMFILE) 33 | 34 | xrdp-sesman: mkpamrules 35 | $(srcdir)/mkpamrules $(PAM_RULES) $(srcdir) $@ 36 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.arch: -------------------------------------------------------------------------------- 1 | auth include system-remote-login 2 | -auth optional pam_gnome_keyring.so 3 | -auth optional pam_kwallet5.so 4 | 5 | account include system-remote-login 6 | 7 | password include system-remote-login 8 | 9 | session include system-remote-login 10 | # For wtmp/lastlog support uncomment one of the following lines:- 11 | #session optional pam_lastlog.so quiet 12 | #session optional pam_lastlog2.so silent 13 | -session optional pam_gnome_keyring.so auto_start 14 | -session optional pam_kwallet5.so auto_start 15 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.debian: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth required pam_env.so readenv=1 3 | auth required pam_env.so readenv=1 envfile=/etc/default/locale 4 | @include common-auth 5 | -auth optional pam_gnome_keyring.so 6 | -auth optional pam_kwallet5.so 7 | 8 | @include common-account 9 | 10 | @include common-password 11 | 12 | # Ensure resource limits are applied 13 | session required pam_limits.so 14 | # Set the loginuid process attribute. 15 | session required pam_loginuid.so 16 | # Update wtmp/lastlog 17 | session optional pam_lastlog.so quiet 18 | @include common-session 19 | -session optional pam_gnome_keyring.so auto_start 20 | -session optional pam_kwallet5.so auto_start 21 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.freebsd: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include system 3 | account include system 4 | password include system 5 | session include system 6 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.macos: -------------------------------------------------------------------------------- 1 | # xrdp-sesman: auth account password session 2 | # based on Apple's sshd PAM configuration 3 | auth optional pam_krb5.so use_kcminit 4 | auth optional pam_ntlm.so try_first_pass 5 | auth optional pam_mount.so try_first_pass 6 | auth required pam_opendirectory.so try_first_pass 7 | account required pam_nologin.so 8 | account required pam_sacl.so sacl_service=ssh 9 | account required pam_opendirectory.so 10 | password required pam_opendirectory.so 11 | session required pam_launchd.so 12 | session optional pam_mount.so 13 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.redhat: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include password-auth 3 | account include password-auth 4 | 5 | # Set the loginuid process attribute. 6 | session required pam_loginuid.so 7 | # Update wtmp/lastlog 8 | session optional pam_lastlog.so quiet 9 | 10 | session include password-auth 11 | password include password-auth 12 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.suse: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include common-auth 3 | account include common-account 4 | 5 | # Set the loginuid process attribute. 6 | session required pam_loginuid.so 7 | # Update lastlog database 8 | session optional pam_lastlog2.so silent 9 | 10 | session include common-session 11 | password include common-password 12 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.system: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include system-auth 3 | account include system-auth 4 | password include system-auth 5 | 6 | # For wtmp/lastlog support uncomment one of the following lines:- 7 | #session optional pam_lastlog.so quiet 8 | #session optional pam_lastlog2.so silent 9 | session include system-auth 10 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.unix: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | # 3 | # Really basic authentication set when nothing else is available 4 | # 5 | # You may need to edit this to suit your system depending on the 6 | # required functionality. 7 | # 8 | auth required pam_unix.so shadow 9 | auth required pam_env.so 10 | 11 | password required pam_unix.so 12 | 13 | account required pam_unix.so 14 | account required pam_nologin.so 15 | 16 | session required pam_unix.so 17 | -------------------------------------------------------------------------------- /instfiles/pulse/Makefile.am: -------------------------------------------------------------------------------- 1 | pulsedir = $(sysconfdir)/$(sysconfsubdir)/pulse 2 | dist_pulse_DATA = default.pa 3 | -------------------------------------------------------------------------------- /instfiles/pulse/default.pa: -------------------------------------------------------------------------------- 1 | .nofail 2 | .fail 3 | load-module module-augment-properties 4 | load-module module-always-sink 5 | .ifexists module-xrdp-sink.so 6 | load-module module-xrdp-sink 7 | .endif 8 | .ifexists module-xrdp-source.so 9 | load-module module-xrdp-source 10 | .endif 11 | load-module module-native-protocol-unix 12 | 13 | -------------------------------------------------------------------------------- /instfiles/rc.d/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/rc.d 2 | dist_startscript_SCRIPTS = xrdp xrdp-sesman 3 | -------------------------------------------------------------------------------- /instfiles/rc.d/xrdp-sesman: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved. 4 | # Copyright (c) 2015-2018 Koichiro Iwao 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions 8 | # are met: 9 | # 1. Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # 2. Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | # SUCH DAMAGE. 26 | # 27 | # $FreeBSD$ 28 | # 29 | # REQUIRE: LOGIN 30 | # PROVIDE: xrdp_sesman 31 | # 32 | 33 | . /etc/rc.subr 34 | 35 | name="xrdp_sesman" 36 | rcvar="xrdp_sesman_enable" 37 | 38 | load_rc_config "$name" 39 | : ${xrdp_sesman_enable="NO"} 40 | 41 | extra_commands="status" 42 | command="%%PREFIX%%/sbin/xrdp-sesman" 43 | 44 | run_rc_command "$1" 45 | -------------------------------------------------------------------------------- /instfiles/xrdp-sesman.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=xrdp session manager 3 | Documentation=man:xrdp-sesman(8) man:sesman.ini(5) 4 | After=network.target 5 | StopWhenUnneeded=true 6 | BindsTo=xrdp.service 7 | 8 | [Service] 9 | Type=exec 10 | EnvironmentFile=-@sysconfdir@/sysconfig/xrdp 11 | EnvironmentFile=-@sysconfdir@/default/xrdp 12 | ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS --nodaemon 13 | ExecReload=kill -HUP $MAINPID 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /instfiles/xrdp.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=xrdp daemon 3 | Documentation=man:xrdp(8) man:xrdp.ini(5) 4 | Requires=xrdp-sesman.service 5 | After=network-online.target xrdp-sesman.service 6 | 7 | [Service] 8 | Type=exec 9 | EnvironmentFile=-@sysconfdir@/sysconfig/xrdp 10 | EnvironmentFile=-@sysconfdir@/default/xrdp 11 | ExecStart=@sbindir@/xrdp $XRDP_OPTIONS --nodaemon 12 | SystemCallArchitectures=native 13 | SystemCallFilter=@system-service 14 | # Uncomment the following line if you wish xrdp connections to survive 15 | # an xrdp restart. 16 | # 17 | # This is not recommended, as the xrdp and xrdp-sesman processes can 18 | # end up with API differences if the restart was caused by an upgrade. It 19 | # may however be useful for some use cases. 20 | #KillMode=process 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | -------------------------------------------------------------------------------- /keygen/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = openssl.conf 2 | 3 | AM_CPPFLAGS = \ 4 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 5 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 6 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 7 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 8 | -I$(top_srcdir)/common 9 | 10 | bin_PROGRAMS = \ 11 | xrdp-keygen 12 | 13 | xrdp_keygen_SOURCES = keygen.c 14 | 15 | xrdp_keygen_LDADD = \ 16 | $(top_builddir)/common/libcommon.la 17 | 18 | xrdpsysconfdir = $(sysconfdir)/$(sysconfsubdir) 19 | 20 | install-data-hook: 21 | umask 077 && \ 22 | if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini ]; then \ 23 | ./xrdp-keygen xrdp $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini; \ 24 | fi && \ 25 | if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem ]; then \ 26 | $(OPENSSL) req -x509 -newkey rsa:2048 -sha256 -nodes \ 27 | -keyout $(DESTDIR)$(xrdpsysconfdir)/key.pem -out \ 28 | $(DESTDIR)$(xrdpsysconfdir)/cert.pem -days 365 \ 29 | -subj /C=US/ST=CA/L=Sunnyvale/O=xrdp/CN=www.xrdp.org \ 30 | -config $(srcdir)/openssl.conf; \ 31 | fi 32 | 33 | uninstall-hook: 34 | rm -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini 35 | rm -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem 36 | rm -f $(DESTDIR)$(xrdpsysconfdir)/key.pem 37 | -------------------------------------------------------------------------------- /keygen/openssl.conf: -------------------------------------------------------------------------------- 1 | [req] 2 | distinguished_name = req_distinguished_name 3 | # The extensions to add to the self signed cert 4 | x509_extensions = v3_ca 5 | 6 | [req_distinguished_name] 7 | 8 | [v3_ca] 9 | # Extensions for a typical CA - PKIX recommendation. 10 | subjectKeyIdentifier = hash 11 | authorityKeyIdentifier = keyid:always, issuer 12 | 13 | # This is what PKIX recommends but some broken software chokes on critical 14 | # extensions. 15 | #basicConstraints = critical, CA:true 16 | # So we do this instead. 17 | basicConstraints = CA:true 18 | 19 | # Key usage: this is typical for a CA certificate. However since it will 20 | # prevent it being used as an test self-signed certificate it is best 21 | # left out by default. 22 | #keyUsage = cRLSign, keyCertSign 23 | 24 | # Some might want this also 25 | #nsCertType = sslCA, emailCA 26 | 27 | # Include email address in subject alt name: another PKIX recommendation 28 | #subjectAltName = email:copy 29 | # Copy issuer details 30 | #issuerAltName = issuer:copy 31 | 32 | # DER hex encoding of an extension: experts only! 33 | #obj = DER:02:03 34 | # Where 'obj' is a standard or added object 35 | # You can even override a supported extension: 36 | #basicConstraints = critical, DER:30:03:01:01:FF 37 | -------------------------------------------------------------------------------- /libipm/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 4 | -I$(top_srcdir)/common 5 | 6 | module_LTLIBRARIES = \ 7 | libipm.la 8 | 9 | libipm_la_SOURCES = \ 10 | libipm.h \ 11 | libipm.c \ 12 | libipm_send.c \ 13 | libipm_recv.c \ 14 | libipm_facilities.h \ 15 | libipm_private.h \ 16 | eicp.h \ 17 | eicp.c \ 18 | ercp.h \ 19 | ercp.c \ 20 | scp.h \ 21 | scp.c \ 22 | scp_sync.h \ 23 | scp_sync.c \ 24 | scp_application_types.h \ 25 | scp_application_types.c 26 | 27 | libipm_la_LIBADD = \ 28 | $(top_builddir)/common/libcommon.la 29 | -------------------------------------------------------------------------------- /libipm/libipm_facilities.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2022 Matt Burt, all xrdp contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * @file libipm/libipm_facilities.h 19 | * @brief Facilities numbers for facilities built on top of libipm 20 | */ 21 | 22 | #if !defined(LIBIPM__FACILITIES_H) 23 | #define LIBIPM__FACILITIES_H 24 | 25 | /** 26 | * Facilities layered on top of libipm (16 bits) 27 | */ 28 | enum libipm_facility 29 | { 30 | LIBIPM_FAC_SCP = 1, /**< SCP - Sesman Control Protocol */ 31 | LIBIPM_FAC_EICP, /**< EICP - Executive Initialization Control Protocol */ 32 | LIBIPM_FAC_ERCP, /**< ERCP - Executive Run-time Control Protocol */ 33 | 34 | LIBIPM_FAC_TEST = 65535 /**< Used for unit testing */ 35 | }; 36 | 37 | #endif /* LIBIPM_FACILITIES_H */ 38 | -------------------------------------------------------------------------------- /libxrdp/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | xrdp_surface.c 3 | 4 | AM_CPPFLAGS = \ 5 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 6 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 7 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 8 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 9 | -I$(top_srcdir)/common 10 | 11 | AM_CFLAGS = $(OPENSSL_CFLAGS) 12 | 13 | AM_LDFLAGS = 14 | 15 | LIBXRDP_EXTRA_LIBS = 16 | 17 | if XRDP_NEUTRINORDP 18 | AM_CPPFLAGS += -DXRDP_NEUTRINORDP 19 | LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) 20 | endif 21 | 22 | if XRDP_RFXCODEC 23 | AM_CPPFLAGS += -DXRDP_RFXCODEC 24 | endif 25 | 26 | if XRDP_TJPEG 27 | AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ 28 | AM_LDFLAGS += @TurboJpegLibDir@ 29 | LIBXRDP_EXTRA_LIBS += -lturbojpeg 30 | else 31 | if XRDP_JPEG 32 | AM_CPPFLAGS += -DXRDP_JPEG 33 | LIBXRDP_EXTRA_LIBS += -ljpeg 34 | endif 35 | endif 36 | 37 | module_LTLIBRARIES = \ 38 | libxrdp.la 39 | 40 | libxrdp_la_SOURCES = \ 41 | libxrdp.c \ 42 | libxrdp.h \ 43 | libxrdpinc.h \ 44 | xrdp_bitmap32_compress.c \ 45 | xrdp_bitmap_compress.c \ 46 | xrdp_caps.c \ 47 | xrdp_channel.c \ 48 | xrdp_channel.h \ 49 | xrdp_fastpath.c \ 50 | xrdp_iso.c \ 51 | xrdp_jpeg_compress.c \ 52 | xrdp_mcs.c \ 53 | xrdp_mppc_enc.c \ 54 | xrdp_orders.c \ 55 | xrdp_orders_rail.c \ 56 | xrdp_orders_rail.h \ 57 | xrdp_rdp.c \ 58 | xrdp_sec.c 59 | 60 | libxrdp_la_LIBADD = \ 61 | $(top_builddir)/common/libcommon.la \ 62 | $(LIBXRDP_EXTRA_LIBS) 63 | -------------------------------------------------------------------------------- /libxrdp/xrdp_channel.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-RDPEDYC : Definitions related to documentation in [MS-RDPEDYC] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * References to MS-RDPEDYC are currently correct for v20210406 of that 19 | * document 20 | */ 21 | 22 | #if !defined(XRDP_CHANNEL_H) 23 | #define XRDP_CHANNEL_H 24 | 25 | /* 26 | These are not directly defined in MS-RDPEDYC, but 27 | they are derived statuses needed to implement it. 28 | */ 29 | #define XRDP_DRDYNVC_STATUS_CLOSED 0 30 | #define XRDP_DRDYNVC_STATUS_OPEN_SENT 1 31 | #define XRDP_DRDYNVC_STATUS_OPEN 2 32 | #define XRDP_DRDYNVC_STATUS_CLOSE_SENT 3 33 | 34 | #define XRDP_DRDYNVC_STATUS_TO_STR(status) \ 35 | ((status) == XRDP_DRDYNVC_STATUS_CLOSED ? "CLOSED" : \ 36 | (status) == XRDP_DRDYNVC_STATUS_OPEN_SENT ? "OPEN_SENT" : \ 37 | (status) == XRDP_DRDYNVC_STATUS_OPEN ? "OPEN" : \ 38 | (status) == XRDP_DRDYNVC_STATUS_CLOSE_SENT ? "CLOSE_SENT" : \ 39 | "unknown" \ 40 | ) 41 | 42 | #endif /* XRDP_CHANNEL_H */ 43 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | lt*.m4 3 | -------------------------------------------------------------------------------- /m4/ax_require_defined.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_require_defined.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_REQUIRE_DEFINED(MACRO) 8 | # 9 | # DESCRIPTION 10 | # 11 | # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have 12 | # been defined and thus are available for use. This avoids random issues 13 | # where a macro isn't expanded. Instead the configure script emits a 14 | # non-fatal: 15 | # 16 | # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found 17 | # 18 | # It's like AC_REQUIRE except it doesn't expand the required macro. 19 | # 20 | # Here's an example: 21 | # 22 | # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) 23 | # 24 | # LICENSE 25 | # 26 | # Copyright (c) 2014 Mike Frysinger 27 | # 28 | # Copying and distribution of this file, with or without modification, are 29 | # permitted in any medium without royalty provided the copyright notice 30 | # and this notice are preserved. This file is offered as-is, without any 31 | # warranty. 32 | 33 | #serial 1 34 | 35 | AC_DEFUN([AX_REQUIRE_DEFINED], [dnl 36 | m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) 37 | ])dnl AX_REQUIRE_DEFINED 38 | -------------------------------------------------------------------------------- /m4/axrdp.m4: -------------------------------------------------------------------------------- 1 | # SYNOPSIS 2 | # 3 | # AXRDP_CHECK_UTMPX_MEMBER_EXISTS(MEMBER, COMPILE-DEFINE) 4 | # 5 | # EXAMPLE 6 | # 7 | # AXRDP_CHECK_UTMPX_MEMBER_EXISTS([ut_exit], [HAVE_UTMPX_UT_EXIT]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # If the member MEMBER exists in the utmpx struct, the COMPILE-DEFINE 12 | # is set for the C compiler. 13 | # 14 | # The shell variable 'ac_cv_utmpx_has_$MEMBER' is set to 'yes' or 'no' 15 | # and cached 16 | # 17 | AC_DEFUN([AXRDP_CHECK_UTMPX_MEMBER_EXISTS], 18 | [ 19 | AS_VAR_PUSHDEF([x_var], [ac_cv_utmpx_has_$1]) 20 | AS_VAR_PUSHDEF([x_define], [$2]) 21 | AC_CACHE_CHECK( 22 | [for $1 in struct utmpx], 23 | [x_var], 24 | [AC_COMPILE_IFELSE( 25 | [AC_LANG_SOURCE([[ 26 | # include 27 | # include 28 | int main() 29 | { 30 | return offsetof(struct utmpx,$1); 31 | }]])], 32 | [AS_VAR_SET([x_var], [yes])], 33 | [AS_VAR_SET([x_var], [no])])] 34 | ) 35 | AS_VAR_IF( 36 | [x_var], 37 | [yes], 38 | [AC_DEFINE([x_define], [1], [Define if '$1' is in struct utmpx.])]) 39 | AS_VAR_POPDEF([x_var]) 40 | AS_VAR_POPDEF([x_define]) 41 | ]) 42 | 43 | 44 | -------------------------------------------------------------------------------- /mc/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | module_LTLIBRARIES = \ 9 | libmc.la 10 | 11 | libmc_la_SOURCES = \ 12 | mc.c \ 13 | mc.h 14 | 15 | libmc_la_LIBADD = \ 16 | $(top_builddir)/common/libcommon.la 17 | 18 | if !MACOS 19 | libmc_la_LDFLAGS = -avoid-version -module 20 | endif 21 | -------------------------------------------------------------------------------- /neutrinordp/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common \ 7 | $(FREERDP_CFLAGS) 8 | 9 | module_LTLIBRARIES = \ 10 | libxrdpneutrinordp.la 11 | 12 | libxrdpneutrinordp_la_SOURCES = \ 13 | xrdp-color.c \ 14 | xrdp-color.h \ 15 | xrdp-neutrinordp.c \ 16 | xrdp-neutrinordp.h 17 | 18 | libxrdpneutrinordp_la_LIBADD = \ 19 | $(top_builddir)/common/libcommon.la \ 20 | $(FREERDP_LIBS) 21 | 22 | libxrdpneutrinordp_la_LDFLAGS = -avoid-version -module 23 | -------------------------------------------------------------------------------- /neutrinordp/xrdp-color.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Server 3 | * freerdp wrapper 4 | * 5 | * Copyright 2011-2012 Jay Sorg 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef __XRDP_COLOR_H 21 | #define __XRDP_COLOR_H 22 | 23 | char * 24 | convert_bitmap(int in_bpp, int out_bpp, char *bmpdata, 25 | int width, int height, int *palette); 26 | int 27 | convert_color(int in_bpp, int out_bpp, int in_color, int *palette); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /pkgconfig/.gitignore: -------------------------------------------------------------------------------- 1 | xrdp.pc 2 | xrdp-uninstalled.pc 3 | -------------------------------------------------------------------------------- /pkgconfig/Makefile.am: -------------------------------------------------------------------------------- 1 | pkgconfigdir = @pkgconfigdir@ 2 | pkgconfig_DATA = xrdp.pc 3 | -------------------------------------------------------------------------------- /pkgconfig/xrdp-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | abs_top_srcdir=@abs_top_srcdir@ 2 | includedir=${abs_top_srcdir}/common 3 | 4 | Name: xrdp 5 | Description: An open source Remote Desktop Protocol (RDP) server 6 | Version: @VERSION@ 7 | Cflags: -I${includedir} 8 | -------------------------------------------------------------------------------- /pkgconfig/xrdp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: xrdp 7 | Description: An open source Remote Desktop Protocol (RDP) server 8 | Version: @VERSION@ 9 | Cflags: -I${includedir} 10 | -------------------------------------------------------------------------------- /scripts/install_astyle_dependencies_with_apt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eufx 3 | 4 | PACKAGES="subversion cmake" 5 | 6 | apt-get update 7 | apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES 8 | -------------------------------------------------------------------------------- /scripts/install_cppcheck_dependencies_with_apt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eufx 3 | 4 | # these are the packages necessary to run ./configure so config_ac.h is generated 5 | PACKAGES="libpam0g-dev libxfixes-dev libxrandr-dev libxkbfile-dev nasm" 6 | 7 | usage() 8 | { 9 | echo "** Usage: $0 " 10 | echo " e.g. $0 1.90" 11 | } >&2 12 | 13 | if [ $# -ne 1 ]; then 14 | usage 15 | exit 1 16 | fi 17 | CPPCHECK_VER="$1" 18 | 19 | apt-get update 20 | 21 | case "$CPPCHECK_VER" in 22 | 1.*) 23 | # no dependencies 24 | ;; 25 | 2.8 | 2.9 | 2.1*) 26 | # Cppcheck 2.8 removed the dependency on z3 27 | # Cppcheck 2.8 added optional support for utilizing Boost 28 | PACKAGES="$PACKAGES libboost-container-dev" 29 | ;; 30 | 2.*) 31 | PACKAGES="$PACKAGES libz3-dev z3" 32 | ;; 33 | esac 34 | 35 | apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES 36 | -------------------------------------------------------------------------------- /sesman/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | Doxyfile 3 | 4 | AM_CPPFLAGS = \ 5 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 6 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 7 | -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ 8 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 9 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 10 | -I$(top_srcdir)/sesman/libsesman \ 11 | -I$(top_srcdir)/common \ 12 | -I$(top_srcdir)/libipm 13 | 14 | sbin_PROGRAMS = \ 15 | xrdp-sesman 16 | 17 | xrdp_sesman_SOURCES = \ 18 | eicp_process.c \ 19 | eicp_process.h \ 20 | ercp_process.c \ 21 | ercp_process.h \ 22 | lock_uds.c \ 23 | lock_uds.h \ 24 | pre_session_list.c \ 25 | pre_session_list.h \ 26 | scp_process.c \ 27 | scp_process.h \ 28 | sesman.c \ 29 | sesman.h \ 30 | sesman.ini.in \ 31 | sesexec_control.c \ 32 | sesexec_control.h \ 33 | session_list.c \ 34 | session_list.h \ 35 | sesman_restart.c \ 36 | sesman_restart.h \ 37 | sig.c \ 38 | sig.h 39 | 40 | xrdp_sesman_LDADD = \ 41 | $(top_builddir)/sesman/libsesman/libsesman.la \ 42 | $(top_builddir)/libipm/libipm.la \ 43 | $(top_builddir)/common/libcommon.la 44 | 45 | sesmansysconfdir=$(sysconfdir)/$(sysconfsubdir) 46 | 47 | SUBST_VARS = sed \ 48 | -e 's|@sesmansysconfdir[@]|$(sesmansysconfdir)|g' 49 | 50 | subst_verbose = $(subst_verbose_@AM_V@) 51 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 52 | subst_verbose_0 = @echo " SUBST $@"; 53 | 54 | SUFFIXES = .in 55 | .in: 56 | $(subst_verbose)$(SUBST_VARS) $< > $@ 57 | 58 | nodist_sesmansysconf_DATA = \ 59 | sesman.ini 60 | 61 | dist_sesmansysconf_SCRIPTS = \ 62 | startwm.sh \ 63 | reconnectwm.sh 64 | 65 | SUBDIRS = \ 66 | libsesman \ 67 | sesexec \ 68 | tools \ 69 | chansrv 70 | 71 | CLEANFILES = $(nodist_sesmansysconf_DATA) 72 | -------------------------------------------------------------------------------- /sesman/chansrv/audin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2019 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * MS-RDPEAI 19 | * 20 | */ 21 | 22 | #ifndef _AUDIN_H_ 23 | #define _AUDIN_H_ 24 | 25 | const char * 26 | audin_wave_format_tag_to_str(int tag); 27 | int 28 | audin_init(void); 29 | int 30 | audin_deinit(void); 31 | int 32 | audin_start(void); 33 | int 34 | audin_stop(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /sesman/chansrv/chansrv_common.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Laxmikant Rashinkar 2009-2014 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _CHANSRV_COMMON_H 20 | #define _CHANSRV_COMMON_H 21 | 22 | #include "parse.h" 23 | #include "os_calls.h" 24 | 25 | /* Define bitmask values for restricting the clipboard */ 26 | #define CLIP_RESTRICT_NONE 0 27 | #define CLIP_RESTRICT_TEXT (1<<0) 28 | #define CLIP_RESTRICT_FILE (1<<1) 29 | #define CLIP_RESTRICT_IMAGE (1<<2) 30 | #define CLIP_RESTRICT_ALL 0x7fffffff 31 | 32 | int read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, int length, int total_length); 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /sesman/chansrv/clipboard.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2009-2013 5 | * Copyright (C) Laxmikant Rashinkar 2012-2013 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #if !defined(CLIPBOARD_H) 21 | #define CLIPBOARD_H 22 | 23 | #include "arch.h" 24 | #include "parse.h" 25 | 26 | int clipboard_init(void); 27 | int clipboard_deinit(void); 28 | int clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); 29 | int clipboard_xevent(void *xevent); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /sesman/chansrv/input.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2014 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | #if !defined(INPUT_H) 20 | #define INPUT_H 21 | 22 | #include "arch.h" 23 | #include "parse.h" 24 | 25 | int 26 | xrdp_input_send_unicode(char32_t unicode); 27 | 28 | int 29 | xrdp_input_unicode_init(void); 30 | 31 | int 32 | xrdp_input_unicode_destroy(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | OBJS = xrdp_pcsc.o 3 | 4 | CFLAGS = -Wall -O2 -fPIC 5 | 6 | all: libpcsclite.so 7 | 8 | libpcsclite.so: $(OBJS) 9 | $(CC) $(LDFLAGS) -shared -o libpcsclite.so $(OBJS) 10 | 11 | clean: 12 | rm -f $(OBJS) libpcsclite.so 13 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-begin-tranaction.txt: -------------------------------------------------------------------------------- 1 | TS_SCardBeginTransaction: 2 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 3 | 0010 00 00 00 de 14 5c 5a 9e 86 37 2b 70 00 00 00 03 .....\Z..7+p.... 4 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 5 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 6 | 0040 00 00 00 bc 00 09 00 00 00 00 00 00 00 00 00 00 ................ 7 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 8 | 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 9 | 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 10 | 0080 00 00 00 02 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 11 | 0090 00 00 00 ... 12 | 13 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-connect.txt: -------------------------------------------------------------------------------- 1 | TS_SCardConnect: 2 | 0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........ 3 | 0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........ 4 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 5 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p 6 | 0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 7 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 8 | 0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............ 9 | 0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................ 10 | 0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m 11 | 0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m 12 | 00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n. 13 | 00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0...... 14 | 00c0 00 00 00 01 00 00 00 00 00 00 00 ........... 15 | TS_SCardConnect: 16 | 0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........ 17 | 0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........ 18 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 19 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p 20 | 0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 21 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 22 | 0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............ 23 | 0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................ 24 | 0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m 25 | 0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m 26 | 00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n. 27 | 00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0...... 28 | 00c0 00 00 00 01 00 00 00 00 00 00 00 ........... 29 | 30 | 31 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-disconnect.txt: -------------------------------------------------------------------------------- 1 | TS_SCardDisconnect: 2 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 3 | 0010 00 00 00 87 b4 3a 7f a4 2a 6d ad 70 00 00 00 03 .....:..*m.p.... 4 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 5 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 6 | 0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 7 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 8 | 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 9 | 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 10 | 0080 00 00 00 03 00 00 00 04 00 00 00 04 00 00 00 00 ................ 11 | 0090 00 00 00 ... 12 | TS_SCardDisconnect: 13 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 14 | 0010 00 00 00 72 7f fb 24 4e b1 36 c8 70 00 00 00 03 ...r..$N.6.p.... 15 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 16 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 17 | 0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 18 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 19 | 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 20 | 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 21 | 0080 00 00 00 04 00 00 00 04 00 00 00 05 00 00 00 00 ................ 22 | 0090 00 00 00 ... 23 | 24 | 25 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-establish-context.txt: -------------------------------------------------------------------------------- 1 | TS_SCardEstablishContext: 2 | 0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d.. 3 | 0010 00 00 a7 8d 52 74 fd 96 bc b4 50 00 00 00 03 00 ....Rt....P..... 4 | 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI.......... 5 | 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................ 6 | 0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 7 | 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 8 | 0060 cc cc 08 00 00 00 00 00 00 00 02 00 00 00 00 00 ................ 9 | 0070 00 00 .. 10 | TS_SCardEstablishContext: 11 | 0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d.. 12 | 0010 00 00 51 f7 43 00 73 65 44 53 50 00 00 00 03 00 ..Q.C.seDSP..... 13 | 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI.......... 14 | 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................ 15 | 0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 16 | 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 17 | 0060 cc cc 08 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 18 | 0070 00 00 .. 19 | 20 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-get-status-change.txt: -------------------------------------------------------------------------------- 1 | TS_SCardGetStatusChange: 2 | 0000 03 00 01 6b 02 f0 80 68 00 01 03 ed f0 81 5c 08 ...k...h......\. 3 | 0010 00 00 00 bf 53 5b 23 43 71 9b 2b 48 01 00 00 03 ....S[#Cq.+H.... 4 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 5 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 10 ................ 6 | 0040 01 00 00 a4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 7 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 8 | 0060 cc cc cc 00 01 00 00 00 00 00 00 04 00 00 00 00 ................ 9 | 0070 00 02 00 ff ff ff ff 02 00 00 00 04 00 02 00 04 ................ 10 | 0080 00 00 00 01 00 00 00 02 00 00 00 08 00 02 00 00 ................ 11 | 0090 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 12 | 00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 13 | 00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c ................ 14 | 00c0 00 02 00 10 00 00 00 00 00 00 00 00 00 00 00 00 ................ 15 | 00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 16 | 00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 17 | 00f0 00 00 00 15 00 00 00 00 00 00 00 15 00 00 00 5c ...............\ 18 | 0100 00 5c 00 3f 00 50 00 6e 00 50 00 3f 00 5c 00 4e .\.?.P.n.P.?.\.N 19 | 0110 00 6f 00 74 00 69 00 66 00 69 00 63 00 61 00 74 .o.t.i.f.i.c.a.t 20 | 0120 00 69 00 6f 00 6e 00 00 00 00 00 19 00 00 00 00 .i.o.n.......... 21 | 0130 00 00 00 19 00 00 00 47 00 65 00 6d 00 70 00 6c .......G.e.m.p.l 22 | 0140 00 75 00 73 00 20 00 47 00 65 00 6d 00 50 00 43 .u.s. .G.e.m.P.C 23 | 0150 00 20 00 54 00 77 00 69 00 6e 00 20 00 30 00 30 . .T.w.i.n. .0.0 24 | 0160 00 20 00 30 00 30 00 00 00 00 00 . .0.0..... 25 | 26 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-release-context.txt: -------------------------------------------------------------------------------- 1 | 0000 03 00 00 7a 02 f0 80 68 00 01 03 ed f0 6c 08 00 ...z...h.....l.. 2 | 0010 00 00 c9 9d 01 9e ec 30 a3 4c 58 00 00 00 03 00 .......0.LX..... 3 | 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 4 | 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 20 00 .............. . 5 | 0040 00 00 18 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 6 | 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 7 | 0060 cc cc 10 00 00 00 00 00 00 00 04 00 00 00 00 00 ................ 8 | 0070 02 00 04 00 00 00 02 00 00 00 .......... 9 | 10 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/wrapper/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CC=bcc32.exe 3 | 4 | CFLAGS=-O2 5 | 6 | OBJS=winscard.obj 7 | 8 | winscard.dll: $(OBJS) 9 | $(CC) -ewinscard.dll -tWD $(OBJS) 10 | 11 | clean: 12 | -del winscard.dll 13 | -del *.obj 14 | -del *.tds 15 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/wrapper/winscard.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | SCardEstablishContext 3 | SCardReleaseContext 4 | SCardIsValidContext 5 | SCardListReaderGroupsA 6 | SCardListReaderGroupsW 7 | SCardListReadersA 8 | SCardListReadersW 9 | SCardListCardsA 10 | SCardListCardsW 11 | SCardListInterfacesA 12 | SCardListInterfacesW 13 | SCardGetProviderIdA 14 | SCardGetProviderIdW 15 | SCardGetCardTypeProviderNameA 16 | SCardGetCardTypeProviderNameW 17 | SCardIntroduceReaderGroupA 18 | SCardIntroduceReaderGroupW 19 | SCardForgetReaderGroupA 20 | SCardForgetReaderGroupW 21 | SCardIntroduceReaderA 22 | SCardIntroduceReaderW 23 | SCardForgetReaderA 24 | SCardForgetReaderW 25 | SCardAddReaderToGroupA 26 | SCardAddReaderToGroupW 27 | SCardRemoveReaderFromGroupA 28 | SCardRemoveReaderFromGroupW 29 | SCardIntroduceCardTypeA 30 | SCardIntroduceCardTypeW 31 | SCardSetCardTypeProviderNameA 32 | SCardSetCardTypeProviderNameW 33 | SCardForgetCardTypeA 34 | SCardForgetCardTypeW 35 | SCardFreeMemory 36 | SCardLocateCardsA 37 | SCardLocateCardsW 38 | SCardGetStatusChangeA 39 | SCardGetStatusChangeW 40 | SCardCancel 41 | SCardConnectA 42 | SCardConnectW 43 | SCardReconnect 44 | SCardDisconnect 45 | SCardBeginTransaction 46 | SCardEndTransaction 47 | SCardState 48 | SCardStatusA 49 | SCardStatusW 50 | SCardTransmit 51 | SCardControl 52 | SCardGetAttrib 53 | SCardSetAttrib 54 | -------------------------------------------------------------------------------- /sesman/chansrv/rail.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2012 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _RAIL_H_ 20 | #define _RAIL_H_ 21 | 22 | #include "../../common/rail.h" 23 | #include "arch.h" 24 | #include "parse.h" 25 | 26 | int 27 | rail_init(void); 28 | int 29 | rail_deinit(void); 30 | int 31 | rail_data_in(struct stream *s, int chan_id, int chan_flags, 32 | int length, int total_length); 33 | int 34 | rail_xevent(void *xevent); 35 | int rail_request_title(int window_id); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /sesman/chansrv/xcommon.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2012 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #if !defined(XCOMMON_H) 20 | #define XCOMMON_H 21 | 22 | #include "arch.h" 23 | #include "parse.h" 24 | 25 | /* 32 implies long */ 26 | #define FORMAT_TO_BYTES(_format) \ 27 | (_format) == 32 ? sizeof(long) : (_format) / 8 28 | 29 | typedef void (*x_server_fatal_cb_type)(void); 30 | 31 | int 32 | xcommon_init(void); 33 | int 34 | xcommon_get_wait_objs(tbus *objs, int *count, int *timeout); 35 | int 36 | xcommon_check_wait_objs(void); 37 | void 38 | xcommon_set_x_server_fatal_handler(x_server_fatal_cb_type handler); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sesman/eicp_process.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2023 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file eicp_process.h 22 | * @brief eicp (executive initialisation control protocol) handler function 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | #ifndef EICP_PROCESS_H 28 | #define EICP_PROCESS_H 29 | 30 | struct pre_session_item; 31 | 32 | /** 33 | * 34 | * @brief Processes an EICP message 35 | * @param sc the sesman connection 36 | * 37 | */ 38 | int 39 | eicp_process(struct pre_session_item *psi); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sesman/ercp_process.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2023 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file ercp_process.h 22 | * @brief ERCP (executive run-time control protocol) handler function 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | #ifndef ERCP_PROCESS_H 28 | #define ERCP_PROCESS_H 29 | 30 | struct session_item; 31 | 32 | /** 33 | * 34 | * @brief Processes an ERCP message 35 | * @param sc the sesman connection 36 | * 37 | */ 38 | int 39 | ercp_process(struct session_item *si); 40 | 41 | #endif // ERCP_PROCESS_H 42 | -------------------------------------------------------------------------------- /sesman/libsesman/Makefile.am: -------------------------------------------------------------------------------- 1 | #EXTRA_DIST = \ 2 | #xrdp_surface.c 3 | 4 | AM_CPPFLAGS = \ 5 | -DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \ 6 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 7 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 8 | -I$(top_srcdir)/libipm \ 9 | -I$(top_srcdir)/common 10 | # -DXRDP_SBIN_PATH=\"${sbindir}\" \ 11 | # -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 12 | # -DXRDP_PID_PATH=\"${localstatedir}/run\" 13 | 14 | #AM_CFLAGS = $(OPENSSL_CFLAGS) 15 | 16 | #AM_LDFLAGS = 17 | 18 | #LIBXRDP_EXTRA_LIBS = 19 | 20 | #if XRDP_NEUTRINORDP 21 | #AM_CPPFLAGS += -DXRDP_NEUTRINORDP 22 | #LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) 23 | #endif 24 | 25 | #if XRDP_RFXCODEC 26 | #AM_CPPFLAGS += -DXRDP_RFXCODEC 27 | #endif 28 | 29 | #if XRDP_TJPEG 30 | #AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ 31 | #AM_LDFLAGS += @TurboJpegLibDir@ 32 | #LIBXRDP_EXTRA_LIBS += -lturbojpeg 33 | #else 34 | #if XRDP_JPEG 35 | #AM_CPPFLAGS += -DXRDP_JPEG 36 | #LIBXRDP_EXTRA_LIBS += -ljpeg 37 | #endif 38 | #endif 39 | 40 | module_LTLIBRARIES = \ 41 | libsesman.la 42 | 43 | # Possible authentication modules 44 | # See https://www.gnu.org/software/automake/manual/html_node/Conditional-Sources.html 45 | EXTRA_libsesman_la_SOURCES = \ 46 | verify_user.c \ 47 | verify_user_bsd.c \ 48 | verify_user_kerberos.c \ 49 | verify_user_pam.c \ 50 | verify_user_pam_userpass.c 51 | 52 | # Make sure the right authentication module is pulled in 53 | libsesman_la_DEPENDENCIES = $(AUTHMOD_OBJ) 54 | 55 | libsesman_la_SOURCES = \ 56 | sesman_access.h \ 57 | sesman_access.c \ 58 | sesman_auth.h \ 59 | sesman_config.h \ 60 | sesman_config.c \ 61 | sesman_clip_restrict.h \ 62 | sesman_clip_restrict.c 63 | 64 | libsesman_la_LIBADD = \ 65 | $(AUTHMOD_OBJ) \ 66 | $(top_builddir)/libipm/libipm.la \ 67 | $(top_builddir)/common/libcommon.la \ 68 | $(AUTHMOD_LIB) 69 | -------------------------------------------------------------------------------- /sesman/libsesman/sesman_access.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sesman_access.h 22 | * @brief User access control definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SESMAN_ACCESS_H 28 | #define SESMAN_ACCESS_H 29 | 30 | struct config_security; 31 | 32 | /** 33 | * 34 | * @brief Checks if the user is allowed to access the terminal server 35 | * @param user the user to check 36 | * @return 0 if access is denied, !=0 if allowed 37 | * 38 | */ 39 | int 40 | access_login_allowed(const struct config_security *cfg_sec, 41 | const char *user); 42 | 43 | /** 44 | * 45 | * @brief Checks if the user is allowed to admin the terminal server 46 | * @param user the user to check 47 | * @return != 0 if the user can perform administrative tasks 48 | * 49 | */ 50 | int 51 | access_login_is_admin(const struct config_security *cfg_sec, 52 | const char *user); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /sesman/libsesman/sesman_clip_restrict.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * This file contains the chansrv configuration parameters from sesman.ini 17 | */ 18 | 19 | #ifndef SESMAN_CLIP_RESTRICT_H 20 | #define SESMAN_CLIP_RESTRICT_H 21 | 22 | #define CLIP_RESTRICT_NONE 0 23 | #define CLIP_RESTRICT_TEXT (1<<0) 24 | #define CLIP_RESTRICT_FILE (1<<1) 25 | #define CLIP_RESTRICT_IMAGE (1<<2) 26 | #define CLIP_RESTRICT_ALL 0x7fffffff 27 | 28 | /** 29 | * Converts a sesman clip restrict string to a bitmask 30 | * 31 | * @param inputstr Input string 32 | * @param unrecognised buffer for unrecognised tokens 33 | * @param unrecognised_len Length of the above 34 | * @return Bitmask 35 | * 36 | * The input is a comma-separated list of tokens as documented in 37 | * the sesman.ini manpage */ 38 | int 39 | sesman_clip_restrict_string_to_bitmask( 40 | const char *inputstr, 41 | char *unrecognised, 42 | unsigned int unrecognised_len); 43 | 44 | /** 45 | * Converts a sesman clip restrict bitmask to a string 46 | * 47 | * @param mask Input mask 48 | * @param output buffer for output string 49 | * @param output_len Length of the above 50 | * @return Length as for snprintf() 51 | */ 52 | int 53 | sesman_clip_restrict_mask_to_string( 54 | int mask, 55 | char output[], 56 | unsigned int output_len); 57 | 58 | #endif /* SESMAN_CLIP_RESTRICT_H */ 59 | 60 | -------------------------------------------------------------------------------- /sesman/notes.txt: -------------------------------------------------------------------------------- 1 | ************************************************************ 2 | ** Notes on the current version of the SCP protocol used ** 3 | ** to communicate with sesman ** 4 | ** ** 5 | ** This information is for internal documentational use ** 6 | ** only. It may be incomplete. The SCP protocol is ** 7 | ** internal, and may change for even minor releases. ** 8 | ************************************************************ 9 | 10 | The SCP protocol is layered on top of libipm, which is in 11 | ../libipm. See ../libipm/scp.h for the interface messages to xrdp-sesman 12 | -------------------------------------------------------------------------------- /sesman/reconnectwm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Write procedures here you want to execute on reconnect 4 | -------------------------------------------------------------------------------- /sesman/scp_process.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file scp_process.h 22 | * @brief scp (sesman control protocol) handler function 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SCP_PROCESS_H 28 | #define SCP_PROCESS_H 29 | 30 | struct pre_session_item; 31 | 32 | /** 33 | * 34 | * @brief Processes an SCP message 35 | * @param sc the sesman connection 36 | * 37 | */ 38 | int 39 | scp_process(struct pre_session_item *sc); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sesman/sesexec/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ 5 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 6 | -I$(top_srcdir)/sesman/libsesman \ 7 | -I$(top_srcdir)/libipm \ 8 | -I$(top_srcdir)/common 9 | 10 | SESEXEC_EXTRA_LIBS = 11 | 12 | if XRDP_UTMP 13 | AM_CPPFLAGS += -DUSE_UTMP 14 | endif 15 | 16 | pkglibexec_PROGRAMS = \ 17 | xrdp-sesexec 18 | 19 | xrdp_sesexec_SOURCES = \ 20 | sesexec.c \ 21 | sesexec.h \ 22 | session.c \ 23 | session.h \ 24 | eicp_server.c \ 25 | eicp_server.h \ 26 | ercp_server.c \ 27 | ercp_server.h \ 28 | env.c \ 29 | env.h \ 30 | login_info.c \ 31 | login_info.h \ 32 | sesexec_discover.c \ 33 | sesexec_discover.h \ 34 | sessionrecord.c \ 35 | sessionrecord.h \ 36 | xauth.c \ 37 | xauth.h \ 38 | xwait.c \ 39 | xwait.h 40 | 41 | xrdp_sesexec_LDFLAGS = 42 | 43 | xrdp_sesexec_LDADD = \ 44 | $(top_builddir)/sesman/libsesman/libsesman.la \ 45 | $(top_builddir)/libipm/libipm.la \ 46 | $(top_builddir)/common/libcommon.la \ 47 | $(SESEXEC_EXTRA_LIBS) 48 | -------------------------------------------------------------------------------- /sesman/sesexec/eicp_server.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2023 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file eicp_server.h 22 | * @brief eicp (executive initialisation control protocol) server function 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | #ifndef EICP_SERVER_H 28 | #define EICP_SERVER_H 29 | 30 | /** 31 | * 32 | * @brief Processes an EICP message 33 | * @param self The EICP transport the message is coming in on 34 | * 35 | */ 36 | int 37 | eicp_server(struct trans *self); 38 | 39 | #endif // EICP_SERVER_H 40 | -------------------------------------------------------------------------------- /sesman/sesexec/env.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file env.h 22 | * @brief User environment handling code declarations 23 | * @author Jay Sorg 24 | * 25 | */ 26 | 27 | #ifndef ENV_H 28 | #define ENV_H 29 | 30 | #include "list.h" 31 | 32 | /** 33 | * 34 | * @brief Creates vnc password file 35 | * @param filename VNC password file name 36 | * @param password The password to be encrypted 37 | * @return 0 on success, 1 on error 38 | * 39 | */ 40 | int 41 | env_check_password_file(const char *filename, const char *password); 42 | 43 | /** 44 | * 45 | * @brief Sets user environment ($PATH, $HOME, $UID, and others) 46 | * @param uid user ID 47 | * @param passwd_file VNC password file 48 | * @param display The session display 49 | * @return 0 on success, g_getuser_info() error codes on error 50 | * 51 | */ 52 | int 53 | env_set_user(int uid, char **passwd_file, int display, 54 | const struct list *env_names, const struct list *env_values); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /sesman/sesexec/ercp_server.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2023 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file ercp_server.h 22 | * @brief ercp (executive run-time control protocol) server function 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | #ifndef ERCP_SERVER_H 28 | #define ERCP_SERVER_H 29 | 30 | /** 31 | * 32 | * @brief Processes an ERCP message 33 | * @param self The ERCP transport the message is coming in on 34 | * 35 | */ 36 | int 37 | ercp_server(struct trans *self); 38 | 39 | #endif // ERCP_SERVER_H 40 | -------------------------------------------------------------------------------- /sesman/sesexec/sessionrecord.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Emmanuel Blindauer 2017 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sessionrecord.h 22 | * @brief utmp handling code 23 | * 24 | */ 25 | 26 | #ifndef SESSIONRECORD_H 27 | #define SESSIONRECORD_H 28 | 29 | struct login_info; 30 | struct proc_exit_status; 31 | 32 | /** 33 | * @brief Record login in utmp 34 | * 35 | * @param pid PID of window manager 36 | * @param display Display number 37 | * @param login_info Information about logged in user 38 | */ 39 | void 40 | utmp_login(int pid, int display, const struct login_info *login_info); 41 | 42 | /** 43 | * @brief Record logout in utmp 44 | * 45 | * @param pid PID of window manager 46 | * @param display Display number 47 | * @param exit_status Exit status of process 48 | */ 49 | void 50 | utmp_logout(int pid, int display, const struct proc_exit_status *exit_status); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /sesman/sesexec/xauth.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Emmanuel Blindauer 2016 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file xauth.c 22 | * @brief XAUTHORITY handling code 23 | * 24 | */ 25 | 26 | #if defined(HAVE_CONFIG_H) 27 | #include 28 | #endif 29 | 30 | #include 31 | #include "xauth.h" 32 | #include "log.h" 33 | #include "os_calls.h" 34 | #include "string_calls.h" 35 | 36 | 37 | /******************************************************************************/ 38 | int 39 | add_xauth_cookie(int display, const char *file) 40 | { 41 | FILE *dp; 42 | char cookie_str[33]; 43 | char cookie_bin[16]; 44 | char xauth_str[256]; 45 | int ret; 46 | 47 | g_random(cookie_bin, 16); 48 | g_bytes_to_hexstr(cookie_bin, 16, cookie_str, 33); 49 | 50 | g_sprintf(xauth_str, "xauth -q -f %s add :%d . %s", 51 | file, display, cookie_str); 52 | 53 | dp = popen(xauth_str, "r"); 54 | if (dp == NULL) 55 | { 56 | LOG(LOG_LEVEL_ERROR, "Unable to launch xauth"); 57 | return 1; 58 | } 59 | 60 | ret = pclose(dp); 61 | if (ret < 0) 62 | { 63 | LOG(LOG_LEVEL_ERROR, "An error occurred while running xauth"); 64 | return 1; 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /sesman/sesexec/xauth.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Emmanuel Blindauer 2016 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file xauth.c 22 | * @brief XAUTHORITY handling code 23 | * 24 | */ 25 | 26 | #ifndef XAUTH_H 27 | #define XAUTH_H 28 | 29 | /** 30 | * 31 | * @brief create the XAUTHORITY file for the user according to the display and the cookie 32 | * xauth uses XAUTHORITY if defined, ~/.Xauthority otherwise 33 | * @param display The session display 34 | * @param file If not NULL, write the authorization in the file instead of default location 35 | * @return 0 if adding the cookie is ok 36 | */ 37 | 38 | int 39 | add_xauth_cookie(int display, const char *file); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sesman/sesexec/xwait.h: -------------------------------------------------------------------------------- 1 | #ifndef XWAIT_H 2 | #define XWAIT_H 3 | 4 | #include 5 | 6 | enum xwait_status 7 | { 8 | XW_STATUS_OK = 0, 9 | XW_STATUS_MISC_ERROR, 10 | XW_STATUS_TIMED_OUT, 11 | XW_STATUS_FAILED_TO_START 12 | }; 13 | 14 | /** 15 | * 16 | * @brief waits for X to start 17 | * @param uid User to run program under 18 | * @param env_names Environment to set for user (names) 19 | * @param env_values Environment to set for user (values) 20 | * @param display number 21 | * @return status 22 | * 23 | */ 24 | enum xwait_status 25 | wait_for_xserver(uid_t uid, 26 | struct list *env_names, 27 | struct list *env_values, 28 | int display); 29 | #endif 30 | -------------------------------------------------------------------------------- /sesman/sesexec_control.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) 2023 Matt Burt 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sesexec_control.h 22 | * @brief Start/stop session executive process 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | 28 | #ifndef SESEXEC_H 29 | #define SESEXEC_H 30 | 31 | #include 32 | 33 | struct trans; 34 | struct pre_session_item; 35 | 36 | /** 37 | * Start a session executive 38 | * @param psi Pre-session item to allocate EICP transport to 39 | * @result 0 for success 40 | * 41 | * If non-zero is returned, all errors have been logged. 42 | * If zero is returned, the sesexec_trans and sesexec_pid fields of 43 | * the pre-session-item have been initialised. 44 | */ 45 | 46 | int 47 | sesexec_start(struct pre_session_item *psi); 48 | 49 | #endif // SESEXEC_H 50 | -------------------------------------------------------------------------------- /sesman/sesman.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sesman.h 22 | * @brief Main include file 23 | * @author Jay Sorg 24 | * 25 | */ 26 | 27 | #ifndef SESMAN_H 28 | #define SESMAN_H 29 | 30 | struct config_sesman; 31 | struct trans; 32 | 33 | /* Globals */ 34 | extern struct config_sesman *g_cfg; 35 | extern tintptr g_term_event; 36 | 37 | /* 38 | * Remove the listening transport 39 | * 40 | * Needed if reloading the config and the listener has changed 41 | */ 42 | void 43 | sesman_delete_listening_transport(void); 44 | 45 | /* 46 | * Create the listening socket transport 47 | * 48 | * @return 0 for success 49 | */ 50 | int 51 | sesman_create_listening_transport(const struct config_sesman *cfg); 52 | 53 | /** 54 | * Callback to process incoming SCP data 55 | */ 56 | int 57 | sesman_scp_data_in(struct trans *self); 58 | 59 | /** 60 | * Callback to process incoming EICP data 61 | */ 62 | int 63 | sesman_eicp_data_in(struct trans *self); 64 | 65 | /** 66 | * Callback to process incoming ERCP data 67 | */ 68 | int 69 | sesman_ercp_data_in(struct trans *self); 70 | 71 | /* 72 | * Check for termination 73 | */ 74 | int 75 | sesman_is_term(void); 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /sesman/sesman_restart.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Matt Burt 2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sesman_restart.h 22 | * @brief Sesman restart declarations 23 | * @author Matt Burt 24 | * 25 | */ 26 | 27 | 28 | #ifndef SESMAN_RESTART_H 29 | #define SESMAN_RESTART_H 30 | 31 | /** 32 | * Discover sessions from a previous sesman run 33 | * @return 0 for success 34 | * 35 | * Errors are logged 36 | */ 37 | int 38 | sesman_restart_discover_sessions(void); 39 | 40 | #endif // SESMAN_RESTART_H 41 | -------------------------------------------------------------------------------- /sesman/sig.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file sig.h 22 | * @brief Signal handling function declarations 23 | * @author Jay Sorg, Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SIG_H 28 | #define SIG_H 29 | 30 | /** 31 | * 32 | * @brief SIGHUP handling code 33 | * 34 | */ 35 | void 36 | sig_sesman_reload_cfg(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sesman/tools/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 4 | -I$(top_srcdir)/sesman/libsesman \ 5 | -I$(top_srcdir)/common \ 6 | -I$(top_srcdir)/libipm 7 | 8 | AM_CFLAGS = $(X_CFLAGS) 9 | 10 | bin_PROGRAMS = \ 11 | xrdp-sesrun \ 12 | xrdp-sesadmin \ 13 | xrdp-dis 14 | 15 | noinst_PROGRAMS = \ 16 | xrdp-authtest \ 17 | xrdp-xcon 18 | 19 | xrdp_sesrun_SOURCES = \ 20 | sesrun.c 21 | 22 | xrdp_sesadmin_SOURCES = \ 23 | sesadmin.c 24 | 25 | xrdp_dis_SOURCES = \ 26 | dis.c 27 | 28 | xrdp_dis_LDADD = \ 29 | $(top_builddir)/common/libcommon.la 30 | 31 | xrdp_xcon_SOURCES = \ 32 | xcon.c 33 | 34 | xrdp_authtest_SOURCES = \ 35 | authtest.c 36 | 37 | xrdp_sesrun_LDADD = \ 38 | $(top_builddir)/sesman/libsesman/libsesman.la \ 39 | $(top_builddir)/common/libcommon.la \ 40 | $(top_builddir)/libipm/libipm.la 41 | 42 | xrdp_sesadmin_LDADD = \ 43 | $(top_builddir)/sesman/libsesman/libsesman.la \ 44 | $(top_builddir)/common/libcommon.la \ 45 | $(top_builddir)/libipm/libipm.la 46 | 47 | xrdp_xcon_LDFLAGS = \ 48 | $(X_LIBS) 49 | 50 | xrdp_xcon_LDADD = \ 51 | $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) 52 | 53 | xrdp_authtest_LDADD = \ 54 | $(top_builddir)/sesman/libsesman/libsesman.la \ 55 | $(top_builddir)/common/libcommon.la \ 56 | $(top_builddir)/libipm/libipm.la \ 57 | $(AUTHMOD_LIB) 58 | -------------------------------------------------------------------------------- /sesman/tools/authmod.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 21 | * @file authmod.c 22 | * 23 | * @brief Pull in the configured authentication module 24 | * 25 | * Configured auth module is referenced by the macro define 26 | * XRDP_AUTHMOD_SRC, defined by the configure system 27 | * 28 | * @author Matt Burt 29 | */ 30 | 31 | #if defined(HAVE_CONFIG_H) 32 | #include 33 | #endif 34 | 35 | #include XRDP_AUTHMOD_SRC 36 | -------------------------------------------------------------------------------- /sesman/tools/xcon.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #if defined(HAVE_CONFIG_H) 20 | #include 21 | #endif 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | Display *g_display = 0; 33 | int g_x_socket = 0; 34 | 35 | int main(int argc, char **argv) 36 | { 37 | int i1; 38 | XEvent xevent; 39 | 40 | g_display = XOpenDisplay(0); 41 | 42 | if (g_display == 0) 43 | { 44 | printf("XOpenDisplay failed\n"); 45 | return 0; 46 | } 47 | 48 | g_x_socket = XConnectionNumber(g_display); 49 | 50 | while (1) 51 | { 52 | struct pollfd pollfd; 53 | pollfd.fd = g_x_socket; 54 | pollfd.events = POLLIN; 55 | pollfd.revents = 0; 56 | do 57 | { 58 | i1 = poll(&pollfd, 1, -1); 59 | } 60 | while (i1 < 0 && errno == EINTR); 61 | 62 | if (i1 < 0) 63 | { 64 | break; 65 | } 66 | 67 | XNextEvent(g_display, &xevent); 68 | } 69 | 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | readme.txt 4 | 5 | SUBDIRS = \ 6 | common \ 7 | libipm \ 8 | libxrdp \ 9 | memtest \ 10 | xrdp 11 | -------------------------------------------------------------------------------- /tests/common/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_builddir) \ 4 | -I$(top_srcdir)/common 5 | 6 | LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ 7 | $(top_srcdir)/tap-driver.sh 8 | 9 | PACKAGE_STRING = "libcommon" 10 | 11 | TESTS = test_common 12 | check_PROGRAMS = test_common 13 | 14 | test_common_SOURCES = \ 15 | test_common.h \ 16 | test_common_main.c \ 17 | test_fifo_calls.c \ 18 | test_list_calls.c \ 19 | test_list16_calls.c \ 20 | test_parse.c \ 21 | test_string_calls.c \ 22 | test_string_calls_unicode.c \ 23 | test_os_calls.c \ 24 | test_os_calls_signals.c \ 25 | test_ssl_calls.c \ 26 | test_base64.c \ 27 | test_guid.c \ 28 | test_scancode.c 29 | 30 | test_common_CFLAGS = \ 31 | @CHECK_CFLAGS@ \ 32 | -D TOP_SRCDIR=\"$(top_srcdir)\" 33 | 34 | test_common_LDADD = \ 35 | $(top_builddir)/common/libcommon.la \ 36 | @CHECK_LIBS@ 37 | -------------------------------------------------------------------------------- /tests/common/UTF-8-test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/common/UTF-8-test.txt -------------------------------------------------------------------------------- /tests/common/test_common.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TEST_COMMON_H 3 | #define TEST_COMMON_H 4 | 5 | #include 6 | 7 | char * 8 | bin_to_hex(const char *input, int length); 9 | 10 | Suite *make_suite_test_fifo(void); 11 | Suite *make_suite_test_list(void); 12 | Suite *make_suite_test_list16(void); 13 | Suite *make_suite_test_parse(void); 14 | Suite *make_suite_test_string(void); 15 | Suite *make_suite_test_string_unicode(void); 16 | Suite *make_suite_test_os_calls(void); 17 | Suite *make_suite_test_ssl_calls(void); 18 | Suite *make_suite_test_base64(void); 19 | Suite *make_suite_test_guid(void); 20 | Suite *make_suite_test_scancode(void); 21 | 22 | TCase *make_tcase_test_os_calls_signals(void); 23 | 24 | void os_calls_signals_init(void); 25 | void os_calls_signals_deinit(void); 26 | 27 | #endif /* TEST_COMMON_H */ 28 | -------------------------------------------------------------------------------- /tests/libipm/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_builddir) \ 4 | -I$(top_srcdir)/libipm \ 5 | -I$(top_srcdir)/common 6 | 7 | LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ 8 | $(top_srcdir)/tap-driver.sh 9 | 10 | PACKAGE_STRING = "libipm" 11 | 12 | TESTS = test_libipm 13 | check_PROGRAMS = test_libipm 14 | 15 | test_libipm_SOURCES = \ 16 | test_libipm_main.c \ 17 | test_libipm.h \ 18 | test_libipm_send_calls.c \ 19 | test_libipm_recv_calls.c 20 | 21 | test_libipm_CFLAGS = \ 22 | @CHECK_CFLAGS@ \ 23 | -D TOP_SRCDIR=\"$(top_srcdir)\" 24 | 25 | test_libipm_LDADD = \ 26 | $(top_builddir)/libipm/libipm.la \ 27 | $(top_builddir)/common/libcommon.la \ 28 | @CHECK_LIBS@ 29 | -------------------------------------------------------------------------------- /tests/libxrdp/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I$(top_builddir) \ 3 | -I$(top_srcdir)/libxrdp \ 4 | -I$(top_srcdir)/common 5 | 6 | LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ 7 | $(top_srcdir)/tap-driver.sh 8 | 9 | PACKAGE_STRING = "libxrdp" 10 | 11 | TESTS = test_libxrdp 12 | check_PROGRAMS = test_libxrdp 13 | 14 | test_libxrdp_SOURCES = \ 15 | test_libxrdp.h \ 16 | test_libxrdp_main.c \ 17 | test_libxrdp_process_monitor_stream.c \ 18 | test_xrdp_sec_process_mcs_data_monitors.c 19 | 20 | test_libxrdp_CFLAGS = \ 21 | @CHECK_CFLAGS@ 22 | 23 | test_libxrdp_LDADD = \ 24 | $(top_builddir)/common/libcommon.la \ 25 | $(top_builddir)/libxrdp/libxrdp.la \ 26 | @CHECK_LIBS@ 27 | -------------------------------------------------------------------------------- /tests/libxrdp/test_libxrdp.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_LIBXRDP_H 2 | #define TEST_LIBXRDP_H 3 | 4 | #include 5 | 6 | Suite *make_suite_test_xrdp_sec_process_mcs_data_monitors(void); 7 | Suite *make_suite_test_monitor_processing(void); 8 | 9 | #endif /* TEST_LIBXRDP_H */ 10 | -------------------------------------------------------------------------------- /tests/libxrdp/test_libxrdp_main.c: -------------------------------------------------------------------------------- 1 | #if defined(HAVE_CONFIG_H) 2 | #include "config_ac.h" 3 | #endif 4 | 5 | #include 6 | #include 7 | #include "log.h" 8 | #include "test_libxrdp.h" 9 | 10 | int main (void) 11 | { 12 | int number_failed; 13 | SRunner *sr; 14 | 15 | sr = srunner_create(make_suite_test_xrdp_sec_process_mcs_data_monitors()); 16 | srunner_add_suite(sr, make_suite_test_monitor_processing()); 17 | 18 | srunner_set_tap(sr, "-"); 19 | 20 | /* 21 | * Set up console logging */ 22 | struct log_config *lc = log_config_init_for_console(LOG_LEVEL_INFO, NULL); 23 | log_start_from_param(lc); 24 | log_config_free(lc); 25 | /* Disable stdout buffering, as this can confuse the error 26 | * reporting when running in libcheck fork mode */ 27 | setvbuf(stdout, NULL, _IONBF, 0); 28 | 29 | srunner_run_all (sr, CK_ENV); 30 | number_failed = srunner_ntests_failed(sr); 31 | srunner_free(sr); 32 | log_end(); 33 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 34 | } 35 | -------------------------------------------------------------------------------- /tests/memtest/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir)/common 4 | 5 | PACKAGE_STRING = "memtest" 6 | 7 | check_PROGRAMS = \ 8 | memtest 9 | 10 | memtest_SOURCES = \ 11 | libmem.h \ 12 | libmem.c \ 13 | memtest.c 14 | 15 | memtest_LDADD = \ 16 | $(top_builddir)/common/libcommon.la 17 | 18 | TESTS = \ 19 | memtest 20 | -------------------------------------------------------------------------------- /tests/memtest/libmem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _LIBMEM_C 3 | #define _LIBMEM_C 4 | 5 | void * 6 | libmem_init(unsigned int addr, int bytes); 7 | void 8 | libmem_deinit(void *aself); 9 | unsigned int 10 | libmem_alloc(void *obj, int bytes); 11 | int 12 | libmem_free(void *obj, unsigned int addr); 13 | int 14 | libmem_set_flags(void *obj, int flags); 15 | int 16 | libmem_clear_flags(void *obj, int flags); 17 | int 18 | libmem_get_alloced_bytes(void *obj); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /tests/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | this directory contains different tests 3 | 4 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_h264_only.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "H.264" ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_h264_preferred.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "H.264", "RFX" ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_order_undefined.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_rfx_only.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "RFX" ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_rfx_preferred.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "RFX", "H.264" ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_codec_rfx_preferred_odd.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "RFX", "H.264", "RFX" ] 3 | 4 | [x264.default] 5 | preset = "ultrafast" 6 | tune = "zerolatency" 7 | profile = "main" # profile is forced to baseline if preset == ultrafast 8 | vbv_max_bitrate = 0 9 | vbv_buffer_size = 0 10 | fps_num = 24 11 | fps_den = 1 12 | threads = 1 13 | 14 | [x264.lan] 15 | [x264.wan] 16 | [x264.broadband_high] 17 | [x264.satellite] 18 | [x264.broadband_low] 19 | [x264.modem] 20 | -------------------------------------------------------------------------------- /tests/xrdp/gfx/gfx_missing_h264.toml: -------------------------------------------------------------------------------- 1 | [codec] 2 | order = [ "H.264", "RFX" ] 3 | 4 | [x264.lan] 5 | [x264.wan] 6 | [x264.broadband_high] 7 | [x264.satellite] 8 | [x264.broadband_low] 9 | [x264.modem] 10 | -------------------------------------------------------------------------------- /tests/xrdp/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test1.jpg -------------------------------------------------------------------------------- /tests/xrdp/test_24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_24bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_4bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_4bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_8bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_8bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_alpha_blend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_alpha_blend.png -------------------------------------------------------------------------------- /tests/xrdp/test_not4_24bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_not4_24bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_not4_4bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_not4_4bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_not4_8bit.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/tests/xrdp/test_not4_8bit.bmp -------------------------------------------------------------------------------- /tests/xrdp/test_xrdp.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_XRDP_H 2 | #define TEST_XRDP_H 3 | 4 | #include 5 | 6 | Suite *make_suite_test_bitmap_load(void); 7 | Suite *make_suite_test_keymap_load(void); 8 | Suite *make_suite_egfx_base_functions(void); 9 | Suite *make_suite_region(void); 10 | Suite *make_suite_tconfig_load_gfx(void); 11 | 12 | #endif /* TEST_XRDP_H */ 13 | -------------------------------------------------------------------------------- /third_party/COPYING-THIRD-PARTY: -------------------------------------------------------------------------------- 1 | -- tomlc99: TOML C library 2 | 3 | MIT License 4 | 5 | Copyright (c) CK Tan 6 | https://github.com/cktan/tomlc99 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | 26 | -------------------------------------------------------------------------------- 27 | -------------------------------------------------------------------------------- /third_party/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | copying_third_party.h \ 3 | COPYING-THIRD-PARTY \ 4 | Makefile.copying \ 5 | README.md 6 | -------------------------------------------------------------------------------- /third_party/Makefile.copying: -------------------------------------------------------------------------------- 1 | 2 | copying: copying_third_party.h 3 | 4 | copying_third_party.h: 5 | bin2c copying_third_party < COPYING-THIRD-PARTY > copying_third_party.h 6 | 7 | clean: 8 | rm -f copying_third_party.h 9 | -------------------------------------------------------------------------------- /third_party/README.md: -------------------------------------------------------------------------------- 1 | # Third-Party Software Components 2 | 3 | Under this directory, third-party software/libraries developed independently 4 | of xrdp are imported as git submodules or subtree. Each third-party software 5 | is subject to its own software license. 6 | 7 | See [COPYING-THIRD-PARTY](third_party/COPYING-THIRD-PARTY) for full license 8 | statement of all third-party components. 9 | 10 | ``` 11 | third_party 12 | └── tomlc99 ······ TOML C library (MIT License) 13 | ``` 14 | 15 | ## Developer's Note 16 | 17 | In order to show all license terms in xrdp, follow the steps below after 18 | adding new third-party libraries. 19 | 20 | 1. Install [adobe/bin2c](https://github.com/adobe/bin2c) to your development 21 | environment 22 | 2. Write all third-party license terms to `COPYING-THIRD-PARTY` 23 | 3. Run `make -f Makefile.copying` to generate `copying_third_party.h` 24 | 4. Commit generated `copying_third_party.h` 25 | -------------------------------------------------------------------------------- /third_party/copying_third_party.h: -------------------------------------------------------------------------------- 1 | #include 2 | const char copying_third_party[] = "\ 3 | -- tomlc99: TOML C library\n\ 4 | \n\ 5 | MIT License\n\ 6 | \n\ 7 | Copyright (c) CK Tan\n\ 8 | https://github.com/cktan/tomlc99\n\ 9 | \n\ 10 | Permission is hereby granted, free of charge, to any person obtaining a copy\n\ 11 | of this software and associated documentation files (the \"Software\"), to deal\n\ 12 | in the Software without restriction, including without limitation the rights\n\ 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\ 14 | copies of the Software, and to permit persons to whom the Software is\n\ 15 | furnished to do so, subject to the following conditions:\n\ 16 | \n\ 17 | The above copyright notice and this permission notice shall be included in all\n\ 18 | copies or substantial portions of the Software.\n\ 19 | \n\ 20 | THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\ 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\ 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\ 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\ 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\ 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\ 26 | SOFTWARE.\n\ 27 | \n\ 28 | --------------------------------------------------------------------------------\n\ 29 | "; 30 | const size_t copying_third_party_len = sizeof(copying_third_party) - 1; 31 | -------------------------------------------------------------------------------- /third_party/tomlc99/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = false 6 | trim_trailing_whitespace = true 7 | 8 | [*.{c,h}] 9 | indent_style = space 10 | indent_size = 2 11 | 12 | [Makefile] 13 | indent_style = tab 14 | indent_size = 4 15 | -------------------------------------------------------------------------------- /third_party/tomlc99/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | 3 | # Object files 4 | *.o 5 | *.ko 6 | *.obj 7 | *.elf 8 | 9 | # Precompiled Headers 10 | *.gch 11 | *.pch 12 | 13 | # Libraries 14 | *.lib 15 | *.a 16 | *.la 17 | *.lo 18 | 19 | # Shared objects (inc. Windows DLLs) 20 | *.dll 21 | *.so 22 | *.so.* 23 | *.dylib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | *.i*86 30 | *.x86_64 31 | *.hex 32 | toml_cat 33 | toml_json 34 | toml_sample 35 | 36 | # Debug files 37 | *.dSYM/ 38 | *.su 39 | -------------------------------------------------------------------------------- /third_party/tomlc99/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) CK Tan 4 | https://github.com/cktan/tomlc99 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /third_party/tomlc99/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | toml.c \ 3 | toml.h \ 4 | LICENSE 5 | 6 | # See src/Makefile 7 | # '-x c' forces gcc to be used if we are using g++ for CI testing 8 | AM_CFLAGS = -x c -std=c99 -std=c99 -Wall -Wextra -fpic 9 | 10 | module_LTLIBRARIES = libtoml.la 11 | 12 | libtoml_la_SOURCES = toml.c toml.h 13 | 14 | libtoml_la_LDFLAGS = -version-info 1:0 15 | 16 | include_headers = toml.h 17 | 18 | -------------------------------------------------------------------------------- /third_party/tomlc99/libtoml.pc.sample: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: libtoml 7 | URL: https://github.com/cktan/tomlc99/ 8 | Description: TOML C library in c99. 9 | Version: v1.0 10 | Libs: -L${libdir} -ltoml 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /third_party/tomlc99/sample.toml: -------------------------------------------------------------------------------- 1 | [server] 2 | host = "example.com" 3 | port = [ 8080, 8181, 8282 ] 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/.gitignore: -------------------------------------------------------------------------------- 1 | /*.out 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/RUN.sh: -------------------------------------------------------------------------------- 1 | rm -f *.out 2 | for i in *.toml; do 3 | echo -n $i 4 | ../toml_cat $i >& $i.out 5 | if [ -f $i.res ]; then 6 | if $(diff $i.out $i.res >& /dev/null); then 7 | echo " [OK]" 8 | else 9 | echo " [FAILED]" 10 | fi 11 | else 12 | echo " [?????]" 13 | fi 14 | 15 | done 16 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arr1.toml: -------------------------------------------------------------------------------- 1 | integers = [ 1, 2, 3 ] 2 | colors = [ "red", "yellow", "green" ] 3 | nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ] 4 | nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] 5 | string_array = [ "all", 'strings', """are the same""", '''type''' ] 6 | 7 | # Mixed-type arrays are allowed 8 | numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ] 9 | contributors = [ 10 | "Foo Bar ", 11 | { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } 12 | ] 13 | 14 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arr1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | integers = [ 3 | 1, 4 | 2, 5 | 3, 6 | ], 7 | colors = [ 8 | "red", 9 | "yellow", 10 | "green", 11 | ], 12 | nested_arrays_of_ints = [ 13 | [ 14 | 1, 15 | 2, 16 | ], 17 | [ 18 | 3, 19 | 4, 20 | 5, 21 | ], 22 | ], 23 | nested_mixed_array = [ 24 | [ 25 | 1, 26 | 2, 27 | ], 28 | [ 29 | "a", 30 | "b", 31 | "c", 32 | ], 33 | ], 34 | string_array = [ 35 | "all", 36 | "strings", 37 | "are the same", 38 | "type", 39 | ], 40 | numbers = [ 41 | 0.100000, 42 | 0.200000, 43 | 0.500000, 44 | 1, 45 | 2, 46 | 5, 47 | ], 48 | contributors = [ 49 | "Foo Bar ", 50 | { 51 | name = "Baz Qux", 52 | email = "bazqux@example.com", 53 | url = "https://example.com/bazqux", 54 | }, 55 | ], 56 | } 57 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arr2.toml: -------------------------------------------------------------------------------- 1 | integers2 = [ 2 | 1, 2, 3 3 | ] 4 | 5 | integers3 = [ 6 | 1, 7 | 2, # this is ok 8 | ] 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arr2.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | integers2 = [ 3 | 1, 4 | 2, 5 | 3, 6 | ], 7 | integers3 = [ 8 | 1, 9 | 2, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab1.toml: -------------------------------------------------------------------------------- 1 | [[products]] 2 | name = "Hammer" 3 | sku = 738594937 4 | 5 | [[products]] # empty table within the array 6 | 7 | [[products]] 8 | name = "Nail" 9 | sku = 284758393 10 | 11 | color = "gray" 12 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | products = [ 3 | { 4 | name = "Hammer", 5 | sku = 738594937, 6 | }, 7 | { 8 | }, 9 | { 10 | name = "Nail", 11 | sku = 284758393, 12 | color = "gray", 13 | }, 14 | ], 15 | } 16 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab2.toml: -------------------------------------------------------------------------------- 1 | [[fruits]] 2 | name = "apple" 3 | 4 | [fruits.physical] # subtable 5 | color = "red" 6 | shape = "round" 7 | 8 | [[fruits.varieties]] # nested array of tables 9 | name = "red delicious" 10 | 11 | [[fruits.varieties]] 12 | name = "granny smith" 13 | 14 | 15 | [[fruits]] 16 | name = "banana" 17 | 18 | [[fruits.varieties]] 19 | name = "plantain" 20 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab2.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruits = [ 3 | { 4 | name = "apple", 5 | varieties = [ 6 | { 7 | name = "red delicious", 8 | }, 9 | { 10 | name = "granny smith", 11 | }, 12 | ], 13 | physical = { 14 | color = "red", 15 | shape = "round", 16 | }, 17 | }, 18 | { 19 | name = "banana", 20 | varieties = [ 21 | { 22 | name = "plantain", 23 | }, 24 | ], 25 | }, 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab3.toml: -------------------------------------------------------------------------------- 1 | # INVALID TOML DOC 2 | [fruit.physical] # subtable, but to which parent element should it belong? 3 | color = "red" 4 | shape = "round" 5 | 6 | [[fruit]] # parser must throw an error upon discovering that "fruit" is 7 | # an array rather than a table 8 | name = "apple" 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab3.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 6: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab4.toml: -------------------------------------------------------------------------------- 1 | # INVALID TOML DOC 2 | fruits = [] 3 | 4 | [[fruits]] # Not allowed 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab4.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 4: array mismatch 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab5.toml: -------------------------------------------------------------------------------- 1 | # INVALID TOML DOC 2 | [[fruits]] 3 | name = "apple" 4 | 5 | [[fruits.varieties]] 6 | name = "red delicious" 7 | 8 | # INVALID: This table conflicts with the previous array of tables 9 | [fruits.varieties] 10 | name = "granny smith" 11 | 12 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab5.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 9: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab6.toml: -------------------------------------------------------------------------------- 1 | # INVALID TOML DOC 2 | [[fruits]] 3 | name = "apple" 4 | 5 | [[fruits.varieties]] 6 | name = "red delicious" 7 | 8 | [fruits.physical] 9 | color = "red" 10 | shape = "round" 11 | 12 | # INVALID: This array of tables conflicts with the previous table 13 | [[fruits.physical]] 14 | color = "green" 15 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab6.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 13: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab7.toml: -------------------------------------------------------------------------------- 1 | points = [ { x = 1, y = 2, z = 3 }, 2 | { x = 7, y = 8, z = 9 }, 3 | { x = 2, y = 4, z = 8 } ] 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/arrtab7.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | points = [ 3 | { 4 | x = 1, 5 | y = 2, 6 | z = 3, 7 | }, 8 | { 9 | x = 7, 10 | y = 8, 11 | z = 9, 12 | }, 13 | { 14 | x = 2, 15 | y = 4, 16 | z = 8, 17 | }, 18 | ], 19 | } 20 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/bool1.toml: -------------------------------------------------------------------------------- 1 | bool1 = true 2 | bool2 = false 3 | 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/bool1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | bool1 = true, 3 | bool2 = false, 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/comment.toml: -------------------------------------------------------------------------------- 1 | # This is a full-line comment 2 | key = "value" # This is a comment at the end of a line 3 | another = "# This is not a comment" 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/comment.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | key = "value", 3 | another = "# This is not a comment", 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float1.toml: -------------------------------------------------------------------------------- 1 | # fractional 2 | flt1 = +1.0 3 | flt2 = 3.1415 4 | flt3 = -0.01 5 | 6 | # exponent 7 | flt4 = 5e+22 8 | flt5 = 1e06 9 | flt6 = -2E-2 10 | 11 | # both 12 | flt7 = 6.626e-34 13 | 14 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | flt1 = 1.000000, 3 | flt2 = 3.141500, 4 | flt3 = -0.010000, 5 | flt4 = 49999999999999995805696.000000, 6 | flt5 = 1000000.000000, 7 | flt6 = -0.020000, 8 | flt7 = 0.000000, 9 | } 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float2.toml: -------------------------------------------------------------------------------- 1 | invalid_float_1 = .7 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float2.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | ERROR: unable to decode value in table 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float3.toml: -------------------------------------------------------------------------------- 1 | invalid_float_2 = 7. 2 | 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float3.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | ERROR: unable to decode value in table 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float4.toml: -------------------------------------------------------------------------------- 1 | invalid_float_3 = 3.e+20 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float4.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | ERROR: unable to decode value in table 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float5.toml: -------------------------------------------------------------------------------- 1 | flt8 = 224_617.445_991_228 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float5.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | flt8 = 224617.445991, 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float6.toml: -------------------------------------------------------------------------------- 1 | # infinity 2 | sf1 = inf # positive infinity 3 | sf2 = +inf # positive infinity 4 | sf3 = -inf # negative infinity 5 | 6 | # not a number 7 | sf4 = nan # actual sNaN/qNaN encoding is implementation-specific 8 | sf5 = +nan # same as `nan` 9 | sf6 = -nan # valid, actual encoding is implementation-specific 10 | 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/float6.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | sf1 = inf, 3 | sf2 = inf, 4 | sf3 = -inf, 5 | sf4 = nan, 6 | sf5 = nan, 7 | sf6 = nan, 8 | } 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab1.toml: -------------------------------------------------------------------------------- 1 | name = { first = "Tom", last = "Preston-Werner" } 2 | point = { x = 1, y = 2 } 3 | animal = { type.name = "pug" } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | name = { 3 | first = "Tom", 4 | last = "Preston-Werner", 5 | }, 6 | point = { 7 | x = 1, 8 | y = 2, 9 | }, 10 | animal = { 11 | type = { 12 | name = "pug", 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab2.toml: -------------------------------------------------------------------------------- 1 | [product] 2 | type = { name = "Nail" } 3 | type.edible = false # INVALID 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab2.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 3: cannot insert new entry into existing table 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab3.toml: -------------------------------------------------------------------------------- 1 | [product] 2 | type.name = "Nail" 3 | type = { edible = false } # INVALID 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/inlinetab3.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 3: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/int0.toml: -------------------------------------------------------------------------------- 1 | int1 = +99 2 | int2 = 42 3 | int3 = 0 4 | int4 = -17 5 | int5 = 1_000 6 | int6 = 5_349_221 7 | int7 = 53_49_221 # Indian number system grouping 8 | int8 = 1_2_3_4_5 # VALID but discouraged 9 | 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/int0.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | int1 = 99, 3 | int2 = 42, 4 | int3 = 0, 5 | int4 = -17, 6 | int5 = 1000, 7 | int6 = 5349221, 8 | int7 = 5349221, 9 | int8 = 12345, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/int1.toml: -------------------------------------------------------------------------------- 1 | # hexadecimal with prefix `0x` 2 | hex1 = 0xDEADBEEF 3 | hex2 = 0xdeadbeef 4 | hex3 = 0xdead_beef 5 | 6 | # octal with prefix `0o` 7 | oct1 = 0o01234567 8 | oct2 = 0o755 # useful for Unix file permissions 9 | 10 | # binary with prefix `0b` 11 | bin1 = 0b11010110 12 | 13 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/int1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | hex1 = 3735928559, 3 | hex2 = 3735928559, 4 | hex3 = 3735928559, 5 | oct1 = 342391, 6 | oct2 = 493, 7 | bin1 = 214, 8 | } 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys00.toml: -------------------------------------------------------------------------------- 1 | key = "value" 2 | bare_key = "value" 3 | bare-key = "value" 4 | 1234 = "value" 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys00.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | key = "value", 3 | bare_key = "value", 4 | bare-key = "value", 5 | 1234 = "value", 6 | } 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys01.toml: -------------------------------------------------------------------------------- 1 | "127.0.0.1" = "value" 2 | "character encoding" = "value" 3 | "ʎǝʞ" = "value" 4 | 'key2' = "value" 5 | 'quoted "value"' = "value" 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys01.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | 127.0.0.1 = "value", 3 | character encoding = "value", 4 | ʎǝʞ = "value", 5 | key2 = "value", 6 | quoted "value" = "value", 7 | } 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys02.toml: -------------------------------------------------------------------------------- 1 | = "no key name" # INVALID 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys02.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 1: syntax error 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys03.toml: -------------------------------------------------------------------------------- 1 | "" = "blank" # VALID but discouraged 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys03.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | = "blank", 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys04.toml: -------------------------------------------------------------------------------- 1 | name = "Orange" 2 | physical.color = "orange" 3 | physical.shape = "round" 4 | site."google.com" = true 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys04.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | name = "Orange", 3 | physical = { 4 | color = "orange", 5 | shape = "round", 6 | }, 7 | site = { 8 | google.com = true, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys05.toml: -------------------------------------------------------------------------------- 1 | fruit.name = "banana" # this is best practice 2 | fruit. color = "yellow" # same as fruit.color 3 | fruit . flavor = "banana" # same as fruit.flavor 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys05.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruit = { 3 | name = "banana", 4 | color = "yellow", 5 | flavor = "banana", 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys06.toml: -------------------------------------------------------------------------------- 1 | # DO NOT DO THIS 2 | name = "Tom" 3 | name = "Pradyun" 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys06.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 3: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys07.toml: -------------------------------------------------------------------------------- 1 | # THIS WILL NOT WORK 2 | spelling = "favorite" 3 | "spelling" = "favourite" 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys07.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 3: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys08.toml: -------------------------------------------------------------------------------- 1 | # This makes the key "fruit" into a table. 2 | fruit.apple.smooth = true 3 | 4 | # So then you can add to the table "fruit" like so: 5 | fruit.orange = 2 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys08.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruit = { 3 | orange = 2, 4 | apple = { 5 | smooth = true, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys09.toml: -------------------------------------------------------------------------------- 1 | # THE FOLLOWING IS INVALID 2 | 3 | # This defines the value of fruit.apple to be an integer. 4 | fruit.apple = 1 5 | 6 | # But then this treats fruit.apple like it's a table. 7 | # You can't turn an integer into a table. 8 | fruit.apple.smooth = true 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys09.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 8: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys10.toml: -------------------------------------------------------------------------------- 1 | # VALID BUT DISCOURAGED 2 | 3 | apple.type = "fruit" 4 | orange.type = "fruit" 5 | 6 | apple.skin = "thin" 7 | orange.skin = "thick" 8 | 9 | apple.color = "red" 10 | orange.color = "orange" 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys10.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | apple = { 3 | type = "fruit", 4 | skin = "thin", 5 | color = "red", 6 | }, 7 | orange = { 8 | type = "fruit", 9 | skin = "thick", 10 | color = "orange", 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys11.toml: -------------------------------------------------------------------------------- 1 | # RECOMMENDED 2 | 3 | apple.type = "fruit" 4 | apple.skin = "thin" 5 | apple.color = "red" 6 | 7 | orange.type = "fruit" 8 | orange.skin = "thick" 9 | orange.color = "orange" 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys11.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | apple = { 3 | type = "fruit", 4 | skin = "thin", 5 | color = "red", 6 | }, 7 | orange = { 8 | type = "fruit", 9 | skin = "thick", 10 | color = "orange", 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys12.toml: -------------------------------------------------------------------------------- 1 | 3.14159 = "pi" 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/keys12.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | 3 = { 3 | 14159 = "pi", 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair0.toml: -------------------------------------------------------------------------------- 1 | key = "value" 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair0.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | key = "value", 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair1.toml: -------------------------------------------------------------------------------- 1 | key = # INVALID 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair1.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 1: syntax error 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair2.toml: -------------------------------------------------------------------------------- 1 | first = "Tom" last = "Preston-Werner" # INVALID 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/kvpair2.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 1: extra chars after value 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string0.toml: -------------------------------------------------------------------------------- 1 | str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string0.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | str = "I'm a string. \"You can quote me\". Name\tJos\0xc3\0xa9\nLocation\tSF.", 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string1.toml: -------------------------------------------------------------------------------- 1 | str1 = """ 2 | Roses are red 3 | Violets are blue""" 4 | 5 | # On a Unix system, the above multi-line string will most likely be the same as: 6 | str2 = "Roses are red\nViolets are blue" 7 | 8 | # On a Windows system, it will most likely be equivalent to: 9 | str3 = "Roses are red\r\nViolets are blue" 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | str1 = "Roses are red\nViolets are blue", 3 | str2 = "Roses are red\nViolets are blue", 4 | str3 = "Roses are red\r\nViolets are blue", 5 | } 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string3.toml: -------------------------------------------------------------------------------- 1 | # The following strings are byte-for-byte equivalent: 2 | str1 = "The quick brown fox jumps over the lazy dog." 3 | 4 | str2 = """ 5 | The quick brown \ 6 | 7 | 8 | fox jumps over \ 9 | the lazy dog.""" 10 | 11 | str3 = """\ 12 | The quick brown \ 13 | fox jumps over \ 14 | the lazy dog.\ 15 | """ 16 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string3.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | str1 = "The quick brown fox jumps over the lazy dog.", 3 | str2 = "The quick brown fox jumps over the lazy dog.", 4 | str3 = "The quick brown fox jumps over the lazy dog.", 5 | } 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string4.toml: -------------------------------------------------------------------------------- 1 | str4 = """Here are two quotation marks: "". Simple enough.""" 2 | # str5 = """Here are three quotation marks: """.""" # INVALID 3 | str5 = """Here are three quotation marks: ""\".""" 4 | str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" 5 | 6 | # "This," she said, "is just a pointless statement." 7 | str7 = """"This," she said, "is just a pointless statement."""" 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string4.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | str4 = "Here are two quotation marks: \"\". Simple enough.", 3 | str5 = "Here are three quotation marks: \"\"\".", 4 | str6 = "Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\".", 5 | str7 = "\"This,\" she said, \"is just a pointless statement.\"", 6 | } 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string5.toml: -------------------------------------------------------------------------------- 1 | # What you see is what you get. 2 | winpath = 'C:\Users\nodejs\templates' 3 | winpath2 = '\\ServerX\admin$\system32\' 4 | quoted = 'Tom "Dubs" Preston-Werner' 5 | regex = '<\i\c*\s*>' 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string5.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | winpath = "C:\\Users\\nodejs\\templates", 3 | winpath2 = "\\\\ServerX\\admin$\\system32\\", 4 | quoted = "Tom \"Dubs\" Preston-Werner", 5 | regex = "<\\i\\c*\\s*>", 6 | } 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string6.toml: -------------------------------------------------------------------------------- 1 | regex2 = '''I [dw]on't need \d{2} apples''' 2 | lines = ''' 3 | The first newline is 4 | trimmed in raw strings. 5 | All other whitespace 6 | is preserved. 7 | ''' 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string6.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | regex2 = "I [dw]on't need \\d{2} apples", 3 | lines = "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n", 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string7.toml: -------------------------------------------------------------------------------- 1 | quot15 = '''Here are fifteen quotation marks: """""""""""""""''' 2 | 3 | # 'That,' she said, 'is still pointless.' 4 | str = ''''That,' she said, 'is still pointless.'''' 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string7.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | quot15 = "Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"", 3 | str = "'That,' she said, 'is still pointless.'", 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string8.toml: -------------------------------------------------------------------------------- 1 | # apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID 2 | apos15 = "Here are fifteen apostrophes: '''''''''''''''" 3 | 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/string8.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 2: triple-s-quote inside string lit 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab01.toml: -------------------------------------------------------------------------------- 1 | [table-1] 2 | key1 = "some string" 3 | key2 = 123 4 | 5 | [table-2] 6 | key1 = "another string" 7 | key2 = 456 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab01.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | table-1 = { 3 | key1 = "some string", 4 | key2 = 123, 5 | }, 6 | table-2 = { 7 | key1 = "another string", 8 | key2 = 456, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab02.toml: -------------------------------------------------------------------------------- 1 | [dog."tater.man"] 2 | type.name = "pug" 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab02.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | dog = { 3 | tater.man = { 4 | type = { 5 | name = "pug", 6 | }, 7 | }, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab03.toml: -------------------------------------------------------------------------------- 1 | [a.b.c] # this is best practice 2 | [ d.e.f ] # same as [d.e.f] 3 | [ g . h . i ] # same as [g.h.i] 4 | [ j . "ʞ" . 'l' ] # same as [j."ʞ".'l'] 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab03.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | a = { 3 | b = { 4 | c = { 5 | }, 6 | }, 7 | }, 8 | d = { 9 | e = { 10 | f = { 11 | }, 12 | }, 13 | }, 14 | g = { 15 | h = { 16 | i = { 17 | }, 18 | }, 19 | }, 20 | j = { 21 | ʞ = { 22 | l = { 23 | }, 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab04.toml: -------------------------------------------------------------------------------- 1 | # [x] you 2 | # [x.y] don't 3 | # [x.y.z] need these 4 | [x.y.z.w] # for this to work 5 | 6 | [x] # defining a super-table afterward is ok 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab04.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | x = { 3 | y = { 4 | z = { 5 | w = { 6 | }, 7 | }, 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab05.toml: -------------------------------------------------------------------------------- 1 | # DO NOT DO THIS 2 | 3 | [fruit] 4 | apple = "red" 5 | 6 | [fruit] 7 | orange = "orange" 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab05.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 6: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab06.toml: -------------------------------------------------------------------------------- 1 | # DO NOT DO THIS EITHER 2 | 3 | [fruit] 4 | apple = "red" 5 | 6 | [fruit.apple] 7 | texture = "smooth" 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab06.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 6: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab07.toml: -------------------------------------------------------------------------------- 1 | # VALID BUT DISCOURAGED 2 | [fruit.apple] 3 | [animal] 4 | [fruit.orange] 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab07.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruit = { 3 | apple = { 4 | }, 5 | orange = { 6 | }, 7 | }, 8 | animal = { 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab08.toml: -------------------------------------------------------------------------------- 1 | # Top-level table begins. 2 | name = "Fido" 3 | breed = "pug" 4 | 5 | # Top-level table ends. 6 | [owner] 7 | name = "Regina Dogman" 8 | member_since = 1999-08-04 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab08.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | name = "Fido", 3 | breed = "pug", 4 | owner = { 5 | name = "Regina Dogman", 6 | member_since = 1999-08-04, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab09.toml: -------------------------------------------------------------------------------- 1 | fruit.apple.color = "red" 2 | # Defines a table named fruit 3 | # Defines a table named fruit.apple 4 | 5 | fruit.apple.taste.sweet = true 6 | # Defines a table named fruit.apple.taste 7 | # fruit and fruit.apple were already created 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab09.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruit = { 3 | apple = { 4 | color = "red", 5 | taste = { 6 | sweet = true, 7 | }, 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab10.toml: -------------------------------------------------------------------------------- 1 | [fruit] 2 | apple.color = "red" 3 | apple.taste.sweet = true 4 | 5 | [fruit.apple] # INVALID 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab10.toml.res: -------------------------------------------------------------------------------- 1 | ERROR: line 5: key exists 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab11.toml: -------------------------------------------------------------------------------- 1 | [fruit] 2 | apple.color = "red" 3 | apple.taste.sweet = true 4 | 5 | # [fruit.apple] # INVALID 6 | # [fruit.apple.taste] # INVALID 7 | 8 | [fruit.apple.texture] # you can add sub-tables 9 | smooth = true 10 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/tab11.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | fruit = { 3 | apple = { 4 | color = "red", 5 | taste = { 6 | sweet = true, 7 | }, 8 | texture = { 9 | smooth = true, 10 | }, 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts1.toml: -------------------------------------------------------------------------------- 1 | odt1 = 1979-05-27T07:32:00Z 2 | odt2 = 1979-05-27T00:32:00-07:00 3 | odt3 = 1979-05-27T00:32:00.999999-07:00 4 | odt4 = 1979-05-27T00:32:00.01-07:00 5 | 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts1.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | odt1 = 1979-05-27T07:32:00Z, 3 | odt2 = 1979-05-27T00:32:00-07:00, 4 | odt3 = 1979-05-27T00:32:00.999-07:00, 5 | odt4 = 1979-05-27T00:32:00.010-07:00, 6 | } 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts2.toml: -------------------------------------------------------------------------------- 1 | odt4 = 1979-05-27 07:32:00Z 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts2.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | odt4 = 1979-05-27T07:32:00Z, 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts3.toml: -------------------------------------------------------------------------------- 1 | ldt1 = 1979-05-27T07:32:00 2 | ldt2 = 1979-05-27T00:32:00.999999 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts3.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | ldt1 = 1979-05-27T07:32:00, 3 | ldt2 = 1979-05-27T00:32:00.999, 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts4.toml: -------------------------------------------------------------------------------- 1 | ld1 = 1979-05-27 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts4.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | ld1 = 1979-05-27, 3 | } 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts5.toml: -------------------------------------------------------------------------------- 1 | lt1 = 07:32:00 2 | lt2 = 00:32:00.999999 3 | -------------------------------------------------------------------------------- /third_party/tomlc99/stdex/ts5.toml.res: -------------------------------------------------------------------------------- 1 | { 2 | lt1 = 07:32:00, 3 | lt2 = 00:32:00.999, 4 | } 5 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/.gitignore: -------------------------------------------------------------------------------- 1 | /goworkspace 2 | /toml-test 3 | /toml-test-decoder 4 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/README.md: -------------------------------------------------------------------------------- 1 | How to run the tests 2 | === 3 | 4 | ``` 5 | % bash build.sh 6 | % bash run.sh 7 | Test: array-mixed-types-arrays-and-ints (invalid) 8 | 9 | Expected an error, but no error was reported. 10 | ------------------------------------------------------------------------------- 11 | Test: array-mixed-types-ints-and-floats (invalid) 12 | 13 | Expected an error, but no error was reported. 14 | ------------------------------------------------------------------------------- 15 | Test: array-mixed-types-strings-and-ints (invalid) 16 | 17 | Expected an error, but no error was reported. 18 | 19 | 129 passed, 3 failed 20 | ``` 21 | 22 | Note: toml version 1.0 allows mixed types in arrays. 23 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | export GOBIN=$DIR 6 | go install github.com/toml-lang/toml-test/cmd/toml-test@latest # install test suite -------------------------------------------------------------------------------- /third_party/tomlc99/test1/extra/array_of_tables.toml: -------------------------------------------------------------------------------- 1 | x = [ {'a'= 1}, {'a'= 2} ] 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/extra/inline_array.toml: -------------------------------------------------------------------------------- 1 | x = [1,2,3] 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/extra/inline_table.toml: -------------------------------------------------------------------------------- 1 | x = {'a'= 1, 'b'= 2 } 2 | -------------------------------------------------------------------------------- /third_party/tomlc99/test1/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | $DIR/toml-test $DIR/../toml_json 6 | -------------------------------------------------------------------------------- /third_party/tomlc99/test2/.gitignore: -------------------------------------------------------------------------------- 1 | /toml-spec-tests -------------------------------------------------------------------------------- /third_party/tomlc99/test2/Note.txt: -------------------------------------------------------------------------------- 1 | Note that we utilize the 'jq' command to normalize json files for comparison. Depending the 2 | verson of jq on your system, some tests may generate error that looks like this: 3 | 4 | parse error: Exceeds depth limit for parsing at line 1 5 | 6 | This is an error in 'jq', and it does not indicate that the tests themselves fail. 7 | -------------------------------------------------------------------------------- /third_party/tomlc99/test2/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | 7 | [ -d toml-spec-tests ] || git clone https://github.com/cktan/toml-spec-tests.git 8 | -------------------------------------------------------------------------------- /third_party/tomlc99/test2/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! (which jq >& /dev/null); then 4 | echo "ERROR: please install the 'jq' utility" 5 | exit 1 6 | fi 7 | 8 | # 9 | # POSITIVE tests 10 | # 11 | for i in toml-spec-tests/values/*.toml; do 12 | fname="$i" 13 | ext="${fname##*.}" 14 | fname="${fname%.*}" 15 | echo -n $fname ' ' 16 | res='[OK]' 17 | if (../toml_json $fname.toml >& $fname.json.out); then 18 | jq -S . $fname.json.out > t.json 19 | mv t.json $fname.json.out 20 | if [ -f $fname.json ]; then 21 | if ! (diff $fname.json $fname.json.out >& /dev/null); then 22 | res='[FAILED]' 23 | else 24 | rm -f $fname.json.out 25 | fi 26 | else 27 | res='[??]' 28 | fi 29 | fi 30 | echo ... $res 31 | done 32 | 33 | 34 | # 35 | # NEGATIVE tests 36 | # 37 | for i in toml-spec-tests/errors/*.toml; do 38 | echo -n $i ' ' 39 | res='[OK]' 40 | if (../toml_json $i >& $i.json.out); then 41 | res='[FAILED]' 42 | fi 43 | echo ... $res 44 | done 45 | -------------------------------------------------------------------------------- /third_party/tomlc99/toml_sample.c: -------------------------------------------------------------------------------- 1 | #include "toml.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | static void fatal(const char *msg, const char *msg1) { 8 | fprintf(stderr, "ERROR: %s%s\n", msg, msg1 ? msg1 : ""); 9 | exit(1); 10 | } 11 | 12 | int main() { 13 | FILE *fp; 14 | char errbuf[200]; 15 | 16 | // 1. Read and parse toml file 17 | fp = fopen("sample.toml", "r"); 18 | if (!fp) { 19 | fatal("cannot open sample.toml - ", strerror(errno)); 20 | } 21 | 22 | toml_table_t *conf = toml_parse_file(fp, errbuf, sizeof(errbuf)); 23 | fclose(fp); 24 | 25 | if (!conf) { 26 | fatal("cannot parse - ", errbuf); 27 | } 28 | 29 | // 2. Traverse to a table. 30 | toml_table_t *server = toml_table_in(conf, "server"); 31 | if (!server) { 32 | fatal("missing [server]", ""); 33 | } 34 | 35 | // 3. Extract values 36 | toml_datum_t host = toml_string_in(server, "host"); 37 | if (!host.ok) { 38 | fatal("cannot read server.host", ""); 39 | } 40 | 41 | toml_array_t *portarray = toml_array_in(server, "port"); 42 | if (!portarray) { 43 | fatal("cannot read server.port", ""); 44 | } 45 | 46 | printf("host: %s\n", host.u.s); 47 | printf("port: "); 48 | for (int i = 0;; i++) { 49 | toml_datum_t port = toml_int_at(portarray, i); 50 | if (!port.ok) 51 | break; 52 | printf("%d ", (int)port.u.i); 53 | } 54 | printf("\n"); 55 | 56 | // 4. Free memory 57 | free(host.u.s); 58 | toml_free(conf); 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /third_party/tomlc99/unittest/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -g -I.. 2 | 3 | TESTS = t1 4 | 5 | all: $(TESTS) 6 | 7 | t1: t1.c ../toml.c 8 | 9 | clean: 10 | rm -f $(TESTS) 11 | 12 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | chkpriv \ 4 | devel 5 | -------------------------------------------------------------------------------- /tools/chkpriv/Makefile.am: -------------------------------------------------------------------------------- 1 | xrdppkgdatadir=$(datadir)/xrdp 2 | 3 | pkglibexec_PROGRAMS = \ 4 | xrdp-droppriv 5 | 6 | nodist_xrdppkgdata_SCRIPTS = \ 7 | xrdp-chkpriv 8 | 9 | AM_LDFLAGS = 10 | 11 | AM_CPPFLAGS = \ 12 | -I$(top_srcdir)/common 13 | 14 | xrdp_droppriv_SOURCES = \ 15 | xrdp-chkpriv.in \ 16 | xrdp-droppriv.c 17 | 18 | xrdp_droppriv_LDADD = \ 19 | $(top_builddir)/common/libcommon.la \ 20 | $(DLOPEN_LIBS) 21 | 22 | SUBST_VARS = sed \ 23 | -e 's|@pkglibexecdir[@]|$(pkglibexecdir)|g' \ 24 | -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ 25 | -e 's|@sysconfsubdir[@]|$(sysconfsubdir)|g' 26 | 27 | subst_verbose = $(subst_verbose_@AM_V@) 28 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 29 | subst_verbose_0 = @echo " SUBST $@"; 30 | 31 | SUFFIXES = .in 32 | .in: 33 | $(subst_verbose)$(SUBST_VARS) $< > $@ 34 | 35 | CLEANFILES = $(nodist_xrdppkgdata_SCRIPTS) 36 | 37 | -------------------------------------------------------------------------------- /tools/chkpriv/xrdp-droppriv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * xrdp: A Remote Desktop Protocol server. 4 | * 5 | * Copyright (C) Jay Sorg and contributors 2004-2024 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Shell around the g_drop_privileges() call 20 | */ 21 | 22 | #if defined(HAVE_CONFIG_H) 23 | #include "config_ac.h" 24 | #endif 25 | 26 | #include "os_calls.h" 27 | #include "log.h" 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | struct log_config *logging; 32 | int status = 1; 33 | logging = log_config_init_for_console(LOG_LEVEL_WARNING, 34 | g_getenv("DROPPRIV_LOG_LEVEL")); 35 | log_start_from_param(logging); 36 | log_config_free(logging); 37 | 38 | if (argc < 4) 39 | { 40 | LOG(LOG_LEVEL_ERROR, "Usage : %s [user] [group] [cmd...]\n", argv[0]); 41 | } 42 | else if (g_drop_privileges(argv[1], argv[2]) == 0) 43 | { 44 | status = g_execvp(argv[3], &argv[3]); 45 | } 46 | 47 | log_end(); 48 | return status; 49 | } 50 | -------------------------------------------------------------------------------- /tools/devel/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | gtcp_proxy 4 | 5 | SUBDIRS = \ 6 | tcp_proxy 7 | -------------------------------------------------------------------------------- /tools/devel/gtcp_proxy/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # := evaluates the expression just once 3 | # = evaluates the expression each time it is used 4 | 5 | CFLAGS := $(shell pkg-config --cflags gtk+-2.0) 6 | CFLAGS += -O2 -Wall 7 | #LDFLAGS = -Wl 8 | LIBS := $(shell pkg-config --libs gtk+-2.0) 9 | LIBS += -ldl -lgthread-2.0 10 | 11 | OBJS = gtcp-proxy.o gtcp.o 12 | 13 | all: gtcp-proxy 14 | 15 | gtcp-proxy: $(OBJS) 16 | gcc -Wall $(CFLAGS) $(LDFLAGS) gtcp-proxy.c gtcp.o -o gtcp-proxy $(LIBS) 17 | 18 | gtcp.o: gtcp.c 19 | gcc -c gtcp.c 20 | clean:: 21 | -rm gtcp-proxy.o gtcp.o gtcp-proxy 22 | -------------------------------------------------------------------------------- /tools/devel/gtcp_proxy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | gtcp-proxy is a 'man in the middle' program to monitor data flowing between 3 | two network connections. 4 | 5 | -------------------------------------------------------------------------------- /tools/devel/gtcp_proxy/gtcp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2013 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _GTCP_H 20 | #define _GTCP_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | int tcp_socket_create(void); 34 | void tcp_set_non_blocking(int skt); 35 | int tcp_bind(int skt, char *port); 36 | int tcp_listen(int skt); 37 | int tcp_accept(int skt); 38 | int tcp_last_error_would_block(); 39 | void tcp_close(int skt); 40 | int tcp_socket(void); 41 | int tcp_connect(int skt, const char *hostname, const char *port); 42 | int tcp_can_send(int skt, int millis); 43 | int tcp_socket_ok(int skt); 44 | int tcp_select(int sck1, int sck2); 45 | int tcp_recv(int skt, void *ptr, int len, int flags); 46 | int tcp_send(int skt, const void *ptr, int len, int flags); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /tools/devel/tcp_proxy/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir)/common 4 | 5 | noinst_PROGRAMS = \ 6 | tcp_proxy 7 | 8 | tcp_proxy_SOURCES = \ 9 | main.c 10 | 11 | tcp_proxy_LDADD = \ 12 | $(top_builddir)/common/libcommon.la \ 13 | $(DLOPEN_LIBS) 14 | -------------------------------------------------------------------------------- /vnc/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | AM_CFLAGS = $(X_CFLAGS) 9 | 10 | module_LTLIBRARIES = \ 11 | libvnc.la 12 | 13 | libvnc_la_SOURCES = \ 14 | vnc.c \ 15 | vnc_clip.c \ 16 | rfb.c \ 17 | vnc.h \ 18 | vnc_clip.h \ 19 | rfb.h 20 | 21 | libvnc_la_LIBADD = \ 22 | $(top_builddir)/common/libcommon.la 23 | 24 | if !MACOS 25 | libvnc_la_LDFLAGS = -avoid-version -module 26 | endif 27 | -------------------------------------------------------------------------------- /vnc/rfb.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2015 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * libvnc - RFB specific functions 19 | */ 20 | 21 | #if defined(HAVE_CONFIG_H) 22 | #include 23 | #endif 24 | 25 | #include "rfb.h" 26 | 27 | /* Messages for ExtendedDesktopSize status code */ 28 | static const char *eds_status_msg[] = 29 | { 30 | /* 0 */ "No error", 31 | /* 1 */ "Resize is administratively prohibited", 32 | /* 2 */ "Out of resources", 33 | /* 3 */ "Invalid screen layout", 34 | /* others */ "Unknown code" 35 | }; 36 | 37 | /* elements in above list */ 38 | #define EDS_STATUS_MSG_COUNT \ 39 | (sizeof(eds_status_msg) / sizeof(eds_status_msg[0])) 40 | 41 | /**************************************************************************//** 42 | * Returns an error string for an ExtendedDesktopSize status code 43 | */ 44 | const char * 45 | rfb_get_eds_status_msg(unsigned int response_code) 46 | { 47 | if (response_code >= EDS_STATUS_MSG_COUNT) 48 | { 49 | response_code = EDS_STATUS_MSG_COUNT - 1; 50 | } 51 | 52 | return eds_status_msg[response_code]; 53 | } 54 | -------------------------------------------------------------------------------- /vnc/vnc_clip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-2015 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * libvnc - functions used by the VNC clipboard feature 19 | */ 20 | 21 | #ifndef VNC_CLIP_H 22 | #define VNC_CLIP_H 23 | 24 | struct vnc; 25 | struct stream; 26 | 27 | /** 28 | * Init the clip module private data structures 29 | */ 30 | void 31 | vnc_clip_init(struct vnc *v); 32 | 33 | /** 34 | * Deallocate the clip module private data structures 35 | */ 36 | void 37 | vnc_clip_exit(struct vnc *v); 38 | 39 | /** 40 | * Process incoming data from the RDP clip channel 41 | * @param v VNC Object 42 | * @param s Stream object containing data 43 | * 44 | * @return Non-zero if error occurs 45 | */ 46 | int 47 | vnc_clip_process_channel_data(struct vnc *v, char *data, int size, 48 | int total_size, int flags); 49 | 50 | /** 51 | * Process incoming RFB protocol clipboard data 52 | * @param v VNC Object 53 | * 54 | * @return Non-zero if error occurs 55 | */ 56 | int 57 | vnc_clip_process_rfb_data(struct vnc *v); 58 | 59 | /** 60 | * Open the RDP clipboard channel 61 | * 62 | * The clip channel ID is written to the VNC object 63 | * * 64 | * @param v VNC Object 65 | * @return Non-zero if error occurs 66 | */ 67 | int 68 | vnc_clip_open_clip_channel(struct vnc *v); 69 | 70 | #endif /* VNC_CLIP_H */ 71 | -------------------------------------------------------------------------------- /vrplayer/README.txt: -------------------------------------------------------------------------------- 1 | A QT based media player that runs on a RDP server and 2 | redirects audio/video to the client where it is decoded 3 | and rendered locally 4 | 5 | Required packages to build vrplayer: 6 | ------------------------------------ 7 | libqt4-gui 8 | qt4-dev-tools 9 | libavutil-dev 10 | libavformat-dev 11 | 12 | to build vrplayer 13 | ----------------- 14 | cd ../xrdpvr 15 | make 16 | cd .. 17 | qmake 18 | make 19 | 20 | To run vrplayer 21 | --------------- 22 | include xrdpapi/.libs and xrdpvr/.libs in your LD_LIBRARY_PATH 23 | 24 | Example: 25 | -------- 26 | export LD_LIBRARY_PATH=../xrdpapi/.libs:../xrdpvr/.libs 27 | run vrplayer inside the xfreerdp session 28 | 29 | this is how we run xfreerdp: 30 | ---------------------------- 31 | ./xfreerdp --sec rdp --plugin xrdpvr 192.168.2.149 32 | 33 | -------------------------------------------------------------------------------- /vrplayer/decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef DECODER_H 2 | #define DECODER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef __cplusplus 9 | #define __STDC_CONSTANT_MACROS 10 | #ifdef _STDINT_H 11 | #undef _STDINT_H 12 | #endif 13 | #include 14 | #endif 15 | 16 | #include 17 | #include 18 | #include /* LK_TODO is this required? */ 19 | 20 | class Decoder : public QObject 21 | { 22 | Q_OBJECT 23 | public: 24 | explicit Decoder(QObject *parent = 0); 25 | int init(QString filename); 26 | //int deinit(); 27 | //int setWindow(QRectangle rect); 28 | 29 | private: 30 | void *channel; 31 | QRect mainWindowGeometry; 32 | 33 | signals: 34 | 35 | public slots: // cppcheck-suppress unknownMacro 36 | void onGeometryChanged(QRect *geometry); 37 | }; 38 | 39 | #endif // DECODER_H 40 | -------------------------------------------------------------------------------- /vrplayer/dlgabout.cpp: -------------------------------------------------------------------------------- 1 | #include "dlgabout.h" 2 | #include "ui_dlgabout.h" 3 | 4 | DlgAbout::DlgAbout(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::DlgAbout) 7 | { 8 | ui->setupUi(this); 9 | connect(ui->okButton, SIGNAL(clicked()), this, SLOT(onOk())); 10 | } 11 | 12 | DlgAbout::~DlgAbout() 13 | { 14 | delete ui; 15 | } 16 | 17 | void DlgAbout::onOk() 18 | { 19 | this->done(0); 20 | } 21 | -------------------------------------------------------------------------------- /vrplayer/dlgabout.h: -------------------------------------------------------------------------------- 1 | #ifndef DLGABOUT_H 2 | #define DLGABOUT_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class DlgAbout; 9 | } 10 | 11 | class DlgAbout : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit DlgAbout(QWidget *parent = 0); 17 | ~DlgAbout(); 18 | 19 | private: 20 | Ui::DlgAbout *ui; 21 | 22 | private slots: // cppcheck-suppress unknownMacro 23 | void onOk(); 24 | }; 25 | 26 | #endif // DLGABOUT_H 27 | -------------------------------------------------------------------------------- /vrplayer/dlgabout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgAbout 4 | 5 | 6 | 7 | 0 8 | 0 9 | 288 10 | 168 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 70 20 | 60 21 | 151 22 | 17 23 | 24 | 25 | 26 | VRPlayer v1.6 27 | 28 | 29 | 30 | 31 | 32 | 180 33 | 120 34 | 94 35 | 27 36 | 37 | 38 | 39 | OK 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /vrplayer/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "mainwindow.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication::setGraphicsSystem(QLatin1String("native")); 8 | QApplication a(argc, argv); 9 | MainWindow w; 10 | w.show(); 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /vrplayer/mediapacket.cpp: -------------------------------------------------------------------------------- 1 | #include "mediapacket.h" 2 | 3 | MediaPacket::MediaPacket() 4 | { 5 | av_pkt = 0; 6 | delay_in_us = 0; 7 | seq = 0; 8 | } 9 | -------------------------------------------------------------------------------- /vrplayer/mediapacket.h: -------------------------------------------------------------------------------- 1 | #ifndef MEDIAPACKET_H 2 | #define MEDIAPACKET_H 3 | 4 | class MediaPacket 5 | { 6 | public: 7 | MediaPacket(); 8 | 9 | void *av_pkt; 10 | int delay_in_us; 11 | int seq; 12 | }; 13 | 14 | #endif // MEDIAPACKET_H 15 | -------------------------------------------------------------------------------- /vrplayer/playaudio.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYAUDIO_H 2 | #define PLAYAUDIO_H 3 | 4 | #ifdef __cplusplus 5 | #define __STDC_CONSTANT_MACROS 6 | #ifdef _STDINT_H 7 | #undef _STDINT_H 8 | #endif 9 | #include 10 | #endif 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "mediapacket.h" 17 | #include "xrdpvr.h" 18 | 19 | /* ffmpeg related stuff */ 20 | extern "C" 21 | { 22 | #include 23 | #include 24 | } 25 | 26 | #define VCR_PLAY 1 27 | #define VCR_PAUSE 2 28 | #define VCR_STOP 3 29 | #define VCR_REWIND 4 30 | #define VCR_POWER_OFF 5 31 | 32 | class PlayAudio : public QObject 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit PlayAudio(QObject *parent = 0, 38 | QQueue *audioQueue = 0, 39 | QMutex *sendMutex = 0, 40 | void *channel = 0, 41 | int stream_id = 101); 42 | 43 | void setVcrOp(int op); 44 | 45 | public slots: // cppcheck-suppress unknownMacro 46 | void play(); 47 | 48 | private: 49 | QQueue *audioQueue; 50 | QMutex *sendMutex; 51 | QMutex vcrMutex; 52 | int vcrFlag; 53 | void *channel; 54 | int stream_id; 55 | 56 | void clearAudioQ(); 57 | }; 58 | 59 | #endif // PLAYAUDIO_H 60 | -------------------------------------------------------------------------------- /vrplayer/playvideo.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "playvideo.h" 6 | #include 7 | 8 | PlayVideo::PlayVideo(QObject *parent, 9 | QQueue *videoQueue, 10 | QMutex *sendMutex, 11 | void *channel, 12 | int stream_id, int fps) : 13 | QObject(parent) 14 | { 15 | this->videoQueue = videoQueue; 16 | this->channel = channel; 17 | this->sendMutex = sendMutex; 18 | this->stream_id = stream_id; 19 | this->fps = fps; 20 | } 21 | 22 | /** 23 | ******************************************************************************/ 24 | static int 25 | get_mstime(void) 26 | { 27 | struct timeval tp; 28 | 29 | gettimeofday(&tp, 0); 30 | return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); 31 | } 32 | 33 | void PlayVideo::play() 34 | { 35 | MediaPacket *pkt; 36 | int now_time; 37 | int sleep_time; 38 | int last_display_time; 39 | 40 | last_display_time = 0; 41 | while (1) 42 | { 43 | sendMutex->lock(); 44 | if (videoQueue->isEmpty()) 45 | { 46 | sendMutex->unlock(); 47 | usleep(10 * 1000); 48 | continue; 49 | } 50 | pkt = videoQueue->dequeue(); 51 | send_video_pkt(channel, stream_id, pkt->av_pkt); 52 | sendMutex->unlock(); 53 | now_time = get_mstime(); 54 | sleep_time = now_time - last_display_time; 55 | if (sleep_time > (1000 / fps)) 56 | { 57 | sleep_time = (1000 / fps); 58 | } 59 | if (sleep_time > 0) 60 | { 61 | usleep(sleep_time * 1000); 62 | } 63 | last_display_time = now_time; 64 | delete pkt; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vrplayer/vrplayer.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2012-11-13T11:52:36 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | TARGET = vrplayer 10 | TEMPLATE = app 11 | 12 | 13 | SOURCES += main.cpp\ 14 | playvideo.cpp \ 15 | mainwindow.cpp \ 16 | mediapacket.cpp \ 17 | playaudio.cpp \ 18 | demuxmedia.cpp \ 19 | ourinterface.cpp \ 20 | dlgabout.cpp 21 | 22 | HEADERS += mainwindow.h \ 23 | mediapacket.h \ 24 | playvideo.h \ 25 | playaudio.h \ 26 | demuxmedia.h \ 27 | ourinterface.h \ 28 | dlgabout.h 29 | 30 | FORMS += mainwindow.ui \ 31 | dlgabout.ui 32 | 33 | # added by LK 34 | INCLUDEPATH += ../xrdpvr 35 | INCLUDEPATH += ../xrdpapi 36 | 37 | LIBS += -Wl,-rpath 38 | LIBS += -Wl,/usr/local/lib/xrdp 39 | 40 | LIBS += -L../xrdpvr/.libs -lxrdpvr 41 | LIBS += -L../xrdpapi/.libs -lxrdpapi 42 | LIBS += -L/usr/lib/x86_64-linux-gnu -lavformat -lavcodec -lavutil 43 | -------------------------------------------------------------------------------- /waitforx/Makefile.am: -------------------------------------------------------------------------------- 1 | pkglibexec_PROGRAMS = \ 2 | waitforx 3 | 4 | AM_LDFLAGS = $(X_LIBS) -lX11 -lXrandr 5 | 6 | AM_CPPFLAGS = \ 7 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 8 | -I$(top_srcdir)/sesman/sesexec \ 9 | -I$(top_srcdir)/common 10 | 11 | AM_CFLAGS = $(X_CFLAGS) 12 | 13 | waitforx_SOURCES = waitforx.c 14 | 15 | waitforx_LDADD = \ 16 | $(top_builddir)/common/libcommon.la 17 | -------------------------------------------------------------------------------- /xrdp/README.logo: -------------------------------------------------------------------------------- 1 | About xrdp_logo.png / xrdp_logo.bmp 2 | 3 | These new xrdp logo files were created by processing vector image files by @metalefty. 4 | 5 | The base images can be found at 6 | https://github.com/metalefty/xrdp-logo 7 | -------------------------------------------------------------------------------- /xrdp/ad24b.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/ad24b.bmp -------------------------------------------------------------------------------- /xrdp/ad256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/ad256.bmp -------------------------------------------------------------------------------- /xrdp/cursor0.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/cursor0.cur -------------------------------------------------------------------------------- /xrdp/cursor1.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/cursor1.cur -------------------------------------------------------------------------------- /xrdp/czech.txt: -------------------------------------------------------------------------------- 1 | no shift 2 | 003b 002b 011b 0161 010d 0159 017e 00fd 00e1 00ed 0039 003d 00b4 3 | ; + ě š č ř ž ý á í é = ´ 4 | 0071 0071 0065 0072 0074 007a 0075 0069 006f 0070 00fa 0029 00a8 5 | q w e r t z u i o p ú ) ¨ 6 | 0061 0073 0064 0066 0067 0068 006a 006b 006c 016f 00a7 7 | a s d f g h j k l ů § 8 | 0079 0078 0063 0076 0062 006e 006d 002c 002e 002d 9 | y x c v b n m , . - 10 | 11 | shift 12 | 00b0 0031 0032 0033 0034 0035 0036 0037 0038 0039 0030 0025 02c7 13 | ° 1 2 3 4 5 6 7 8 9 0 % ˇ 14 | 0051 0057 0045 0052 0054 005a 0055 0049 004f 0050 002f 0028 0027 15 | Q W E R T Z U I O P / ( ' 16 | 0041 0053 0044 0046 0047 0048 004a 004b 004c 0022 0021 17 | A S D F G H J K L " ! 18 | 0059 0058 0043 0056 0042 004e 004d 003f 003a 005f 19 | Y X C V B N M ? : _ 20 | 21 | altgr 22 | 007e 02c7 005e 02d8 00b0 02db 0060 00b7 00b4 02dd 00a8 00b8 23 | ~ ˇ ^ ˘ ° ˛ ` · ´ ˝ ¨ ¸ 24 | 005c 007c 20ac 00f7 00d7 00a4 25 | \ | € ÷ × ¤ 26 | 0111 0110 005b 005d 0142 0141 0024 00df 27 | đ Đ [ ] ł Ł $ ß 28 | 0023 0026 0040 007b 007d 003c 003e 002a 29 | # & @ { } < > * 30 | -------------------------------------------------------------------------------- /xrdp/sans-10.fv1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/sans-10.fv1 -------------------------------------------------------------------------------- /xrdp/sans-18.fv1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/sans-18.fv1 -------------------------------------------------------------------------------- /xrdp/xrdp24b.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/xrdp24b.bmp -------------------------------------------------------------------------------- /xrdp/xrdp256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/xrdp256.bmp -------------------------------------------------------------------------------- /xrdp/xrdp_encoder_openh264.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2016-2024 5 | * Copyright (C) Christopher Pitstick 2023-2024 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * openh264 Encoder 20 | */ 21 | 22 | #ifndef _XRDP_ENCODER_OPENH264_H 23 | #define _XRDP_ENCODER_OPENH264_H 24 | 25 | #include "arch.h" 26 | 27 | void * 28 | xrdp_encoder_openh264_create(void); 29 | int 30 | xrdp_encoder_openh264_delete(void *handle); 31 | int 32 | xrdp_encoder_openh264_encode(void *handle, int session, int left, int top, 33 | int width, int height, int twidth, int theight, 34 | int format, const char *data, 35 | short *crects, int num_crects, 36 | char *cdata, int *cdata_bytes, 37 | int connection_type, int *flags_ptr); 38 | 39 | /** 40 | * Test OpenH264 library is installed correctly 41 | * 42 | * It's possible on some distros to install the noopenh264 package 43 | * (https://gitlab.com/freedesktop-sdk/noopenh264) for building. If this 44 | * is installed at runtime, openh264 cannot be used. 45 | * @return Boolean (!= 0 -> working) 46 | */ 47 | int 48 | xrdp_encoder_openh264_install_ok(void); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /xrdp/xrdp_encoder_x264.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2016-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * libx264 Encoder 19 | */ 20 | 21 | #ifndef _XRDP_ENCODER_X264_H 22 | #define _XRDP_ENCODER_X264_H 23 | 24 | #include "arch.h" 25 | 26 | void * 27 | xrdp_encoder_x264_create(void); 28 | int 29 | xrdp_encoder_x264_delete(void *handle); 30 | int 31 | xrdp_encoder_x264_encode(void *handle, int session, int left, int top, 32 | int width, int height, int twidth, int theight, 33 | int format, const char *data, 34 | short *crects, int num_crects, 35 | char *cdata, int *cdata_bytes, int connection_type, 36 | int *flags_ptr); 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /xrdp/xrdp_logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/xrdp_logo.bmp -------------------------------------------------------------------------------- /xrdp/xrdp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neutrinolabs/xrdp/322b6c2642f864ce148dbbaa0ba5168d127c9598/xrdp/xrdp_logo.png -------------------------------------------------------------------------------- /xrdp/xrdp_mm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2023 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * module manager 19 | */ 20 | 21 | #ifndef _XRDP_MM_H 22 | #define _XRDP_MM_H 23 | 24 | #include "arch.h" 25 | #include "trans.h" 26 | #include "list16.h" 27 | #include "libxrdpinc.h" 28 | #include "xrdp_types.h" 29 | 30 | int 31 | advance_resize_state_machine(struct xrdp_mm *mm, 32 | enum display_resize_state new_state); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /xrdp_accel_assist/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I$(top_srcdir)/common 3 | 4 | EXTRA_DIST = xrdp_accel_assist_shaders.c 5 | 6 | XRDP_EXTRA_LIBS = 7 | XRDP_EXTRA_SOURCES = 8 | 9 | if XRDP_NVENC 10 | AM_CPPFLAGS += -DXRDP_NVENC 11 | AM_CPPFLAGS += $(XRDP_NVENC_CFLAGS) 12 | XRDP_EXTRA_LIBS += $(XRDP_NVENC_LIBS) 13 | XRDP_EXTRA_SOURCES += xrdp_accel_assist_nvenc.c xrdp_accel_assist_nvenc.h encoder_headers/nvEncodeAPI_11_1.h 14 | endif 15 | 16 | pkglibexec_PROGRAMS = \ 17 | xrdp-accel-assist 18 | 19 | xrdp_accel_assist_SOURCES = \ 20 | xrdp_accel_assist.c \ 21 | xrdp_accel_assist.h \ 22 | xrdp_accel_assist_x11.c \ 23 | xrdp_accel_assist_x11.h \ 24 | xrdp_accel_assist_egl.c \ 25 | xrdp_accel_assist_egl.h \ 26 | xrdp_accel_assist_glx.c \ 27 | xrdp_accel_assist_glx.h \ 28 | $(XRDP_EXTRA_SOURCES) 29 | 30 | xrdp_accel_assist_LDADD = \ 31 | $(top_builddir)/common/libcommon.la \ 32 | $(XRDP_EXTRA_LIBS) \ 33 | -lX11 -lepoxy 34 | 35 | -------------------------------------------------------------------------------- /xrdp_accel_assist/xrdp_accel_assist.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2020-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _XRDP_ACCEL_ASSIST_H 20 | #define _XRDP_ACCEL_ASSIST_H 21 | 22 | #define XH_YUV420 1 23 | #define XH_YUV422 2 24 | #define XH_YUV444 3 25 | 26 | #define XH_BT601 0 27 | #define XH_BT709FR 1 28 | #define XH_BTRFX 2 29 | 30 | struct xh_rect 31 | { 32 | short x; 33 | short y; 34 | short w; 35 | short h; 36 | }; 37 | 38 | #define XH_ENC_FLAGS_FORCEIDR (1 << 0) 39 | 40 | enum encoder_result 41 | { 42 | INCREMENTAL_FRAME_ENCODED, /* P frame */ 43 | KEY_FRAME_ENCODED, /* IDR frame */ 44 | ENCODER_ERROR 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /xrdp_accel_assist/xrdp_accel_assist_egl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2022-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _XRDP_ACCEL_ASSIST_EGL_H 20 | #define _XRDP_ACCEL_ASSIST_EGL_H 21 | 22 | int 23 | xrdp_accel_assist_inf_egl_init(void); 24 | int 25 | xrdp_accel_assist_inf_egl_create_image(Pixmap pixmap, inf_image_t *inf_image); 26 | int 27 | xrdp_accel_assist_inf_egl_destroy_image(inf_image_t inf_image); 28 | int 29 | xrdp_accel_assist_inf_egl_bind_tex_image(inf_image_t inf_image); 30 | int 31 | xrdp_accel_assist_inf_egl_release_tex_image(inf_image_t inf_image); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /xrdp_accel_assist/xrdp_accel_assist_glx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2022-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _XRDP_ACCEL_ASSIST_GLX_H 20 | #define _XRDP_ACCEL_ASSIST_GLX_H 21 | 22 | int 23 | xrdp_accel_assist_inf_glx_init(void); 24 | int 25 | xrdp_accel_assist_inf_glx_create_image(Pixmap pixmap, inf_image_t *inf_image); 26 | int 27 | xrdp_accel_assist_inf_glx_destroy_image(inf_image_t inf_image); 28 | int 29 | xrdp_accel_assist_inf_glx_bind_tex_image(inf_image_t inf_image); 30 | int 31 | xrdp_accel_assist_inf_glx_release_tex_image(inf_image_t inf_image); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /xrdp_accel_assist/xrdp_accel_assist_nvenc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2022-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _XRDP_ACCEL_ASSIST_NVENC_H 20 | #define _XRDP_ACCEL_ASSIST_NVENC_H 21 | 22 | int 23 | xrdp_accel_assist_nvenc_init(void); 24 | int 25 | xrdp_accel_assist_nvenc_create_encoder(int width, int height, int tex, 26 | int tex_format, struct enc_info **ei); 27 | int 28 | xrdp_accel_assist_nvenc_delete_encoder(struct enc_info *ei); 29 | enum encoder_result 30 | xrdp_accel_assist_nvenc_encode(struct enc_info *ei, int tex, 31 | void *cdata, int *cdata_bytes, 32 | int flags); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /xrdp_accel_assist/xrdp_accel_assist_x11.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2020-2024 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef _XRDP_ACCEL_ASSIST_X11_H 20 | #define _XRDP_ACCEL_ASSIST_X11_H 21 | 22 | /* generic type that can hold either a GLXPixmap(XID, unsigned int or long) 23 | * or EGLSurface(void*) */ 24 | typedef intptr_t inf_image_t; 25 | 26 | /* forward declaration used in xrdp_accel_assist_nvenc and 27 | xrdp_accel_assist_yami */ 28 | struct enc_info; 29 | 30 | int 31 | xrdp_accel_assist_x11_init(void); 32 | int 33 | xrdp_accel_assist_x11_get_wait_objs(intptr_t *objs, int *obj_count); 34 | int 35 | xrdp_accel_assist_x11_check_wait_objs(void); 36 | int 37 | xrdp_accel_assist_x11_delete_all_pixmaps(void); 38 | int 39 | xrdp_accel_assist_x11_create_pixmap(int width, int height, int magic, 40 | int con_id, int mon_id); 41 | enum encoder_result 42 | xrdp_accel_assist_x11_encode_pixmap(int left, int top, int width, int height, 43 | int mon_id, int num_crects, 44 | struct xh_rect *crects, 45 | void *cdata, int *cdata_bytes, 46 | int flags); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /xrdpapi/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | simple.c \ 3 | vrplayer.c \ 4 | vrplayer.mk 5 | 6 | AM_CPPFLAGS = \ 7 | -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ 8 | -I$(top_srcdir)/common 9 | 10 | module_LTLIBRARIES = \ 11 | libxrdpapi.la 12 | 13 | libxrdpapi_la_SOURCES = \ 14 | xrdpapi.c \ 15 | xrdpapi.h 16 | 17 | libxrdpapi_la_LIBADD = \ 18 | $(top_builddir)/common/libcommon.la 19 | 20 | # Build the 'simple' example program, so it's added to the CI 21 | noinst_PROGRAMS = xrdp-xrdpapi-simple 22 | 23 | xrdp_xrdpapi_simple_SOURCES = \ 24 | simple.c 25 | 26 | # If you change this, update the standalone build instructions in simple.c 27 | xrdp_xrdpapi_simple_LDADD = \ 28 | libxrdpapi.la \ 29 | $(top_builddir)/common/libcommon.la 30 | -------------------------------------------------------------------------------- /xrdpapi/vrplayer.mk: -------------------------------------------------------------------------------- 1 | CFLAGS = -I../xrdpvr 2 | LIBS = -L./.libs -L../xrdpvr/.libs -lxrdpapi -lxrdpvr -lavformat 3 | 4 | vrplayer: vrplayer.o 5 | gcc $(CFLAGS) vrplayer.c -o vrplayer $(LIBS) 6 | -------------------------------------------------------------------------------- /xrdpvr/Makefile.am: -------------------------------------------------------------------------------- 1 | module_LTLIBRARIES = \ 2 | libxrdpvr.la 3 | 4 | libxrdpvr_la_SOURCES = \ 5 | xrdpvr.c \ 6 | xrdpvr.h \ 7 | xrdpvr_internal.h 8 | -------------------------------------------------------------------------------- /xup/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/${sysconfsubdir}\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | module_LTLIBRARIES = \ 9 | libxup.la 10 | 11 | libxup_la_SOURCES = \ 12 | xup.c \ 13 | xup.h 14 | 15 | libxup_la_LIBADD = \ 16 | $(top_builddir)/common/libcommon.la 17 | 18 | if !MACOS 19 | libxup_la_LDFLAGS = -avoid-version -module 20 | endif 21 | --------------------------------------------------------------------------------