# emerge dsniff - compulation error with full package

## cindy

I am trying to install dsniff, when I try to emerge I am receiving this error:

>emerge dsniff

Calculating dependencies

!!! all ebuilds that could satisfy "dsniff" have been masked.

!!! Error calculating dependencies. Please correct.

When I download the entire package to complile from scratch, I am receiving this error:

 >make

gcc -g -O2 -D_BSD_SOURCE -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I.      -I/usr/X11R6/include -I./missing -c ./arpspoof.c

arpspoof.c: In function `arp_send':

arpspoof.c:49: warning: passing arg 1 of `libnet_get_hwaddr' from incompatible pointer type

arpspoof.c:49: too many arguments to function `libnet_get_hwaddr'

arpspoof.c:60: warning: passing arg 6 of `libnet_build_ethernet' from incompatible pointer type

arpspoof.c:60: too few arguments to function `libnet_build_ethernet'

arpspoof.c:64: `ETH_H' undeclared (first use in this function)

arpspoof.c:64: (Each undeclared identifier is reported only once

arpspoof.c:64: for each function it appears in.)

arpspoof.c:64: too few arguments to function `libnet_build_arp'

arpspoof.c: In function `main':

arpspoof.c:181: warning: assignment makes pointer from integer without a cast

make: *** [arpspoof.o] Error 1

One person suggested that it could be a pointer to the arpspoof object.  I assume in the full package that the arpspoof in that directory is being used.

Any suggustions would be greatly appreciated.

----------

## Cosmin

You could unmask the package. For this, modify /usr/portage/profiles/package.mask accordingly. Look around to learn more about masking packages.

----------

## cindy

Thanks - Yes, the package was masked, I assume because it is broken?

The first part compiled OK - but I run into the same error with arpspoof:

Any more ideas???? 

RCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H  -I.    -I/var/tmp/portage/dsniff-2.3/work/db-3.2.9/dist  -I/usr/X11R6/include -I./missing -c ./missing/strlcat.c

gcc -O3 -march=i686 -funroll-loops -pipe -D_BSD_SOURCE -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H  -I.    -I/var/tmp/portage/dsniff-2.3/work/db-3.2.9/dist  -I/usr/X11R6/include -I./missing -c ./missing/md5.c

ar -cr libmissing.a dummy.o  strlcpy.o strlcat.o md5.o

ranlib libmissing.a

gcc -O3 -march=i686 -funroll-loops -pipe -D_BSD_SOURCE -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H  -I.    -I/var/tmp/portage/dsniff-2.3/work/db-3.2.9/dist  -I/usr/X11R6/include -I./missing -c ./arpspoof.c

arpspoof.c: In function `arp_send':

arpspoof.c:49: warning: passing arg 1 of `libnet_get_hwaddr' from incompatible pointer type

arpspoof.c:49: too many arguments to function `libnet_get_hwaddr'

arpspoof.c:60: warning: passing arg 6 of `libnet_build_ethernet' from incompatible pointer type

arpspoof.c:60: too few arguments to function `libnet_build_ethernet'

arpspoof.c:64: `ETH_H' undeclared (first use in this function)

arpspoof.c:64: (Each undeclared identifier is reported only once

arpspoof.c:64: for each function it appears in.)

arpspoof.c:64: too few arguments to function `libnet_build_arp'

arpspoof.c: In function `main':

arpspoof.c:181: warning: assignment makes pointer from integer without a cast

make: *** [arpspoof.o] Error 1

----------

## Cosmin

Can you please post the result from 

```
emerge -pv dsniff
```

 If you are using some other switches for emerge, please add them, so you would have something like emerge -pvuD...

----------

## cindy

This is what I receive from the -pv switches :

> emerge -pv dsniff

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-analyzer/dsniff-2.3

-------------------------------------

I have been posting and searching on the Internet and it appears to be a known problem, I wonder, in the make file, maybe I can point to a different version of arpspoof.  I think the arpspoof that dsniff wants is not the latest in Linux.  Do you know how?

Thanks for all your help

----------

## cindy

it seems that the Make file cannot locate PCAPLIB - does anyone know how to force it>

 If I look in the make file :

install_prefix =

prefix = /usr/ //<----- Changed to usr

