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

Re: [cobalt-users] RaQ2 openssh-3.4p1 monitor_fdpass.c:



On Saturday 29 June 2002 08:05 pm, Glenn Parsons wrote:
>
> No, overwriting is not. More (many) times than not, that sort of experiment
> tends to nip us in the.. well, you and I know. Unless it's a machine at
> home that I expect to rebuild regularly anyway..
>
============= For the archives ======================
$ su -
# cd /home/vxx
# openssl version
  OpenSSL 0.9.6.c        You may need a new version
# wget 
ftp://ftp.stealth.net/pub/mirrors/ftp.openssh.com/pub/OpenBSD/OpenSSH/portable/openssh-3.4p1.tar.gz
# cd openssh-3.4p1
# ./configure
Thanks to Jay for finding this
 copy this text (between ==== )  to a file named patch-it
======================== patch =========================================
--- ./monitor_fdpass.c.orig-missing-scmrights2  Thu Jun  6 17:40:51 2002
+++ ./monitor_fdpass.c  Fri Jun 28 18:35:58 2002
@@ -24,6 +24,11 @@
  */

 #include "includes.h"
+
+#ifndef SCM_RIGHTS
+#define SCM_RIGHTS 0x01
+#endif /* SCM_RIGHTS */
+
 RCSID("$OpenBSD: monitor_fdpass.c,v 1.3 2002/06/04 23:05:49 markus Exp $");

 #include <sys/uio.h>
@@ -112,9 +117,12 @@
                fatal("%s: no fd", __func__);
 #else
        cmsg = CMSG_FIRSTHDR(&msg);
+#if 0
+        /* Linux kernel 2.0.x doesn't handle cmsg_type in recvmsg(). */
        if (cmsg->cmsg_type != SCM_RIGHTS)
                fatal("%s: expected type %d got %d", __func__,
                    SCM_RIGHTS, cmsg->cmsg_type);
+#endif /* 0 */
        fd = (*(int *)CMSG_DATA(cmsg));
 #endif
        return fd;
======================== end patch ==============================
# patch monitor_fdpass.c < patch-it
# make
# /usr/sbin/adduser sshd
# vi /etc/passwd  (changed)
  sshd:x:503:1504:://var/empty:/bin/badsh
# mkdir /var/empty
# chown root:root /var/empty
# chmod 755 /var/empty
# make install
# edit /etc/ssh/sshd_config
  UsePrivilegeSeparation yes
  Compression no
started the new sshd
  ./sshd -p 55555
connected from remote
  ssh -p 55555 root@xxxxxxxxxxxxxxx
  exit
kill sshd process running on port 55555

Now restart sshd
and the new one is RUNNING

-- 
Gerald Waugh 
http://frontstreetnetworks.com  SOHO Networks & Web Site Hosting
Front Street Networks LLC     voice +1 203 785 0699 * fax +1 203 785 1787
229 Front Street, Ste. #C, New Haven CT 06513-3203