Patch for popper under OSF/1 3.0B + Enhanced Security

From: Massimo Ianigro <massimo_at_area.BA.CNR.IT>
Date: Thu, 09 Mar 1995 19:12:57 +0100 (MET)

Hi all,
i have received many request about the patch i applied to popper ver.1.381
in order to let it run under OSF/1 3.0 + Enhanced Security.

This is a brief history of what i have done:
1) Makefile:
        I have added the following compile flag:
                -D_BSD: in order to avoid a 'unkown storage size
                                for "stat" ..' in pop_xmit.c
                -DOSF30B: to avoid a multiple definition of 'struct state _res'
                                in pop_init.c
                -DOSF1_ENHANCED_SECURITY:
                                this flag allows pop_pass.c to use the enhanced
                                security database instead of reading passwords
                                from /etc/passwd
        I have added the following link flag:
                -lsecurity: to link libsecurity...

2) Version.h:
        I have replaced VERSION number 1.831 with 1.831ES (eheh!)

3) pop_init.c:
        A #ifdef OSF30B to avoid multiple definition of '...struct state _res'

4) popper.c
        A #ifdef OSF1_ENHANCED_SECURITY in order to run set_auth_parameters(argc,argv);

5) pop_pass.c
        A couple of #ifdef OSF1_ENHANCED_SECURITY to include the right header files
        and to replace the usual way of getting passwords from /etc/passwd with
        the routines that handle the passwords from the protected database(s).
        Furthermore, i have used 'bigcrypt' instead of 'crypt' because the last
        truncates returned ecnrypted password, disallowing users with
        long password to get their mail.

I have tested this version with my users and any of them seem to have more problem
than usual with e-mail. So i think it should work pretty fine....

Enjoy,

                Massimo

Standard disclaimer: use this software at your own risk, etc., etc., etc..... ;-)

Special disclaimer: sorry for my bad English, i think that i should better
                     patch my knowledge about it before patching people's software ;)

-- 
 -----------------------------------------------------------------------------
| Massimo Ianigro         |    E-write at :       Massimo.Ianigro_at_ba.cnr.it   |
|   C . N . R .           |                                    39 80 5481969  |
| Via Amendola, 166/5     |    Fax :  39 80 5484311   Voice :  39 80 5482176  |
| 70126  BARI   ITALY     |                                    39 80 5482100  |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|Experience is directly proportional to the amount of equipment ruined(Murphy)|
 ----------------------------------------------------------------------------
*************  CUT HERE   *******************
diff -c popper/Makefile popper-patch/Makefile
*** popper/Makefile	Thu Apr 04 01:25:45 1991
--- popper-patch/Makefile	Thu Mar 09 17:13:38 1995
***************
*** 1,5 ****
--- 1,17 ----
  #_at_(#)_at_(#)Makefile	2.5  2.5 4/3/91
  
+ # In this kit there is a file, OSF-30B.patch, that contains diffs between original
+ # distribution and new files modified in order to run under OSF/1 ver. 3.0B and
+ # Enhanced Security.
+ # If you have any problem with them, feel free to contact me at massimo_at_ba.cnr.it
+ # 
+ #		Ciao
+ #
+ #				Massimo Ianigro
+ #
+ #Warning!! This release uses the function bigcrypt instead of crypt...
+ #
+ 
  CSRCS		=	pop_dele.c pop_dropcopy.c pop_dropinfo.c \
  			pop_get_command.c pop_get_subcommand.c pop_init.c \
  			pop_last.c pop_list.c pop_log.c pop_lower.c \
***************
*** 37,50 ****
  #               SYSLOG42        -	For BSD 4.2 syslog (default is BSD 4.3 
  #					syslog).
  #               STRNCASECMP     -	If you do not have strncasecmp()
  
! CFLAGS		=	-O -DBIND43 -DHAVE_VSPRINTF
  
  TARGET		=	popper
  
  TAR		=	${TARGET}.tar
  
! INSTALLDIR	=	/usr/etc
  
  MANPAGE		=	popper.8
  
--- 49,69 ----
  #               SYSLOG42        -	For BSD 4.2 syslog (default is BSD 4.3 
  #					syslog).
  #               STRNCASECMP     -	If you do not have strncasecmp()
+ #		OSF1_ENHANCED_SECURITY	If you run enhanced security under osf/1 3.0b
+ #		OSF30B			If you run under osf/1 3.0B
  
! CFLAGS		=	-O -DBIND43 -DHAVE_VSPRINTF -DDEBUG -DOSF30B -D_BSD \
! 				-DOSF1_ENHANCED_SECURITY
! #
! # use -lsecurity if you run under OSF/1 3.0B with enhanced security
! #
! LFLAGS		=	-lsecurity
  
  TARGET		=	popper
  
  TAR		=	${TARGET}.tar
  
