Date: Wed, 06 Jul 2005 11:57:32 -0400 From: Joe Marcus Clarke <marcus@FreeBSD.org> To: "Michael L. Hostbaek" <mich@FreeBSD.org> Cc: current@FreeBSD.org, phk@FreeBSD.org Subject: Re: (problem found) grantpt broken on -CURRENT Message-ID: <42CBFF6C.3040601@FreeBSD.org> In-Reply-To: <20050706153659.GV3302@mich2.itxmarket.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42CBFF6C.3040601>