aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am17
-rw-r--r--debian/control1
-rwxr-xr-xfreerdp2-session.in2
-rw-r--r--freerdp2.desktop.in4
-rw-r--r--lightdm-remote-session-freerdp2.in2
-rw-r--r--socket-sucker.c77
6 files changed, 9 insertions, 94 deletions
diff --git a/Makefile.am b/Makefile.am
index a02b80f..75aab62 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,14 +7,14 @@ lightdm_session_DATA = \
freerdp2.desktop
%.desktop: %.desktop.in
- @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
session_startdir = $(pkgdatadir)
session_start_SCRIPTS = \
freerdp2-session
freerdp2-session: freerdp2-session.in
- @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
@chmod +x $@
apparmordir = $(sysconfdir)/apparmor.d/
@@ -22,20 +22,11 @@ apparmor_DATA = \
lightdm-remote-session-freerdp2
lightdm-remote-session-freerdp2: lightdm-remote-session-freerdp2.in
- @sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-pkglibexec_PROGRAMS = \
- socket-sucker \
+libexec_PROGRAMS = \
freerdp2-session-wrapper
-socket_sucker_SOURCES = \
- socket-sucker.c
-socket_sucker_CFLAGS = \
- -Wall -Werror \
- -fPIE
-socket_sucker_LDFLAGS = \
- -pie
-
freerdp2_session_wrapper_SOURCES = \
freerdp2-session-wrapper.c
freerdp2_session_wrapper_CFLAGS = \
diff --git a/debian/control b/debian/control
index f461785..d20bbf9 100644
--- a/debian/control
+++ b/debian/control
@@ -24,6 +24,7 @@ Depends:
freerdp2-x11 (>= 2~),
libpam-freerdp2,
lightdm (>= 1.3.3-0~),
+ socat,
Suggests:
apparmor,
Description: Log into RDP sessions via LightDM
diff --git a/freerdp2-session.in b/freerdp2-session.in
index e6a8b32..0242a13 100755
--- a/freerdp2-session.in
+++ b/freerdp2-session.in
@@ -1,7 +1,7 @@
#!/bin/bash
if [ -e ~/.freerdp-socket ]; then
- @pkglibexecdir@/socket-sucker | /usr/bin/xfreerdp /sound:sys:pulse /f /from-stdin
+ socat unix-connect:"$socket" - | /usr/bin/xfreerdp /sound:sys:pulse /f /from-stdin
else
zenity --warning --text="Unable to locate FreeRDP socket"
fi;
diff --git a/freerdp2.desktop.in b/freerdp2.desktop.in
index 1944b83..28c8076 100644
--- a/freerdp2.desktop.in
+++ b/freerdp2.desktop.in
@@ -1,8 +1,8 @@
[Desktop Entry]
Name=FreeRDP
Comment=Full Screen RDP session
-Exec=@pkglibexecdir@/freerdp2-session-wrapper
-TryExec=@pkglibexecdir@/freerdp2-session-wrapper
+Exec=@libexecdir@/freerdp2-session-wrapper
+TryExec=@libexecdir@/freerdp2-session-wrapper
Icon=
Type=Application
X-LightDM-PAM-Service=lightdm-remote-freerdp2
diff --git a/lightdm-remote-session-freerdp2.in b/lightdm-remote-session-freerdp2.in
index f33ec7c..239c5de 100644
--- a/lightdm-remote-session-freerdp2.in
+++ b/lightdm-remote-session-freerdp2.in
@@ -5,7 +5,7 @@
#include <tunables/global>
-@pkglibexecdir@/freerdp2-session-wrapper {
+@libexecdir@/freerdp2-session-wrapper {
#include <abstractions/authentication>
#include <abstractions/nameservice>
#include <abstractions/wutmp>
diff --git a/socket-sucker.c b/socket-sucker.c
deleted file mode 100644
index 07734cc..0000000
--- a/socket-sucker.c
+++ /dev/null
@@ -1,77 +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 <http://www.gnu.org/licenses/>.
- *
- * Author: Ted Gould <ted@canonical.com>
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#define BUFFER_SIZE 256
-
-int
-main (int argc, char * argv[])
-{
- int socket_fd = 0;
- int servlen = 0;
- struct sockaddr_un serv_addr;
-
- bzero((char *)&serv_addr, sizeof(serv_addr));
-
- const char * home = getenv("HOME");
- if (home == NULL) {
- return -1;
- }
-
- serv_addr.sun_family = AF_UNIX;
-
- 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;
- }
-
- servlen = strlen(serv_addr.sun_path) + sizeof(serv_addr.sun_family);
-
- if ((socket_fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
- return -1;
- }
-
- if (connect(socket_fd, (struct sockaddr *)&serv_addr, servlen) < 0) {
- return -1;
- }
-
- char buffer[BUFFER_SIZE + 2];
- int in = 0;
- int out = 0;
-
- in = read(socket_fd, buffer, BUFFER_SIZE);
-
- if (in > 0) {
- out = write(1, buffer, in);
- }
-
- close(socket_fd);
-
- if (in > 0 && out > 0 && in == out) {
- return 0;
- } else {
- return -1;
- }
-}