├── docs ├── man │ ├── .gitignore │ ├── xrdp-dis.1.in │ ├── Makefile.am │ ├── xrdp-keygen.8.in │ ├── xrdp-sesadmin.8.in │ ├── xrdp-genkeymap.8.in │ ├── xrdp-chansrv.8.in │ ├── xrdp-sesman.8.in │ └── xrdp.8.in └── Makefile.am ├── fontdump ├── .gitignore └── Makefile ├── description-pak ├── m4 ├── .gitignore └── ax_require_defined.m4 ├── sesman ├── chansrv │ ├── pcsc │ │ ├── .gitignore │ │ ├── wrapper │ │ │ ├── Makefile │ │ │ ├── winscard.def │ │ │ └── winscard-func-names.txt │ │ ├── Makefile │ │ └── dumps │ │ │ ├── scard-release-context.txt │ │ │ ├── scard-begin-tranaction.txt │ │ │ ├── scard-establish-context.txt │ │ │ ├── scard-disconnect.txt │ │ │ ├── scard-get-status-change.txt │ │ │ ├── scard-connect.txt │ │ │ ├── scard-transmit.txt │ │ │ └── scard-end-tranaction.txt │ ├── audin.h │ ├── chansrv_common.h │ ├── clipboard.h │ ├── rail.h │ ├── fifo.h │ ├── xcommon.h │ ├── clipboard_file.h │ ├── sound.h │ ├── Makefile.am │ ├── chansrv_config.h │ └── chansrv_common.c ├── reconnectwm.sh ├── tools │ ├── config.c │ ├── Makefile.am │ ├── xcon.c │ ├── tcp.h │ └── dis.c ├── libscp │ ├── libscp_commands.h │ ├── Makefile.am │ ├── libscp_types_mng.h │ ├── libscp_commands_mng.h │ ├── libscp.h │ ├── libscp_init.c │ ├── libscp_init.h │ ├── libscp_vX.h │ ├── libscp_connection.h │ ├── libscp_vX.c │ ├── libscp_v1c_mng.h │ ├── libscp_connection.c │ ├── libscp_lock.h │ ├── libscp_tcp.h │ ├── libscp_v1c.h │ ├── libscp_v1s_mng.h │ └── libscp_v0.h ├── scp_v1.h ├── sesman.h ├── scp_v0.h ├── scp_v1_mng.h ├── scp.h ├── xauth.h ├── access.h ├── sig.h ├── env.h ├── xauth.c ├── Makefile.am └── auth.h ├── tools ├── Makefile.am └── devel │ ├── Makefile.am │ ├── gtcp_proxy │ ├── README.txt │ ├── Makefile │ └── gtcp.h │ └── tcp_proxy │ └── Makefile.am ├── pkgconfig ├── .gitignore ├── Makefile.am ├── xrdp-uninstalled.pc.in └── xrdp.pc.in ├── tests ├── readme.txt ├── Makefile.am ├── common │ ├── test_common.h │ ├── Makefile.am │ └── test_common_main.c └── memtest │ ├── Makefile.am │ ├── libmem.h │ └── memtest.c ├── xrdp ├── ad24b.bmp ├── ad256.bmp ├── cursor0.cur ├── cursor1.cur ├── sans-10.fv1 ├── xrdp24b.bmp ├── xrdp256.bmp ├── xrdp_logo.bmp ├── czech.txt ├── xrdp_encoder.h └── Makefile.am ├── instfiles ├── pulse │ ├── Makefile.am │ └── default.pa ├── default │ ├── Makefile.am │ └── xrdp ├── init.d │ └── Makefile.am ├── rc.d │ ├── Makefile.am │ └── xrdp-sesman ├── pam.d │ ├── xrdp-sesman.debian │ ├── xrdp-sesman.freebsd │ ├── xrdp-sesman.system │ ├── xrdp-sesman.redhat │ ├── xrdp-sesman.suse │ ├── xrdp-sesman.arch │ ├── xrdp-sesman.unix │ ├── xrdp-sesman.macos │ ├── Makefile.am │ └── mkpamrules ├── xrdp.service.in ├── xrdp-sesman.service.in └── Makefile.am ├── tcutils ├── resources │ └── images │ │ └── tools.gif ├── resources.qrc ├── main.cpp ├── README.txt └── mainwindow.h ├── xrdpvr └── Makefile.am ├── vrplayer ├── mediapacket.cpp ├── mediapacket.h ├── main.cpp ├── dlgabout.cpp ├── dlgabout.h ├── README.txt ├── decoder.h ├── vrplayer.pro ├── dlgabout.ui ├── playaudio.h ├── playvideo.cpp ├── playvideo.h ├── demuxmedia.h ├── ourinterface.h ├── mainwindow.ui ├── playaudio.cpp └── decoder.cpp ├── xrdpapi ├── vrplayer.mk └── Makefile.am ├── scripts ├── install_cppcheck_dependencies_with_apt.sh ├── run_cppcheck.sh └── install_xrdp_build_dependencies_with_apt.sh ├── .gitmodules ├── genkeymap ├── Makefile.am ├── readme.txt └── dump-keymaps.sh ├── mc └── Makefile.am ├── SECURITY.md ├── vnc └── Makefile.am ├── xup └── Makefile.am ├── postinstall-pak ├── faq-general.txt ├── neutrinordp ├── Makefile.am └── xrdp-color.h ├── bootstrap ├── .cirrus.yml ├── .gitignore ├── common ├── base64.h ├── ms-rdpedisp.h ├── ms-rdperp.h ├── file.h ├── fifo.h ├── thread_calls.h ├── ms-erref.h ├── ms-rdpele.h ├── list16.h ├── list.h ├── Makefile.am ├── xrdp_sockets.h ├── ms-fscc.h ├── base64.c ├── ms-rdpegdi.h └── pixman-region16.c ├── keygen ├── Makefile.am └── openssl.conf ├── Makefile.am ├── design.txt ├── file-loc.txt ├── libxrdp ├── Makefile.am └── xrdp_orders_rail.h ├── astyle_config.as └── install.txt /docs/man/.gitignore: -------------------------------------------------------------------------------- 1 | *.[1-8] 2 | -------------------------------------------------------------------------------- /fontdump/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | -------------------------------------------------------------------------------- /description-pak: -------------------------------------------------------------------------------- 1 | RDP server for Linux 2 | -------------------------------------------------------------------------------- /m4/.gitignore: -------------------------------------------------------------------------------- 1 | libtool.m4 2 | lt*.m4 3 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | man 4 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | devel 4 | -------------------------------------------------------------------------------- /pkgconfig/.gitignore: -------------------------------------------------------------------------------- 1 | xrdp.pc 2 | xrdp-uninstalled.pc 3 | -------------------------------------------------------------------------------- /tests/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | this directory contains different tests 3 | 4 | -------------------------------------------------------------------------------- /xrdp/ad24b.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/ad24b.bmp -------------------------------------------------------------------------------- /xrdp/ad256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/ad256.bmp -------------------------------------------------------------------------------- /xrdp/cursor0.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/cursor0.cur -------------------------------------------------------------------------------- /xrdp/cursor1.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/cursor1.cur -------------------------------------------------------------------------------- /xrdp/sans-10.fv1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/sans-10.fv1 -------------------------------------------------------------------------------- /xrdp/xrdp24b.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/xrdp24b.bmp -------------------------------------------------------------------------------- /xrdp/xrdp256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/xrdp256.bmp -------------------------------------------------------------------------------- /xrdp/xrdp_logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/xrdp/xrdp_logo.bmp -------------------------------------------------------------------------------- /pkgconfig/Makefile.am: -------------------------------------------------------------------------------- 1 | pkgconfigdir = @pkgconfigdir@ 2 | pkgconfig_DATA = xrdp.pc 3 | -------------------------------------------------------------------------------- /instfiles/pulse/Makefile.am: -------------------------------------------------------------------------------- 1 | pulsedir = $(sysconfdir)/xrdp/pulse 2 | dist_pulse_DATA = default.pa 3 | -------------------------------------------------------------------------------- /sesman/reconnectwm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Write procedures here you want to execute on reconnect 4 | -------------------------------------------------------------------------------- /tools/devel/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | gtcp_proxy 4 | 5 | SUBDIRS = \ 6 | tcp_proxy 7 | -------------------------------------------------------------------------------- /instfiles/default/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/default 2 | dist_startscript_DATA = xrdp 3 | -------------------------------------------------------------------------------- /instfiles/init.d/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/init.d 2 | dist_startscript_SCRIPTS = xrdp 3 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | readme.txt 4 | 5 | SUBDIRS = \ 6 | common \ 7 | memtest 8 | -------------------------------------------------------------------------------- /instfiles/rc.d/Makefile.am: -------------------------------------------------------------------------------- 1 | startscriptdir = $(sysconfdir)/rc.d 2 | dist_startscript_SCRIPTS = xrdp xrdp-sesman 3 | -------------------------------------------------------------------------------- /tcutils/resources/images/tools.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PKRoma/xrdp/HEAD/tcutils/resources/images/tools.gif -------------------------------------------------------------------------------- /sesman/tools/config.c: -------------------------------------------------------------------------------- 1 | #if defined(HAVE_CONFIG_H) 2 | #include 3 | #endif 4 | 5 | #include "../config.c" 6 | -------------------------------------------------------------------------------- /tcutils/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/images/tools.gif 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.debian: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | @include common-auth 3 | @include common-account 4 | @include common-session 5 | @include common-password 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/common/test_common.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TEST_COMMON_H 3 | #define TEST_COMMON_H 4 | 5 | #include 6 | 7 | Suite *make_suite_test_string(void); 8 | 9 | #endif /* TEST_COMMON_H */ -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/install_cppcheck_dependencies_with_apt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eufx 3 | 4 | PACKAGES="libz3-dev z3" 5 | 6 | apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES 7 | -------------------------------------------------------------------------------- /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 | session include system-auth 6 | -------------------------------------------------------------------------------- /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/pam.d/xrdp-sesman.redhat: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include password-auth 3 | account include password-auth 4 | session include password-auth 5 | password include password-auth 6 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.suse: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include common-auth 3 | account include common-account 4 | session include common-session 5 | password include common-password 6 | -------------------------------------------------------------------------------- /instfiles/pam.d/xrdp-sesman.arch: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | auth include system-remote-login 3 | account include system-remote-login 4 | password include system-remote-login 5 | session include system-remote-login 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tcutils/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /xrdpapi/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | simple.c \ 3 | vrplayer.c \ 4 | vrplayer.mk 5 | 6 | AM_CPPFLAGS = \ 7 | -DXRDP_SOCKET_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 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "librfxcodec"] 2 | path = librfxcodec 3 | url = https://github.com/neutrinolabs/librfxcodec.git 4 | branch = . 5 | ignore = untracked 6 | 7 | [submodule "libpainter"] 8 | path = libpainter 9 | url = https://github.com/neutrinolabs/libpainter.git 10 | branch = . 11 | ignore = untracked 12 | -------------------------------------------------------------------------------- /tools/devel/tcp_proxy/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir)/common 4 | 5 | if XRDP_DEBUG 6 | AM_CPPFLAGS += -DXRDP_DEBUG 7 | endif 8 | 9 | noinst_PROGRAMS = \ 10 | tcp_proxy 11 | 12 | tcp_proxy_SOURCES = \ 13 | main.c 14 | 15 | tcp_proxy_LDADD = \ 16 | $(top_builddir)/common/libcommon.la \ 17 | -ldl 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /genkeymap/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | dump-keymaps.sh \ 3 | readme.txt 4 | 5 | AM_CFLAGS = $(X_CFLAGS) 6 | 7 | bin_PROGRAMS = \ 8 | xrdp-genkeymap 9 | 10 | xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c 11 | 12 | xrdp_genkeymap_LDFLAGS = \ 13 | $(X_LIBS) 14 | 15 | xrdp_genkeymap_LDADD = \ 16 | $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) 17 | -------------------------------------------------------------------------------- /tests/memtest/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_srcdir)/common 4 | 5 | if XRDP_DEBUG 6 | AM_CPPFLAGS += -DXRDP_DEBUG 7 | endif 8 | 9 | check_PROGRAMS = \ 10 | memtest 11 | 12 | memtest_SOURCES = \ 13 | libmem.h \ 14 | libmem.c \ 15 | memtest.c 16 | 17 | memtest_LDADD = \ 18 | $(top_builddir)/common/libcommon.la 19 | 20 | TESTS = \ 21 | memtest 22 | -------------------------------------------------------------------------------- /fontdump/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 | -------------------------------------------------------------------------------- /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 | class DlgAbout; 8 | } 9 | 10 | class DlgAbout : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit DlgAbout(QWidget *parent = 0); 16 | ~DlgAbout(); 17 | 18 | private: 19 | Ui::DlgAbout *ui; 20 | 21 | private slots: 22 | void onOk(); 23 | }; 24 | 25 | #endif // DLGABOUT_H 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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.target xrdp-sesman.service 6 | 7 | [Service] 8 | Type=forking 9 | PIDFile=@localstatedir@/run/xrdp.pid 10 | EnvironmentFile=-@sysconfdir@/sysconfig/xrdp 11 | EnvironmentFile=-@sysconfdir@/default/xrdp 12 | ExecStart=@sbindir@/xrdp $XRDP_OPTIONS 13 | ExecStop=@sbindir@/xrdp $XRDP_OPTIONS --kill 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /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=forking 10 | PIDFile=@localstatedir@/run/xrdp-sesman.pid 11 | EnvironmentFile=-@sysconfdir@/sysconfig/xrdp 12 | EnvironmentFile=-@sysconfdir@/default/xrdp 13 | ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS 14 | ExecStop=@sbindir@/xrdp-sesman $SESMAN_OPTIONS --kill 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /mc/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | if XRDP_DEBUG 9 | AM_CPPFLAGS += -DXRDP_DEBUG 10 | endif 11 | 12 | module_LTLIBRARIES = \ 13 | libmc.la 14 | 15 | libmc_la_SOURCES = \ 16 | mc.c \ 17 | mc.h 18 | 19 | libmc_la_LIBADD = \ 20 | $(top_builddir)/common/libcommon.la 21 | 22 | if !MACOS 23 | libmc_la_LDFLAGS = -avoid-version -module 24 | endif 25 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | 4 | ## Reporting a Vulnerability 5 | 6 | Please DO NOT report any security issues to public GitHub issue. 7 | 8 | If you find a security vulnerability please kindly inform us about the problem immediately 9 | so that we can fix the security problem to protect a lot of users around the world as soon 10 | as possible. 11 | 12 | Our email address for security report is below. This is a private mailing list and not open 13 | for public viewing. 14 | 15 | * [xrdp-core@googlegroups.com](mailto:xrdp-core@googlegroups.com) 16 | 17 | -------------------------------------------------------------------------------- /vnc/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | if XRDP_DEBUG 9 | AM_CPPFLAGS += -DXRDP_DEBUG 10 | endif 11 | 12 | module_LTLIBRARIES = \ 13 | libvnc.la 14 | 15 | libvnc_la_SOURCES = \ 16 | vnc.c \ 17 | vnc.h 18 | 19 | libvnc_la_LIBADD = \ 20 | $(top_builddir)/common/libcommon.la 21 | 22 | if !MACOS 23 | libvnc_la_LDFLAGS = -avoid-version -module 24 | endif 25 | -------------------------------------------------------------------------------- /xup/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | if XRDP_DEBUG 9 | AM_CPPFLAGS += -DXRDP_DEBUG 10 | endif 11 | 12 | module_LTLIBRARIES = \ 13 | libxup.la 14 | 15 | libxup_la_SOURCES = \ 16 | xup.c \ 17 | xup.h 18 | 19 | libxup_la_LIBADD = \ 20 | $(top_builddir)/common/libcommon.la 21 | 22 | if !MACOS 23 | libxup_la_LDFLAGS = -avoid-version -module 24 | endif 25 | -------------------------------------------------------------------------------- /postinstall-pak: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | if ! ([ "$1" = "configure" ] || [ "$1" = "reconfigure" ]); then 4 | exit 0 5 | fi 6 | 7 | 8 | XRDP="xrdp" 9 | ADDUSER="/usr/sbin/adduser" 10 | XRDPLOG="/var/log/xrdp-sesman.log" 11 | SESMANLOG="/var/log/xrdp-sesman.log" 12 | 13 | [ -d /var/run/xrdp ] || mkdir -p /var/run/xrdp 14 | $ADDUSER --system --disabled-password --disabled-login --home /var/run/xrdp \ 15 | --no-create-home --quiet --group $XRDP 16 | 17 | touch $SESMANLOG $XRDPLOG 18 | chown $XRDP:$XRDP $SESMANLOG 19 | chown $XRDP:$XRDP $XRDPLOG 20 | 21 | #DEBHELPER# 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /faq-general.txt: -------------------------------------------------------------------------------- 1 | General FAQ 2 | 3 | Q. What is RDP? 4 | 5 | A. RDP stands for Remote Desktop Protocol. It's the protocol used by Windows 6 | terminal servers to talk to the terminal server clients. 7 | 8 | 9 | Q. What is xrdp? 10 | 11 | A. xrdp, usually spelled in lower case, is as open source implementation of the 12 | RDP protocol. 13 | 14 | 15 | Q. I can't get xrdp to compile in Ubuntu. What can I do? 16 | 17 | A. See faq-compile.txt. 18 | 19 | 20 | Q. Can I use LDAP? 21 | 22 | A. Yes, xrdp uses PAM and thus can be configured to use LDAP for authentication. 23 | -------------------------------------------------------------------------------- /tests/common/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = \ 3 | -I$(top_builddir) \ 4 | -I$(top_srcdir)/common 5 | 6 | if XRDP_DEBUG 7 | AM_CPPFLAGS += -DXRDP_DEBUG 8 | endif 9 | 10 | LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ 11 | $(top_srcdir)/tap-driver.sh 12 | 13 | TESTS = test_common 14 | check_PROGRAMS = test_common 15 | 16 | test_common_SOURCES = \ 17 | test_common.h \ 18 | test_common_main.c \ 19 | test_string_calls.c 20 | 21 | test_common_CFLAGS = \ 22 | @CHECK_CFLAGS@ 23 | 24 | test_common_LDADD = \ 25 | $(top_builddir)/common/libcommon.la \ 26 | @CHECK_LIBS@ 27 | -------------------------------------------------------------------------------- /tests/common/test_common_main.c: -------------------------------------------------------------------------------- 1 | 2 | #if defined(HAVE_CONFIG_H) 3 | #include "config_ac.h" 4 | #endif 5 | 6 | #include 7 | #include 8 | #include "test_common.h" 9 | 10 | int main (void) 11 | { 12 | int number_failed; 13 | SRunner *sr; 14 | 15 | sr = srunner_create (make_suite_test_string()); 16 | // srunner_add_suite(sr, make_list_suite()); 17 | 18 | srunner_set_tap(sr, "-"); 19 | srunner_run_all (sr, CK_ENV); 20 | number_failed = srunner_ntests_failed(sr); 21 | srunner_free(sr); 22 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 23 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /instfiles/pam.d/Makefile.am: -------------------------------------------------------------------------------- 1 | PAM_FILES = \ 2 | xrdp-sesman.debian \ 3 | xrdp-sesman.redhat \ 4 | xrdp-sesman.suse \ 5 | xrdp-sesman.freebsd \ 6 | xrdp-sesman.macos \ 7 | xrdp-sesman.unix \ 8 | xrdp-sesman.arch 9 | 10 | EXTRA_DIST = $(PAM_FILES) mkpamrules 11 | 12 | CLEANFILES = xrdp-sesman 13 | 14 | if SESMAN_NOPAM 15 | PAMFILE = 16 | else 17 | if SESMAN_PAMUSERPASS 18 | PAMFILE = 19 | else 20 | if SESMAN_KERBEROS 21 | PAMFILE = 22 | else 23 | PAMFILE = xrdp-sesman 24 | endif 25 | endif 26 | endif 27 | 28 | pamddir = $(sysconfdir)/pam.d 29 | 30 | pamd_DATA = \ 31 | $(PAMFILE) 32 | 33 | xrdp-sesman: mkpamrules 34 | $(srcdir)/mkpamrules $(PAM_RULES) $(srcdir) $@ 35 | -------------------------------------------------------------------------------- /neutrinordp/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 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 | if XRDP_DEBUG 10 | AM_CPPFLAGS += -DXRDP_DEBUG 11 | endif 12 | 13 | module_LTLIBRARIES = \ 14 | libxrdpneutrinordp.la 15 | 16 | libxrdpneutrinordp_la_SOURCES = \ 17 | xrdp-color.c \ 18 | xrdp-color.h \ 19 | xrdp-neutrinordp.c \ 20 | xrdp-neutrinordp.h 21 | 22 | libxrdpneutrinordp_la_LIBADD = \ 23 | $(top_builddir)/common/libcommon.la \ 24 | $(FREERDP_LIBS) 25 | 26 | libxrdpneutrinordp_la_LDFLAGS = -avoid-version -module 27 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | which autoconf 4 | if ! test $? -eq 0 5 | then 6 | echo "error, install autoconf" 7 | exit 1 8 | fi 9 | 10 | which automake 11 | if ! test $? -eq 0 12 | then 13 | echo "error, install automake" 14 | exit 1 15 | fi 16 | 17 | which libtool || which libtoolize 18 | if ! test $? -eq 0 19 | then 20 | echo "error, install libtool" 21 | exit 1 22 | fi 23 | 24 | which 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 | autoreconf -fvi 42 | -------------------------------------------------------------------------------- /tcutils/README.txt: -------------------------------------------------------------------------------- 1 | A QT based utility program for thin clients using xrdp and NeutrinoRDP 2 | 3 | This program sends commands to NeutrinoRDP to do something 4 | useful on the client end (such as unmounting a USB drive, 5 | or powering down the client) 6 | 7 | Required packages to build tcutils: 8 | ----------------------------------- 9 | libqt4-gui 10 | qt4-dev-tools 11 | 12 | to build tcutils: 13 | ----------------- 14 | qmake 15 | make 16 | 17 | To run tcutils: 18 | --------------- 19 | include xrdpapi/.libs in your LD_LIBRARY_PATH 20 | 21 | Example: 22 | -------- 23 | export LD_LIBRARY_PATH=../xrdpapi/.libs 24 | run tcutils inside the xfreerdp session 25 | 26 | this is how we run xfreerdp: 27 | ---------------------------- 28 | ./xfreerdp --sec rdp --plugin tcutils 192.168.2.149 29 | 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 36 | void onGeometryChanged(QRect *geometry); 37 | }; 38 | 39 | #endif // DECODER_H 40 | -------------------------------------------------------------------------------- /.cirrus.yml: -------------------------------------------------------------------------------- 1 | FreeBSD_task: 2 | matrix: 3 | env: 4 | SSL: libressl 5 | matrix: 6 | freebsd_instance: 7 | image_family: freebsd-12-2 8 | prepare_script: 9 | - pkg install -y $SSL git autoconf automake libtool pkgconf opus jpeg-turbo fdk-aac pixman libX11 libXfixes libXrandr nasm fusefs-libs check 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-ipv6 --enable-opus --enable-jpeg --enable-fdkaac --enable-painter --enable-pixman --enable-fuse 14 | build_script: 15 | - make -j $(sysctl -n hw.ncpu || echo 4) 16 | install_script: 17 | - make install 18 | test_script: 19 | - /usr/local/sbin/xrdp -v 20 | -------------------------------------------------------------------------------- /docs/man/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = \ 2 | xrdp-dis.1 \ 3 | sesman.ini.5 \ 4 | xrdp.ini.5 \ 5 | xrdp.8 \ 6 | xrdp-chansrv.8 \ 7 | xrdp-genkeymap.8 \ 8 | xrdp-keygen.8 \ 9 | xrdp-sesadmin.8 \ 10 | xrdp-sesman.8 \ 11 | xrdp-sesrun.8 12 | 13 | EXTRA_DIST = $(man_MANS:=.in) 14 | 15 | SUBST_VARS = sed \ 16 | -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ 17 | -e 's|@bindir[@]|$(bindir)|g' \ 18 | -e 's|@sbindir[@]|$(sbindir)|g' \ 19 | -e 's|@localstatedir[@]|$(localstatedir)|g' \ 20 | -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ 21 | -e 's|@socketdir[@]|$(socketdir)|g' \ 22 | -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \ 23 | -e 's|@xrdphomeurl[@]|http://www.xrdp.org/|g' 24 | 25 | subst_verbose = $(subst_verbose_@AM_V@) 26 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 27 | subst_verbose_0 = @echo " SUBST $@"; 28 | 29 | SUFFIXES = .in 30 | .in: 31 | $(subst_verbose)$(SUBST_VARS) $< > $@ 32 | 33 | CLEANFILES = $(man_MANS) 34 | -------------------------------------------------------------------------------- /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 | int 26 | audin_init(void); 27 | int 28 | audin_deinit(void); 29 | int 30 | audin_start(void); 31 | int 32 | audin_stop(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /.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 | genkeymap/xrdp-genkeymap 18 | install-sh 19 | instfiles/pam.d/xrdp-sesman 20 | keygen/xrdp-keygen 21 | *.la 22 | .libs 23 | libtool 24 | *.lo 25 | *.log 26 | ltmain.sh 27 | Makefile 28 | Makefile.in 29 | missing 30 | mkinstalldirs 31 | NEWS 32 | *.o 33 | README 34 | sesman/chansrv/xrdp-chansrv 35 | sesman/sessvc/xrdp-sessvc 36 | sesman/tools/xrdp-dis 37 | sesman/tools/xrdp-sesadmin 38 | sesman/tools/xrdp-sesrun 39 | sesman/tools/xrdp-sestest 40 | sesman/tools/xrdp-xcon 41 | sesman/xrdp-sesman 42 | sesman/sesman.ini 43 | *.so 44 | stamp-h1 45 | tap-driver.sh 46 | test-driver 47 | tests/common/test_common 48 | tests/memtest/memtest 49 | tools/devel/tcp_proxy/tcp_proxy 50 | *.trs 51 | xrdp/xrdp 52 | xrdp/xrdp.ini 53 | xrdp_configure_options.h 54 | -------------------------------------------------------------------------------- /common/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Koichiro Iwao 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 | * Base64 encoder / decoder 19 | */ 20 | 21 | #if !defined(SSL_CALLS_H) 22 | #define SSL_CALLS_H 23 | 24 | #include "arch.h" 25 | 26 | size_t 27 | base64_decoded_bytes(const char *src); 28 | char * 29 | base64_decode(char *dst, const char *src, size_t len); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /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 | int read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, int length, int total_length); 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_commands.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_commands.h 22 | * @brief libscp data types definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_COMMANDS_H 28 | #define LIBSCP_COMMANDS_H 29 | 30 | #include "libscp_commands_mng.h" 31 | 32 | #define SCP_CMD_LOGIN 0x0001 33 | #define SCP_CMD_CONN_ERROR 0xFFFF 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sesman/libscp/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -I$(top_srcdir)/common 7 | 8 | if XRDP_DEBUG 9 | AM_CPPFLAGS += -DXRDP_DEBUG 10 | endif 11 | 12 | module_LTLIBRARIES = \ 13 | libscp.la 14 | 15 | libscp_la_SOURCES = \ 16 | libscp.h \ 17 | libscp_commands.h \ 18 | libscp_commands_mng.h \ 19 | libscp_connection.c \ 20 | libscp_connection.h \ 21 | libscp_init.c \ 22 | libscp_init.h \ 23 | libscp_lock.c \ 24 | libscp_lock.h \ 25 | libscp_session.c \ 26 | libscp_session.h \ 27 | libscp_tcp.c \ 28 | libscp_tcp.h \ 29 | libscp_types.h \ 30 | libscp_types_mng.h \ 31 | libscp_v0.c \ 32 | libscp_v0.h \ 33 | libscp_v1c.c \ 34 | libscp_v1c.h \ 35 | libscp_v1c_mng.c \ 36 | libscp_v1c_mng.h \ 37 | libscp_v1s.c \ 38 | libscp_v1s.h \ 39 | libscp_v1s_mng.c \ 40 | libscp_v1s_mng.h \ 41 | libscp_vX.c \ 42 | libscp_vX.h 43 | 44 | libscp_la_LIBADD = \ 45 | $(top_builddir)/common/libcommon.la \ 46 | -lpthread 47 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | #endif /* MS_RDPEDISP_H */ 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sesman/scp_v1.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_v1.h 22 | * @brief scp version 1 declarations 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SCP_V1_H 28 | #define SCP_V1_H 29 | 30 | /** 31 | * 32 | * @brief processes the stream using scp version 1 33 | * @param in_sck connection socket 34 | * @param in_s input stream 35 | * @param out_s output stream 36 | * 37 | */ 38 | void 39 | scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /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 | #include "arch.h" 31 | #include "parse.h" 32 | #include "os_calls.h" 33 | #include "log.h" 34 | #include "env.h" 35 | #include "auth.h" 36 | #include "config.h" 37 | #include "sig.h" 38 | #include "session.h" 39 | #include "access.h" 40 | #include "scp.h" 41 | 42 | #include "libscp.h" 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /keygen/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = openssl.conf 2 | 3 | AM_CPPFLAGS = \ 4 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 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)/xrdp 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 | -------------------------------------------------------------------------------- /sesman/chansrv/fifo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com 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 | /* FIFO implementation to store a pointer to a user struct */ 20 | 21 | typedef struct fifo 22 | { 23 | long* user_data; 24 | int rd_ptr; 25 | int wr_ptr; 26 | int entries; 27 | } FIFO; 28 | 29 | int fifo_init(FIFO* fp, int num_entries); 30 | int fifo_deinit(FIFO* fp); 31 | int fifo_is_empty(FIFO* fp); 32 | int fifo_insert(FIFO* fp, void* data); 33 | void* fifo_remove(FIFO* fp); 34 | void* fifo_peek(FIFO* fp); 35 | 36 | -------------------------------------------------------------------------------- /sesman/scp_v0.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_v0.h 22 | * @brief scp version 0 declarations 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SCP_V0_H 28 | #define SCP_V0_H 29 | 30 | #include "libscp.h" 31 | 32 | /** 33 | * 34 | * @brief processes the stream using scp version 0 35 | * @param in_sck connection socket 36 | * @param in_s input stream 37 | * @param out_s output stream 38 | * 39 | */ 40 | void 41 | scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /sesman/scp_v1_mng.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_v1.h 22 | * @brief scp version 1 declarations - management 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SCP_V1_MNG_H 28 | #define SCP_V1_MNG_H 29 | 30 | /** 31 | * 32 | * @brief processes the stream using scp version 1 33 | * @param in_sck connection socket 34 | * @param in_s input stream 35 | * @param out_s output stream 36 | * 37 | */ 38 | void 39 | scp_v1_mng_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/libscp/libscp_types_mng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_types_mng.h 22 | * @brief libscp data types definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_TYPES_MNG_H 28 | #define LIBSCP_TYPES_MNG_H 29 | 30 | #include "os_calls.h" 31 | #include "parse.h" 32 | #include "arch.h" 33 | #include "log.h" 34 | 35 | enum SCP_MNG_COMMAND 36 | { 37 | SCP_MNG_CMD_KILL, 38 | SCP_MNG_CMD_DISCONNECT 39 | }; 40 | 41 | struct SCP_MNG_DATA 42 | { 43 | enum SCP_MNG_COMMAND cmd; 44 | SCP_SID sid; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sesman/scp.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.h 22 | * @brief scp (sesman control protocol) common definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef SCP_H 28 | #define SCP_H 29 | 30 | #include "scp_v0.h" 31 | #include "scp_v1.h" 32 | #include "scp_v1_mng.h" 33 | 34 | /** 35 | * 36 | * @brief Starts a an scp protocol thread. 37 | * Starts a an scp protocol thread. 38 | * But does only version control.... 39 | * @param socket the connection socket 40 | * 41 | */ 42 | void* 43 | scp_process_start(void* sck); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_commands_mng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_commands_mng.h 22 | * @brief libscp data types definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_COMMANDS_MNG_H 28 | #define LIBSCP_COMMANDS_MNG_H 29 | 30 | #define SCP_CMD_MNG_LOGIN 0x0001 31 | #define SCP_CMD_MNG_LOGIN_ALLOW 0x0002 32 | #define SCP_CMD_MNG_LOGIN_DENY 0x0003 33 | #define SCP_CMD_MNG_CMD_ERROR 0x0004 34 | #define SCP_CMD_MNG_LIST_REQ 0x0005 35 | #define SCP_CMD_MNG_LIST 0x0006 36 | #define SCP_CMD_MNG_ACTION 0x0007 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /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_get_local_time(void); 33 | int 34 | xcommon_init(void); 35 | int 36 | xcommon_get_wait_objs(tbus* objs, int* count, int* timeout); 37 | int 38 | xcommon_check_wait_objs(void); 39 | void 40 | xcommon_set_x_server_fatal_handler(x_server_fatal_cb_type handler); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /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 | description-pak \ 15 | design.txt \ 16 | faq-compile.txt \ 17 | faq-general.txt \ 18 | file-loc.txt \ 19 | fontdump \ 20 | install.txt \ 21 | m4 \ 22 | postinstall-pak \ 23 | tcutils \ 24 | vrplayer 25 | 26 | if XRDP_NEUTRINORDP 27 | NEUTRINORDPDIR = neutrinordp 28 | else 29 | NEUTRINORDPDIR = 30 | endif 31 | 32 | if XRDP_XRDPVR 33 | XRDPVRDIR = xrdpvr 34 | else 35 | XRDPVRDIR = 36 | endif 37 | 38 | if XRDP_PAINTER 39 | PAINTERDIR = libpainter 40 | else 41 | PAINTERDIR = 42 | endif 43 | 44 | if XRDP_RFXCODEC 45 | RFXCODECDIR = librfxcodec 46 | else 47 | RFXCODECDIR = 48 | endif 49 | 50 | SUBDIRS = \ 51 | common \ 52 | vnc \ 53 | xup \ 54 | mc \ 55 | $(NEUTRINORDPDIR) \ 56 | libxrdp \ 57 | $(PAINTERDIR) \ 58 | $(RFXCODECDIR) \ 59 | xrdp \ 60 | sesman \ 61 | keygen \ 62 | docs \ 63 | instfiles \ 64 | genkeymap \ 65 | xrdpapi \ 66 | pkgconfig \ 67 | $(XRDPVRDIR) \ 68 | tests \ 69 | tools 70 | 71 | distclean-local: 72 | -rm -f xrdp_configure_options.h 73 | -------------------------------------------------------------------------------- /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/libscp/libscp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp.h 22 | * @brief libscp main header 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_H 28 | #define LIBSCP_H 29 | 30 | #include "libscp_types.h" 31 | #include "libscp_commands.h" 32 | 33 | #include "libscp_connection.h" 34 | #include "libscp_session.h" 35 | #include "libscp_init.h" 36 | #include "libscp_tcp.h" 37 | #include "libscp_lock.h" 38 | 39 | #include "libscp_vX.h" 40 | #include "libscp_v0.h" 41 | #include "libscp_v1s.h" 42 | #include "libscp_v1c.h" 43 | #include "libscp_v1s_mng.h" 44 | #include "libscp_v1c_mng.h" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_init.c 22 | * @brief libscp initialization code 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #if defined(HAVE_CONFIG_H) 28 | #include 29 | #endif 30 | 31 | #include "libscp_init.h" 32 | 33 | //struct log_config* s_log; 34 | 35 | /* server API */ 36 | int 37 | scp_init(void) 38 | { 39 | /* 40 | if (0 == log) 41 | { 42 | return 1; 43 | } 44 | */ 45 | 46 | //s_log = log; 47 | 48 | scp_lock_init(); 49 | 50 | LOG(LOG_LEVEL_DEBUG, "libscp initialized"); 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_init.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_init.h 22 | * @brief libscp initialization code header 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_INIT_H 28 | #define LIBSCP_INIT_H 29 | 30 | #include "log.h" 31 | 32 | #include "libscp.h" 33 | 34 | /** 35 | * 36 | * @brief version neutral server accept function 37 | * @param c connection descriptor 38 | * @param s session descriptor pointer address. 39 | * it will return a newly allocated descriptor. 40 | * It this memory needs to be g_free()d 41 | * 42 | */ 43 | int 44 | scp_init(void); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sesman/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 | -------------------------------------------------------------------------------- /design.txt: -------------------------------------------------------------------------------- 1 | 2 | This document is intended to explain xrdp server design. 3 | 4 | Many connections, all capable of running different modules 5 | one connection could be using a vnc connection 6 | one could be running a custom app made for xrdp 7 | one could be running a X11 session 8 | clients control the screen size and color depth 9 | 10 | all controlled by a configuration file. 11 | 12 | you can create a lib or use a lib with your executable that talks 13 | to xrdp server. 14 | 15 | ------ ---------- 16 | -xrdp---linked-------mylib.so- session 1 17 | ------ ---------- 18 | | 19 | | ------------------------- 20 | |----unix socket--myapp linked to libxrdp- session 2 21 | | ------------------------- 22 | | 23 | | ----------- 24 | |----linked-------mylib2.so- session 3 25 | ----------- 26 | 27 | Any of the above sessions can repeat or have different session 28 | numbers or not even be used. 29 | If a session is disconnected, all that changes is the rdp connection 30 | is lost, the session remains. 31 | 32 | For X11, start the XServer after the user is 33 | authenticated. First check for the next available X11 display, 34 | create a user session, start the XServer and set the DISPLAY environment 35 | variable. 36 | -------------------------------------------------------------------------------- /genkeymap/readme.txt: -------------------------------------------------------------------------------- 1 | Creating a new keymap file. 2 | --------------------------- 3 | 4 | The names of the files are of the format; 5 | 6 | km-xxxxxxxx.ini 7 | 8 | where the xxxxxxxx is replaced by the hex number of the layout of interest. 9 | 10 | The files have 8 sections; 11 | 12 | [noshift], [shift], [altgr], [shiftaltgr], [capslock], [capslockaltgr], 13 | [shiftcapslock], [shiftcapslockaltgr] 14 | 15 | In each section there are multiple lines for each key. 16 | 17 | An example line looks like; 18 | 19 | Key10=49:49 20 | 21 | In this line, 10 is the X11 scancode, the first 49 is the keysym value, 22 | the second 49 if the unicode value of the key. This is the definition 23 | for the 'noshift' '1' key on a en-us keyboard. In this case, the keysym 24 | and the unicode value are the same. 25 | 26 | Here is an example where they are not; 27 | 28 | This is the definition for the backspace key; 29 | Key22=65288:8 30 | 31 | And this is the star on the keypad; 32 | Key63=65450:42 33 | 34 | To create a new file run "xrdp-genkeymap " 35 | 36 | Example: ./xrdp-genkeymap /etc/xrdp/km-00000409.ini 37 | 38 | Note: You need to have enough rights to be able to write to the 39 | /etc/xrdp directory. 40 | 41 | Alternatively, create the keymap file in a directory of your choice, then 42 | copy or move it over to /etc/xrdp using sudo/su. 43 | 44 | -------------------------------------------------------------------------------- /common/fifo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Laxmikant Rashinkar 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 | * FIFO implementation to store pointer to data struct 19 | */ 20 | 21 | #ifndef _FIFO_H 22 | #define _FIFO_H 23 | 24 | #include "arch.h" 25 | 26 | typedef struct user_data USER_DATA; 27 | 28 | struct user_data 29 | { 30 | USER_DATA *next; 31 | void *item; 32 | }; 33 | 34 | typedef struct fifo 35 | { 36 | USER_DATA *head; 37 | USER_DATA *tail; 38 | int auto_free; 39 | } FIFO; 40 | 41 | FIFO *fifo_create(void); 42 | void fifo_delete(FIFO *self); 43 | int fifo_add_item(FIFO *self, void *item); 44 | void *fifo_remove_item(FIFO *self); 45 | int fifo_is_empty(FIFO *self); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /file-loc.txt: -------------------------------------------------------------------------------- 1 | 2 | default build will install the following 3 | 4 | /usr/local/lib/xrdp 5 | libcommon.so 6 | libmc.so 7 | libscp.so 8 | libvnc.so 9 | libxrdp.so 10 | libxrdpapi.so 11 | libxup.so 12 | 13 | /usr/local/bin 14 | xrdp-dis 15 | xrdp-genkeymap 16 | xrdp-keygen 17 | xrdp-sesadmin 18 | xrdp-sesrun 19 | 20 | /usr/local/sbin 21 | xrdp 22 | xrdp-sesman 23 | xrdp-sessvc 24 | xrdp-chansrv 25 | 26 | /etc/xrdp 27 | km-xxxxxxxx.ini 28 | sesman.ini 29 | rsakeys.ini 30 | startwm.sh 31 | xrdp.ini 32 | xrdp_keyboard.ini 33 | 34 | /etc/xrdp/pulse 35 | default.pa 36 | 37 | /etc/pam.d 38 | xrdp-sesman 39 | 40 | /usr/local/share/man/man1 41 | xrdp-dis.1 42 | 43 | /usr/local/share/man/man5 44 | sesman.ini.5 45 | xrdp.ini.5 46 | 47 | /usr/local/share/man/man8 48 | xrdp-chansrv.8 49 | xrdp-genkeymap.8 50 | xrdp-keygen.8 51 | xrdp-sesadmin.8 52 | xrdp-sesman.8 53 | xrdp-sesrun.8 54 | xrdp-sessvc.8 55 | xrdp.8 56 | 57 | /usr/local/share/xrdp 58 | ad24b.bmp 59 | ad256.bmp 60 | cursor0.cur 61 | cursor1.cur 62 | sans-10.fv1 63 | xrdp24b.bmp 64 | xrdp256.bmp 65 | xrdp_logo.bmp 66 | 67 | when running, the following are created and written to 68 | 69 | /var/run 70 | xrdp.pid 71 | sesman.pid 72 | 73 | /var/log 74 | xrdp.log 75 | xrdp-sesman.log 76 | 77 | /tmp/.xrdp 78 | xrdp* 79 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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@/xrdp/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@/xrdp/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 FILES 35 | .TP 36 | .I @sysconfdir@/xrdp/rsakeys.ini 37 | RSA public and private key pair used to identify this XRDP server. 38 | 39 | .SH SEE ALSO 40 | .BR xrdp (8), 41 | .BR xrdp\-sesman (8). 42 | 43 | .SH AUTHOR 44 | This manual page was originally written by Vincent Bernat . 45 | -------------------------------------------------------------------------------- /sesman/tools/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 3 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 4 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 5 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 6 | -DXRDP_SOCKET_PATH=\"${socketdir}\" \ 7 | -I$(top_srcdir)/common \ 8 | -I$(top_srcdir)/sesman/libscp \ 9 | -I$(top_srcdir)/sesman 10 | 11 | if XRDP_DEBUG 12 | AM_CPPFLAGS += -DXRDP_DEBUG 13 | endif 14 | 15 | AM_CFLAGS = $(X_CFLAGS) 16 | 17 | bin_PROGRAMS = \ 18 | xrdp-sesrun \ 19 | xrdp-sesadmin \ 20 | xrdp-dis 21 | 22 | noinst_PROGRAMS = \ 23 | xrdp-sestest \ 24 | xrdp-xcon 25 | 26 | xrdp_sesrun_SOURCES = \ 27 | config.c \ 28 | sesrun.c \ 29 | tcp.c \ 30 | tcp.h 31 | 32 | xrdp_sestest_SOURCES = \ 33 | sestest.c 34 | 35 | xrdp_sesadmin_SOURCES = \ 36 | sesadmin.c 37 | 38 | xrdp_dis_SOURCES = \ 39 | dis.c 40 | 41 | xrdp_dis_LDADD = \ 42 | $(top_builddir)/common/libcommon.la 43 | 44 | xrdp_xcon_SOURCES = \ 45 | xcon.c 46 | 47 | xrdp_sesrun_LDADD = \ 48 | $(top_builddir)/common/libcommon.la 49 | 50 | xrdp_sestest_LDADD = \ 51 | $(top_builddir)/common/libcommon.la \ 52 | $(top_builddir)/sesman/libscp/libscp.la 53 | 54 | xrdp_sesadmin_LDADD = \ 55 | $(top_builddir)/common/libcommon.la \ 56 | $(top_builddir)/sesman/libscp/libscp.la 57 | 58 | xrdp_xcon_LDFLAGS = \ 59 | $(X_LIBS) 60 | 61 | xrdp_xcon_LDADD = \ 62 | $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) 63 | -------------------------------------------------------------------------------- /tcutils/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | //#include 17 | 18 | #include "utils.h" 19 | 20 | namespace Ui { 21 | class MainWindow; 22 | } 23 | 24 | class MainWindow : public QMainWindow 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit MainWindow(QWidget *parent = 0); 30 | ~MainWindow(); 31 | 32 | private: 33 | Ui::MainWindow *ui; 34 | void *wtsChannel; 35 | QSystemTrayIcon *trayIcon; 36 | QMenu *trayMenu; 37 | bool okToQuit; 38 | QRect savedGeometry; 39 | QStatusBar *statusBar; 40 | 41 | QList itemList; 42 | 43 | void setupSystemTray(); 44 | int initWtsChannel(); 45 | int deinitWtsChannel(); 46 | void setStatusMsg(QString msg); 47 | void closeEvent(QCloseEvent * event); 48 | 49 | private slots: 50 | void onBtnRefreshClicked(); 51 | void onBtnUnmountClicked(); 52 | void onActionQuit(); 53 | void onActionLaunch(); 54 | void onSystemTrayClicked(QSystemTrayIcon::ActivationReason); 55 | }; 56 | 57 | #endif // MAINWINDOW_H 58 | -------------------------------------------------------------------------------- /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: 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 | -------------------------------------------------------------------------------- /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 access.h 22 | * @brief User access control definitions 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef ACCESS_H 28 | #define ACCESS_H 29 | 30 | /** 31 | * 32 | * @brief Checks if the user is allowed to access the terminal server 33 | * @param user the user to check 34 | * @return 0 if access is denied, !=0 if allowed 35 | * 36 | */ 37 | int 38 | access_login_allowed(const char *user); 39 | 40 | /** 41 | * 42 | * @brief Checks if the user is allowed to access the terminal server for management 43 | * @param user the user to check 44 | * @return 0 if access is denied, !=0 if allowed 45 | * 46 | */ 47 | int 48 | access_login_mng_allowed(const char *user); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_vX.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_vX.h 22 | * @brief libscp version neutral code header 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_VX_H 28 | #define LIBSCP_VX_H 29 | 30 | #include "libscp_types.h" 31 | 32 | #include "libscp_v0.h" 33 | #include "libscp_v1s.h" 34 | 35 | /* server API */ 36 | /** 37 | * 38 | * @brief version neutral server accept function 39 | * @param c connection descriptor 40 | * @param s session descriptor pointer address. 41 | * it will return a newly allocated descriptor. 42 | * It this memory needs to be g_free()d 43 | * 44 | */ 45 | enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_connection.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_connection.h 22 | * @brief SCP_CONNECTION handling code 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_CONNECTION_H 28 | #define LIBSCP_CONNECTION_H 29 | 30 | #include "libscp.h" 31 | 32 | /** 33 | * 34 | * @brief creates a new connection 35 | * @param sck the connection socket 36 | * 37 | * @return a struct SCP_CONNECTION* object on success, NULL otherwise 38 | * 39 | */ 40 | struct SCP_CONNECTION* 41 | scp_connection_create(int sck); 42 | 43 | /** 44 | * 45 | * @brief destroys a struct SCP_CONNECTION* object 46 | * @param c the object to be destroyed 47 | * 48 | */ 49 | void 50 | scp_connection_destroy(struct SCP_CONNECTION* c); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /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_NO_SUCH_FILE = 0xc000000f, 36 | STATUS_ACCESS_DENIED = 0xc0000022, 37 | STATUS_OBJECT_NAME_INVALID = 0xc0000033, 38 | STATUS_OBJECT_NAME_NOT_FOUND = 0xc0000034, 39 | STATUS_SHARING_VIOLATION = 0xc0000043, 40 | STATUS_NOT_SUPPORTED = 0xc00000bb 41 | }; 42 | 43 | #endif /* MS_ERREF_H */ 44 | -------------------------------------------------------------------------------- /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 | \fIUsername\fP for authentication on the server. 22 | Defaults to \fBroot\fP. 23 | 24 | .TP 25 | .BI \-p= password 26 | The \fIpassword\fP to authenticate with. 27 | The default is to ask for the password interactively. 28 | 29 | .TP 30 | .BI \-s= server 31 | The host address of the \fIserver\fP to connect to. 32 | Defaults to \fBlocalhost\fP. 33 | 34 | .TP 35 | .BI \-i= port 36 | The TCP \fIport\fP number to connect to. 37 | Defaults to \fB3350\fP. 38 | 39 | .TP 40 | .BI \-c= command 41 | Specifies the \fIcommand\fP to execute on the server. 42 | Valid commands are: 43 | .RS 4 44 | .TP 45 | .B list 46 | List currently active sessions. 47 | .TP 48 | .BI kill: sid 49 | Kills the session specified the given \fIsession id\fP. 50 | (not yet implemented). 51 | .RE 52 | 53 | .SH FILES 54 | xrdp\-sesadmin.log 55 | 56 | .SH SEE ALSO 57 | .BR xrdp (8). 58 | 59 | More info on \fBxrdp\fR can be found on the 60 | .UR @xrdphomeurl@ 61 | xrdp homepage 62 | .UE 63 | -------------------------------------------------------------------------------- /libxrdp/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | xrdp_surface.c 3 | 4 | AM_CPPFLAGS = \ 5 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 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_DEBUG 18 | AM_CPPFLAGS += -DXRDP_DEBUG 19 | endif 20 | 21 | if XRDP_NEUTRINORDP 22 | AM_CPPFLAGS += -DXRDP_NEUTRINORDP 23 | LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) 24 | endif 25 | 26 | if XRDP_RFXCODEC 27 | AM_CPPFLAGS += -DXRDP_RFXCODEC 28 | endif 29 | 30 | if XRDP_TJPEG 31 | AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ 32 | AM_LDFLAGS += @TurboJpegLibDir@ 33 | LIBXRDP_EXTRA_LIBS += -lturbojpeg 34 | else 35 | if XRDP_JPEG 36 | AM_CPPFLAGS += -DXRDP_JPEG 37 | LIBXRDP_EXTRA_LIBS += -ljpeg 38 | endif 39 | endif 40 | 41 | module_LTLIBRARIES = \ 42 | libxrdp.la 43 | 44 | libxrdp_la_SOURCES = \ 45 | libxrdp.c \ 46 | libxrdp.h \ 47 | libxrdpinc.h \ 48 | xrdp_bitmap32_compress.c \ 49 | xrdp_bitmap_compress.c \ 50 | xrdp_caps.c \ 51 | xrdp_channel.c \ 52 | xrdp_fastpath.c \ 53 | xrdp_iso.c \ 54 | xrdp_jpeg_compress.c \ 55 | xrdp_mcs.c \ 56 | xrdp_mppc_enc.c \ 57 | xrdp_orders.c \ 58 | xrdp_orders_rail.c \ 59 | xrdp_orders_rail.h \ 60 | xrdp_rdp.c \ 61 | xrdp_sec.c 62 | 63 | libxrdp_la_LIBADD = \ 64 | $(top_builddir)/common/libcommon.la \ 65 | $(LIBXRDP_EXTRA_LIBS) 66 | -------------------------------------------------------------------------------- /sesman/chansrv/clipboard_file.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(CLIPBOARD_FILE_H) 20 | #define CLIPBOARD_FILE_H 21 | 22 | #include "arch.h" 23 | #include "parse.h" 24 | 25 | int 26 | clipboard_send_data_response_for_file(const char *data, int data_size); 27 | int 28 | clipboard_process_file_request(struct stream *s, int clip_msg_status, 29 | int clip_msg_len); 30 | int 31 | clipboard_process_file_response(struct stream *s, int clip_msg_status, 32 | int clip_msg_len); 33 | int 34 | clipboard_c2s_in_files(struct stream *s, char *file_list); 35 | 36 | int 37 | clipboard_request_file_size(int stream_id, int lindex); 38 | int 39 | clipboard_request_file_data(int stream_id, int lindex, int offset, 40 | int request_bytes); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /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 Shutdown signal code 33 | * @param sig The received signal 34 | * 35 | */ 36 | void 37 | sig_sesman_shutdown(int sig); 38 | 39 | /** 40 | * 41 | * @brief SIGHUP handling code 42 | * @param sig The received signal 43 | * 44 | */ 45 | void 46 | sig_sesman_reload_cfg(int sig); 47 | 48 | /** 49 | * 50 | * @brief SIGCHLD handling code 51 | * @param sig The received signal 52 | * 53 | */ 54 | void 55 | sig_sesman_session_end(int sig); 56 | 57 | /** 58 | * 59 | * @brief signal handling thread 60 | * 61 | */ 62 | void* 63 | sig_handler_thread(void* arg); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 /* LICNSE_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 | -------------------------------------------------------------------------------- /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-preprocessor 23 | 24 | --indent-col1-comments 25 | 26 | --min-conditional-indent=2 27 | 28 | --max-instatement-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-brackets 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 | # Preserve the original file's date and time modified. 49 | --preserve-date 50 | 51 | # Formatted files display mode. Display only the files that have been formatted. 52 | # Do not display files that are unchanged. 53 | --formatted 54 | 55 | --lineend=linux 56 | 57 | -------------------------------------------------------------------------------- /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 | void 40 | list16_init(struct list16 *self); 41 | void 42 | list16_deinit(struct list16 *self); 43 | void 44 | list16_add_item(struct list16 *self, tui16 item); 45 | tui16 46 | list16_get_item(struct list16 *self, int index); 47 | void 48 | list16_clear(struct list16 *self); 49 | int 50 | list16_index_of(struct list16 *self, tui16 item); 51 | void 52 | list16_remove_item(struct list16 *self, int index); 53 | void 54 | list16_insert_item(struct list16 *self, int index, tui16 item); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_vX.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_vX.c 22 | * @brief libscp version neutral code 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #if defined(HAVE_CONFIG_H) 28 | #include 29 | #endif 30 | 31 | #include "libscp_vX.h" 32 | 33 | /* server API */ 34 | enum SCP_SERVER_STATES_E scp_vXs_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s) 35 | { 36 | tui32 version; 37 | 38 | /* reading version and packet size */ 39 | if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8)) 40 | { 41 | return SCP_SERVER_STATE_NETWORK_ERR; 42 | } 43 | 44 | in_uint32_be(c->in_s, version); 45 | 46 | if (version == 0) 47 | { 48 | return scp_v0s_accept(c, s, 1); 49 | } 50 | else if (version == 1) 51 | { 52 | return scp_v1s_accept(c, s, 1); 53 | } 54 | 55 | return SCP_SERVER_STATE_VERSION_ERR; 56 | } 57 | -------------------------------------------------------------------------------- /common/list.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(LIST_H) 22 | #define LIST_H 23 | 24 | #include "arch.h" 25 | 26 | /* list */ 27 | struct list 28 | { 29 | tintptr *items; 30 | int count; 31 | int alloc_size; 32 | int grow_by; 33 | int auto_free; 34 | }; 35 | 36 | struct list * 37 | list_create(void); 38 | void 39 | list_delete(struct list *self); 40 | void 41 | list_add_item(struct list *self, tintptr item); 42 | tintptr 43 | list_get_item(const struct list *self, int index); 44 | void 45 | list_clear(struct list *self); 46 | int 47 | list_index_of(struct list *self, tintptr item); 48 | void 49 | list_remove_item(struct list *self, int index); 50 | void 51 | list_insert_item(struct list *self, int index, tintptr item); 52 | void 53 | list_append_list_strdup(struct list *self, struct list *dest, int start_index); 54 | void 55 | list_dump_items(struct list *self); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 30 | Display *g_display = 0; 31 | int g_x_socket = 0; 32 | 33 | int main(int argc, char **argv) 34 | { 35 | fd_set rfds; 36 | int i1; 37 | XEvent xevent; 38 | 39 | g_display = XOpenDisplay(0); 40 | 41 | if (g_display == 0) 42 | { 43 | printf("XOpenDisplay failed\n"); 44 | return 0; 45 | } 46 | 47 | g_x_socket = XConnectionNumber(g_display); 48 | 49 | while (1) 50 | { 51 | FD_ZERO(&rfds); 52 | FD_SET(g_x_socket, &rfds); 53 | i1 = select(g_x_socket + 1, &rfds, 0, 0, 0); 54 | 55 | if (i1 < 0) 56 | { 57 | break; 58 | } 59 | 60 | XNextEvent(g_display, &xevent); 61 | } 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /install.txt: -------------------------------------------------------------------------------- 1 | 2 | Installation directions for xrdp. 3 | 4 | Things you need to compile and install. Most systems don't 5 | have these installed by default. 6 | gcc and make 7 | Header files for pam 8 | Header files for openssl 9 | 10 | You can build sesman without pam, there is a Makefile parameter 11 | for that. 12 | I also have a replacement ssl_calls.c to avoid the openssl dependency 13 | email me(Jay) for it or see http://server1.xrdp.org/xrdp/openssl. 14 | Due to the license, I can't include it in this project. 15 | 16 | http://server1.xrdp.org/xrdp/openssl/ 17 | 18 | unpack the tarball 19 | 20 | tar -zxvf xrdp-0.1.tar.gz 21 | 22 | this will create a folder xrdp 23 | 24 | switch to the xrdp folder(cd xrdp) 25 | 26 | run make 27 | 28 | as root, run make install 29 | 30 | This will install most of the files in /usr/local/xrdp. 31 | Some files install in /etc/xrdp. These are configuration 32 | files. 33 | 34 | files and location 35 | /usr/local/xrdp/startwm.sh - script that starts the window manager 36 | You may need to edit this file to run your window manager. 37 | /etc/sesman.ini - sesman configuration file 38 | /etc/rsakeys.ini - rsa stuff 39 | /etc/xrdp.ini - xrdp configuration file 40 | /var/run/sesman.pid 41 | /var/rub/xrdp.pid 42 | 43 | Sesman and xrdp both have to be running as root. 44 | You should set them to start when the system starts. 45 | You can use xrdp_control.sh script to start them. 46 | 47 | To completely remove xrdp 48 | remove directory /usr/local/xrdp 49 | remove directory /etc/xrdp 50 | remove file /var/run/xrdp.pid 51 | remove file /var/run/sesman.pid 52 | remove any startup links added to /etc/init.d or /etc/rcX.d 53 | 54 | jay.sorg@gmail.com 55 | -------------------------------------------------------------------------------- /sesman/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 username Username 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(const char *username, char **passwd_file, int display, 54 | const struct list *env_names, const struct list *env_values); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /docs/man/xrdp-genkeymap.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp\-genkeymap" "8" "@PACKAGE_VERSION@" "xrdp team" "" 2 | .de URL 3 | . \\$2 \(laURL: \\$1 \(ra\\$3 4 | .. 5 | .if \n[.g] .mso www.tmac 6 | 7 | .SH "NAME" 8 | \fBxrdp\-genkeymap\fR \- key map generator for XRDP 9 | 10 | .SH "SYNTAX" 11 | .B xrdp\-genkeymap 12 | .I file 13 | 14 | .SH "DESCRIPTION" 15 | \fBxrdp\-genkeymap\fR extracts the key map used by the currently running X session to generated a mapping from Remote Desktop Protocol (RDP) key codes to X keysyms and Unicode code points. 16 | 17 | .SH OPTIONS 18 | .TP 19 | .I outfile 20 | The key map information is stored in the file named \fIoutfile\fP. 21 | 22 | .SH "FILES" 23 | .TP 24 | .I @sysconfdir@/xrdp/km-XXXXXXXX.ini 25 | Files containing the keyboard mapping for language \fIXXXXXXXX\fP, which is a 8 digit hexadecimal number identifying the country and language code. 26 | .RS 8 27 | .TP 28 | .B 00000405 29 | cs Czech 30 | .TP 31 | .B 00000407 32 | de German 33 | .TP 34 | .B 00000409 35 | en-us US English 36 | .TP 37 | .B 0000040c 38 | fr French 39 | .TP 40 | .B 00000410 41 | it Italian 42 | .TP 43 | .B 00000416 44 | br Portuguese (Brazil) 45 | .TP 46 | .B 00000419 47 | ru Russian 48 | .TP 49 | .B 0000041d 50 | se Swedish 51 | .TP 52 | .B 00000809 53 | en-uk UK English 54 | .RE 55 | 56 | .SH "AUTHORS" 57 | Jay Sorg 58 | .br 59 | Simone Fedele 60 | 61 | .SH "SEE ALSO" 62 | .BR xrdp (8), 63 | .BR setxkbmap (1), 64 | .BR unicode (7) 65 | .PP 66 | Description of Keyboard Input mapping on the 67 | .UR https://github.com/FreeRDP/FreeRDP/wiki/Keyboard 68 | FreeRDP wiki 69 | .UE 70 | .PP 71 | For more info on \fBxrdp\fR see 72 | .UR @xrdphomeurl@ 73 | .UE 74 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_v1c_mng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_v1c_mng.h 22 | * @brief libscp version 1 client api declarations - session management 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_V1C_MNG_H 28 | #define LIBSCP_V1C_MNG_H 29 | 30 | #include "libscp.h" 31 | 32 | /* client API */ 33 | /* 001 */ 34 | enum SCP_CLIENT_STATES_E 35 | scp_v1c_mng_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 36 | 37 | /* 004 * / 38 | enum SCP_CLIENT_STATES_E 39 | scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 40 | 41 | / * 021 * / 42 | enum SCP_CLIENT_STATES_E 43 | scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass); 44 | 45 | / * 022 * / 46 | enum SCP_CLIENT_STATES_E 47 | scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c); 48 | */ 49 | 50 | /* 041 */ 51 | enum SCP_CLIENT_STATES_E 52 | scp_v1c_mng_get_session_list(struct SCP_CONNECTION* c, int* scount, 53 | struct SCP_DISCONNECTED_SESSION** s); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /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/libscp/libscp_connection.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_connection.c 22 | * @brief SCP_CONNECTION handling code 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #if defined(HAVE_CONFIG_H) 28 | #include 29 | #endif 30 | 31 | #include "libscp_connection.h" 32 | 33 | //extern struct log_config* s_log; 34 | 35 | struct SCP_CONNECTION * 36 | scp_connection_create(int sck) 37 | { 38 | struct SCP_CONNECTION *conn; 39 | 40 | conn = g_new(struct SCP_CONNECTION, 1); 41 | 42 | if (0 == conn) 43 | { 44 | LOG(LOG_LEVEL_ERROR, "[connection:%d] connection create: malloc error", __LINE__); 45 | return 0; 46 | } 47 | 48 | conn->in_sck = sck; 49 | make_stream(conn->in_s); 50 | init_stream(conn->in_s, 8196); 51 | make_stream(conn->out_s); 52 | init_stream(conn->out_s, 8196); 53 | 54 | return conn; 55 | } 56 | 57 | void 58 | scp_connection_destroy(struct SCP_CONNECTION *c) 59 | { 60 | free_stream(c->in_s); 61 | free_stream(c->out_s); 62 | g_free(c); 63 | } 64 | -------------------------------------------------------------------------------- /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-rdpefs.h \ 14 | ms-rdpegdi.h \ 15 | ms-rdpele.h \ 16 | ms-rdperp.h \ 17 | ms-rdpedisp.h \ 18 | ms-smb2.h \ 19 | xrdp_client_info.h \ 20 | xrdp_constants.h \ 21 | xrdp_rail.h \ 22 | xrdp_sockets.h 23 | 24 | AM_CPPFLAGS = \ 25 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 26 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 27 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 28 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 29 | -DXRDP_LOG_PATH=\"${localstatedir}/log\" \ 30 | -DXRDP_SOCKET_PATH=\"${socketdir}\" 31 | 32 | if XRDP_DEBUG 33 | AM_CPPFLAGS += -DXRDP_DEBUG 34 | endif 35 | 36 | # -no-suppress is an automake-specific flag which is needed 37 | # to prevent us missing compiler errors in some circumstances 38 | # (see https://github.com/neutrinolabs/xrdp/pull/1843 ) 39 | AM_CFLAGS = -no-suppress $(OPENSSL_CFLAGS) 40 | 41 | module_LTLIBRARIES = \ 42 | libcommon.la 43 | 44 | libcommon_la_SOURCES = \ 45 | arch.h \ 46 | base64.h \ 47 | base64.c \ 48 | defines.h \ 49 | fifo.c \ 50 | fifo.h \ 51 | file.c \ 52 | file.h \ 53 | list.c \ 54 | list.h \ 55 | list16.c \ 56 | list16.h \ 57 | log.c \ 58 | log.h \ 59 | os_calls.c \ 60 | os_calls.h \ 61 | parse.h \ 62 | rail.h \ 63 | ssl_calls.c \ 64 | ssl_calls.h \ 65 | string_calls.c \ 66 | string_calls.h \ 67 | thread_calls.c \ 68 | thread_calls.h \ 69 | trans.c \ 70 | trans.h \ 71 | $(PIXMAN_SOURCES) 72 | 73 | libcommon_la_LIBADD = \ 74 | -lpthread \ 75 | $(OPENSSL_LIBS) \ 76 | $(DLOPEN_LIBS) 77 | -------------------------------------------------------------------------------- /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@/xrdp/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sesman/tools/tcp.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 tcp.h 22 | * @brief Tcp stream functions declarations 23 | * @author Jay Sorg, Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef TCP_H 28 | #define TCP_H 29 | 30 | /** 31 | * 32 | * @brief Force receiving data from tcp stream 33 | * @param sck The socket to read from 34 | * @param data Data buffer 35 | * @param len Data buffer size 36 | * @return 0 on success, 1 on error 37 | * 38 | */ 39 | int 40 | tcp_force_recv(int sck, char* data, int len); 41 | 42 | /** 43 | * 44 | * @brief Force sending data to tcp stream 45 | * @param sck the socket to write to 46 | * @param data Data buffer 47 | * @param len Data buffer size 48 | * @return 0 on success, 1 on error 49 | * 50 | */ 51 | int 52 | tcp_force_send(int sck, char* data, int len); 53 | 54 | /** 55 | * 56 | * @brief Binds the listening socket 57 | * @param sck Listening socket 58 | * @param addr Listening address 59 | * @param port Listening port 60 | * @return 0 on success, -1 on error 61 | * 62 | */ 63 | int 64 | tcp_bind(int sck, char* addr, char* port); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /common/xrdp_sockets.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 | * names of UNIX sockets for inter-process communication 19 | */ 20 | 21 | #if !defined(XRDP_SOCKETS_H) 22 | #define XRDP_SOCKETS_H 23 | 24 | /* basename of socket files */ 25 | #define XRDP_CHANSRV_BASE_STR "xrdp_chansrv_socket_%d" 26 | #define CHANSRV_PORT_OUT_BASE_STR "xrdp_chansrv_audio_out_socket_%d" 27 | #define CHANSRV_PORT_IN_BASE_STR "xrdp_chansrv_audio_in_socket_%d" 28 | #define CHANSRV_API_BASE_STR "xrdpapi_%d" 29 | #define XRDP_X11RDP_BASE_STR "xrdp_display_%d" 30 | #define XRDP_DISCONNECT_BASE_STR "xrdp_disconnect_display_%d" 31 | 32 | /* fullpath of sockets */ 33 | #define XRDP_CHANSRV_STR XRDP_SOCKET_PATH "/" XRDP_CHANSRV_BASE_STR 34 | #define CHANSRV_PORT_OUT_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_OUT_BASE_STR 35 | #define CHANSRV_PORT_IN_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_IN_BASE_STR 36 | #define CHANSRV_API_STR XRDP_SOCKET_PATH "/" CHANSRV_API_BASE_STR 37 | #define XRDP_X11RDP_STR XRDP_SOCKET_PATH "/" XRDP_X11RDP_BASE_STR 38 | #define XRDP_DISCONNECT_STR XRDP_SOCKET_PATH "/" XRDP_DISCONNECT_BASE_STR 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_lock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 LIBSCP_LOCK_H 20 | #define LIBSCP_LOCK_H 21 | 22 | #include "libscp_types.h" 23 | 24 | #define LIBSCP_LOCK_FORK_BLOCKER 1 25 | #define LIBSCP_LOCK_FORK_WAITING 0 26 | 27 | /** 28 | * 29 | * @brief initializes all the locks 30 | * 31 | */ 32 | void 33 | scp_lock_init(void); 34 | 35 | /** 36 | * 37 | * @brief requires to fork a new child process 38 | * 39 | */ 40 | void 41 | scp_lock_fork_request(void); 42 | 43 | /** 44 | * 45 | * @brief releases a fork() request 46 | * 47 | */ 48 | void 49 | scp_lock_fork_release(void); 50 | 51 | /** 52 | * 53 | * @brief starts a section that is critical for forking 54 | * 55 | * starts a section that is critical for forking, that is no one can fork() 56 | * while I'm in a critical section. But if someone wanted to fork we have 57 | * to wait until he finishes with lock_fork_release() 58 | * 59 | * @return 60 | * 61 | */ 62 | int 63 | scp_lock_fork_critical_section_start(void); 64 | 65 | /** 66 | * 67 | * @brief closes the critical section 68 | * 69 | */ 70 | void 71 | scp_lock_fork_critical_section_end(int blocking); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_tcp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_tcp.h 22 | * @brief Tcp stream functions declarations 23 | * @author Jay Sorg, Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_TCP_H 28 | #define LIBSCP_TCP_H 29 | 30 | #include "libscp.h" 31 | 32 | /** 33 | * 34 | * @brief Force receiving data from tcp stream 35 | * @param sck The socket to read from 36 | * @param data Data buffer 37 | * @param len Data buffer size 38 | * @return 0 on success, 1 on error 39 | * 40 | */ 41 | int 42 | scp_tcp_force_recv(int sck, char* data, int len); 43 | 44 | /** 45 | * 46 | * @brief Force sending data to tcp stream 47 | * @param sck the socket to write to 48 | * @param data Data buffer 49 | * @param len Data buffer size 50 | * @return 0 on success, 1 on error 51 | * 52 | */ 53 | int 54 | scp_tcp_force_send(int sck, char* data, int len); 55 | 56 | /** 57 | * 58 | * @brief Binds the listening socket 59 | * @param sck Listening socket 60 | * @param addr Listening address 61 | * @param port Listening port 62 | * @return 0 on success, -1 on error 63 | * 64 | */ 65 | int 66 | scp_tcp_bind(int sck, char* addr, char* port); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /sesman/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 "log.h" 32 | #include "os_calls.h" 33 | #include "string_calls.h" 34 | 35 | 36 | /******************************************************************************/ 37 | int 38 | add_xauth_cookie(int display, const char *file) 39 | { 40 | FILE *dp; 41 | char cookie_str[33]; 42 | char cookie_bin[16]; 43 | char xauth_str[256]; 44 | int ret; 45 | 46 | g_random(cookie_bin, 16); 47 | g_bytes_to_hexstr(cookie_bin, 16, cookie_str, 33); 48 | 49 | g_sprintf(xauth_str, "xauth -q -f %s add :%d . %s", 50 | file, display, cookie_str); 51 | 52 | dp = popen(xauth_str, "r"); 53 | if (dp == NULL) 54 | { 55 | LOG(LOG_LEVEL_ERROR, "Unable to launch xauth"); 56 | return 1; 57 | } 58 | 59 | ret = pclose(dp); 60 | if (ret < 0) 61 | { 62 | LOG(LOG_LEVEL_ERROR, "An error occurred while running xauth"); 63 | return 1; 64 | } 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /xrdp/xrdp_encoder.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _XRDP_ENCODER_H 3 | #define _XRDP_ENCODER_H 4 | 5 | #include "arch.h" 6 | #include "fifo.h" 7 | 8 | struct xrdp_enc_data; 9 | 10 | /* for codec mode operations */ 11 | struct xrdp_encoder 12 | { 13 | struct xrdp_mm *mm; 14 | int in_codec_mode; 15 | int codec_id; 16 | int codec_quality; 17 | int max_compressed_bytes; 18 | tbus xrdp_encoder_event_to_proc; 19 | tbus xrdp_encoder_event_processed; 20 | tbus xrdp_encoder_term; 21 | FIFO *fifo_to_proc; 22 | FIFO *fifo_processed; 23 | tbus mutex; 24 | int (*process_enc)(struct xrdp_encoder *self, struct xrdp_enc_data *enc); 25 | void *codec_handle; 26 | int frame_id_client; /* last frame id received from client */ 27 | int frame_id_server; /* last frame id received from Xorg */ 28 | int frame_id_server_sent; 29 | int frames_in_flight; 30 | }; 31 | 32 | /* used when scheduling tasks in xrdp_encoder.c */ 33 | struct xrdp_enc_data 34 | { 35 | struct xrdp_mod *mod; 36 | int num_drects; 37 | short *drects; /* 4 * num_drects */ 38 | int num_crects; 39 | short *crects; /* 4 * num_crects */ 40 | char *data; 41 | int width; 42 | int height; 43 | int flags; 44 | int frame_id; 45 | }; 46 | 47 | typedef struct xrdp_enc_data XRDP_ENC_DATA; 48 | 49 | /* used when scheduling tasks from xrdp_encoder.c */ 50 | struct xrdp_enc_data_done 51 | { 52 | int comp_bytes; 53 | int pad_bytes; 54 | char *comp_pad_data; 55 | struct xrdp_enc_data *enc; 56 | int last; /* true is this is last message for enc */ 57 | int x; 58 | int y; 59 | int cx; 60 | int cy; 61 | }; 62 | 63 | typedef struct xrdp_enc_data_done XRDP_ENC_DATA_DONE; 64 | 65 | struct xrdp_encoder * 66 | xrdp_encoder_create(struct xrdp_mm *mm); 67 | void 68 | xrdp_encoder_delete(struct xrdp_encoder *self); 69 | THREAD_RV THREAD_CC 70 | proc_enc_msg(void *arg); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_v1c.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_v1c.h 22 | * @brief libscp version 1 client api declarations 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_V1C_H 28 | #define LIBSCP_V1C_H 29 | 30 | #include "libscp.h" 31 | 32 | /* client API */ 33 | /* 001 */ 34 | enum SCP_CLIENT_STATES_E 35 | scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 36 | 37 | /* 004 */ 38 | enum SCP_CLIENT_STATES_E 39 | scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 40 | 41 | /* 021 */ 42 | enum SCP_CLIENT_STATES_E 43 | scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass); 44 | 45 | /* 022 */ 46 | enum SCP_CLIENT_STATES_E 47 | scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c); 48 | 49 | /* 041 */ 50 | enum SCP_CLIENT_STATES_E 51 | scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount, 52 | struct SCP_DISCONNECTED_SESSION** s); 53 | 54 | /* 043 */ 55 | enum SCP_CLIENT_STATES_E 56 | scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s, 57 | SCP_SID sid); 58 | 59 | /* 044 */ 60 | enum SCP_CLIENT_STATES_E 61 | scp_v1c_select_session_cancel(struct SCP_CONNECTION* c); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /vrplayer/playvideo.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYVIDEO_H 2 | #define PLAYVIDEO_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 | #include "xrdpapi.h" 19 | 20 | /* ffmpeg related stuff */ 21 | extern "C" 22 | { 23 | #include 24 | #include 25 | } 26 | 27 | #define VCR_PLAY 1 28 | #define VCR_PAUSE 2 29 | #define VCR_STOP 3 30 | #define VCR_REWIND 4 31 | #define VCR_POWER_OFF 5 32 | 33 | class PlayVideo : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit PlayVideo(QObject *parent = 0, 39 | QQueue *videoQueue = 0, 40 | QMutex *sendMutex = 0, 41 | void *channel = 0, 42 | int stream_id = 101, 43 | int fps = 24); 44 | 45 | //void onMediaSeek(int value); 46 | //void setVcrOp(int op); 47 | //void onMediaRestarted(); 48 | 49 | public slots: 50 | void play(); 51 | 52 | //signals: 53 | // void onElapsedtime(int val); /* in hundredth of a sec */ 54 | 55 | private: 56 | QQueue *videoQueue; 57 | 58 | // int vcrFlag; 59 | // QMutex vcrMutex; 60 | QMutex *sendMutex; 61 | // QMutex posMutex; 62 | // int64_t la_seekPos; /* locked access; must hold posMutex */ 63 | void *channel; 64 | int stream_id; 65 | int fps; 66 | // int64_t elapsedTime; /* elapsed time in usecs since play started */ 67 | // int64_t pausedTime; /* time at which stream was paused */ 68 | // bool isStopped; 69 | 70 | // void updateMediaPos(); 71 | // void clearVideoQ(); 72 | }; 73 | 74 | #endif // PLAYVIDEO_H 75 | -------------------------------------------------------------------------------- /vrplayer/demuxmedia.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMUXMEDIA_H 2 | #define DEMUXMEDIA_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 | #include 16 | #include 17 | 18 | #include "mediapacket.h" 19 | #include "playaudio.h" 20 | #include "playvideo.h" 21 | 22 | /* ffmpeg related stuff */ 23 | extern "C" 24 | { 25 | #include 26 | #include 27 | } 28 | 29 | #define VCR_PLAY 1 30 | #define VCR_PAUSE 2 31 | #define VCR_STOP 3 32 | #define VCR_REWIND 4 33 | #define VCR_POWER_OFF 5 34 | 35 | class DemuxMedia : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit DemuxMedia(QObject *parent = 0, QQueue *videoQueue = 0, 41 | void *channel = 0, int stream_id = 101); 42 | 43 | void setVcrOp(int op); 44 | int clear(); 45 | 46 | public slots: 47 | void startDemuxing(); 48 | void onMediaSeek(int value); 49 | 50 | private: 51 | QMutex vcrMutex; 52 | int vcrFlag; 53 | void *channel; 54 | int stream_id; 55 | QMutex sendMutex; 56 | QMutex posMutex; 57 | int64_t elapsedTime; /* elapsed time in usecs since play started */ 58 | int64_t pausedTime; /* time at which stream was paused */ 59 | int64_t la_seekPos; /* locked access; must hold posMutex */ 60 | bool isStopped; 61 | 62 | QQueue *videoQueue; 63 | PlayVideo *playVideo; 64 | QThread *playVideoThread; 65 | 66 | void updateMediaPos(); 67 | 68 | signals: 69 | void onMediaRestarted(); 70 | 71 | signals: 72 | void onElapsedtime(int val); /* in hundredth of a sec */ 73 | 74 | }; 75 | 76 | #endif // DEMUXMEDIA_H 77 | -------------------------------------------------------------------------------- /vrplayer/ourinterface.h: -------------------------------------------------------------------------------- 1 | #ifndef OURINTERFACE_H 2 | #define OURINTERFACE_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 // LK_TODO 15 | 16 | #include "xrdpvr.h" 17 | #include "xrdpapi.h" 18 | #include "demuxmedia.h" 19 | #include "playvideo.h" 20 | 21 | /* ffmpeg related stuff */ 22 | extern "C" 23 | { 24 | #include 25 | #include 26 | } 27 | 28 | class OurInterface : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit OurInterface(QObject *parent = 0); 34 | 35 | /* public methods */ 36 | int oneTimeInit(); 37 | void oneTimeDeinit(); 38 | int initRemoteClient(); 39 | void deInitRemoteClient(); 40 | int sendGeometry(QRect rect); 41 | void setFilename(QString filename); 42 | void playMedia(); 43 | //PlayVideo *getPlayVideoInstance(); 44 | DemuxMedia *getDemuxMediaInstance(); 45 | void setVcrOp(int op); 46 | int setVolume(int volume); 47 | 48 | public slots: 49 | void onGeometryChanged(int x, int y, int width, int height); 50 | 51 | signals: 52 | void on_ErrorMsg(QString title, QString msg); 53 | void onMediaDurationInSeconds(int duration); 54 | 55 | private: 56 | 57 | /* private stuff */ 58 | 59 | QQueue videoQueue; 60 | 61 | DemuxMedia *demuxMedia; 62 | QThread *demuxMediaThread; 63 | //PlayVideo *playVideo; 64 | QString filename; 65 | void *channel; 66 | int stream_id; 67 | QRect savedGeometry; 68 | 69 | /* private methods */ 70 | int openVirtualChannel(); 71 | int closeVirtualChannel(); 72 | int sendMetadataFile(); 73 | int sendVideoFormat(); 74 | int sendAudioFormat(); 75 | }; 76 | 77 | #endif // INTERFACE_H 78 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /genkeymap/dump-keymaps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | which setxkbmap 4 | if test $? -ne 0 5 | then 6 | echo "error, setxkbmap not found" 7 | exit 1 8 | fi 9 | 10 | # English - US 'en-us' 0x00000409 11 | setxkbmap -model pc104 -layout us 12 | ./xrdp-genkeymap ../instfiles/km-00000409.ini 13 | 14 | # English - US 'dvorak' 0x00010409 15 | setxkbmap -model pc104 -layout dvorak 16 | ./xrdp-genkeymap ../instfiles/km-00010409.ini 17 | 18 | # English - US 'dvp' 0x19360409 19 | OLD_SETTINGS=$(setxkbmap -query -verbose 4 | sed "s/^\([a-z]\+\):\s*\(.*\)$/-\1 \2/;s/^-options/-option \"\" -option/;s/,/ -option /g" | xargs -d \\n) 20 | setxkbmap -rules xfree86 -model pc105 -layout us -variant dvp -option "" -option compose:102 -option caps:shift -option numpad:sg -option numpad:shift3 -option keypad:hex -option keypad:atm -option kpdl:semi -option lv3:ralt_alt 21 | ./xrdp-genkeymap ../instfiles/km-19360409.ini 22 | setxkbmap ${OLD_SETTINGS} 23 | 24 | # English - UK 'en-GB' 0x00000809 25 | setxkbmap -model pc105 -layout gb 26 | ./xrdp-genkeymap ../instfiles/km-00000809.ini 27 | 28 | # German 'de' 0x00000407 29 | setxkbmap -model pc104 -layout de 30 | ./xrdp-genkeymap ../instfiles/km-00000407.ini 31 | 32 | # Italian 'it' 0x00000410 33 | setxkbmap -model pc104 -layout it 34 | ./xrdp-genkeymap ../instfiles/km-00000410.ini 35 | 36 | # Japanese 'jp' 0x00000411 37 | setxkbmap -model pc105 -layout jp -variant OADG109A 38 | ./xrdp-genkeymap ../instfiles/km-00000411.ini 39 | 40 | # Polish 'pl' 0x00000415 41 | setxkbmap -model pc104 -layout pl 42 | ./xrdp-genkeymap ../instfiles/km-00000415.ini 43 | 44 | # Russia 'ru' 0x00000419 45 | setxkbmap -model pc104 -layout ru 46 | ./xrdp-genkeymap ../instfiles/km-00000419.ini 47 | 48 | # Sweden 'se' 0x0000041d 49 | setxkbmap -model pc104 -layout se 50 | ./xrdp-genkeymap ../instfiles/km-0000041d.ini 51 | 52 | # Portuguese -PT 'pt-pt' 0x00000816 53 | setxkbmap -model pc104 -layout pt 54 | ./xrdp-genkeymap ../instfiles/km-00000816.ini 55 | 56 | # set back to en-us 57 | setxkbmap -model pc104 -layout us 58 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/wrapper/winscard-func-names.txt: -------------------------------------------------------------------------------- 1 | ClassInstall32 2 | SCardAccessNewReaderEvent 3 | SCardReleaseAllEvents 4 | SCardReleaseNewReaderEvent 5 | SCardAccessStartedEvent 6 | 7 | done SCardAddReaderToGroupA 8 | done SCardAddReaderToGroupW 9 | done SCardBeginTransaction 10 | done SCardCancel 11 | done SCardConnectA 12 | done SCardConnectW 13 | done SCardControl 14 | done SCardDisconnect 15 | done SCardEndTransaction 16 | done SCardEstablishContext 17 | done SCardForgetCardTypeA 18 | done SCardForgetCardTypeW 19 | done SCardForgetReaderA 20 | done SCardForgetReaderGroupA 21 | done SCardForgetReaderGroupW 22 | done SCardForgetReaderW 23 | done SCardFreeMemory 24 | done SCardGetAttrib 25 | done SCardGetCardTypeProviderNameA 26 | done SCardGetCardTypeProviderNameW 27 | done SCardGetProviderIdA 28 | done SCardGetProviderIdW 29 | done SCardGetStatusChangeA 30 | done SCardGetStatusChangeW 31 | 32 | SCardGetTransmitCount 33 | 34 | done SCardIntroduceCardTypeA 35 | done SCardIntroduceCardTypeW 36 | done SCardIntroduceReaderA 37 | done SCardIntroduceReaderGroupA 38 | done SCardIntroduceReaderGroupW 39 | done SCardIntroduceReaderW 40 | done SCardIsValidContext 41 | done SCardListCardsA 42 | done SCardListCardsW 43 | done SCardListInterfacesA 44 | done SCardListInterfacesW 45 | done SCardListReaderGroupsA 46 | done SCardListReaderGroupsW 47 | done SCardListReadersA 48 | done SCardListReadersW 49 | done SCardLocateCardsA 50 | 51 | SCardLocateCardsByATRA 52 | SCardLocateCardsByATRW 53 | 54 | done SCardLocateCardsW 55 | 56 | SCardReadCacheA 57 | SCardReadCacheW 58 | 59 | done SCardReconnect 60 | done SCardReleaseContext 61 | 62 | SCardReleaseStartedEvent 63 | 64 | done SCardRemoveReaderFromGroupA 65 | done SCardRemoveReaderFromGroupW 66 | done SCardSetAttrib 67 | done SCardSetCardTypeProviderNameA 68 | done SCardSetCardTypeProviderNameW 69 | done SCardState 70 | done SCardStatusA 71 | done SCardStatusW 72 | done SCardTransmit 73 | 74 | SCardWriteCacheA 75 | SCardWriteCacheW 76 | g_rgSCardRawPci 77 | g_rgSCardT0Pci 78 | g_rgSCardT1Pci 79 | -------------------------------------------------------------------------------- /scripts/run_cppcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script to run cppcheck 4 | # 5 | # Usage: /path/to/run_cppcheck.sh [ -v CPPCHECK_VER] [] 6 | # 7 | # - If is missing, '.' is assumed 8 | # - If -v CPPCHECK_VER is specified, that version of cppcheck is run from 9 | # ~/cppcheck.local (whether or not it's there!). Use install_cppcheck.sh 10 | # to install a new version. 11 | # 12 | # Environment (all optional):- 13 | # 14 | # CPPCHECK : Override the default cppcheck command ('cppcheck'). 15 | # Ignored if -v is specified 16 | # CPPCHECK_FLAGS : Override the default cppcheck flags 17 | 18 | INSTALL_ROOT=~/cppcheck.local 19 | 20 | # Figure out CPPCHECK setting, if any. Currently '-v' must be the first 21 | # argument on the command line. 22 | case "$1" in 23 | -v) # Version is separate parameter 24 | if [ $# -ge 2 ]; then 25 | CPPCHECK="$INSTALL_ROOT/$2/bin/cppcheck" 26 | shift 2 27 | else 28 | echo "** ignoring '-v' with no arg" >&2 29 | shift 1 30 | fi 31 | ;; 32 | -v*) # Version is in same parameter 33 | # ${parameter#word} is not supported by classic Bourne shell, 34 | # but it is on bash, dash, etc. If it doesn't work on your shell, 35 | # don't use this form! 36 | CPPCHECK="$INSTALL_ROOT/${1#-v}/bin/cppcheck" 37 | shift 1 38 | esac 39 | if [ -z "$CPPCHECK" ]; then 40 | CPPCHECK=cppcheck 41 | fi 42 | 43 | # Supply default flags passed to cppcheck if necessary 44 | if [ -z "$CPPCHECK_FLAGS" ]; then 45 | CPPCHECK_FLAGS="--quiet --force --std=c11 --std=c++11 --inline-suppr \ 46 | --enable=warning --error-exitcode=1" 47 | fi 48 | 49 | # Any options/directories specified? 50 | if [ $# -eq 0 ]; then 51 | set -- . 52 | fi 53 | 54 | # Display the cppcheck version and command for debugging 55 | "$CPPCHECK" --version && { 56 | echo Command: $CPPCHECK $CPPCHECK_FLAGS "$@" 57 | "$CPPCHECK" $CPPCHECK_FLAGS "$@" 58 | } 59 | -------------------------------------------------------------------------------- /sesman/chansrv/sound.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 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 _SOUND_H_ 20 | #define _SOUND_H_ 21 | 22 | #include "arch.h" 23 | #include "parse.h" 24 | #include "os_calls.h" 25 | #include "chansrv.h" 26 | #include "trans.h" 27 | 28 | #define SNDC_CLOSE 0x01 29 | #define SNDC_WAVE 0x02 30 | #define SNDC_SETVOLUME 0x03 31 | #define SNDC_SETPITCH 0x04 32 | #define SNDC_WAVECONFIRM 0x05 33 | #define SNDC_TRAINING 0x06 34 | #define SNDC_FORMATS 0x07 35 | #define SNDC_CRYPTKEY 0x08 36 | #define SNDC_WAVEENCRYPT 0x09 37 | #define SNDC_UDPWAVE 0x0A 38 | #define SNDC_UDPWAVELAST 0x0B 39 | #define SNDC_QUALITYMODE 0x0C 40 | 41 | /* used for sound input (mic) */ 42 | #define SNDC_REC_NEGOTIATE 39 43 | #define SNDC_REC_START 40 44 | #define SNDC_REC_STOP 41 45 | #define SNDC_REC_DATA 42 46 | #define SNDC_REC_SET_VOLUME 43 47 | 48 | /* commands recvd from pulseaudio source */ 49 | #define PA_CMD_START_REC 1 50 | #define PA_CMD_STOP_REC 2 51 | #define PA_CMD_SEND_DATA 3 52 | 53 | int sound_init(void); 54 | int sound_deinit(void); 55 | int sound_get_wait_objs(tbus* objs, int* count, int* timeout); 56 | int sound_check_wait_objs(void); 57 | 58 | int sound_data_in(struct stream* s, int chan_id, int chan_flags, 59 | int length, int total_length); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /sesman/chansrv/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | clipboard-notes.txt \ 3 | pcsc \ 4 | wave-format-server.txt 5 | 6 | AM_CPPFLAGS = \ 7 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 8 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 9 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 10 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 11 | -DXRDP_SOCKET_PATH=\"${socketdir}\" \ 12 | -I$(top_srcdir)/common 13 | 14 | if XRDP_DEBUG 15 | AM_CPPFLAGS += -DXRDP_DEBUG 16 | endif 17 | 18 | CHANSRV_EXTRA_LIBS = 19 | 20 | if XRDP_FUSE 21 | AM_CPPFLAGS += -DXRDP_FUSE $(FUSE_CFLAGS) -DFUSE_USE_VERSION=26 22 | CHANSRV_EXTRA_LIBS += $(FUSE_LIBS) 23 | endif 24 | 25 | if XRDP_FDK_AAC 26 | AM_CPPFLAGS += -DXRDP_FDK_AAC $(FDKAAC_CFLAGS) 27 | CHANSRV_EXTRA_LIBS += $(FDKAAC_LIBS) 28 | endif 29 | 30 | if XRDP_OPUS 31 | AM_CPPFLAGS += -DXRDP_OPUS 32 | CHANSRV_EXTRA_LIBS += -lopus 33 | endif 34 | 35 | if XRDP_MP3LAME 36 | AM_CPPFLAGS += -DXRDP_MP3LAME 37 | CHANSRV_EXTRA_LIBS += -lmp3lame 38 | endif 39 | 40 | if XRDP_RDPSNDAUDIN 41 | AM_CPPFLAGS += -DXRDP_RDPSNDAUDIN 42 | endif 43 | 44 | AM_CFLAGS = $(X_CFLAGS) 45 | 46 | sbin_PROGRAMS = \ 47 | xrdp-chansrv 48 | 49 | xrdp_chansrv_SOURCES = \ 50 | chansrv.c \ 51 | chansrv.h \ 52 | chansrv_common.c \ 53 | chansrv_common.h \ 54 | chansrv_config.c \ 55 | chansrv_config.h \ 56 | chansrv_fuse.c \ 57 | chansrv_fuse.h \ 58 | chansrv_xfs.c \ 59 | chansrv_xfs.h \ 60 | clipboard.c \ 61 | clipboard.h \ 62 | clipboard_common.h \ 63 | clipboard_file.c \ 64 | clipboard_file.h \ 65 | devredir.c \ 66 | devredir.h \ 67 | fifo.c \ 68 | fifo.h \ 69 | irp.c \ 70 | irp.h \ 71 | rail.c \ 72 | rail.h \ 73 | smartcard.c \ 74 | smartcard.h \ 75 | smartcard_pcsc.c \ 76 | smartcard_pcsc.h \ 77 | sound.c \ 78 | sound.h \ 79 | xcommon.c \ 80 | xcommon.h \ 81 | audin.c \ 82 | audin.h 83 | 84 | xrdp_chansrv_LDFLAGS = \ 85 | $(X_LIBS) 86 | 87 | xrdp_chansrv_LDADD = \ 88 | $(top_builddir)/common/libcommon.la \ 89 | $(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \ 90 | $(CHANSRV_EXTRA_LIBS) 91 | -------------------------------------------------------------------------------- /docs/man/xrdp-sesman.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp\-sesman" "8" "@PACKAGE_VERSION@" "xrdp team" "" 2 | .SH "NAME" 3 | xrdp\-sesman \- \fBxrdp\fR(8) session manager 4 | 5 | .SH "SYNTAX" 6 | .B xrdp\-sesman 7 | \-\-kill 8 | .br 9 | .B xrdp\-sesman 10 | \-\-help 11 | .br 12 | .B xrdp\-sesman 13 | \-\-version 14 | .br 15 | .B xrdp\-sesman 16 | [\-\-nodaemon] [\-\-dump\-config] [\-\-config /path/to/sesman.ini] 17 | 18 | .SH "DESCRIPTION" 19 | \fBxrdp\-sesman\fR is \fBxrdp\fR(8) session manager. 20 | .br 21 | It manages user sessions by authenticating the user and starting the appropriate Xserver. 22 | 23 | .SH "OPTIONS" 24 | .TP 25 | \fB\-k\fR, \fB\-\-kill\fR 26 | Kills running \fBxrdp\-sesman\fR daemon. 27 | .TP 28 | \fB\-h\fR, \fB\-\-help\fR 29 | Output help information and exit. 30 | .TP 31 | \fB\-v\fR, \fB\-\-version\fR 32 | Output version information and exit. 33 | .TP 34 | \fB\-n\fR, \fB\-\-nodaemon\fR 35 | Starts \fBxrdp\-sesman\fR in foreground instead of starting it as a daemon. 36 | .TP 37 | \fB\-\-dump\-config\fR 38 | Print the configuration on stdout before starting the daemon. 39 | The default is not to do this. 40 | .TP 41 | \fB\-c\fR, \fB\-\-config\fR 42 | Specify a path to a different \fIsesman.ini\fR file. This option is intended 43 | to be used primarily for testing or for unusual configurations. 44 | .P 45 | .RS 46 | If you use this option, be aware that you will have to have a 47 | \fB@sysconfdir@/xrdp/sesman.ini\fR in place too, as a few elements of 48 | the system (notably \fBxrdp(8)\fR and \fBxrdp\-chansrv(8)\fR) will want 49 | to read it. 50 | .RE 51 | .SH "FILES" 52 | @sbindir@/xrdp\-sesman 53 | .br 54 | @bindir@/xrdp\-sesrun 55 | .br 56 | @sysconfdir@/xrdp/sesman.ini 57 | .br 58 | @localstatedir@/log/xrdp\-sesman.log 59 | .br 60 | @localstatedir@/run/xrdp\-sesman.pid 61 | 62 | .SH "AUTHORS" 63 | Jay Sorg 64 | .br 65 | Simone Fedele 66 | 67 | .SH "SEE ALSO" 68 | .BR sesman.ini (5), 69 | .BR xrdp\-sesrun (8), 70 | .BR xrdp (8), 71 | .BR xrdp.ini (5) 72 | 73 | for more info on \fBxrdp\fR see 74 | .UR @xrdphomeurl@ 75 | .UE 76 | -------------------------------------------------------------------------------- /tests/memtest/memtest.c: -------------------------------------------------------------------------------- 1 | 2 | #if defined(HAVE_CONFIG_H) 3 | #include 4 | #endif 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "libmem.h" 12 | #include "log.h" 13 | 14 | int main(int argc, char **argv) 15 | { 16 | void *obj; 17 | unsigned int addr1; 18 | unsigned int addr2; 19 | unsigned int addr3; 20 | unsigned int addr4; 21 | unsigned int addr5; 22 | int index; 23 | int rd; 24 | struct log_config *config; 25 | 26 | config = log_config_init_for_console(LOG_LEVEL_DEBUG, NULL); 27 | log_start_from_param(config); 28 | log_config_free(config); 29 | 30 | srand(time(0)); 31 | obj = libmem_init(0x80000000, 64 * 1024 * 1024); 32 | for (index = 0; index < 256; index++) 33 | { 34 | rd = rand() & 0xffff; 35 | printf("1 rd %d\n", rd); 36 | addr1 = libmem_alloc(obj, rd); 37 | rd = rand() & 0xffff; 38 | printf("2 rd %d\n", rd); 39 | addr2 = libmem_alloc(obj, rd); 40 | rd = rand() & 0xffff; 41 | printf("3 rd %d\n", rd); 42 | addr3 = libmem_alloc(obj, rd); 43 | rd = rand() & 0xffff; 44 | printf("4 rd %d\n", rd); 45 | addr4 = libmem_alloc(obj, rd); 46 | addr5 = libmem_alloc(obj, rd); 47 | libmem_free(obj, addr1); 48 | printf("5\n"); 49 | addr1 = libmem_alloc(obj, 64); 50 | printf("6\n"); 51 | libmem_free(obj, addr3); 52 | printf("7\n"); 53 | addr3 = libmem_alloc(obj, 64 * 1024); 54 | libmem_free(obj, addr5); 55 | addr5 = libmem_alloc(obj, 64 * 1024); 56 | printf("8\n"); 57 | libmem_free(obj, addr1); 58 | printf("9\n"); 59 | libmem_free(obj, addr2); 60 | printf("10\n"); 61 | libmem_free(obj, addr3); 62 | libmem_free(obj, addr4); 63 | if (index == 255) 64 | { 65 | libmem_set_flags(obj, 1); 66 | } 67 | libmem_free(obj, addr5); 68 | } 69 | libmem_deinit(obj); 70 | log_end(); 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-transmit.txt: -------------------------------------------------------------------------------- 1 | TS_SCardTransmit: 2 | 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 3 | 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 4 | 0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................ 5 | 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 6 | 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 7 | 0050 07 00 00 00 00 a4 02 0c 02 ef 0f 00 01 00 00 00 ................ 8 | 0060 00 00 00 00 00 00 00 00 ........ 9 | TS_SCardTransmit: 10 | 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 11 | 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 12 | 0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................ 13 | 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 14 | 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 15 | 0050 05 00 00 00 00 b0 07 5b 10 00 00 00 01 00 00 00 .......[........ 16 | 0060 00 00 00 00 00 00 00 00 ........ 17 | TS_SCardTransmit: 18 | 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 19 | 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 20 | 0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................ 21 | 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 22 | 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 23 | 0050 07 00 00 00 00 a4 02 0c 02 ef 10 00 01 00 00 00 ................ 24 | 0060 00 00 00 00 00 00 00 00 ........ 25 | TS_SCardTransmit: 26 | 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 27 | 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 28 | 0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................ 29 | 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 30 | 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 31 | 0050 05 00 00 00 00 b0 07 04 10 00 00 00 01 00 00 00 ................ 32 | 0060 00 00 00 00 00 00 00 00 ........ 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/man/xrdp.8.in: -------------------------------------------------------------------------------- 1 | .TH "xrdp" "8" "@PACKAGE_VERSION@" "xrdp team" "" 2 | .SH "NAME" 3 | \fBxrdp\fR \- a Remote Desktop Protocol (RDP) server 4 | 5 | .SH "SYNTAX" 6 | .B xrdp 7 | \-\-kill 8 | .br 9 | .B xrdp 10 | \-\-help 11 | .br 12 | .B xrdp 13 | \-\-version 14 | .br 15 | .B xrdp 16 | [\-\-nodaemon] [\-\-port port] [\-\-fork] [\-\-dump\-config] [\-\-config /path/to/xrdp.ini] 17 | 18 | .SH "DESCRIPTION" 19 | \fBxrdp\fR is a Remote Desktop Protocol (RDP) Server. 20 | .br 21 | Unlike Windows NT/2000/2003 server, \fBxrdp\fR will not display a Windows desktop but an X window desktop to the user. 22 | 23 | It can also be used as a VNC\->RDP bridge. 24 | 25 | .SH "OPTIONS" 26 | .TP 27 | \fB\-k\fR, \fB\-\-kill\fR 28 | Kill running \fBxrdp\fR daemon. 29 | .TP 30 | \fB\-h\fR, \fB\-\-help\fR 31 | Output help information and exit. 32 | .TP 33 | \fB\-v\fR, \fB\-\-version\fR 34 | Output version information and exit. 35 | .TP 36 | \fB\-n\fR, \fB\-\-nodaemon\fR 37 | Start \fBxrdp\fR in foreground instead of starting it as a daemon. 38 | .TP 39 | \fB\-p\fR, \fB\-\-port\fR 40 | Specify TCP port to listen to. This overrides \fIport\fR setting in 41 | \fIxrdp.ini\fR file. 42 | .TP 43 | \fB\-f\fR, \fB\-\-fork\fR 44 | Fork a new process on a new connection. If not enabled, use a new thread 45 | for every connection. This overrides \fIfork\fR setting in 46 | \fIxrdp.ini\fR file. 47 | .TP 48 | \fB\-\-dump\-config\fR 49 | Print the configuration on stdout before starting the daemon. 50 | The default is not to do this. 51 | .TP 52 | \fB\-c\fR, \fB\-\-config\fR 53 | Specify a path to a different \fIxrdp.ini\fR file. This option is intended 54 | to be used primarily for testing or for unusual configurations. 55 | 56 | 57 | .SH "FILES" 58 | @sbindir@/xrdp 59 | .br 60 | @sysconfdir@/xrdp/xrdp.ini 61 | .br 62 | @localstatedir@/log/xrdp.log 63 | .br 64 | @localstatedir@/run/xrdp.pid 65 | 66 | .SH "AUTHORS" 67 | Jay Sorg 68 | .br 69 | Simone Fedele 70 | 71 | .SH "SEE ALSO" 72 | .BR xrdp.ini (5), 73 | .BR sesman (8), 74 | .BR sesman.ini (5), 75 | .BR sesrun (8) 76 | 77 | for more info on \fBxrdp\fR see 78 | .UR @xrdphomeurl@ 79 | .UE 80 | -------------------------------------------------------------------------------- /vrplayer/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 800 23 | 25 24 | 25 | 26 | 27 | 28 | File 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Help 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | TopToolBarArea 46 | 47 | 48 | false 49 | 50 | 51 | 52 | 53 | 54 | Open Media File 55 | 56 | 57 | 58 | 59 | Exit application 60 | 61 | 62 | Exit application 63 | 64 | 65 | 66 | 67 | About 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /libxrdp/xrdp_orders_rail.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2012-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(_XRDP_ORDERS_RAIL_H) 20 | #define _XRDP_ORDERS_RAIL_H 21 | 22 | int 23 | xrdp_orders_send_window_delete(struct xrdp_orders *self, int window_id); 24 | int 25 | xrdp_orders_send_window_cached_icon(struct xrdp_orders *self, 26 | int window_id, int cache_entry, 27 | int cache_id, int flags); 28 | int 29 | xrdp_orders_send_window_icon(struct xrdp_orders *self, 30 | int window_id, int cache_entry, int cache_id, 31 | struct rail_icon_info *icon_info, 32 | int flags); 33 | int 34 | xrdp_orders_send_window_new_update(struct xrdp_orders *self, int window_id, 35 | struct rail_window_state_order *window_state, 36 | int flags); 37 | int 38 | xrdp_orders_send_notify_delete(struct xrdp_orders *self, int window_id, 39 | int notify_id); 40 | int 41 | xrdp_orders_send_notify_new_update(struct xrdp_orders *self, 42 | int window_id, int notify_id, 43 | struct rail_notify_state_order *notify_state, 44 | int flags); 45 | int 46 | xrdp_orders_send_monitored_desktop(struct xrdp_orders *self, 47 | struct rail_monitored_desktop_order *mdo, 48 | int flags); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /common/ms-fscc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-FSCC : Definitions from [MS-FSCC] 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-FSCC are currently correct for v20190923 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_FSCC_H) 23 | #define MS_FSCC_H 24 | 25 | /* 26 | * File system ioctl codes (section 2.3) 27 | */ 28 | #define FSCTL_DELETE_OBJECT_ID 0x900a0 29 | 30 | /* 31 | * File information classes (section 2.4) 32 | */ 33 | enum FS_INFORMATION_CLASS 34 | { 35 | FileAllocationInformation = 19, /* Set */ 36 | FileBasicInformation = 4, /* Query, Set */ 37 | FileBothDirectoryInformation = 3, /* Query */ 38 | FileDirectoryInformation = 1, /* Query */ 39 | FileDispositionInformation = 13, /* Set */ 40 | FileEndOfFileInformation = 20, /* Set */ 41 | FileFullDirectoryInformation = 2, /* Query */ 42 | FileNamesInformation = 12, /* Query */ 43 | FileRenameInformation = 10, /* Set */ 44 | FileStandardInformation = 5 /* Query */ 45 | }; 46 | 47 | /* 48 | * Size of structs above without trailing RESERVED fields (MS-RDPEFS 49 | * 2.2.3.3.8) 50 | */ 51 | #define FILE_BASIC_INFORMATION_SIZE 36 52 | #define FILE_STD_INFORMATION_SIZE 22 53 | #define FILE_END_OF_FILE_INFORMATION_SIZE 8 54 | 55 | /* Windows file attributes (section 2.6) */ 56 | #define W_FILE_ATTRIBUTE_DIRECTORY 0x00000010 57 | #define W_FILE_ATTRIBUTE_READONLY 0x00000001 58 | #define W_FILE_ATTRIBUTE_SYSTEM 0x00000004 59 | #define W_FILE_ATTRIBUTE_NORMAL 0x00000080 60 | 61 | #endif /* MS_FSCC_H */ 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /common/base64.c: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Koichiro Iwao 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 | * Base64 encoder / decoder 19 | */ 20 | 21 | #if defined(HAVE_CONFIG_H) 22 | #include 23 | #endif 24 | 25 | #include "string_calls.h" 26 | 27 | #include 28 | #include 29 | 30 | size_t 31 | base64_decoded_bytes(const char *src) 32 | { 33 | size_t len; 34 | size_t padding; 35 | 36 | len = g_strlen(src); 37 | padding = 0; 38 | 39 | if (src[len - 1] == '=') 40 | { 41 | padding++; 42 | 43 | if (src[len - 2] == '=') 44 | { 45 | padding++; 46 | } 47 | } 48 | 49 | return len * 3 / 4 - padding; 50 | } 51 | 52 | /*****************************************************************************/ 53 | char * 54 | base64_decode(char *dst, const char *src, size_t len) 55 | { 56 | BIO *b64; 57 | BIO *bio; 58 | char *b64str; 59 | size_t estimated_decoded_bytes; 60 | size_t decoded_bytes; 61 | 62 | b64str = g_strdup(src); 63 | estimated_decoded_bytes = base64_decoded_bytes(b64str); 64 | dst[estimated_decoded_bytes] = '\0'; 65 | 66 | b64 = BIO_new(BIO_f_base64()); 67 | bio = BIO_new_mem_buf(b64str, len); 68 | bio = BIO_push(b64, bio); 69 | BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); 70 | decoded_bytes = BIO_read(bio, dst, len); 71 | BIO_free_all(bio); 72 | 73 | /* if input is corrupt, return empty string */ 74 | if (estimated_decoded_bytes != decoded_bytes) 75 | { 76 | g_strncpy(dst, "", sizeof("")); 77 | } 78 | 79 | return dst; 80 | } 81 | -------------------------------------------------------------------------------- /sesman/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | Doxyfile 3 | 4 | AM_CPPFLAGS = \ 5 | -DXRDP_SYSCONF_PATH=\"${sysconfdir}\" \ 6 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 7 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 8 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 9 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 10 | -DXRDP_SOCKET_PATH=\"${socketdir}\" \ 11 | -I$(top_srcdir)/common \ 12 | -I$(top_srcdir)/sesman/libscp 13 | 14 | if XRDP_DEBUG 15 | AM_CPPFLAGS += -DXRDP_DEBUG 16 | endif 17 | 18 | if SESMAN_BSD 19 | AUTH_C = verify_user_bsd.c 20 | AUTH_LIB = 21 | else 22 | if SESMAN_PAMUSERPASS 23 | AUTH_C = verify_user_pam_userpass.c 24 | AUTH_LIB = -lpam -lpam_userpass 25 | else 26 | if SESMAN_KERBEROS 27 | AUTH_C = verify_user_kerberos.c 28 | AUTH_LIB = -lkrb5 29 | else 30 | if SESMAN_NOPAM 31 | AUTH_C = verify_user.c 32 | AUTH_LIB = -lcrypt 33 | else 34 | AUTH_C = verify_user_pam.c 35 | AUTH_LIB = -lpam 36 | endif 37 | endif 38 | endif 39 | endif 40 | 41 | sbin_PROGRAMS = \ 42 | xrdp-sesman 43 | 44 | xrdp_sesman_SOURCES = \ 45 | access.c \ 46 | access.h \ 47 | auth.h \ 48 | config.c \ 49 | config.h \ 50 | env.c \ 51 | env.h \ 52 | scp.c \ 53 | scp.h \ 54 | scp_v0.c \ 55 | scp_v0.h \ 56 | scp_v1.c \ 57 | scp_v1.h \ 58 | scp_v1_mng.c \ 59 | scp_v1_mng.h \ 60 | sesman.c \ 61 | sesman.h \ 62 | session.c \ 63 | session.h \ 64 | sig.c \ 65 | sig.h \ 66 | xauth.c \ 67 | xauth.h \ 68 | $(AUTH_C) 69 | 70 | xrdp_sesman_LDADD = \ 71 | $(top_builddir)/common/libcommon.la \ 72 | $(top_builddir)/sesman/libscp/libscp.la \ 73 | $(AUTH_LIB) \ 74 | -lpthread 75 | 76 | sesmansysconfdir=$(sysconfdir)/xrdp 77 | 78 | SUBST_VARS = sed \ 79 | -e 's|@sesmansysconfdir[@]|$(sesmansysconfdir)|g' 80 | 81 | subst_verbose = $(subst_verbose_@AM_V@) 82 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 83 | subst_verbose_0 = @echo " SUBST $@"; 84 | 85 | SUFFIXES = .in 86 | .in: 87 | $(subst_verbose)$(SUBST_VARS) $< > $@ 88 | 89 | dist_sesmansysconf_DATA = \ 90 | sesman.ini 91 | 92 | dist_sesmansysconf_SCRIPTS = \ 93 | startwm.sh \ 94 | reconnectwm.sh 95 | 96 | SUBDIRS = \ 97 | libscp \ 98 | tools \ 99 | chansrv 100 | -------------------------------------------------------------------------------- /vrplayer/playaudio.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "playaudio.h" 5 | #include 6 | 7 | PlayAudio::PlayAudio(QObject *parent, 8 | QQueue *audioQueue, 9 | QMutex *sendMutex, 10 | void *channel, 11 | int stream_id) : 12 | QObject(parent) 13 | { 14 | this->audioQueue = audioQueue; 15 | this->sendMutex = sendMutex; 16 | this->channel = channel; 17 | this->stream_id = stream_id; 18 | this->vcrFlag = 0; 19 | } 20 | 21 | void PlayAudio::play() 22 | { 23 | MediaPacket *pkt; 24 | 25 | while (1) 26 | { 27 | vcrMutex.lock(); 28 | switch (vcrFlag) 29 | { 30 | case VCR_PLAY: 31 | vcrFlag = 0; 32 | vcrMutex.unlock(); 33 | continue; 34 | break; 35 | 36 | case VCR_PAUSE: 37 | vcrMutex.unlock(); 38 | usleep(1000 * 100); 39 | continue; 40 | break; 41 | 42 | case VCR_STOP: 43 | vcrMutex.unlock(); 44 | clearAudioQ(); 45 | usleep(1000 * 100); 46 | continue; 47 | break; 48 | 49 | default: 50 | vcrMutex.unlock(); 51 | goto label1; 52 | break; 53 | } 54 | 55 | label1: 56 | 57 | printf("audio\n"); 58 | if (audioQueue->isEmpty()) 59 | { 60 | qDebug() << "PlayAudio::play: GOT EMPTY"; 61 | usleep(1000 * 10); 62 | continue; 63 | } 64 | 65 | printf(""); 66 | pkt = audioQueue->dequeue(); 67 | sendMutex->lock(); 68 | send_audio_pkt(channel, stream_id, pkt->av_pkt); 69 | sendMutex->unlock(); 70 | usleep(pkt->delay_in_us); 71 | delete pkt; 72 | } 73 | } 74 | 75 | void PlayAudio::setVcrOp(int op) 76 | { 77 | vcrMutex.lock(); 78 | this->vcrFlag = op; 79 | vcrMutex.unlock(); 80 | } 81 | 82 | void PlayAudio::clearAudioQ() 83 | { 84 | MediaPacket *pkt; 85 | 86 | while (!audioQueue->isEmpty()) 87 | { 88 | pkt = audioQueue->dequeue(); 89 | av_free_packet((AVPacket *) pkt->av_pkt); 90 | delete pkt; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /sesman/chansrv/chansrv_config.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 _CHANSRV_CONFIG 20 | #define _CHANSRV_CONFIG 21 | 22 | #include 23 | 24 | struct config_chansrv 25 | { 26 | /** Whether to use a UNIX socket for chansrv */ 27 | int use_unix_socket; 28 | 29 | /** Whether the FUSE mount is enabled or not */ 30 | int enable_fuse_mount; 31 | 32 | /** RestrictOutboundClipboard setting from sesman.ini */ 33 | int restrict_outbound_clipboard; 34 | 35 | /** * FuseMountName from sesman.ini */ 36 | char *fuse_mount_name; 37 | /** FileUmask from sesman.ini */ 38 | mode_t file_umask; 39 | }; 40 | 41 | 42 | /** 43 | * 44 | * @brief Reads sesman configuration 45 | * @param use_logger Use logger to log errors (otherwise stdout) 46 | * @param sesman_ini Name of configuration file to read 47 | * 48 | * @return configuration on success, NULL on failure 49 | * 50 | * @pre logging is assumed to be active 51 | * @post pass return value to config_free() to prevent memory leaks 52 | * 53 | */ 54 | struct config_chansrv * 55 | config_read(int use_logger, const char *sesman_ini); 56 | 57 | /** 58 | * 59 | * @brief Dumps configuration to stdout 60 | * @param pointer to a config_chansrv struct 61 | * 62 | */ 63 | void 64 | config_dump(struct config_chansrv *config); 65 | 66 | /** 67 | * 68 | * @brief Frees configuration allocated by config_read() 69 | * @param pointer to a config_chansrv struct (may be NULL) 70 | * 71 | */ 72 | void 73 | config_free(struct config_chansrv *cs); 74 | 75 | #endif /* _CHANSRV_CONFIG */ 76 | -------------------------------------------------------------------------------- /sesman/chansrv/pcsc/dumps/scard-end-tranaction.txt: -------------------------------------------------------------------------------- 1 | TS_SCardEndTransaction: 2 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 3 | 0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....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 c0 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 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 11 | 0090 00 00 00 ... 12 | TS_SCardEndTransaction: 13 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 14 | 0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....p.... 15 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...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 c0 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 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 22 | 0090 00 00 00 ... 23 | TS_SCardEndTransaction: 24 | 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 25 | 0010 00 00 00 fe 1c ea fb 2e a3 58 a6 70 00 00 00 03 .........X.p.... 26 | 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 27 | 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 28 | 0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 29 | 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 30 | 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 31 | 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 32 | 0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 33 | 0090 00 00 00 ... 34 | 35 | 36 | -------------------------------------------------------------------------------- /vrplayer/decoder.cpp: -------------------------------------------------------------------------------- 1 | #include "decoder.h" 2 | 3 | Decoder::Decoder(QObject *parent) : 4 | QObject(parent) 5 | { 6 | channel = NULL; 7 | } 8 | 9 | /* 10 | * inititialize the decoder 11 | * 12 | * @return 0 on success, -1 on failure 13 | *****************************************************************************/ 14 | int Decoder::init(QString filename) 15 | { 16 | printf("Decoder::init\n"); 17 | if (channel) 18 | return -1; 19 | 20 | /* open a virtual channel and connect to remote client */ 21 | channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "xrdpvr", 0); 22 | if (channel == NULL) 23 | { 24 | qDebug() << "WTSVirtualChannelOpenEx() failed\n"; 25 | return -1; 26 | } 27 | 28 | /* initialize the player */ 29 | if (xrdpvr_init_player(channel, 101, filename.toAscii().data())) 30 | { 31 | fprintf(stderr, "failed to initialize the player\n"); 32 | return -1; 33 | } 34 | 35 | #if 1 36 | sleep(1); 37 | qDebug() << "sleeping 1"; 38 | xrdpvr_set_geometry(channel, 101, mainWindowGeometry.x(), 39 | mainWindowGeometry.y(), mainWindowGeometry.width(), 40 | mainWindowGeometry.height()); 41 | qDebug() << "set geometry to:" << mainWindowGeometry.x() << 42 | "" << mainWindowGeometry.y() << 43 | "" << mainWindowGeometry.width() << 44 | "" << mainWindowGeometry.height(); 45 | #endif 46 | 47 | /* send compressed media data to client; client will decompress */ 48 | /* the media and play it locally */ 49 | xrdpvr_play_media(channel, 101, filename.toAscii().data()); 50 | 51 | /* perform clean up */ 52 | xrdpvr_deinit_player(channel, 101); 53 | 54 | WTSVirtualChannelClose(channel); 55 | 56 | return 0; 57 | } 58 | 59 | void Decoder::onGeometryChanged(QRect *g) 60 | { 61 | #if 1 62 | mainWindowGeometry.setX(g->x()); 63 | mainWindowGeometry.setY(g->y()); 64 | mainWindowGeometry.setWidth(g->width()); 65 | mainWindowGeometry.setHeight(g->height()); 66 | #else 67 | if (!channel) 68 | return; 69 | 70 | xrdpvr_set_geometry(channel, 101, g->x(), g->y(), g->width(), g->height()); 71 | qDebug() << "sent geometry"; 72 | #endif 73 | } 74 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_v1s_mng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_v1s_mng.h 22 | * @brief libscp version 1 server api declarations - session management 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_V1S_MNG_H 28 | #define LIBSCP_V1S_MNG_H 29 | 30 | #include "libscp.h" 31 | 32 | /* server API */ 33 | /** 34 | * 35 | * @brief processes the stream using scp version 1 36 | * @param c connection descriptor 37 | * @param s pointer to session descriptor pointer 38 | * 39 | * this function places in *s the address of a newly allocated SCP_SESSION structure 40 | * that should be free()d 41 | */ 42 | enum SCP_SERVER_STATES_E 43 | scp_v1s_mng_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s); 44 | 45 | /** 46 | * 47 | * @brief allows connection to sesman 48 | * @param c connection descriptor 49 | * 50 | */ 51 | /* 002 */ 52 | enum SCP_SERVER_STATES_E 53 | scp_v1s_mng_allow_connection(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 54 | 55 | /** 56 | * 57 | * @brief denies connection to sesman 58 | * @param c connection descriptor 59 | * @param reason pointer to a string containing the reason for denying connection 60 | * 61 | */ 62 | /* 003 */ 63 | enum SCP_SERVER_STATES_E 64 | scp_v1s_mng_deny_connection(struct SCP_CONNECTION* c, const char *reason); 65 | 66 | /** 67 | * 68 | * @brief sends session list 69 | * @param c connection descriptor 70 | * 71 | */ 72 | /* 006 */ 73 | enum SCP_SERVER_STATES_E 74 | scp_v1s_mng_list_sessions(struct SCP_CONNECTION* c, struct SCP_SESSION* s, 75 | int sescnt, struct SCP_DISCONNECTED_SESSION* ds); 76 | // SCP_SID* sid); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /common/ms-rdpegdi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * MS-RDPEGDI : Definitions from [MS-RDPEGDI] 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-RDPEGDI are currently correct for v20180912 of that 19 | * document 20 | */ 21 | 22 | #if !defined(MS_RDPEGDI_H) 23 | #define MS_RDPEGDI_H 24 | 25 | /* Drawing Order: controlFlags (2.2.2.2.1, 2.2.2.2.1.1.2) */ 26 | #define TS_STANDARD 0x01 27 | #define TS_SECONDARY 0x02 28 | #define TS_BOUNDS 0x04 29 | #define TS_TYPE_CHANGE 0x08 30 | #define TS_DELTA_COORDINATES 0x10 31 | #define TS_ZERO_BOUNDS_DELTAS 0x20 32 | #define TS_ZERO_FIELD_BYTE_BIT0 0x40 33 | #define TS_ZERO_FIELD_BYTE_BIT1 0x80 34 | 35 | /* Drawing Order: orderType (2.2.2.2.1.1.2) */ 36 | /* Should be renamed */ 37 | #define RDP_ORDER_DESTBLT 0 /* TS_ENC_DSTBLT_ORDER */ 38 | #define RDP_ORDER_PATBLT 1 39 | #define RDP_ORDER_SCREENBLT 2 40 | #define RDP_ORDER_LINE 9 41 | #define RDP_ORDER_RECT 10 42 | #define RDP_ORDER_DESKSAVE 11 43 | #define RDP_ORDER_MEMBLT 13 44 | #define RDP_ORDER_TRIBLT 14 45 | #define RDP_ORDER_POLYLINE 22 46 | #define RDP_ORDER_TEXT2 27 47 | #define RDP_ORDER_COMPOSITE 37 /* 0x25 - not defined in RDPEGDI */ 48 | 49 | /* Secondary Drawing Order Header: orderType (2.2.2.2.1.2.1.1) */ 50 | #define TS_CACHE_BITMAP_UNCOMPRESSED 0x00 51 | #define TS_CACHE_COLOR_TABLE 0x01 52 | #define TS_CACHE_BITMAP_COMPRESSED 0x02 53 | #define TS_CACHE_GLYPH 0x03 54 | #define TS_CACHE_BITMAP_UNCOMPRESSED_REV2 0x04 55 | #define TS_CACHE_BITMAP_COMPRESSED_REV2 0x05 56 | #define TS_CACHE_BRUSH 0x07 57 | #define TS_CACHE_BITMAP_COMPRESSED_REV3 0x08 58 | 59 | #endif /* MS_RDPEGDI_H */ 60 | -------------------------------------------------------------------------------- /sesman/chansrv/chansrv_common.c: -------------------------------------------------------------------------------- 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 | #if defined(HAVE_CONFIG_H) 20 | #include 21 | #endif 22 | 23 | #include "chansrv_common.h" 24 | 25 | /** 26 | * Assemble fragmented incoming packets into one stream 27 | * 28 | * @param src stream that contains partial data 29 | * @param dest stream that contains entire data 30 | * @param chan_flags fragmentation flags 31 | * @param length bytes in this packet 32 | * @param total_length total length of assembled packet 33 | * 34 | * @return 1 when all data has been assembled, 0 otherwise 35 | * 36 | * NOTE: it is the responsibility of the caller to free dest stream 37 | ****************************************************************************/ 38 | int 39 | read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, 40 | int length, int total_length) 41 | { 42 | struct stream *ls; 43 | 44 | if ((chan_flags & 3) == 3) 45 | { 46 | /* packet not fragmented */ 47 | xstream_new(ls, total_length); 48 | xstream_copyin(ls, src->p, length); 49 | ls->p = ls->data; 50 | *dest = ls; 51 | return 1; 52 | } 53 | 54 | /* is this the first fragmented packet? */ 55 | if (chan_flags & 1) 56 | { 57 | xstream_new(ls, total_length); 58 | *dest = ls; 59 | } 60 | else 61 | { 62 | ls = *dest; 63 | } 64 | 65 | xstream_copyin(ls, src->p, length); 66 | 67 | /* in last packet, chan_flags & 0x02 will be true */ 68 | if (chan_flags & 0x02) 69 | { 70 | /* rewind stream */ 71 | ls->p = ls->data; 72 | return 1; 73 | } 74 | 75 | return 0; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /instfiles/pam.d/mkpamrules: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Find suitable PAM config file 4 | 5 | rules="$1" 6 | srcdir="$2" 7 | outfile="$3" 8 | 9 | service="xrdp-sesman" 10 | pamdir="/etc/pam.d" 11 | pamdir_suse="/usr/etc/pam.d" 12 | 13 | # Modules needed by xrdp-sesman.unix, if we get to that 14 | unix_modules_needed="pam_unix.so pam_env.so pam_nologin.so" 15 | 16 | # Directories where pam modules might be installed 17 | # Add to this list as platforms are added 18 | pam_module_dir_searchpath="/lib*/security /usr/lib*/security /lib/*/security /usr/lib/*/security" 19 | 20 | find_pam_module_dir() 21 | { 22 | # Looks for the pam security module directory 23 | set -- $pam_module_dir_searchpath 24 | for d in "$@"; do 25 | if [ -s $d/pam_unix.so ]; then 26 | echo $d 27 | break 28 | fi 29 | done 30 | } 31 | 32 | can_apply_unix_config() 33 | { 34 | result=0 35 | module_dir="$1" 36 | for m in $unix_modules_needed; do 37 | if [ ! -s $module_dir/$m ]; then 38 | echo " ** $m not found" >&2 39 | result=1 40 | fi 41 | done 42 | 43 | return $result 44 | } 45 | 46 | guess_rules () 47 | { 48 | rules= 49 | if [ -s "$pamdir/password-auth" ]; then 50 | rules="redhat" 51 | 52 | elif [ -s "$pamdir_suse/common-account" ]; then 53 | rules="suse" 54 | 55 | elif [ -s "$pamdir/common-account" ]; then 56 | if grep "^@include" "$pamdir/passwd" >/dev/null 2>&1; then 57 | rules="debian" 58 | else 59 | rules="suse" 60 | fi 61 | 62 | elif [ ! -f "$pamdir/system-auth" -a -s "$pamdir/system" ]; then 63 | rules="freebsd" 64 | 65 | elif [ -s "$pamdir/authorization" ]; then 66 | rules="macos" 67 | 68 | elif [ -s "$pamdir/system-remote-login" ]; then 69 | rules="arch" 70 | 71 | elif [ -s "$pamdir/system-auth" ]; then 72 | rules="system" 73 | 74 | else 75 | module_dir=`find_pam_module_dir` 76 | if [ -d "$module_dir" ]; then 77 | #echo "- Found pam modules in $module_dir" >&2 78 | if can_apply_unix_config "$module_dir" ; then 79 | rules="unix" 80 | fi 81 | fi 82 | fi 83 | } 84 | 85 | if [ "$rules" = "auto" ]; then 86 | guess_rules 87 | if [ -z "$rules" ]; then 88 | echo "** Can't guess PAM rules for this system" 89 | exit 1 90 | fi 91 | fi 92 | 93 | if [ -s "$srcdir/$service.$rules" ]; then 94 | ln -nsf "$srcdir/$service.$rules" "$outfile" 95 | else 96 | echo "Cannot find $srcdir/$service.$rules" 97 | exit 1 98 | fi 99 | -------------------------------------------------------------------------------- /sesman/libscp/libscp_v0.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file libscp_v0.h 22 | * @brief libscp version 0 declarations 23 | * @author Simone Fedele 24 | * 25 | */ 26 | 27 | #ifndef LIBSCP_V0_H 28 | #define LIBSCP_V0_H 29 | 30 | #include "libscp.h" 31 | 32 | /* client API */ 33 | /** 34 | * 35 | * @brief connects to sesman using scp v0 36 | * @param c connection descriptor 37 | * @param s session descriptor 38 | * @param d display 39 | * 40 | */ 41 | enum SCP_CLIENT_STATES_E 42 | scp_v0c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s); 43 | 44 | /* server API */ 45 | /** 46 | * 47 | * @brief processes the stream using scp version 0 48 | * @param c connection descriptor 49 | * @param s session descriptor 50 | * @param skipVchk if set to !0 skips the version control (to be used after 51 | * scp_vXs_accept() ) 52 | * 53 | */ 54 | enum SCP_SERVER_STATES_E 55 | scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SESSION** s, int skipVchk); 56 | 57 | /** 58 | * 59 | * @brief allows the connection to TS, returning the display port 60 | * @param c connection descriptor 61 | * 62 | */ 63 | enum SCP_SERVER_STATES_E 64 | scp_v0s_allow_connection(struct SCP_CONNECTION* c, SCP_DISPLAY d, const tui8 *guid); 65 | 66 | /** 67 | * 68 | * @brief denies the connection to TS 69 | * @param c connection descriptor 70 | * 71 | */ 72 | enum SCP_SERVER_STATES_E 73 | scp_v0s_deny_connection(struct SCP_CONNECTION* c); 74 | 75 | /** 76 | * @brief send reply to an authentication request 77 | * @param c connection descriptor 78 | * @param value the reply code 0 means ok 79 | * @return 80 | */ 81 | enum SCP_SERVER_STATES_E 82 | scp_v0s_replyauthentication(struct SCP_CONNECTION* c, unsigned short int value); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /instfiles/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | keymap-names.txt \ 3 | xrdp-sesman.service.in \ 4 | xrdp.service.in 5 | 6 | # 7 | # substitute directories in service file 8 | # 9 | CLEANFILES= \ 10 | xrdp-sesman.service \ 11 | xrdp.service 12 | 13 | SUBST_VARS = sed \ 14 | -e 's|@sbindir[@]|$(sbindir)|g' \ 15 | -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ 16 | -e 's|@localstatedir[@]|$(localstatedir)|g' 17 | 18 | subst_verbose = $(subst_verbose_@AM_V@) 19 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 20 | subst_verbose_0 = @echo " SUBST $@"; 21 | 22 | SUFFIXES = .in 23 | .in: 24 | $(subst_verbose)$(SUBST_VARS) $< > $@ 25 | 26 | # 27 | # files for all platforms 28 | # 29 | startscriptdir=$(sysconfdir)/xrdp 30 | 31 | dist_startscript_DATA = \ 32 | km-00000406.ini \ 33 | km-00000407.ini \ 34 | km-00000409.ini \ 35 | km-0000040a.ini \ 36 | km-0000040b.ini \ 37 | km-0000040c.ini \ 38 | km-00000410.ini \ 39 | km-00000411.ini \ 40 | km-00000412.ini \ 41 | km-00000414.ini \ 42 | km-00000415.ini \ 43 | km-00000416.ini \ 44 | km-00000419.ini \ 45 | km-0000041d.ini \ 46 | km-00000807.ini \ 47 | km-00000809.ini \ 48 | km-0000080a.ini \ 49 | km-0000080c.ini \ 50 | km-00000813.ini \ 51 | km-00000816.ini \ 52 | km-0000100c.ini \ 53 | km-00010409.ini \ 54 | km-19360409.ini 55 | 56 | # 57 | # platform specific files 58 | # 59 | SUBDIRS = 60 | if LINUX 61 | SUBDIRS += \ 62 | pam.d \ 63 | pulse 64 | if HAVE_SYSTEMD 65 | systemdsystemunit_DATA = \ 66 | xrdp-sesman.service \ 67 | xrdp.service 68 | else 69 | SUBDIRS += \ 70 | default \ 71 | init.d 72 | endif # HAVE_SYSTEMD 73 | endif # LINUX 74 | 75 | if FREEBSD 76 | SUBDIRS += \ 77 | pam.d \ 78 | rc.d \ 79 | pulse 80 | endif 81 | 82 | if MACOS 83 | SUBDIRS += pam.d 84 | endif 85 | 86 | # 87 | # install-data-hook for each platform 88 | # TODO: subst these directories as well as service files 89 | # 90 | if LINUX 91 | # must be tab below 92 | install-data-hook: 93 | if [ -f $(DESTDIR)$(sysconfdir)/init.d/xrdp ]; then \ 94 | sed -i 's|__BASE__|$(prefix)|' $(DESTDIR)$(sysconfdir)/init.d/xrdp; \ 95 | fi 96 | endif 97 | 98 | if FREEBSD 99 | # must be tab below 100 | install-data-hook: 101 | sed -i '' 's|%%PREFIX%%|$(prefix)|g' $(DESTDIR)$(sysconfdir)/rc.d/xrdp \ 102 | $(DESTDIR)$(sysconfdir)/rc.d/xrdp-sesman 103 | endif 104 | -------------------------------------------------------------------------------- /sesman/tools/dis.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 | 31 | #include "xrdp_sockets.h" 32 | #include "string_calls.h" 33 | 34 | int main(int argc, char **argv) 35 | { 36 | int sck; 37 | int dis; 38 | struct sockaddr_un sa; 39 | size_t len; 40 | char *display; 41 | 42 | if (argc != 1) 43 | { 44 | printf("xrdp disconnect utility\n"); 45 | printf("run with no parameters to disconnect you xrdp session\n"); 46 | return 0; 47 | } 48 | 49 | display = getenv("DISPLAY"); 50 | 51 | if (display == 0) 52 | { 53 | printf("display not set\n"); 54 | return 1; 55 | } 56 | 57 | dis = g_get_display_num_from_display(display); 58 | if (dis < 0) 59 | { 60 | printf("Can't parse DISPLAY='%s'\n", display); 61 | return 1; 62 | } 63 | memset(&sa, 0, sizeof(sa)); 64 | sa.sun_family = AF_UNIX; 65 | sprintf(sa.sun_path, XRDP_DISCONNECT_STR, dis); 66 | 67 | if (access(sa.sun_path, F_OK) != 0) 68 | { 69 | printf("not in an xrdp session\n"); 70 | return 1; 71 | } 72 | 73 | if ((sck = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) 74 | { 75 | printf("socket open error\n"); 76 | return 1; 77 | } 78 | 79 | len = sizeof(sa); 80 | 81 | if (sendto(sck, "sig", 4, 0, (struct sockaddr *)&sa, len) > 0) 82 | { 83 | printf("message sent ok\n"); 84 | } 85 | else 86 | { 87 | printf("message send failed: %s\n", strerror(errno)); 88 | } 89 | 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /xrdp/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | czech.txt \ 3 | rdp-scan-codes.txt \ 4 | xrdpwin.c 5 | 6 | AM_CPPFLAGS = \ 7 | -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ 8 | -DXRDP_SBIN_PATH=\"${sbindir}\" \ 9 | -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ 10 | -DXRDP_PID_PATH=\"${localstatedir}/run\" \ 11 | -DXRDP_MODULE_PATH=\"${moduledir}\" \ 12 | -DXRDP_SOCKET_PATH=\"${socketdir}\" \ 13 | -I$(top_builddir) \ 14 | -I$(top_srcdir)/common \ 15 | -I$(top_srcdir)/libxrdp 16 | 17 | XRDP_EXTRA_LIBS = 18 | 19 | if XRDP_DEBUG 20 | AM_CPPFLAGS += -DXRDP_DEBUG 21 | endif 22 | 23 | if XRDP_RFXCODEC 24 | AM_CPPFLAGS += -DXRDP_RFXCODEC 25 | AM_CPPFLAGS += -I$(top_srcdir)/librfxcodec/include 26 | XRDP_EXTRA_LIBS += $(top_builddir)/librfxcodec/src/.libs/librfxencode.a 27 | endif 28 | 29 | if XRDP_PIXMAN 30 | AM_CPPFLAGS += -DXRDP_PIXMAN 31 | AM_CPPFLAGS += $(PIXMAN_CFLAGS) 32 | XRDP_EXTRA_LIBS += $(PIXMAN_LIBS) 33 | endif 34 | 35 | if XRDP_PAINTER 36 | AM_CPPFLAGS += -DXRDP_PAINTER 37 | AM_CPPFLAGS += -I$(top_srcdir)/libpainter/include 38 | XRDP_EXTRA_LIBS += $(top_builddir)/libpainter/src/.libs/libpainter.a 39 | endif 40 | 41 | sbin_PROGRAMS = \ 42 | xrdp 43 | 44 | xrdp_SOURCES = \ 45 | funcs.c \ 46 | lang.c \ 47 | xrdp.c \ 48 | xrdp.h \ 49 | xrdp_bitmap.c \ 50 | xrdp_cache.c \ 51 | xrdp_encoder.c \ 52 | xrdp_encoder.h \ 53 | xrdp_font.c \ 54 | xrdp_listen.c \ 55 | xrdp_login_wnd.c \ 56 | xrdp_mm.c \ 57 | xrdp_painter.c \ 58 | xrdp_process.c \ 59 | xrdp_region.c \ 60 | xrdp_types.h \ 61 | xrdp_wm.c 62 | 63 | xrdp_LDADD = \ 64 | $(top_builddir)/common/libcommon.la \ 65 | $(top_builddir)/libxrdp/libxrdp.la \ 66 | $(XRDP_EXTRA_LIBS) 67 | 68 | xrdpsysconfdir=$(sysconfdir)/xrdp 69 | 70 | if MACOS 71 | lib_extension = dylib 72 | else 73 | lib_extension = so 74 | endif 75 | 76 | SUBST_VARS = sed \ 77 | -e 's|@lib_extension[@]|$(lib_extension)|g' 78 | 79 | subst_verbose = $(subst_verbose_@AM_V@) 80 | subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) 81 | subst_verbose_0 = @echo " SUBST $@"; 82 | 83 | SUFFIXES = .in 84 | .in: 85 | $(subst_verbose)$(SUBST_VARS) $< > $@ 86 | 87 | dist_xrdpsysconf_DATA = \ 88 | xrdp.ini \ 89 | xrdp_keyboard.ini 90 | 91 | xrdppkgdatadir=$(datadir)/xrdp 92 | 93 | dist_xrdppkgdata_DATA = \ 94 | ad24b.bmp \ 95 | ad256.bmp \ 96 | xrdp24b.bmp \ 97 | xrdp256.bmp \ 98 | xrdp_logo.bmp \ 99 | sans-10.fv1 \ 100 | cursor0.cur \ 101 | cursor1.cur 102 | -------------------------------------------------------------------------------- /scripts/install_xrdp_build_dependencies_with_apt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eufx 3 | 4 | FEATURE_SET=min 5 | ARCH=amd64 6 | 7 | if [ $# -ge 1 ]; then 8 | FEATURE_SET="$1" 9 | shift 10 | fi 11 | if [ $# -ge 1 ]; then 12 | ARCH="$1" 13 | shift 14 | fi 15 | APT_EXTRA_ARGS="$@" 16 | 17 | # common build tools for all architectures and feature sets 18 | PACKAGES=" \ 19 | autoconf \ 20 | automake \ 21 | clang \ 22 | gcc \ 23 | g++ \ 24 | libtool \ 25 | make \ 26 | nasm \ 27 | pkg-config \ 28 | check \ 29 | " 30 | 31 | case "$ARCH" 32 | in 33 | amd64) 34 | PACKAGES_AMD64_MIN=" \ 35 | libpam0g-dev \ 36 | libssl-dev \ 37 | libx11-dev \ 38 | libxrandr-dev \ 39 | libxfixes-dev" 40 | 41 | case "$FEATURE_SET" 42 | in 43 | min) 44 | PACKAGES="$PACKAGES $PACKAGES_AMD64_MIN" 45 | ;; 46 | max) 47 | PACKAGES="$PACKAGES \ 48 | $PACKAGES_AMD64_MIN 49 | libfuse-dev \ 50 | libjpeg-dev \ 51 | libmp3lame-dev \ 52 | libfdk-aac-dev \ 53 | libopus-dev \ 54 | libpixman-1-dev" 55 | ;; 56 | *) 57 | echo "unsupported feature set: $FEATURE_SET" 58 | exit 1; 59 | ;; 60 | esac 61 | ;; 62 | i386) 63 | PACKAGES="$PACKAGES \ 64 | g++-multilib \ 65 | gcc-multilib \ 66 | libgl1-mesa-dev:i386 \ 67 | libglu1-mesa-dev:i386 \ 68 | libjpeg-dev:i386 \ 69 | libmp3lame-dev:i386 \ 70 | libfdk-aac-dev:i386 \ 71 | libopus-dev:i386 \ 72 | libpam0g-dev:i386 \ 73 | libssl-dev:i386 \ 74 | libx11-dev:i386 \ 75 | libxext-dev:i386 \ 76 | libxfixes-dev:i386 \ 77 | libxrandr-dev:i386 \ 78 | libxrender-dev:i386 \ 79 | libfuse-dev:i386" 80 | 81 | dpkg --add-architecture i386 82 | dpkg --print-architecture 83 | dpkg --print-foreign-architectures 84 | apt-get update 85 | ;; 86 | *) 87 | echo "unsupported architecture: $ARCH" 88 | exit 1; 89 | ;; 90 | esac 91 | 92 | apt-get -yq \ 93 | --no-install-suggests \ 94 | --no-install-recommends \ 95 | $APT_EXTRA_ARGS \ 96 | install $PACKAGES 97 | -------------------------------------------------------------------------------- /sesman/auth.h: -------------------------------------------------------------------------------- 1 | /** 2 | * xrdp: A Remote Desktop Protocol server. 3 | * 4 | * Copyright (C) Jay Sorg 2004-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 | /** 20 | * 21 | * @file auth.h 22 | * @brief User authentication definitions 23 | * @author Jay Sorg 24 | * 25 | */ 26 | 27 | #ifndef AUTH_H 28 | #define AUTH_H 29 | 30 | /** 31 | * 32 | * @brief Validates user's password 33 | * @param user user's login name 34 | * @param pass user's password 35 | * @return non-zero handle on success, 0 on failure 36 | * 37 | */ 38 | long 39 | auth_userpass(const char *user, const char *pass, int *errorcode); 40 | 41 | /** 42 | * 43 | * @brief FIXME 44 | * @param in_val 45 | * @param in_display 46 | * @return 0 on success, 1 on failure 47 | * 48 | */ 49 | int 50 | auth_start_session(long in_val, int in_display); 51 | 52 | /** 53 | * 54 | * @brief FIXME 55 | * @param in_val 56 | * @return 0 on success, 1 on failure 57 | * 58 | */ 59 | int 60 | auth_stop_session(long in_val); 61 | 62 | /** 63 | * 64 | * @brief FIXME 65 | * @param in_val 66 | * @return 0 on success, 1 on failure 67 | * 68 | */ 69 | int 70 | auth_end(long in_val); 71 | 72 | /** 73 | * 74 | * @brief FIXME 75 | * @param in_val 76 | * @return 0 on success, 1 on failure 77 | * 78 | */ 79 | int 80 | auth_set_env(long in_val); 81 | 82 | 83 | #define AUTH_PWD_CHG_OK 0 84 | #define AUTH_PWD_CHG_CHANGE 1 85 | #define AUTH_PWD_CHG_CHANGE_MANDATORY 2 86 | #define AUTH_PWD_CHG_NOT_NOW 3 87 | #define AUTH_PWD_CHG_ERROR 4 88 | 89 | /** 90 | * 91 | * @brief FIXME 92 | * @param in_val 93 | * @return 0 on success, 1 on failure 94 | * 95 | */ 96 | int 97 | auth_check_pwd_chg(const char *user); 98 | 99 | /** 100 | * 101 | * @brief FIXME 102 | * @param in_val 103 | * @return 0 on success, 1 on failure 104 | * 105 | */ 106 | int 107 | auth_change_pwd(const char *user, const char *newpwd); 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /common/pixman-region16.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008 Red Hat, Inc. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this software 5 | * and its documentation for any purpose is hereby granted without 6 | * fee, provided that the above copyright notice appear in all copies 7 | * and that both that copyright notice and this permission notice 8 | * appear in supporting documentation, and that the name of 9 | * Red Hat, Inc. not be used in advertising or publicity pertaining to 10 | * distribution of the software without specific, written prior 11 | * permission. Red Hat, Inc. makes no representations about the 12 | * suitability of this software for any purpose. It is provided "as 13 | * is" without express or implied warranty. 14 | * 15 | * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 16 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 17 | * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER 19 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 20 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 21 | * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 22 | * 23 | * Author: Soren Sandmann 24 | */ 25 | 26 | /* taken from pixman 0.34 27 | altered to compile without all of pixman */ 28 | 29 | #if defined(HAVE_CONFIG_H) 30 | #include "config_ac.h" 31 | #endif 32 | #include 33 | #include 34 | #include 35 | #if defined(HAVE_STDINT_H) 36 | #include 37 | #endif 38 | #include "pixman-region.h" 39 | 40 | #if !defined(UINT32_MAX) 41 | #define UINT32_MAX (4294967295U) 42 | #endif 43 | #if !defined(INT16_MIN) 44 | #define INT16_MIN (-32767-1) 45 | #endif 46 | #if !defined(INT16_MAX) 47 | #define INT16_MAX (32767) 48 | #endif 49 | 50 | #define PIXMAN_EXPORT 51 | #define FALSE 0 52 | #define TRUE 1 53 | 54 | #define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2)) 55 | #define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2)) 56 | 57 | typedef pixman_box16_t box_type_t; 58 | typedef pixman_region16_data_t region_data_type_t; 59 | typedef pixman_region16_t region_type_t; 60 | typedef signed int overflow_int_t; 61 | 62 | #define PREFIX(x) pixman_region##x 63 | 64 | #define PIXMAN_REGION_MAX INT16_MAX 65 | #define PIXMAN_REGION_MIN INT16_MIN 66 | 67 | #define FUNC "func" 68 | 69 | #define critical_if_fail(expr) 70 | 71 | int _pixman_log_error(const char *func, const char *format, ...) 72 | { 73 | return 0; 74 | } 75 | 76 | #include "pixman-region.c" 77 | 78 | --------------------------------------------------------------------------------