Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2006 20:52:12 -0500
From:      Justin Hibbits <jrh29@alumni.cwru.edu>
To:        freebsd-ports@freebsd.org
Subject:   Fwd: Fix for cgdb
Message-ID:  <765D9EE1-15E1-4006-A948-D0A5FAF8A466@alumni.cwru.edu>
References:  <1DD6BDCD-04FF-4241-88ED-A0694EE54CC4@alumni.cwru.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-7-1009255034
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

Originally sent to the author, but the email bounced.

- Justin Hibbits

Begin forwarded message:

> From: Justin Hibbits <jrh29@alumni.cwru.edu>
> Date: December 14, 2006 8:49:37 PM EST
> To: gslin@gslin.org
> Subject: Fix for cgdb
>
> I found a bug with cgdb, which you made the initial port for.  It  
> doesn't work as a normal user, at least on 6.1, because it wants to  
> change ownership of the slave terminal.  I wrote a patch which  
> replaces that function call with a call to grantpt() as it should  
> use, and it's attached.
>
> - Justin Hibbits
--Apple-Mail-7-1009255034
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream; x-unix-mode=0644;
	name=patch-various-util-src.c
Content-Disposition: attachment;
	filename=patch-various-util-src.c

--- various/util/src/pseudo.c.orig	Sat Jun  3 14:09:05 2006
+++ various/util/src/pseudo.c	Thu Dec 14 14:26:47 2006
@@ -46,6 +46,7 @@
 #include <util.h>
 #endif
 #ifdef HAVE_LIBUTIL_H
+#include <inttypes.h>
 #include <libutil.h>
 #endif
 
@@ -440,7 +441,11 @@
 
 		/* Set slave ownership and permissions to real uid of process */
 
-		pty_set_owner(slavename, getuid());
+		if (grantpt(*masterfd) == -1)
+		{
+			close(*masterfd);
+			return -1;
+		}
 
 		/* Open the slave descriptor */
 

--Apple-Mail-7-1009255034
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed



--Apple-Mail-7-1009255034--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?765D9EE1-15E1-4006-A948-D0A5FAF8A466>