! INSTALLDIR	=	/etc
  
  MANPAGE		=	popper.8
  
***************
*** 55,61 ****
  
  
  ${TARGET}: ${OBJS}
! 	cc  ${OBJS} -o ${TARGET}
  
  tar: ${SRCS} ${DOCS} ${MAKEFILE}
  	rm -f ${TAR} *.Z*
--- 74,80 ----
  
  
  ${TARGET}: ${OBJS}
! 	cc  ${OBJS} -o ${TARGET}  ${LFLAGS}
  
  tar: ${SRCS} ${DOCS} ${MAKEFILE}
  	rm -f ${TAR} *.Z*
diff -c popper/pop_init.c popper-patch/pop_init.c
*** popper/pop_init.c	Thu Apr 04 01:25:28 1991
--- popper-patch/pop_init.c	Tue Mar 07 11:36:19 1995
***************
*** 122,128 ****
--- 122,130 ----
  #       include <resolv.h>
  
          /*  Distrust distant nameservers */
+ #ifndef OSF30B
          extern struct state     _res;
+ #endif
          struct hostent      *   ch_again;
          char            *   *   addrp;
  
diff -c popper/pop_pass.c popper-patch/pop_pass.c
*** popper/pop_pass.c	Thu Apr 04 01:25:35 1991
--- popper-patch/pop_pass.c	Tue Mar 07 19:20:08 1995
***************
*** 15,20 ****
--- 15,26 ----
  #include <pwd.h>
  #include "popper.h"
  
+ #ifdef OSF1_ENHANCED_SECURITY
+ #include <sys/security.h>
+ #include <prot.h>
+ #include <unistd.h>
+ #endif
+ 
  /* 
   *  pass:   Obtain the user password from a POP client
   */
***************
*** 22,27 ****
--- 28,52 ----
  int pop_pass (p)
  POP     *   p;
  {
+ 
+ #ifdef OSF1_ENHANCED_SECURITY
+     register struct pr_passwd  *   pw;
+         char *cp;
+ 
+         setprpwent();
+         pw = getprpwnam(p->user);
+ 
+         if (pw == NULL) return (pop_msg(p,POP_FAILURE,
+             "Password supplied for \"%s\" is incorrect.",p->user));
+         cp = bigcrypt(p->pop_parm[1],pw->ufld.fd_encrypt);
+ /*fprintf(stderr,"%s %s %s %s\n",p->user,p->pop_parm[1],cp,pw->ufld.fd_encrypt);*/
+         if (strcmp(cp,pw->ufld.fd_encrypt) != 0) {
+         return (pop_msg(p,POP_FAILURE,
+             "Password supplied for \"%s\" is incorrect.",p->user));
+         }
+         endprpwent();
+ 
+ #else
      register struct passwd  *   pw;
      char *crypt();
  
***************
*** 39,44 ****
--- 64,70 ----
      if (strcmp (crypt (p->pop_parm[1], pw->pw_passwd), pw->pw_passwd) != 0)
          return (pop_msg(p,POP_FAILURE,
              "Password supplied for \"%s\" is incorrect.",p->user));
+ #endif
  
      /*  Build the name of the user's maildrop */
      (void)sprintf(p->drop_name,"%s/%s",POP_MAILDIR,p->user);
***************
*** 57,60 ****
--- 83,87 ----
      return (pop_msg (p,POP_SUCCESS,
          "%s has %d message(s) (%d octets).",
              p->user,p->msg_count,p->drop_size));
+ 
  }
Only in popper-patch: popper
diff -c popper/popper.c popper-patch/popper.c
*** popper/popper.c	Thu Apr 04 01:25:42 1991
--- popper-patch/popper.c	Tue Mar 07 12:56:18 1995
***************
*** 26,31 ****
--- 26,36 ----
      state_table     *   s;
      char                message[MAXLINELEN];
  
+ #ifdef OSF1_ENHANCED_SECURITY
+         set_auth_parameters(argc,argv);
+ #endif
+ 
+ 
      /*  Start things rolling */
      pop_init(&p,argc,argv);
  
diff -c popper/version.h popper-patch/version.h
*** popper/version.h	Wed Sep 01 11:47:19 1993
--- popper-patch/version.h	Tue Mar 07 15:33:56 1995
***************
*** 12,15 ****
   *  Current version of this POP implementation
   */
  
! #define VERSION         "1.831"
--- 12,15 ----
   *  Current version of this POP implementation
   */
  
! #define VERSION         "1.831-ES"
Received on Thu Mar 09 1995 - 13:13:45 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT