Re: OpenSSH_4.3p2 fails to create a pty session

This is a discussion on Re: OpenSSH_4.3p2 fails to create a pty session within the OpenSSH Development forums, part of the Networking and Network Related category; On Wed, Aug 16, 2006 at 04:15:31PM -0400, Eric Millbrandt wrote: > Darren Tucker wrote: > >In ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-17-2006
Darren Tucker
 
Posts: n/a
Default Re: OpenSSH_4.3p2 fails to create a pty session

On Wed, Aug 16, 2006 at 04:15:31PM -0400, Eric Millbrandt wrote:
> Darren Tucker wrote:
> >In order to figure out what's going on, we need to know what options
> >are enabled on your config.h that affect pty allocation.
> >
> >From our survey data I see that FreeBSD 4 has openpty (which is used
> >if possible) so HAVE_OPENPTY should be set. (Could you please check
> >config.h and confirm, if not post your config.h here.)

> Yes HAVE_OPENPTY is defined.
> >
> >Also, you could try this patch to see what descriptors openpty
> >returns. I suspect that one or both descriptors will be -1 but
> >openpty will have returned 0 (ie success).
> >

> openpty returned 0 descriptors 4/6 name /dev/ttyp3


OK, so openpty returns a success, and hopefully the descriptors it returned
are valid.

[...]
> debug3: mm_request_send entering: type 26
> mm_send_fd: sendmsg(4): Bad file descriptor


I'm not sure if the "Bad descriptor" error refers to the descriptor
being sent or the descriptor over which it is sent. I suspect the former
otherwise sshd would have bailed much sooner.

I suggest using lsof(1) to examine the file descriptors in question, but
since there's a very small window to catch it you probably need something
like the patch below (ie run "lsof -p [pid]" while it's sleeping).

The other thing to check is to make sure all of your device files for
ptys exist (maybe rerun MAKEDEV or whatever FreeBSD uses).

Index: monitor_fdpass.c
================================================== =================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/monitor_fdpass.c,v
retrieving revision 1.20
diff -u -p -r1.20 monitor_fdpass.c
--- monitor_fdpass.c 5 Aug 2006 02:39:40 -0000 1.20
+++ monitor_fdpass.c 17 Aug 2006 14:10:30 -0000
@@ -69,6 +69,9 @@ mm_send_fd(int sock, int fd)
msg.msg_iov = &vec;
msg.msg_iovlen = 1;

+ error("lsof me now! (pid %d, sock %d, fd %d)", getpid(), sock, fd);
+ sleep(1000);
+
if ((n = sendmsg(sock, &msg, 0)) == -1)
fatal("%s: sendmsg(%d): %s", __func__, fd,
strerror(errno));

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/lis...enssh-unix-dev
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:09 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0