I've installed SpamAssassin on several Linux boxes, but today was my
first non-Linux install. The system was a DEC Alpha running OSF1 v4.0.
I had to make a couple of minor tweaks to get a clean build, the patches
for which are below.

The change in type from unsigned char* to char* for full_read() and
full_write() in spamd/spamc.c are, of course, optional but do
eliminate a screen-full of compiler warnings.

        -Bill Randle
        Neo Software Specialties, LLC
        [EMAIL PROTECTED]




*** Makefile.PL.orig	Fri Jun 14 10:19:06 2002
--- Makefile.PL	Sat Jun 15 14:41:42 2002
***************
*** 125,135 ****
  	$(CP) rules/user_prefs.template $(DEF_RULES_DIR)/user_prefs.template
  
  $(LOCAL_RULES_DIR)/local.cf: rules/local.cf
! 	[ -f $(LOCAL_RULES_DIR)/local.cf ] || $(CP) rules/local.cf $(LOCAL_RULES_DIR)/local.cf
  
  migrate_cfs:
! 	[ ! -f /etc/spamassassin.cf ] || $(MV) /etc/spamassassin.cf /etc/mail/spamassassin/migrated.cf
! 	[ ! -f /etc/mail/spamassassin.cf ] || $(MV) /etc/mail/spamassassin.cf /etc/mail/spamassassin/migrated.cf
  
  $(DEF_RULES_DIR):
  	mkdir -p $(DEF_RULES_DIR)
--- 125,135 ----
  	$(CP) rules/user_prefs.template $(DEF_RULES_DIR)/user_prefs.template
  
  $(LOCAL_RULES_DIR)/local.cf: rules/local.cf
! 	\[ -f $(LOCAL_RULES_DIR)/local.cf ] || $(CP) rules/local.cf $(LOCAL_RULES_DIR)/local.cf
  
  migrate_cfs:
! 	\[ ! -f /etc/spamassassin.cf ] || $(MV) /etc/spamassassin.cf /etc/mail/spamassassin/migrated.cf
! 	\[ ! -f /etc/mail/spamassassin.cf ] || $(MV) /etc/mail/spamassassin.cf /etc/mail/spamassassin/migrated.cf
  
  $(DEF_RULES_DIR):
  	mkdir -p $(DEF_RULES_DIR)
*** spamd/spamc.c.orig	Thu Jun  6 20:55:34 2002
--- spamd/spamc.c	Sat Jun 15 14:13:31 2002
***************
*** 47,53 ****
--- 47,58 ----
  # define EX__MAX 77
  
  extern char *optarg;
+ /* some versions of OSF/1 (aka DEC Unix or Digital Unix)
+  * typedef in_addr_t, even though EX__MAX is not defined
+  */
+ #  if !(defined(__osf__) && (defined(_OSF_SOURCE) || defined(_XOPEN_SOURCE_EXTENDED)))
  typedef unsigned long	in_addr_t;	/* base type for internet address */
+ #  endif
  # endif
  #endif
  
***************
*** 96,102 ****
   * the data that's there, in one call.
   */
  int
! full_read (int fd, unsigned char *buf, int min, int len)
  {
    int total;
    int thistime;
--- 101,107 ----
   * the data that's there, in one call.
   */
  int
! full_read (int fd, char *buf, int min, int len)
  {
    int total;
    int thistime;
***************
*** 118,124 ****
  }
  
  int
! full_write (int fd, const unsigned char *buf, int len)
  {
    int total;
    int thistime;
--- 123,129 ----
  }
  
  int
! full_write (int fd, const char *buf, int len)
  {
    int total;
    int thistime;
***************
*** 138,148 ****
  int dump_message(int in,int out)
  {
    size_t bytes;
!   unsigned char buf[8192];
  
    while((bytes=full_read(in, buf, 8192, 8192)) > 0)
    {
!     if(bytes != full_write (out,buf,bytes))
      {
        return EX_IOERR;
      }
--- 143,153 ----
  int dump_message(int in,int out)
  {
    size_t bytes;
!   char buf[8192];
  
    while((bytes=full_read(in, buf, 8192, 8192)) > 0)
    {
!     if(bytes != full_write (out,(const char *)buf,bytes))
      {
        return EX_IOERR;
      }
***************
*** 171,177 ****
      /* Message is too big, so return so we can dump the message back out */
      bytes2 = snprintf(header_buf,1024,"SKIP %s\r\nUser: %s\r\n\r\n",
  			PROTOCOL_VERSION, username);
!     full_write (out,header_buf,bytes2);
      ret = ESC_PASSTHROUGHRAW;
    } else
    {
--- 176,182 ----
      /* Message is too big, so return so we can dump the message back out */
      bytes2 = snprintf(header_buf,1024,"SKIP %s\r\nUser: %s\r\n\r\n",
  			PROTOCOL_VERSION, username);
!     full_write (out,(const char *)header_buf,bytes2);
      ret = ESC_PASSTHROUGHRAW;
    } else
    {
***************
*** 199,206 ****
        }
      }
  
!     full_write (out,header_buf,bytes2);
!     full_write (out,msg_buf,bytes);
    }
  
    free(header_buf);
--- 204,211 ----
        }
      }
  
!     full_write (out,(const char *)header_buf,bytes2);
!     full_write (out,(const char *)msg_buf,bytes);
    }
  
    free(header_buf);
***************
*** 345,351 ****
      }
      else
      {
!       full_write (out, out_buf, out_index);
      }
    }
  
--- 350,356 ----
      }
      else
      {
!       full_write (out, (const char *)out_buf, out_index);
      }
    }
  
***************
*** 494,500 ****
      if(!CHECK_ONLY && (ESC_PASSTHROUGHRAW == exstatus || (SAFE_FALLBACK && EX_OK != exstatus)))
      {
        /* Message was too big or corrupted, so dump the buffer then bail */
!       full_write (STDOUT_FILENO,msg_buf,amount_read);
        dump_message(STDIN_FILENO,STDOUT_FILENO);
        exstatus = EX_OK;
      }
--- 499,505 ----
      if(!CHECK_ONLY && (ESC_PASSTHROUGHRAW == exstatus || (SAFE_FALLBACK && EX_OK != exstatus)))
      {
        /* Message was too big or corrupted, so dump the buffer then bail */
!       full_write (STDOUT_FILENO,(const char *)msg_buf,amount_read);
        dump_message(STDIN_FILENO,STDOUT_FILENO);
        exstatus = EX_OK;
      }
***************
*** 509,515 ****
    {
      if(amount_read > 0)
      {
!       full_write(STDOUT_FILENO,msg_buf,amount_read);
      }
      return dump_message(STDIN_FILENO,STDOUT_FILENO);
    }
--- 514,520 ----
    {
      if(amount_read > 0)
      {
!       full_write(STDOUT_FILENO,(const char *)msg_buf,amount_read);
      }
      return dump_message(STDIN_FILENO,STDOUT_FILENO);
    }

Reply via email to