From b396c574a0c3373d3b807e5ea629670cf7cc6150 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 8 Nov 2012 22:27:01 +0100 Subject: fork lightdm-remote-session-freerdp as lightdm-remote-session-x2go --- .gitgnore | 5 +++ Makefile.am | 32 +++++++++--------- configure.ac | 2 +- debian/changelog | 7 ++++ debian/compat | 1 + debian/control | 28 +++++++++++++++ debian/copyright | 29 ++++++++++++++++ debian/rules | 8 +++++ debian/source/format | 1 + debian/watch | 2 ++ freerdp-session-wrapper.c | 32 ------------------ freerdp-session.in | 9 ----- freerdp.desktop.in | 8 ----- lightdm-remote-freerdp | 7 ---- lightdm-remote-session-freerdp.in | 71 --------------------------------------- lightdm-remote-session-x2go.in | 71 +++++++++++++++++++++++++++++++++++++++ lightdm-remote-x2go | 7 ++++ socket-sucker.c | 2 +- x2go-session-wrapper.c | 32 ++++++++++++++++++ x2go-session.in | 9 +++++ x2go.desktop.in | 8 +++++ 21 files changed, 226 insertions(+), 145 deletions(-) create mode 100644 .gitgnore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch delete mode 100644 freerdp-session-wrapper.c delete mode 100755 freerdp-session.in delete mode 100644 freerdp.desktop.in delete mode 100644 lightdm-remote-freerdp delete mode 100644 lightdm-remote-session-freerdp.in create mode 100644 lightdm-remote-session-x2go.in create mode 100644 lightdm-remote-x2go create mode 100644 x2go-session-wrapper.c create mode 100755 x2go-session.in create mode 100644 x2go.desktop.in diff --git a/.gitgnore b/.gitgnore new file mode 100644 index 0000000..127de56 --- /dev/null +++ b/.gitgnore @@ -0,0 +1,5 @@ +socket-sucker +freerdp-session +freerdp.desktop +compile +.deps diff --git a/Makefile.am b/Makefile.am index 44c2938..fcdb845 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,33 +1,33 @@ pam_sessiondir = $(sysconfdir)/pam.d/ pam_session_DATA = \ - lightdm-remote-freerdp + lightdm-remote-x2go lightdm_sessiondir = $(datadir)/lightdm/remote-sessions lightdm_session_DATA = \ - freerdp.desktop + x2go.desktop %.desktop: %.desktop.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ session_startdir = $(pkgdatadir) session_start_SCRIPTS = \ - freerdp-session + x2go-session -freerdp-session: freerdp-session.in +x2go-session: x2go-session.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ @chmod +x $@ apparmordir = $(sysconfdir)/apparmor.d/ apparmor_DATA = \ - lightdm-remote-session-freerdp + lightdm-remote-session-x2go -lightdm-remote-session-freerdp: lightdm-remote-session-freerdp.in +lightdm-remote-session-x2go: lightdm-remote-session-x2go.in @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ pkglibexec_PROGRAMS = \ socket-sucker \ - freerdp-session-wrapper + x2go-session-wrapper socket_sucker_SOURCES = \ socket-sucker.c @@ -37,22 +37,22 @@ socket_sucker_CFLAGS = \ socket_sucker_LDFLAGS = \ -pie -freerdp_session_wrapper_SOURCES = \ - freerdp-session-wrapper.c -freerdp_session_wrapper_CFLAGS = \ +x2go_session_wrapper_SOURCES = \ + x2go-session-wrapper.c +x2go_session_wrapper_CFLAGS = \ -DPKGDATADIR="\"$(pkgdatadir)\"" \ -Wall -Werror EXTRA_DIST = \ $(pam_session_DATA) \ - freerdp.desktop.in \ - freerdp-session.in \ - lightdm-remote-session-freerdp.in + x2go.desktop.in \ + x2go-session.in \ + lightdm-remote-session-x2go.in CLEANFILES = \ - freerdp.desktop \ - freerdp-session \ - lightdm-remote-session-freerdp + x2go.desktop \ + x2go-session \ + lightdm-remote-session-x2go DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall diff --git a/configure.ac b/configure.ac index 4216307..6bdc96d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([lightdm-remote-session-freerdp], [1.0]) +AC_INIT([lightdm-remote-session-x2go], [1.0]) AM_INIT_AUTOMAKE([1.11 -Wno-portability]) AM_SILENT_RULES([yes]) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..352a76b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +lightdm-remote-session-freerdp (0.1-0~x2go1) UNRELEASED; urgency=low + + * Initial upstream release. Forked from Canonical's + lightdm-remote-session-freerdp. + + -- Mike Gabriel Thu, 08 Nov 2012 22:27:37 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a5c5eaf --- /dev/null +++ b/debian/control @@ -0,0 +1,28 @@ +ource: lightdm-remote-session-x2go +Section: misc +Priority: extra +Maintainer: X2Go Developers +Uploaders: + Mike Gabriel +Build-Depends: + debhelper (>= 9), + dh-apparmor, +Standards-Version: 3.9.3 +Homepage: http://wiki.x2go.org +Vcs-Git: git://code.x2go.org/lightdm-remote-session-x2go +Vcs-Browser: http://code.x2go.org/gitweb?p=lightdm-remote-session-x2go.git;a=summary + +Package: lightdm-remote-session-x2go +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + zenity, + pyhoca-cli, + libpam-x2go, + lightdm (>= 1.3.3-0~) +Suggests: + apparmor, +Description: Log into X2Go sessions via LightDM + The configuration files needed and scripts required to login + to a full screen X2Go session using LightDM and PyHoca / Python X2Go. \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8ff5501 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: lightdm-remote-session-x2go +Source: http://launchpad.net/lightdm-remote-session-x2go + +Files: * +Copyright: 2012, Canonical Ltd. +License: GPL-3 + +Files: debian/* +Copyright: + 2012, Canonical Ltd. + 2012, Mike Gabriel (X2Go Project) +License: GPL-3 + +License: GPL-3 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 3 of the License. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..18a6333 --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_installdeb: + dh_apparmor --profile-name=lightdm-remote-session-x2go -plightdm-remote-session-x2go + dh_installdeb diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..b4cc38d --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://launchpad.net/lightdm-remote-session-freerdp/+download .*/lightdm-remote-session-freerdp-(.+)\.tar\.gz 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/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-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-x2go.in b/lightdm-remote-session-x2go.in new file mode 100644 index 0000000..ff1a656 --- /dev/null +++ b/lightdm-remote-session-x2go.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@/x2go-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-x2go b/lightdm-remote-x2go new file mode 100644 index 0000000..86c3206 --- /dev/null +++ b/lightdm-remote-x2go @@ -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_x2go.so +session required pam_limits.so +session required pam_x2go.so diff --git a/socket-sucker.c b/socket-sucker.c index 8e8ad25..007dbf1 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, ".x2go-socket"); if (printsize > sizeof(serv_addr.sun_path) - 1 || printsize < 0) { return -1; } diff --git a/x2go-session-wrapper.c b/x2go-session-wrapper.c new file mode 100644 index 0000000..d6bc9a9 --- /dev/null +++ b/x2go-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 "/x2go-session"; + args[1] = NULL; + + execvp(args[0], args); + + return 0; +} diff --git a/x2go-session.in b/x2go-session.in new file mode 100755 index 0000000..bfdf5e9 --- /dev/null +++ b/x2go-session.in @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ -e ~/.x2go-socket ]; then + @pkglibexecdir@/socket-sucker | /usr/bin/xx2go --plugin rdpsnd.so -f --from-stdin +else + zenity --warning --text="Unable to locate FreeRDP socket" +fi; + +rm -f ~/.x2go-socket diff --git a/x2go.desktop.in b/x2go.desktop.in new file mode 100644 index 0000000..a8b6ad5 --- /dev/null +++ b/x2go.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=FreeRDP +Comment=Full Screen RDP session +Exec=@pkglibexecdir@/x2go-session-wrapper +TryExec=@pkglibexecdir@/x2go-session-wrapper +Icon= +Type=Application +X-LightDM-PAM-Service=lightdm-remote-x2go -- cgit v1.2.3