compiling LPFW (Leopard Flower Personal Firewall) -> cannot execute binary file

Hey,

I’ve been trying to compile LPFW for a while now without success, so I’m seeking for some help here :wink:
I downloaded the latest v.0.4 sources from Leopard Flower | Free System Administration software downloads at SourceForge.net and followed the Install instruction:

mkdir build
cd build
make -C …/ DESTDIR=pwd

Here the complete output:


boo@boopc:~/Downloads> unzip lpfw-0.4-src.zip -d lpfw-0.4-src
Archive:  lpfw-0.4-src.zip                                                                                                                                                                                                       
a12e0514cca929280106c5b33c59a5e0d9a8f161                                                                                                                                                                                         
   creating: lpfw-0.4-src/lpfw-0.4-src/                                                                                                                                                                                          
  inflating: lpfw-0.4-src/lpfw-0.4-src/CHANGELOG                                                                                                                                                                                 
  inflating: lpfw-0.4-src/lpfw-0.4-src/INSTALL                                                                                                                                                                                   
  inflating: lpfw-0.4-src/lpfw-0.4-src/Makefile                                                                                                                                                                                  
  inflating: lpfw-0.4-src/lpfw-0.4-src/README                                                                                                                                                                                    
   creating: lpfw-0.4-src/lpfw-0.4-src/argtable/                                                                                                                                                                                 
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_end.c                                                                                                                                                                        
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_file.c                                                                                                                                                                       
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_int.c                                                                                                                                                                        
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_lit.c                                                                                                                                                                        
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_rem.c                                                                                                                                                                        
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/arg_str.c                                                                                                                                                                        
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/argtable2.c                                                                                                                                                                      
  inflating: lpfw-0.4-src/lpfw-0.4-src/argtable/argtable2.h  
   creating: lpfw-0.4-src/lpfw-0.4-src/common/
  inflating: lpfw-0.4-src/lpfw-0.4-src/common/defines.h  
  inflating: lpfw-0.4-src/lpfw-0.4-src/common/includes.h  
   creating: lpfw-0.4-src/lpfw-0.4-src/lpfw-cli/
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-cli/Makefile  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-cli/ipc.c  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-cli/lpfwcli.c  
   creating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/Makefile  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/frontend.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/frontend.ui  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/ipc_wrapper2.c  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/lpfw-pygui.c  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/lpfwgui.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/pic.jpg  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/popup_in.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/popup_in.ui  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/popup_out.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/popup_out.ui  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/prefs.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/prefs.ui  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/resource.py  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui/resource.qrc  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw.c  
  inflating: lpfw-0.4-src/lpfw-0.4-src/lpfw.ebuild  
  inflating: lpfw-0.4-src/lpfw-0.4-src/msgq.c  
   creating: lpfw-0.4-src/lpfw-0.4-src/sha512/
  inflating: lpfw-0.4-src/lpfw-0.4-src/sha512/sha.c  
  inflating: lpfw-0.4-src/lpfw-0.4-src/sha512/sha.h  
  inflating: lpfw-0.4-src/lpfw-0.4-src/sha512/u64.h  
  inflating: lpfw-0.4-src/lpfw-0.4-src/test.c  
   creating: lpfw-0.4-src/lpfw-0.4-src/ubuntu/
  inflating: lpfw-0.4-src/lpfw-0.4-src/ubuntu/30-lpfw.conf  
  inflating: lpfw-0.4-src/lpfw-0.4-src/ubuntu/lpfw.conf  
  inflating: lpfw-0.4-src/lpfw-0.4-src/version.h  
boo@boopc:~/Downloads> cd lpfw-0.4-src/
boo@boopc:~/Downloads/lpfw-0.4-src> cd lpfw-0.4-src/
boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src> mkdir build
boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src> cd build/
boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> make -C ../ DESTDIR=`pwd`
make: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src'
gcc -g lpfw.c msgq.c test.c sha512/sha.c argtable/arg_end.c argtable/arg_file.c argtablboo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> 
e/arg_int.c argtable/arg_lit.c argtable/arg_rem.c argtable/arg_str.c argtable/argtable2.c common/includes.h common/defines.h  -lnetfilter_queue -lnetfilter_conntrack -lpthread -lcap -o lpfw
lpfw.c:23:39: fatal error: libnfnetlink/libnfnetlink.h: No such file or directory
 #include <libnfnetlink/libnfnetlink.h>
                                       ^
compilation terminated.
make: *** [lpfw] Error 1
make: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src'

