Subject: how I built wuftpd under hpux 10.20

From: Albert Lunde <[email-masked]>
Date: Tue, 3 Dec 1996 21:50:31 -0600

Below, is a fairly detailed diff of what I did to build
wu-ftpd-2.4.2-beta-11 under hp/ux 10.20 with the HP ANSI C compiler.

Because I was making so many configuration changes I made a new set of
files ".cus" (for custom), parallel to the .hpx files.

I generally followed the FAQ for the bigcrypt patch, but adapted it a bit
to this version of the code, and _tryed_ to confirm the right value for
some of the defines.

Some of the diffs like the binary installation directory, and CMASK
represent purely local options, so this shouldn't be followed blindly. It
also hasn't been used in full production, yet, so there could be bugs.

===========================================
diff -c ./src/makefiles/Makefile.hpx ./src/makefiles/Makefile.cus
===========================================
*** ./src/makefiles/Makefile.hpx	Fri Mar 15 00:26:48 1996
--- ./src/makefiles/Makefile.cus	Wed Nov  6 22:23:54 1996
***************
*** 1,4 ****
--- 1,7 ----
  #
+ # modified from Makefile.hpx for pubweb and hp/ux 10.20
+ # 11/6/96
+ #
  # Makefile for HPUX
  # $Id: Makefile.hpx,v 1.3 1995/06/30 03:57:27 sob Exp $
  #
***************
*** 6,12 ****
  IFLAGS   = -I.. -I../support
  LFLAGS   = -L../support
  CFLAGS   = -Aa -Dunix -D_HPUX_SOURCE -O -DDEBUG ${IFLAGS} ${LFLAGS}
! LIBES    = -lsupport -lc -lPW
  LIBC     = /lib/libc.a
  LINTFLAGS=	
  LKERB    = -lauth -lckrb -lkrb -ldes
--- 9,15 ----
  IFLAGS   = -I.. -I../support
  LFLAGS   = -L../support
  CFLAGS   = -Aa -Dunix -D_HPUX_SOURCE -O -DDEBUG ${IFLAGS} ${LFLAGS}
! LIBES    = -lsupport -lc -lPW -lsec
  LIBC     = /lib/libc.a
  LINTFLAGS=	
  LKERB    = -lauth -lckrb -lkrb -ldes
===========================================
diff -c ./src/config/config.hpx ./src/config/config.cus
===========================================
*** ./src/config/config.hpx	Mon Apr 15 00:51:40 1996
--- ./src/config/config.cus	Tue Nov 12 19:17:58 1996
***************
*** 1,11 ****
  /*
   * config.h for HPUX
   * $Id: config.hpx,v 1.4 1995/12/05 09:54:15 sob Exp $
   */
  #define HAVE_SYMLINK
  #undef  BSD
! #undef  HAVE_DIRENT
! #undef  HAVE_D_NAMLEN
  #undef  HAVE_FLOCK
  #define HAVE_FTW
  #define HAVE_GETCWD
--- 1,14 ----
  /*
+  * modified from config.hpx for hp/ux 10.20 and pubweb
+  *
   * config.h for HPUX
   * $Id: config.hpx,v 1.4 1995/12/05 09:54:15 sob Exp $
   */
+
  #define HAVE_SYMLINK
  #undef  BSD
! #define  HAVE_DIRENT
! #define  HAVE_D_NAMLEN
  #undef  HAVE_FLOCK
  #define HAVE_FTW
  #define HAVE_GETCWD
***************
*** 20,33 ****
  #define REGEX
  #define REGEXEC
  #define SPT_TYPE SPT_PSTAT
! #undef  SHADOW_PASSWORD
  #define SVR4
  #define UPLOAD
  #define USG

! #define _PATH_WTMP "/etc/wtmp"

! #define RLIM_INFINITY 0x7fffffff
  #define	seteuid(x)	setresuid(-1,x,-1)
  #define setegid(x)	setresgid(-1,x,-1)

--- 23,39 ----
  #define REGEX
  #define REGEXEC
  #define SPT_TYPE SPT_PSTAT
! #define  SHADOW_PASSWORD
  #define SVR4
  #define UPLOAD
  #define USG

! #define CMASK 022

! #define _PATH_WTMP "/var/adm/wtmp"
!
! /* #define RLIM_INFINITY 0x7fffffff */
! #include <sys/resource.h>
  #define	seteuid(x)	setresuid(-1,x,-1)
  #define setegid(x)	setresgid(-1,x,-1)

***************
*** 42,45 ****
--- 48,63 ----

  typedef void	SIGNAL_TYPE;

+ #define _PATH_BSHELL "/usr/bin/sh"
+
+ /* choose paths for various files */
+
+ #define USE_VAR
+ #define USE_PID
+
+ /* HP trusted system support */
+ #define HP_BIGCRYPT
+
  #include "../config.h"
