From 349c023757d351d9e59b93bcfad7d06874c7d2ec Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 7 Dec 2017 09:24:37 +0100 Subject: Continue project under name lightdm-remote-session-freerdp2. --- .bzrignore | 5 --- .gitgnore | 5 +++ Makefile.am | 34 +++++++++--------- README | 2 +- README.md | 9 +++++ autogen.sh | 6 ++-- configure.ac | 18 ++-------- freerdp-session-wrapper.c | 32 ----------------- freerdp-session.in | 9 ----- freerdp.desktop.in | 8 ----- freerdp2-session-wrapper.c | 32 +++++++++++++++++ freerdp2-session.in | 9 +++++ freerdp2.desktop.in | 8 +++++ lightdm-remote-freerdp | 7 ---- lightdm-remote-freerdp2 | 7 ++++ lightdm-remote-session-freerdp.in | 71 -------------------------------------- lightdm-remote-session-freerdp2.in | 71 ++++++++++++++++++++++++++++++++++++++ socket-sucker.c | 3 +- 18 files changed, 164 insertions(+), 172 deletions(-) delete mode 100644 .bzrignore create mode 100644 .gitgnore mode change 100644 => 120000 README create mode 100644 README.md delete mode 100644 freerdp-session-wrapper.c delete mode 100755 freerdp-session.in delete mode 100644 freerdp.desktop.in create mode 100644 freerdp2-session-wrapper.c create mode 100755 freerdp2-session.in create mode 100644 freerdp2.desktop.in delete mode 100644 lightdm-remote-freerdp create mode 100644 lightdm-remote-freerdp2 delete mode 100644 lightdm-remote-session-freerdp.in create mode 100644 lightdm-remote-session-freerdp2.in diff --git a/.bzrignore b/.bzrignore deleted file mode 100644 index 127de56..0000000 --- a/.bzrignore +++ /dev/null @@ -1,5 +0,0 @@ -socket-sucker -freerdp-session -freerdp.desktop -compile -.deps diff --git a/.gitgnore b/.gitgnore new file mode 100644 index 0000000..9949d96 --- /dev/null +++ b/.gitgnore @@ -0,0 +1,5 @@ +freerdp2-session +freerdp2.desktop +lightdm-remote-session-freerdp2 +compile +.deps diff --git a/Makefile.am b/Makefile.am index 44c2938..a02b80f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,33 +1,32 @@ - pam_sessiondir = $(sysconfdir)/pam.d/ pam_session_DATA = \ - lightdm-remote-freerdp + lightdm-remote-freerdp2 lightdm_sessiondir = $(datadir)/lightdm/remote-sessions lightdm_session_DATA = \ - freerdp.desktop + freerdp2.desktop %.desktop: %.desktop.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ session_startdir = $(pkgdatadir) session_start_SCRIPTS = \ - freerdp-session + freerdp2-session -freerdp-session: freerdp-session.in +freerdp2-session: freerdp2-session.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ @chmod +x $@ apparmordir = $(sysconfdir)/apparmor.d/ apparmor_DATA = \ - lightdm-remote-session-freerdp + lightdm-remote-session-freerdp2 -lightdm-remote-session-freerdp: lightdm-remote-session-freerdp.in +lightdm-remote-session-freerdp2: lightdm-remote-session-freerdp2.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ pkglibexec_PROGRAMS = \ socket-sucker \ - freerdp-session-wrapper + freerdp2-session-wrapper socket_sucker_SOURCES = \ socket-sucker.c @@ -37,22 +36,22 @@ socket_sucker_CFLAGS = \ socket_sucker_LDFLAGS = \ -pie -freerdp_session_wrapper_SOURCES = \ - freerdp-session-wrapper.c -freerdp_session_wrapper_CFLAGS = \ +freerdp2_session_wrapper_SOURCES = \ + freerdp2-session-wrapper.c +freerdp2_session_wrapper_CFLAGS = \ -DPKGDATADIR="\"$(pkgdatadir)\"" \ -Wall -Werror EXTRA_DIST = \ $(pam_session_DATA) \ - freerdp.desktop.in \ - freerdp-session.in \ - lightdm-remote-session-freerdp.in + freerdp2.desktop.in \ + freerdp2-session.in \ + lightdm-remote-session-freerdp2.in CLEANFILES = \ - freerdp.desktop \ - freerdp-session \ - lightdm-remote-session-freerdp + freerdp2.desktop \ + freerdp2-session \ + lightdm-remote-session-freerdp2 DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall @@ -81,4 +80,3 @@ dist-hook: else \ echo Failed to generate AUTHORS: not a branch >&2; \ fi - diff --git a/README b/README deleted file mode 100644 index 7b3e973..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -Configuration for LightDM to use the remote session diff --git a/README b/README new file mode 120000 index 0000000..42061c0 --- /dev/null +++ b/README @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c20350 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# LightDM (Arctica Greeter) Remote Logon: FreeRDP(2) # + +Configuration for LightDM / Arctica Greeter to launch remote FreeRDP +sessions using FreeRDPv2. + +This code project was originally started by Canonical Ltd. and has been +adapted by various authors with the purpose of making Remote Logon +against RDP servers via Arctica Greeter (formerly known as Unity Greeter) +available on Ubuntu and non-Ubuntu systems alike. diff --git a/autogen.sh b/autogen.sh index 5164b66..26c48a5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,9 +1,9 @@ #!/bin/sh -which gnome-autogen.sh || { - echo "Could not find 'gnome-autgen.sh'. Is gnome-common installed?" +which mate-autogen || { + echo "Could not find 'mate-autogen'. Is mate-common installed?" exit 1 } -. gnome-autogen.sh +. mate-autogen diff --git a/configure.ac b/configure.ac index 4216307..2d5a1c6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([lightdm-remote-session-freerdp], [1.0]) +AC_INIT([lightdm-remote-session-freerdp2], [1.0]) AM_INIT_AUTOMAKE([1.11 -Wno-portability]) AM_SILENT_RULES([yes]) @@ -7,25 +7,11 @@ AC_PROG_CC AC_PROG_INSTALL AM_PROG_CC_C_O -########################### -# Local Install -########################### - -with_localinstall="no" -AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], - [install all files locally (for distcheck)]), - with_localinstall=$enableval, - with_localinstall=no) - ########################### # PAM Module dir ########################### -if test "x$with_localinstall" = "xyes"; then - PAMMODULEDIR="${libdir}/security/" -else - PAMMODULEDIR="/lib/security" -fi +PAMMODULEDIR="/lib/security" AC_SUBST(PAMMODULEDIR) diff --git a/freerdp-session-wrapper.c b/freerdp-session-wrapper.c deleted file mode 100644 index 8c31fab..0000000 --- a/freerdp-session-wrapper.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright © 2012 Canonical Ltd. - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 3, as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranties of - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - * - * Author: Ted Gould - */ - -#include -#include - -int -main (int argc, char * argv[]) -{ - char * args[2]; - args[0] = PKGDATADIR "/freerdp-session"; - args[1] = NULL; - - execvp(args[0], args); - - return 0; -} diff --git a/freerdp-session.in b/freerdp-session.in deleted file mode 100755 index 7eaead3..0000000 --- a/freerdp-session.in +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ -e ~/.freerdp-socket ]; then - @pkglibexecdir@/socket-sucker | /usr/bin/xfreerdp --plugin rdpsnd.so -f --from-stdin -else - zenity --warning --text="Unable to locate FreeRDP socket" -fi; - -rm -f ~/.freerdp-socket diff --git a/freerdp.desktop.in b/freerdp.desktop.in deleted file mode 100644 index 6eb26d4..0000000 --- a/freerdp.desktop.in +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=FreeRDP -Comment=Full Screen RDP session -Exec=@pkglibexecdir@/freerdp-session-wrapper -TryExec=@pkglibexecdir@/freerdp-session-wrapper -Icon= -Type=Application -X-LightDM-PAM-Service=lightdm-remote-freerdp diff --git a/freerdp2-session-wrapper.c b/freerdp2-session-wrapper.c new file mode 100644 index 0000000..76f299f --- /dev/null +++ b/freerdp2-session-wrapper.c @@ -0,0 +1,32 @@ +/* + * Copyright © 2012 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Ted Gould + */ + +#include +#include + +int +main (int argc, char * argv[]) +{ + char * args[2]; + args[0] = PKGDATADIR "/freerdp2-session"; + args[1] = NULL; + + execvp(args[0], args); + + return 0; +} diff --git a/freerdp2-session.in b/freerdp2-session.in new file mode 100755 index 0000000..3640b69 --- /dev/null +++ b/freerdp2-session.in @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ -e ~/.freerdp-socket ]; then + @pkglibexecdir@/socket-sucker | /usr/bin/xfreerdp --plugin rdpsnd.so /f /from-stdin +else + zenity --warning --text="Unable to locate FreeRDP socket" +fi; + +rm -f ~/.freerdp-socket diff --git a/freerdp2.desktop.in b/freerdp2.desktop.in new file mode 100644 index 0000000..1944b83 --- /dev/null +++ b/freerdp2.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=FreeRDP +Comment=Full Screen RDP session +Exec=@pkglibexecdir@/freerdp2-session-wrapper +TryExec=@pkglibexecdir@/freerdp2-session-wrapper +Icon= +Type=Application +X-LightDM-PAM-Service=lightdm-remote-freerdp2 diff --git a/lightdm-remote-freerdp b/lightdm-remote-freerdp deleted file mode 100644 index d79bc2e..0000000 --- a/lightdm-remote-freerdp +++ /dev/null @@ -1,7 +0,0 @@ -#%PAM-1.0 -auth requisite pam_nologin.so -auth required pam_env.so readenv=1 -auth required pam_env.so readenv=1 envfile=/etc/default/locale -auth required pam_freerdp.so -session required pam_limits.so -session required pam_freerdp.so diff --git a/lightdm-remote-freerdp2 b/lightdm-remote-freerdp2 new file mode 100644 index 0000000..d79bc2e --- /dev/null +++ b/lightdm-remote-freerdp2 @@ -0,0 +1,7 @@ +#%PAM-1.0 +auth requisite pam_nologin.so +auth required pam_env.so readenv=1 +auth required pam_env.so readenv=1 envfile=/etc/default/locale +auth required pam_freerdp.so +session required pam_limits.so +session required pam_freerdp.so diff --git a/lightdm-remote-session-freerdp.in b/lightdm-remote-session-freerdp.in deleted file mode 100644 index 38772f2..0000000 --- a/lightdm-remote-session-freerdp.in +++ /dev/null @@ -1,71 +0,0 @@ -# vim:syntax=apparmor -# Profile for restricting lightdm remote session for FreeRDP -# Based on the Guest Account Apparmor script from: -# Author: Martin Pitt - -#include - -@pkglibexecdir@/freerdp-session-wrapper { - #include - #include - #include - /etc/compizconfig/config rw, # bug in compiz https://launchpad.net/bugs/697678 - - / r, - /bin/ rmix, - /bin/fusermount Px, - /bin/** rmix, - /cdrom/ rmix, - /cdrom/** rmix, - /dev/ r, - /dev/** rmw, # audio devices etc. - owner /dev/shm/** rmw, - /etc/ r, - /etc/** rmk, - /etc/gdm/Xsession ix, - /lib/ r, - /lib/** rmixk, - /lib32/ r, - /lib32/** rmixk, - /lib64/ r, - /lib64/** rmixk, - owner /media/ r, - owner /media/** rmwlixk, # we want access to USB sticks and the like - /opt/ r, - /opt/** rmixk, - @{PROC}/ r, - @{PROC}/* rm, - @{PROC}/asound rm, - @{PROC}/asound/** rm, - @{PROC}/ati rm, - @{PROC}/ati/** rm, - owner @{PROC}/** rm, - # needed for gnome-keyring-daemon - @{PROC}/*/status r, - /sbin/ r, - /sbin/** rmixk, - /sys/ r, - /sys/** rm, - /tmp/ rw, - owner /tmp/** rwlkmix, - /usr/ r, - /usr/** rmixk, - /var/ r, - /var/** rmixk, - /var/guest-data/** rw, # allow to store files permanently - /var/tmp/ rw, - owner /var/tmp/** rwlkm, - /{,var/}run/ r, - # necessary for writing to sockets, etc. - /{,var/}run/** rmkix, - /{,var/}run/shm/** wl, - - capability ipc_lock, - - # silence warnings for stuff that we really don't want to grant - deny capability dac_override, - deny capability dac_read_search, - #deny /etc/** w, # re-enable once LP#697678 is fixed - deny /usr/** w, - deny /var/crash/ w, -} diff --git a/lightdm-remote-session-freerdp2.in b/lightdm-remote-session-freerdp2.in new file mode 100644 index 0000000..e298653 --- /dev/null +++ b/lightdm-remote-session-freerdp2.in @@ -0,0 +1,71 @@ +# vim:syntax=apparmor +# Profile for restricting lightdm remote session for FreeRDP +# Based on the Guest Account Apparmor script from: +# Author: Martin Pitt + +#include + +@pkglibexecdir@/freerdp2-session-wrapper { + #include + #include + #include + /etc/compizconfig/config rw, # bug in compiz https://launchpad.net/bugs/697678 + + / r, + /bin/ rmix, + /bin/fusermount Px, + /bin/** rmix, + /cdrom/ rmix, + /cdrom/** rmix, + /dev/ r, + /dev/** rmw, # audio devices etc. + owner /dev/shm/** rmw, + /etc/ r, + /etc/** rmk, + /etc/gdm/Xsession ix, + /lib/ r, + /lib/** rmixk, + /lib32/ r, + /lib32/** rmixk, + /lib64/ r, + /lib64/** rmixk, + owner /media/ r, + owner /media/** rmwlixk, # we want access to USB sticks and the like + /opt/ r, + /opt/** rmixk, + @{PROC}/ r, + @{PROC}/* rm, + @{PROC}/asound rm, + @{PROC}/asound/** rm, + @{PROC}/ati rm, + @{PROC}/ati/** rm, + owner @{PROC}/** rm, + # needed for gnome-keyring-daemon + @{PROC}/*/status r, + /sbin/ r, + /sbin/** rmixk, + /sys/ r, + /sys/** rm, + /tmp/ rw, + owner /tmp/** rwlkmix, + /usr/ r, + /usr/** rmixk, + /var/ r, + /var/** rmixk, + /var/guest-data/** rw, # allow to store files permanently + /var/tmp/ rw, + owner /var/tmp/** rwlkm, + /{,var/}run/ r, + # necessary for writing to sockets, etc. + /{,var/}run/** rmkix, + /{,var/}run/shm/** wl, + + capability ipc_lock, + + # silence warnings for stuff that we really don't want to grant + deny capability dac_override, + deny capability dac_read_search, + #deny /etc/** w, # re-enable once LP#697678 is fixed + deny /usr/** w, + deny /var/crash/ w, +} diff --git a/socket-sucker.c b/socket-sucker.c index 8e8ad25..72c7941 100644 --- a/socket-sucker.c +++ b/socket-sucker.c @@ -42,7 +42,7 @@ main (int argc, char * argv[]) serv_addr.sun_family = AF_UNIX; - int printsize = snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".freerdp-socket"); + int printsize = snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".freerdp2-socket"); if (printsize > sizeof(serv_addr.sun_path) - 1 || printsize < 0) { return -1; } @@ -75,4 +75,3 @@ main (int argc, char * argv[]) return -1; } } - -- cgit v1.2.3