Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 1995 12:24:06 +0800 (WST)
From:      Peter Wemm <peter@jhome.DIALix.COM>
To:        ports@freebsd.org
Subject:   urgent bugfix for "screen".
Message-ID:  <Pine.BSF.3.91.951025121529.19259A-100000@jhome.DIALix.COM>

next in thread | raw e-mail | index | archive | help
The "screen-3.6.2" port does not work with md5 passwords still! :-(

If you run it as root, or run it setuid root, it explodes, core dumps 
and/or runs a child process at 100% cpu in a spin loop.

The reason for this is that the patch-ac file is flawed.

In the current patch-ac file, it changes screen to do this:
#ifdef PASSWORD
#include <pwd.h> /* for _PASSWORD_LEN */
#endif
#include "config.h"
....
#ifndef _PASSWORD_LEN
#define _PASSWORD_LEN 30
#endif
char Password[_PASSWORD_LEN];

This is wrong on two counts..  All the MD5 passwords I've seen were 
LONGER than 30 characters (34 or 35 I think), and config.h is where 
"PASSWORD" is defined! - meaning that the system <pwd.h> include file is 
never #included (the system _PASSWORD_LEN is 128 BTW) because "PASSWORD" 
is not defined yet.

The following patch-ac replacement works for me..
(I sent this to Satoshi a few days ago (a week?), but never got a response)

-Peter
----------------- patch-ac -----------------
*** process.c.bak	Sat Oct 21 19:51:15 1995
--- process.c	Sat Oct 21 19:52:13 1995
***************
*** 35,43 ****
  #include <sys/ioctl.h>
  #endif
  
- 
  #include "config.h"
  
  #ifdef SVR4
  # include <sys/stropts.h>
  #endif
--- 35,46 ----
  #include <sys/ioctl.h>
  #endif
  
  #include "config.h"
  
+ #ifdef PASSWORD
+ #include <pwd.h>        /* for _PASSWORD_LEN */
+ #endif
+ 
  #ifdef SVR4
  # include <sys/stropts.h>
  #endif
***************
*** 150,156 ****
  #endif
  #ifdef PASSWORD
  int CheckPassword;
! char Password[30];
  #endif
  
  struct plop plop_tab[MAX_PLOP_DEFS];
--- 153,162 ----
  #endif
  #ifdef PASSWORD
  int CheckPassword;
! #ifndef _PASSWORD_LEN
! #define _PASSWORD_LEN 40
! #endif
! char Password[_PASSWORD_LEN];
  #endif
  
  struct plop plop_tab[MAX_PLOP_DEFS];
--------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951025121529.19259A-100000>