+
+
===========================================
diff -c ./support/makefiles/Makefile.hpx ./support/makefiles/Makefile.cus
===========================================
*** ./support/makefiles/Makefile.hpx	Mon Apr 15 00:52:28 1996
--- ./support/makefiles/Makefile.cus	Wed Nov  6 21:33:22 1996
***************
*** 1,4 ****
--- 1,6 ----
  #
+ # modified from Makefile.hpx
+ #
  # Makefile for HP-UX
  #
  # $Id: Makefile.hpx,v 1.3 1996/01/22 07:42:16 sob Exp $
===========================================
diff -c ./makefiles/Makefile.hpx ./makefiles/Makefile.cus
===========================================
*** ./makefiles/Makefile.hpx	Sat Jun 17 22:16:56 1995
--- ./makefiles/Makefile.cus	Wed Nov 13 10:24:00 1996
***************
*** 1,8 ****
! BINDIR=		/etc
! ETCDIR=		/etc
! MANDIR=		/usr/man
  MANEXT=		8
! INSTALL=	./util/install

  all:
  	@ echo 'Use the "build" command (shell script) to make ftpd.'
--- 1,8 ----
! BINDIR=		/local-adm/bin
! ETCDIR=		/local-adm/bin
! MANDIR=		/opt/local/man
  MANEXT=		8
! INSTALL=	/opt/local/bin/bsd_install

  all:
  	@ echo 'Use the "build" command (shell script) to make ftpd.'
===========================================
diff -c ./src/extensions.c ./src/extensions.c.dist
===========================================
*** ./src/extensions.c	Wed Nov  6 22:20:24 1996
--- ./src/extensions.c.dist	Mon Apr 15 00:51:05 1996
***************
*** 96,102 ****
    disctime[30];

  #ifdef __STDC__
! extern char *realpath(const char *pathname, char *result);
  #else
  extern char *realpath();
  #endif
--- 96,102 ----
    disctime[30];

  #ifdef __STDC__
! extern char *realpath(char *pathname, char *result);
  #else
  extern char *realpath();
  #endif
===========================================
diff -c ./src/ftpd.c ./src/ftpd.c.dist
===========================================
*** ./src/ftpd.c	Tue Nov 12 17:51:31 1996
--- ./src/ftpd.c.dist	Mon Apr 15 00:51:11 1996
***************
*** 137,152 ****
  #include <krb.h>
  #endif

- #ifdef HP_BIGCRYPT
- /* Albert Lunde 11/12/96
-    patch based on Jose Luis Martinez Garcia entry in wuftpd FAQ
-    but with different conditional options */
- #include <hpsecurity.h>
- #include <prot.h>
- /* use #define SHADOW_PASSWORD in src.conf.h
-    use LIBES = -lsupport -lc -lPW -lsec */
- #endif
-
  #ifdef ULTRIX_AUTH
  #include <auth.h>
  #include <sys/svcinfo.h>
--- 137,142 ----
***************
*** 1248,1260 ****
  {
      char *xpasswd,
       *salt;
-
- #ifdef HP_BIGCRYPT
-         /* Albert Lunde 11/12/96
-            patch based on Jose Luis Martinez Garcia entry in wuftpd FAQ
-            but with different conditional options */
-     char *bpasswd;
- #endif /* HP_BIGCRYPT */

  #ifdef ULTRIX_AUTH
      int numfails;
--- 1238,1243 ----
***************
*** 1305,1322 ****
  	xpasswd = skey_crypt(passwd, salt, pw, pwok);
  	pwok = 0;
  #else
- #ifdef HP_BIGCRYPT
-         /* Albert Lunde 11/12/96
-            patch based on Jose Luis Martinez Garcia entry in wuftpd FAQ
-            but with different conditional options */
          xpasswd = crypt(passwd, salt);
-         /* bigcrypt added to support hp trusted system/"Commercial
Security" option */
-         bpasswd = bigcrypt(passwd, salt);
- #else
-         xpasswd = crypt(passwd, salt);
  #endif
  #endif
- #endif

  #ifdef SKEY
  /* comment the next line if you REALLY want to allow replayable passwds. */
--- 1288,1296 ----
***************
*** 1326,1338 ****
  #endif
  #ifdef ULTRIX_AUTH
          if ((numfails = ultrix_check_pass(passwd, xpasswd)) < 0) {
- #elif defined(HP_BIGCRYPT)
-         /* Albert Lunde 11/12/96
-            patch based on Jose Luis Martinez Garcia entry in wuftpd FAQ
-            but with different conditional options */
-         if (pw == NULL || *pw->pw_passwd == '\0' ||
-             (strcmp(xpasswd, pw->pw_passwd) &&
-              strcmp(bpasswd, pw->pw_passwd))) {
  #else
          /* The strcmp does not catch null passwords! */
          if (pw == NULL || *pw->pw_passwd == '\0' ||
--- 1300,1305 ----
==========

---
    Albert Lunde                      [email-masked]