pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/48313: x11vnc - unable to log back in with -forever -unixpw



The following reply was made to PR pkg/48313; it has been noted by GNATS.

From: Nat Sloss <nathanialsloss%yahoo.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/48313: x11vnc - unable to log back in with -forever -unixpw
Date: Sat, 19 Oct 2013 09:16:34 +1100

 Hi,
 
 Try these patches, they use openpty and I think they should work for all 
 configurations and I've considered many os's the only one whose man page did 
 not mention libutil for openpty was osx but as far as I've searched it should 
 have a libutil.
 
 Index: pkgsrc/x11/x11vnc/Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/x11/x11vnc/Makefile,v
 retrieving revision 1.51
 diff -u -r1.51 Makefile
 --- pkgsrc/x11/x11vnc/Makefile 6 Jun 2013 12:55:22 -0000       1.51
 +++ pkgsrc/x11/x11vnc/Makefile 18 Oct 2013 22:38:51 -0000
 @@ -14,6 +14,7 @@
  GNU_CONFIGURE=        yes
  
  CONFIGURE_ARGS+=      --with-system-libvncserver
 +CONFIGURE_ARGS+=      LDFLAGS=-lutil
  
  PTHREAD_AUTO_VARS=    yes
  SUBST_CLASSES+=               pthread
 --- /dev/null  2013-10-19 07:31:28.000000000 +1100
 +++ pkgsrc/x11/x11vnc/patches/patch-x11vnc_Makefile.in 2013-10-19 
 09:33:04.000000000 +1100
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- x11vnc/Makefile.in.orig   2011-08-10 22:35:08.000000000 +0000
 ++++ x11vnc/Makefile.in
 +@@ -84,7 +84,7 @@ x11vnc_OBJECTS = $(am_x11vnc_OBJECTS)
 + @HAVE_SYSTEM_LIBVNCSERVER_FALSE@     ../libvncclient/libvncclient.a
 + am__DEPENDENCIES_2 =
 + x11vnc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 +-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 ++DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
 + depcomp = $(SHELL) $(top_srcdir)/depcomp
 + am__depfiles_maybe = depfiles
 + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 --- /dev/null  2013-10-19 07:31:28.000000000 +1100
 +++ pkgsrc/x11/x11vnc/patches/patch-x11vnc_unixpw.c    2013-10-19 
 09:33:04.000000000 +1100
 @@ -0,0 +1,60 @@
 +$NetBSD$
 +
 +--- x11vnc/unixpw.c.orig      2011-08-10 22:31:32.000000000 +0000
 ++++ x11vnc/unixpw.c
 +@@ -54,6 +54,13 @@ extern char *crypt(const char*, const ch
 + #include "cursor.h"
 + #include "rates.h"
 + #include <rfb/default8x16.h>
 ++#if defined(__NetBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
 ++#include <util.h>
 ++#elif defined(__FreeBSD__) || defined(__DragonFly__)
 ++#include <libutil.h>
 ++#elif defined(__Linux__)
 ++#include <pty.h>
 ++#endif
 + 
 + #if LIBVNCSERVER_HAVE_FORK
 + #if LIBVNCSERVER_HAVE_SYS_WAIT_H && LIBVNCSERVER_HAVE_WAITPID
 +@@ -583,39 +590,17 @@ char *get_pty_ptmx(int *fd_p) {
 + 
 + 
 + char *get_pty_loop(int *fd_p) {
 +-     char master_str[16];
 +-     int fd = -1, i;
 +-     char c;
 ++     int fd = -1, slave;
 + 
 +      *fd_p = -1;
 + 
 +-     /* for *BSD loop over /dev/ptyXY */
 +-
 +-     for (c = 'p'; c <= 'z'; c++) {
 +-             for (i=0; i < 16; i++) {
 +-                     sprintf(master_str, "/dev/pty%c%x", c, i);
 +-#ifdef O_NOCTTY
 +-                     fd = open(master_str, O_RDWR|O_NOCTTY);
 +-#else
 +-                     fd = open(master_str, O_RDWR);
 +-#endif
 +-                     if (fd >= 0) {
 +-                             break;
 +-                     }
 +-             }
 +-             if (fd >= 0) {
 +-                     break;
 +-             }
 +-     }
 +-     if (fd < 0) {
 ++     if (openpty(&fd, &slave, slave_str, NULL, NULL) < 0)
 +              return NULL;
 +-     }
 + 
 + #if LIBVNCSERVER_HAVE_SYS_IOCTL_H && defined(TIOCFLUSH)
 +      ioctl(fd, TIOCFLUSH, (char *) 0);
 + #endif
 + 
 +-     sprintf(slave_str, "/dev/tty%c%x", c, i);
 +      *fd_p = fd;
 +      return slave_str;
 + }
 
 
 Regards,
 
 Nat.
 


Home | Main Index | Thread Index | Old Index