From owner-freebsd-current@FreeBSD.ORG Wed Jul 6 15:57:10 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD4B116A41C; Wed, 6 Jul 2005 15:57:10 +0000 (GMT) (envelope-from marcus@FreeBSD.org) Received: from av-tac-rtp.cisco.com (bantam.cisco.com [64.102.19.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17FF743D49; Wed, 6 Jul 2005 15:57:10 +0000 (GMT) (envelope-from marcus@FreeBSD.org) X-TACSUNS: Virus Scanned Received: from rooster.cisco.com (localhost [127.0.0.1]) by av-tac-rtp.cisco.com (8.11.7p1+Sun/8.11.7) with ESMTP id j66Fv9A16095; Wed, 6 Jul 2005 11:57:09 -0400 (EDT) Received: from [64.102.192.190] (dhcp-64-102-192-190.cisco.com [64.102.192.190]) by rooster.cisco.com (8.11.7p1+Sun/8.11.7) with ESMTP id j66Fv8725758; Wed, 6 Jul 2005 11:57:08 -0400 (EDT) Message-ID: <42CBFF6C.3040601@FreeBSD.org> Date: Wed, 06 Jul 2005 11:57:32 -0400 From: Joe Marcus Clarke Organization: FreeBSD, Inc. User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Michael L. Hostbaek" References: <1120539465.3587.19.camel@shumai.marcuscom.com> <1120623729.99631.21.camel@shumai.marcuscom.com> <1120641560.95261.1.camel@shumai.marcuscom.com> <20050706153659.GV3302@mich2.itxmarket.com> In-Reply-To: <20050706153659.GV3302@mich2.itxmarket.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------010307060706060008060907" Cc: current@FreeBSD.org, phk@FreeBSD.org Subject: Re: (problem found) grantpt broken on -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2005 15:57:11 -0000 This is a multi-part message in MIME format. --------------010307060706060008060907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael L. Hostbaek wrote: | Joe Marcus Clarke (marcus) writes: | |>On Wed, 2005-07-06 at 00:22 -0400, Joe Marcus Clarke wrote: |> |>>I created this patch that corrects the problem, but I'm not sure if it's |>>the right way to go. Poul-Henning (or anyone) could you have a look and |>>let me know if this is okay? I'd really like to see this working again |>>in -CURRENT so 6.0 GNOME users will be able to use their sftp shares. |>>Thanks. |>> |>>Oh, and it might be a good idea to make sys/types.h aware of MAXMINOR as |>>it still hardcodes the constant. |> |>Actually, I think the real solution is to reimplement ptsname() using |>devname(3) similar to the way ttyname() is done. | | | I confirm that this patch (like the other), also fixes kio_sftp and | kdesu on -CURRENT. Actually, the first patch provided pty* names where as the previous version of ptsname provided tty* device names. The pty names break gnome-vfs sftp. This attached patch seems to do the trick for gnome-vfs. Michael, can you verify this patch still works for you? Poul-Henning, thanks for your initial review. Can you have a look at this patch, and see if anything is glaringly wrong? Thanks! Joe | | Thanks ! | | /mich | | - -- Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCy/9sb2iPiv4Uz4cRAtd8AJ0c9LBcyqCb6iAE20qxu3+k9wZ0aACgqRPH CSFVX8X+TVDRm3F9Jne4mok= =aPc4 -----END PGP SIGNATURE----- --------------010307060706060008060907 Content-Type: text/x-patch; x-mac-type="0"; x-mac-creator="0"; name="grantpt.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grantpt.c.diff" --- src/lib/libc/stdlib/grantpt.c.orig Wed Jun 8 14:28:48 2005 +++ src/lib/libc/stdlib/grantpt.c Wed Jul 6 11:45:18 2005 @@ -214,8 +214,9 @@ char * ptsname(int fildes) { static char slave[] = _PATH_DEV PTS_PREFIX "XY"; - char *retval; + char *retval, *dname; struct stat sbuf; + size_t used; retval = NULL; @@ -223,10 +224,14 @@ ptsname(int fildes) if (!ISPTM(sbuf)) errno = EINVAL; else { - (void)sprintf(slave, _PATH_DEV PTS_PREFIX "%c%c", - PT_DEV1[minor(sbuf.st_rdev) / 32], - PT_DEV2[minor(sbuf.st_rdev) % 32]); retval = slave; + *retval = '\0'; + strcpy(retval, _PATH_DEV); + used = strlen(retval); + strcpy(retval + used, PTS_PREFIX); + used = strlen(retval); + dname = devname(sbuf.st_rdev, S_IFCHR); + strcpy(retval + used, dname + strlen(PTM_PREFIX)); } } --------------010307060706060008060907--