However, the needed header file is located here:


boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> ls /usr/include/libnfnetlink-1.0.1/libnfnetlink/
libnfnetlink.h  linux_nfnetlink_compat.h  linux_nfnetlink.h

Then I made the same make command with sudo:

boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> sudo make -C ../ DESTDIR=`pwd`
make: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src'
mv lpfw /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build
cd lpfw-cli; make ; make DESTDIR=/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build install
make[1]: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-cli'
gcc -g ipc.c lpfwcli.c ../common/includes.h ../common/defines.h ../argtable/arg_end.c ../argtable/arg_file.c ../argtable/arg_int.c ../argtable/arg_lit.c ../argtable/arg_rem.c ../argtable/arg_str.c ../argtable/argtable2.c  -lncurses -lpthread -o lpfwcli
make[1]: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-cli'
make[1]: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-cli'
mv lpfwcli /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build
make[1]: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-cli'
cd lpfw-pygui; make ; make DESTDIR=/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build install
make[1]: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui'
gcc ../common/includes.h ipc_wrapper2.c -g -lpthread -o ipc_wrapper2
gcc lpfw-pygui.c ../common/includes.h ../common/defines.h ../argtable/arg_end.c ../argtable/arg_file.c ../argtable/arg_int.c ../argtable/arg_lit.c ../argtable/arg_rem.c ../argtable/arg_str.c ../argtable/argtable2.c  -g -o lpfwpygui
make[1]: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui'
make[1]: Entering directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui'
mv lpfwpygui /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build
mkdir -p /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
mv ipc_wrapper2 /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp resource.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp prefs.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp popup_out.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp popup_in.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp lpfwgui.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
cp frontend.py /home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/build/lpfw-pygui
make[1]: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src/lpfw-pygui'
make: Leaving directory `/home/boo/Downloads/lpfw-0.4-src/lpfw-0.4-src'

Now, the compilation works fine but the lpfw binary is somehow not executable:

boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> sudo ./lpfw
sudo: ./lpfw: command not found
boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> chmod +x lpfw
boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> sudo ./lpfw
./lpfw: ./lpfw: cannot execute binary file

boo@boopc:~/Downloads/lpfw-0.4-src/lpfw-0.4-src/build> file lpfw
lpfw: GCC precompiled header (version 014) for C

Unfortunately, I dont even know what exactly is the problem, so I really appreciate any help. Thanks in advance!

Are you aware that openSUSE has a firewall already? Is there any particular reason you need to install LPFW instead?

Yes, I know that Opensuse has a firewall, but is there also the possibility of configuring (easily) per-application rules?

lpfw is not executable. Why don’t you show the results of ‘ls -l’? Be sure to wrap it in CODE tags.

Here it is:

ls -l
total 1672
-rwxr-xr-x 1 boo   users 1524144 Dec 26 10:18 lpfw
-rwxr-xr-x 1 root root   109464 Dec 26 10:18 lpfwcli
-rwxr-xr-x 1 root root    68424 Dec 26 10:18 lpfwpygui
drwxr-xr-x 2 root root     4096 Dec 26 10:18 lpfw-pygui

and already thanks for helping me!

It looks like you have a Python GUI and a CLI. Try ‘./lpfwpygui’.

I guess you are right, but I tried to follow the instructions:

SIMPLE CONFIGURATION:

  1. Make sure lpfw,lpfwcli, and lpfwpygui are in the same folder
  2. In a terminal window navigate into the folder where lpfw is located and launch “./lpfw” as root
  3. In a terminal window of an X session navigate into the folder where lpfw is located and launch “./lpfwcli” or “./lpfwpygui” as a regular user (not root). You will see the frontend.

And the second point fails, or do I miss something?

I’m not clear on what this lpfw is. It’s identified by file as a header, but in the information you provide it should be an executable. I take it you’ve read the README and the INSTALL files? That should usually get you started.

Yes, I followed the INSTALL and README files. Is it possible that Its somehow related to the error which occurs when I execute the make command without root rights? Why is gcc unable to find the header file when not executed as root?

Thanks for your help!
I solved the problem. Somehow, all netfilter libraries have been installed like this:

/usr/include/libnfnetlink-1.0.1/libnfnetlink/*.h

But the headers themselves and also LPFW expects them to be in

/usr/include/libnfnetlink/*.h
so, I copied the folders directly into the include folder and then the compilation worked successfully with root rights and the resulting files where proper executables.