From owner-freebsd-ports@FreeBSD.ORG Fri Dec 15 01:53:47 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C30B116A47C for ; Fri, 15 Dec 2006 01:53:47 +0000 (UTC) (envelope-from jrh29@alumni.cwru.edu) Received: from eastrmmtao01.cox.net (eastrmmtao01.cox.net [68.230.240.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7955B43DFC for ; Fri, 15 Dec 2006 01:50:50 +0000 (GMT) (envelope-from jrh29@alumni.cwru.edu) Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao01.cox.net (InterMail vM.6.01.06.03 201-2131-130-104-20060516) with ESMTP id <20061215015214.JXIG20860.eastrmmtao01.cox.net@eastrmimpo02.cox.net> for ; Thu, 14 Dec 2006 20:52:14 -0500 Received: from [192.168.1.101] ([68.98.143.44]) by eastrmimpo02.cox.net with bizsmtp id ypr31V00x0xh5580000000; Thu, 14 Dec 2006 20:51:03 -0500 Mime-Version: 1.0 (Apple Message framework v752.2) To: freebsd-ports@freebsd.org Message-Id: <765D9EE1-15E1-4006-A948-D0A5FAF8A466@alumni.cwru.edu> Content-Type: multipart/mixed; boundary=Apple-Mail-7-1009255034 References: <1DD6BDCD-04FF-4241-88ED-A0694EE54CC4@alumni.cwru.edu> From: Justin Hibbits Date: Thu, 14 Dec 2006 20:52:12 -0500 X-Mailer: Apple Mail (2.752.2) Subject: Fwd: Fix for cgdb X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Dec 2006 01:53:47 -0000 --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 > 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 #endif #ifdef HAVE_LIBUTIL_H +#include #include #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--