OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src openpkg-web          Date:   09-Jun-2003 15:07:40
  Branch: HEAD                             Handle: 2003060914073801

  Modified files:
    openpkg-src/dsniff      dsniff.patch dsniff.spec
    openpkg-web             news.txt

  Log:
    Ok, just before going onto holidays, let's finally (puhhh) repair this
    package, too. This package was broken since a longer time because of
    the newer libnids package. And I've found workaround int the past. This
    solution now is the hard-core one: include all libs it requires locally
    and patch those locally to fit together.

  Summary:
    Revision    Changes     Path
    1.2         +216 -0     openpkg-src/dsniff/dsniff.patch
    1.15        +59 -7      openpkg-src/dsniff/dsniff.spec
    1.4776      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/dsniff/dsniff.patch
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 dsniff.patch
  --- openpkg-src/dsniff/dsniff.patch   9 Jan 2002 13:56:55 -0000       1.1
  +++ openpkg-src/dsniff/dsniff.patch   9 Jun 2003 13:07:39 -0000       1.2
  @@ -8,3 +8,219 @@
    #include <db_185.h>
    #elif HAVE_DB_H
    #include <db.h>
  +--- Libnet-1.0.2a/include/libnet.h.orig      Wed Feb  7 00:19:25 2001
  ++++ Libnet-1.0.2a/include/libnet.h   Mon Jun  9 14:13:22 2003
  +@@ -83,10 +83,8 @@
  + 
  + #define LIBNET_VERSION  "1.0.2a"
  + 
  +-#if (!LIBNET_LIL_ENDIAN && !LIBNET_BIG_ENDIAN)
  +-#error "byte order has not been specified, you'll
  +-need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN.  See the
  +-documentation regarding the libnet-config script."
  ++#if (!defined(LIBNET_LIL_ENDIAN) && !defined(LIBNET_BIG_ENDIAN))
  ++#error "byte order has not been specified, you'll need to #define either 
LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN.  See the documentation regarding the 
libnet-config script."
  + #endif
  + 
  + #endif  /* __LIBNET_H */
  +--- libnids-1.16/src/checksum.c.orig Tue Jun 20 23:06:32 2000
  ++++ libnids-1.16/src/checksum.c      Mon Jun  9 14:42:03 2003
  +@@ -4,193 +4,6 @@
  + #include <netinet/tcp.h>
  + #include <netinet/udp.h>
  + 
  +-#if ( __i386  )
  +-// all asm procedures are copied from Linux 2.0.36 and 2.2.10 kernels
  +-
  +-/*
  +-  computes the checksum of a memory block at buff, length len, and
  +-  adds in "sum" (32-bit)
  +- 
  +-  returns a 32-bit number suitable for feeding into itself or
  +-  csum_tcpudp_magic
  +- 
  +-  this function must be called with even lengths, except for the last
  +-  fragment, which may be odd
  +- 
  +-  it's best to have buff aligned on a 32-bit boundary
  +-*/
  +-u_int
  +-csum_partial(const u_char * buff, int len, u_int sum)
  +-{
  +-  __asm__ (
  +-/*          "pushl %esi
  +-    pushl %ebx
  +-    movl 20(%esp),%eax      # Function arg: u_int sum
  +-    movl 16(%esp),%ecx      # Function arg: int len
  +-        movl 12(%esp),%esi  # Function arg: u_char *buff*/
  +-
  +-       "testl $2, %%esi             
  +-    jz 2f                   
  +-    subl $2, %%ecx          
  +-    jae 1f                  
  +-    addl $2, %%ecx          
  +-    jmp 4f
  +-1:  movw (%%esi), %%bx
  +-    addl $2, %%esi
  +-    addw %%bx, %%ax
  +-    adcl $0, %%eax
  +-2:
  +-    movl %%ecx, %%edx
  +-    shrl $5, %%ecx
  +-    jz 2f
  +-    testl %%esi, %%esi
  +-1:  movl (%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 4(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 8(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 12(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 16(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 20(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 24(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    movl 28(%%esi), %%ebx
  +-    adcl %%ebx, %%eax
  +-    lea 32(%%esi), %%esi
  +-    dec %%ecx
  +-    jne 1b
  +-    adcl $0, %%eax
  +-2:  movl %%edx, %%ecx
  +-    andl $0x1c, %%edx
  +-    je 4f
  +-    shrl $2, %%edx          
  +-3:  adcl (%%esi), %%eax
  +-    lea 4(%%esi), %%esi
  +-    dec %%edx
  +-    jne 3b
  +-    adcl $0, %%eax
  +-4:  andl $3, %%ecx
  +-    jz 7f
  +-    cmpl $2, %%ecx
  +-    jb 5f
  +-    movw (%%esi),%%cx
  +-    leal 2(%%esi),%%esi
  +-    je 6f
  +-    shll $16,%%ecx
  +-5:  movb (%%esi),%%cl
  +-6:  addl %%ecx,%%eax
  +-    adcl $0, %%eax
  +-7: "
  +-       : "=a"(sum)
  +-       : "0"(sum), "c"(len), "S"(buff)
  +-       : "bx", "dx");
  +-
  +-  return (sum);
  +-}
  +-
  +-/*
  +-  This is a version of ip_compute_csum() optimized for IP headers,
  +-  which always checksum on 4 octet boundaries.
  +- 
  +-  By Jorge Cwik <[EMAIL PROTECTED]>, adapted for linux by Arnt
  +-  Gulbrandsen.
  +-*/
  +-inline u_short ip_fast_csum(u_char * iph, u_int ihl)
  +-{
  +-  u_int sum;
  +-  
  +-  __asm__ __volatile__("
  +-        movl (%1), %0
  +-        subl $4, %2
  +-        jbe 2f
  +-        addl 4(%1), %0
  +-        adcl 8(%1), %0
  +-        adcl 12(%1), %0
  +-1:      adcl 16(%1), %0
  +-        lea 4(%1), %1
  +-        decl %2
  +-        jne 1b
  +-        adcl $0, %0
  +-        movl %0, %2
  +-        shrl $16, %0
  +-        addw %w2, %w0
  +-        adcl $0, %0
  +-        notl %0
  +-2:
  +-        "
  +-    /*
  +-      Since the input registers which are loaded with iph and ipl
  +-      are modified, we must also specify them as outputs, or gcc
  +-      will assume they contain their original values.
  +-    */
  +-    : "=r" (sum), "=r" (iph), "=r" (ihl)
  +-    : "1" (iph), "2" (ihl));
  +-  
  +-  return (sum);
  +-}
  +-
  +-/* Fold a partial checksum. */
  +-static inline u_int
  +-csum_fold(u_int sum)
  +-{
  +-  __asm__("
  +-    addl %1, %0
  +-    adcl $0xffff, %0
  +-    "
  +-    : "=r" (sum)
  +-    : "r" (sum << 16), "0" (sum & 0xffff0000)
  +-      );
  +-  return ((~sum) >> 16);
  +-}
  +- 
  +-/*
  +-  computes the checksum of the TCP/UDP pseudo-header
  +-  returns a 16-bit checksum, already complemented
  +-*/
  +-static inline u_short
  +-csum_tcpudp_magic(u_int saddr, u_int daddr, u_short len,
  +-              u_short proto, u_int sum)
  +-{
  +-  __asm__("
  +-    addl %1, %0
  +-    adcl %2, %0
  +-    adcl %3, %0
  +-    adcl $0, %0
  +-    "
  +-    : "=r" (sum)
  +-    : "g" (daddr), "g"(saddr), "g"((ntohs(len) << 16) + proto * 256), "0"(sum));
  +-  return (csum_fold(sum));
  +-}
  +-
  +-/*
  +-  this routine is used for miscellaneous IP-like checksums, mainly in
  +-  icmp.c
  +-*/
  +-inline u_short
  +-ip_compute_csum(u_char * buff, int len)
  +-{
  +-  return (csum_fold(csum_partial(buff, len, 0)));
  +-}
  +-
  +-inline u_short
  +-my_tcp_check(struct tcphdr *th, int len, u_int saddr, u_int daddr)
  +-{
  +-  return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_TCP,
  +-                       csum_partial((char *)th, len, 0));
  +-}
  +-inline u_short
  +-my_udp_check(void *u, int len, u_int saddr, u_int daddr)
  +-{
  +-  return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP,
  +-                       csum_partial((char *)u, len, 0));
  +-}
  +-
  +-#else /* !i386 */
  +-
  + struct psuedo_hdr
  + {
  +   u_int saddr;      
  +@@ -275,4 +88,3 @@
  +   return (ip_check_ext((u_short *)u, len, sum));
  + }                     
  + 
  +-#endif /* !i386 */
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/dsniff/dsniff.spec
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 dsniff.spec
  --- openpkg-src/dsniff/dsniff.spec    23 Mar 2003 10:41:46 -0000      1.14
  +++ openpkg-src/dsniff/dsniff.spec    9 Jun 2003 13:07:39 -0000       1.15
  @@ -23,6 +23,22 @@
   ##  SUCH DAMAGE.
   ##
   
  +##  FIXME: rse: this package is a very sensible one. It depends on
  +##  FIXME: rse: particular versions of libnet and libnids and libnids
  +##  FIXME: rse: in turn also depends on the particular libnet version.
  +##  FIXME: rse: The below versions (plus the patches in dsniff.patch)
  +##  FIXME: rse: are able to successfully build dsniff 2.3. Neither just
  +##  FIXME: rse: dsniff 2.4b1, nor libnids 1.17rc1 nor libnet 1.1.0 alone
  +##  FIXME: rse: can solve the problem. So, until dsniff 2.4 will support
  +##  FIXME: rse: the version in our libnids and libnet packages, let's
  +##  FIXME: rse: keep the local copies here. And do not blindly try to
  +##  FIXME: rse: upgrade them!
  +
  +#   package versions
  +%define       V_dsniff  2.3
  +%define       V_libnet  1.0.2a
  +%define       V_libnids 1.16
  +
   #   package information
   Name:         dsniff
   Summary:      Tools for network auditing and penetration testing
  @@ -32,11 +48,13 @@
   Distribution: OpenPKG [EVAL]
   Group:        Network
   License:      BSD-style
  -Version:      2.3
  -Release:      20030323
  +Version:      %{V_dsniff}
  +Release:      20030609
   
   #   list of sources
  -Source0:      http://www.monkey.org/~dugsong/dsniff/dsniff-%{version}.tar.gz
  +Source0:      http://www.monkey.org/~dugsong/dsniff/dsniff-%{V_dsniff}.tar.gz
  +Source1:      
http://www.packetfactory.net/libnet/dist/deprecated/libnet-%{V_libnet}.tar.gz
  +Source2:      
http://www.packetfactory.net/projects/libnids/dist/libnids-%{V_libnids}.tar.gz
   Patch0:       dsniff.patch
   
   #   build information
  @@ -58,12 +76,46 @@
       sessions by exploiting weak bindings in ad-hoc PKI.
   
   %prep
  -    %setup -q
  -    %patch -p0
  +    %setup0 -q
  +    %setup1 -q -T -D -a 1
  +    %setup2 -q -T -D -a 2
  +    %patch0 -p0
   
   %build
  -    CC="%{l_cc}" \
  -    CFLAGS="%{l_cflags -O}" \
  +    ( cd Libnet-%{V_libnet}
  +      CC="%{l_cc}" \
  +      CFLAGS="%{l_cflags -O}" \
  +      ./configure \
  +          --prefix=%{l_prefix}
  +      %{l_make} %{l_mflags -O}
  +    )
  +    ( cd libnids-%{V_libnids}
  +      PATH="`pwd`/../Libnet-%{V_libnet}:$PATH"
  +      define="LIBNET_LIL_ENDIAN"
  +      case "%{l_target}" in
  +          sparc*-* ) define="LIBNET_BIG_ENDIAN" ;;
  +          *68*-*   ) define="LIBNET_BIG_ENDIAN" ;;
  +      esac
  +      CC="%{l_cc}" \
  +      CFLAGS="%{l_cflags -O} -I`pwd`/src -I`pwd`/../Libnet-%{V_libnet}/include 
-D$define" \
  +      LDFLAGS="-L`pwd`/src -L`pwd`/../Libnet-%{V_libnet}/lib %{l_ldflags}" \
  +      ./configure \
  +          --prefix=%{l_prefix}
  +      %{l_make} %{l_mflags -O}
  +    )
  +    CC="%{l_cc}"
  +    CFLAGS="%{l_cflags -O}"
  +    CFLAGS="$CFLAGS -I`pwd`/Libnet-%{V_libnet}/include"
  +    CFLAGS="$CFLAGS `./Libnet-%{V_libnet}/libnet-config --defines`"
  +    CFLAGS="$CFLAGS -I`pwd`/Libnet-%{V_libnet}/include"
  +    CFLAGS="$CFLAGS -I`pwd`/libnids-%{V_libnids}/src"
  +    CFLAGS="$CFLAGS %{l_cppflags}"
  +    LDFLAGS="-L`pwd`/Libnet-%{V_libnet}/lib"
  +    LDFLAGS="$LDFLAGS -L`pwd`/libnids-%{V_libnids}/src"
  +    LDFLAGS="$LDFLAGS %{l_ldflags}"
  +    export CC
  +    export CFLAGS
  +    export LDFLAGS
       ./configure \
           --prefix=%{l_prefix} \
           --libdir=%{l_prefix}/share/dsniff \
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.4775 -r1.4776 news.txt
  --- openpkg-web/news.txt      9 Jun 2003 12:37:37 -0000       1.4775
  +++ openpkg-web/news.txt      9 Jun 2003 13:07:38 -0000       1.4776
  @@ -1,3 +1,4 @@
  +09-Jun-2003: Upgraded package: P<dsniff-2.3-20030609>
   09-Jun-2003: Upgraded package: P<libnids-1.17rc1-20030609>
   09-Jun-2003: Upgraded package: P<imapd-2.1.13-20030609>
   09-Jun-2003: Upgraded package: P<mysql3-3.23.56-20030609>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to