exec_prefix = ${prefix}

libdir = ${exec_prefix}/lib

sbindir = ${exec_prefix}/sbin

mandir = ${prefix}/man

PCAPLIB = -lpcap // <-- Can I change this? I do not understand this var

arpspoof: arpspoof.o arp.o

$(CC) $(LDFLAGS) -o $@ arpspoof.o arp.o $(LIBS) $(PCAPLIB) $(LNETLIB)

PCAPLIB is missing. Hence the number of args.

My pacap resides in:

/usr/lib/libpcap.a

/usr/lib/libpcap.so.0.6

/usr/lib/libpcap.so.0

/usr/lib/libpcap.so

Thanks for the help - Any more ideas? Thanks

----------

## cindy

sorry, the above message references the Makefile.  I suppose I need to modify the Makefile.in - but it still did not work

Someone MUST have solved this already!

----------

## Cosmin

May be a silly question, but how much space do you have on drive? Seems like your / and /var/tmp directories are on the same partition. You can use mount to view the mounted partitions and df to see disk usage. If you don't have enough free space on your drive, you might get some strange errors. You could check...

If it still doesn't work, you could unpack the sources and run 

```
./configure --help
```

and see the result. From here you might be able to instruct make to build without the offending program (I believe it is pcap). So you might have to type something like ./configure -nopcap. If this is not too annoying to you, please post the result of ./configure --help.

If the configure step is succesfully, you can make and make install. Then you have to emerge --inject dsniff to tell portage you installed dsniff. Please tell me if you get stuck or is something wrong/unclear.

----------

## cindy

Hi - Yes I have lots of space on my machine.  I received advice from another forum that told me that my libnet files were out of date.  I performed an protage update and now some of my other programs will not work, so I will continue with that problem until I have my machine stable again.  

The problem with omitting PCAP is that it would be a necessary item for dsniff - PCAP allows you to put you network card into permiscious mode. I mean, pacp is there and I know it is functioning, I am using ethereal.  So if the program is already there should I be able to omit it?, what about the dsniff compile, does it need this to compile or does it just call it?  I don't know.  Sorry about my messages becoming short - I was becoming flustered with things not working right away.

----------

## Janne Pikkarainen

Cindy: Whoa, the dsniff really seems to be b0rked. Do you really need dsniff or would some equivalent be good enough? I don't know exactly what the alternative could be, though... here are some suggestions but they might not be doing the exactly same thing you need.

http://packages.gentoo.org/packages/?category=net-analyzer;name=ettercap

http://packages.gentoo.org/packages/?category=net-analyzer;name=lcrzoex

http://packages.gentoo.org/packages/?category=net-analyzer;name=paketto

http://packages.gentoo.org/packages/?category=net-analyzer;name=sniffit

----------

## darfsnuzal

Cindy: dsniff will not compile with libnet > 1.0 (maybe 1.02a.)  The only way around this is to obtain a copy of libnet 1.0, compile it (but don't install it) and then configure dsniff with something like:

./configure \

--with-libnet=/path/to/libnet-x \

-- other options here

Unfortunately, I think the versions of libpcap and libnids will also be an issue but the solution is the same: grab the versions that dsniff expects, compile (but don't install!) them and then direct dsniff's configure script to them:

./configure \

--with-libnet=/path/to/libnet-x \

--with-libpcap=/path/to/libpcap-x \

--with-libnids=/path/to/libnids-x

As far as I can tell, Dug hasn't updated dsniff since May 2002.  I always cringe when someone mentions installing dsniff because of the very old library versions required.

HTH.

----------

## IndianZ

Hi All

When you are emerging packages, it is possible to have different versions parallel in your system. portage will take care of dependencies  :Wink: 

concerning dsniff, try:

emerge /usr/portage/net-libs/libnet/libnet-1.0.2a-r3.ebuild

this will install the libnet 1.0.2. then you can:

emerge /usr/portage/net-analyzer/dsniff/dsniff-2.3-r1.ebuild

even when it's masked  :Wink: 

I run into some troubles to start dsniff binary after that, Error dsniff: couldn't open /etc/dsniff/dsniff.services after that, but compiling was no problem...

have a nice day....

----------

