NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/38396: sshd does not work



The following reply was made to PR bin/38396; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/38396: sshd does not work
Date: Tue, 15 Apr 2008 23:52:42 +0200

 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Suggested patch below
 
 Martin
 
 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=patch
 
 Index: monitor_fdpass.c
 ===================================================================
 RCS file: /cvsroot/src/crypto/dist/ssh/monitor_fdpass.c,v
 retrieving revision 1.7
 diff -u -r1.7 monitor_fdpass.c
 --- monitor_fdpass.c   13 Apr 2008 21:44:14 -0000      1.7
 +++ monitor_fdpass.c   15 Apr 2008 21:39:56 -0000
 @@ -59,9 +59,14 @@
  
        memset(&msg, 0, sizeof(msg));
        msg.msg_control = &cmsgbuf.buf;
 -      msg.msg_controllen = CMSG_SPACE(sizeof(int));
 +      /*
 +       * DO NOT CHANGE THE msg.msg_controllen OR cmsg->cmsg_len
 +       * VALUES WITHOUT TESTING ON AN ARCH WHERE CMSG_SPACE != CMSG_LEN,
 +       * RESP. ALIGNMENT MATTERS!
 +       */
 +      msg.msg_controllen = CMSG_LEN(sizeof(int));
        cmsg = CMSG_FIRSTHDR(&msg);
 -      cmsg->cmsg_len = CMSG_LEN(sizeof(int));
 +      cmsg->cmsg_len = msg.msg_controllen;
        cmsg->cmsg_level = SOL_SOCKET;
        cmsg->cmsg_type = SCM_RIGHTS;
        *(int *)CMSG_DATA(cmsg) = fd;
 
 --bp/iNruPH9dso1Pn--
 


Home | Main Index | Thread Index | Old Index