Make use of openpty(3) to allocate a pseudo-tty, allowing us to enable the

NX and ssh/sftp plugins. Please note that there are still some issues with
these plugins but they should not be tty related.

ok ajacoutot@, jasper@ (maintainer) and openpty diff looked at by naddy@
This commit is contained in:
mpi 2012-05-22 08:02:36 +00:00
parent 8ea815592e
commit 2e55d1e85e
7 changed files with 133 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2012/02/24 13:48:26 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.3 2012/05/22 08:02:36 mpi Exp $
# from upstream, removed at next update
MASTER_SITES0= https://github.com/FreeRDP/Remmina/commit/
@ -18,6 +18,8 @@ WRKDIST= ${WRKDIR}/FreeRDP-Remmina-356c033
PKGNAME-main= ${DISTNAME:L}
PKGNAME-rdp= remmina-plugins-rdp-${V}
REVISION-main= 0
CATEGORIES= x11 net
HOMEPAGE= http://remmina.sourceforge.net/
@ -44,6 +46,7 @@ cWANTLIB += atk-1.0 cairo gdk-3 glib-2.0 gtk-3 pango-1.0
WANTLIB-main += ${cWANTLIB} intl # XXX no iconv?
WANTLIB-main += X11 c gcrypt gdk_pixbuf-2.0 gio-2.0 gmodule-2.0 gnome-keyring
WANTLIB-main += gobject-2.0 gthread-2.0 pthread vte2_90 jpeg z telepathy-glib
WANTLIB-main += util xkbfile ssh
WANTLIB-rdp += ${cWANTLIB}
WANTLIB-rdp += freerdp-channels freerdp-codec freerdp-core freerdp-gdi
@ -52,6 +55,7 @@ WANTLIB-rdp += freerdp-kbd freerdp-rail
BUILD_DEPENDS= net/avahi,-gtk3
LIB_DEPENDS-main= devel/vte3 \
security/libssh \
net/telepathy/telepathy-glib \
x11/gnome/libgnome-keyring
@ -71,11 +75,9 @@ CFLAGS += -pthread
# Only useed by Ubuntu's Unity.
CONFIGURE_ARGS+= -DWITH_APPINDICATOR=OFF
# This needs the grantpt(3) and alike functions.
CONFIGURE_ARGS+= -DWITH_LIBSSH=OFF
pre-configure:
${SUBST_CMD} \
${WRKSRC}/remmina-plugins/nx/CMakeLists.txt \
${WRKSRC}/remmina-plugins/rdp/CMakeLists.txt \
${WRKSRC}/remmina-plugins/telepathy/CMakeLists.txt \
${WRKSRC}/remmina-plugins/vnc/CMakeLists.txt \

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-CMakeLists_txt,v 1.1 2012/02/24 13:48:26 ajacoutot Exp $
--- CMakeLists.txt.orig Fri Feb 24 11:29:57 2012
+++ CMakeLists.txt Fri Feb 24 11:29:46 2012
@@ -64,9 +64,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
$OpenBSD: patch-CMakeLists_txt,v 1.2 2012/05/22 08:02:36 mpi Exp $
--- CMakeLists.txt.orig Thu Apr 19 16:20:37 2012
+++ CMakeLists.txt Thu Apr 19 16:27:53 2012
@@ -64,15 +64,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
@ -13,3 +13,10 @@ $OpenBSD: patch-CMakeLists_txt,v 1.1 2012/02/24 13:48:26 ajacoutot Exp $
check_include_files(termios.h HAVE_TERMIOS_H)
check_include_files(netdb.h HAVE_NETDB_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(sys/un.h HAVE_SYS_UN_H)
check_include_files(errno.h HAVE_ERRNO_H)
+check_include_files(util.h HAVE_UTIL_H)
include_directories(.)
include_directories(remmina/include)

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-config_h_in,v 1.1 2012/05/22 08:02:36 mpi Exp $
--- config.h.in.orig Thu Apr 19 16:28:12 2012
+++ config.h.in Thu Apr 19 16:28:23 2012
@@ -11,6 +11,7 @@
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_SYS_UN_H
#cmakedefine HAVE_ERRNO_H
+#cmakedefine HAVE_UTIL_H
#cmakedefine GTK_VERSION ${GTK_VERSION}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-remmina-plugins_nx_CMakeLists_txt,v 1.1 2012/05/22 08:02:36 mpi Exp $
--- remmina-plugins/nx/CMakeLists.txt.orig Thu Apr 19 17:08:26 2012
+++ remmina-plugins/nx/CMakeLists.txt Thu Apr 19 17:08:44 2012
@@ -29,6 +29,8 @@ set(REMMINA_PLUGIN_NX_SRCS
add_library(remmina-plugin-nx ${REMMINA_PLUGIN_NX_SRCS})
set_target_properties(remmina-plugin-nx PROPERTIES PREFIX "")
+include_directories(${X11BASE}/include)
+
include_directories(${REMMINA_COMMON_INCLUDE_DIRS} ${XKBFILE_INCLUDE_DIRS} ${LIBSSH_INCLUDE_DIRS})
target_link_libraries(remmina-plugin-nx ${REMMINA_COMMON_LIBRARIES} ${XKBFILE_LIBRARIES} ${LIBSSH_LIBRARIES})

View File

@ -1,7 +1,17 @@
$OpenBSD: patch-remmina_CMakeLists_txt,v 1.1 2012/02/24 13:48:26 ajacoutot Exp $
$OpenBSD: patch-remmina_CMakeLists_txt,v 1.2 2012/05/22 08:02:36 mpi Exp $
--- remmina/CMakeLists.txt.orig Fri Feb 10 19:54:23 2012
+++ remmina/CMakeLists.txt Fri Feb 24 11:47:36 2012
@@ -90,6 +90,9 @@ set(REMMINA_SRCS
+++ remmina/CMakeLists.txt Thu Apr 19 17:06:18 2012
@@ -17,6 +17,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307, USA.
+include(CheckFunctionExists)
+include(CheckLibraryExists)
+
set(REMMINA_SRCS
src/remmina_about.c
src/remmina_about.h
@@ -90,6 +93,9 @@ set(REMMINA_SRCS
add_executable(remmina ${REMMINA_SRCS})
@ -11,3 +21,27 @@ $OpenBSD: patch-remmina_CMakeLists_txt,v 1.1 2012/02/24 13:48:26 ajacoutot Exp $
include_directories(${GTK_INCLUDE_DIRS})
target_link_libraries(remmina ${GTK_LIBRARIES})
@@ -130,6 +136,23 @@ if(GTK3_FOUND)
include_directories(${APPINDICATOR_INCLUDE_DIRS})
target_link_libraries(remmina ${APPINDICATOR_LIBRARIES})
endif()
+endif()
+
+
+check_function_exists(ptsname HAVE_PTSNAME)
+if(HAVE_PTSNAME)
+ add_definitions(-DHAVE_UNIX98_PTY)
+endif()
+
+check_function_exists(openpty OPENPTY_IN_LIBC)
+if(NOT OPENPTY_IN_LIBC)
+ check_library_exists(util openpty "" OPENPTY_IN_LIBUTIL)
+ if(OPENPTY_IN_LIBUTIL)
+ target_link_libraries(remmina util)
+ endif()
+endif()
+if(OPENPTY_IN_LIBC OR OPENPTY_IN_LIBUTIL)
+ add_definitions(-DHAVE_OPENPTY)
endif()
add_subdirectory(po)

View File

@ -0,0 +1,52 @@
$OpenBSD: patch-remmina_src_remmina_ssh_c,v 1.1 2012/05/22 08:02:36 mpi Exp $
--- remmina/src/remmina_ssh.c.orig Fri Feb 10 19:54:23 2012
+++ remmina/src/remmina_ssh.c Thu Apr 19 17:06:35 2012
@@ -36,12 +36,12 @@
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -54,6 +54,9 @@
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
+#ifdef HAVE_UTIL_H
+#include <util.h>
+#endif
#include "remmina_public.h"
#include "remmina_log.h"
#include "remmina_ssh.h"
@@ -1430,8 +1433,9 @@ remmina_ssh_shell_thread (gpointer data)
gboolean
remmina_ssh_shell_open (RemminaSSHShell *shell, RemminaSSHExitFunc exit_callback, gpointer data)
{
- gchar *slavedevice;
struct termios stermios;
+#if defined(HAVE_UNIX98_PTY)
+ gchar *slavedevice;
shell->master = posix_openpt (O_RDWR | O_NOCTTY);
if (shell->master == -1 ||
@@ -1439,6 +1443,11 @@ remmina_ssh_shell_open (RemminaSSHShell *shell, Remmin
unlockpt (shell->master) == -1 ||
(slavedevice = ptsname (shell->master)) == NULL ||
(shell->slave = open (slavedevice, O_RDWR | O_NOCTTY)) < 0)
+#elif defined(HAVE_OPENPTY)
+ if (openpty(&shell->master, &shell->slave, NULL, NULL, NULL))
+#else
+#error Have neither UNIX98 PTY nor BSD openpty!
+#endif
{
REMMINA_SSH (shell)->error = g_strdup ("Failed to create pty device.");
return FALSE;

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.1 2012/02/24 13:48:26 ajacoutot Exp $
@comment $OpenBSD: PLIST-main,v 1.2 2012/05/22 08:02:36 mpi Exp $
@conflict remmina-plugins-*
@conflict remmina-plugins-telepathy-*
@pkgpath x11/remmina/core
@ -9,6 +9,7 @@ include/remmina/
lib/pkgconfig/remmina.pc
lib/remmina/
lib/remmina/plugins/
lib/remmina/plugins/remmina-plugin-nx.so
lib/remmina/plugins/remmina-plugin-telepathy.so
lib/remmina/plugins/remmina-plugin-vnc.so
lib/remmina/plugins/remmina-plugin-xdmcp.so
@ -21,6 +22,7 @@ share/icons/hicolor/16x16/actions/remmina-pin-up.png
share/icons/hicolor/16x16/actions/remmina-scale.png
share/icons/hicolor/16x16/actions/remmina-switch-page.png
share/icons/hicolor/16x16/apps/remmina.png
share/icons/hicolor/16x16/emblems/remmina-nx.png
share/icons/hicolor/16x16/emblems/remmina-rdp-ssh.png
share/icons/hicolor/16x16/emblems/remmina-rdp.png
share/icons/hicolor/16x16/emblems/remmina-sftp.png
@ -33,6 +35,7 @@ share/icons/hicolor/22x22/actions/remmina-fullscreen.png
share/icons/hicolor/22x22/actions/remmina-scale.png
share/icons/hicolor/22x22/actions/remmina-switch-page.png
share/icons/hicolor/22x22/apps/remmina.png
share/icons/hicolor/22x22/emblems/remmina-nx.png
share/icons/hicolor/22x22/emblems/remmina-rdp-ssh.png
share/icons/hicolor/22x22/emblems/remmina-rdp.png
share/icons/hicolor/22x22/emblems/remmina-sftp.png