Next: , Previous: , Up: Top   [Contents]


2 How to compile the library?

Requirements for compiling the library:

Type

./configure

to configure LibNetBlock for your system.

If you want to enable the public interface of LibNetBlock, configure the library with

./configure --enable-public-interface

See the chapter on developing to learn how to use LibNetBlock (Developing).

LibNetBlock allows some programs to be banned (not allowed to run under LibNetBlock, because they might need accesss to the network). One banning file is always supported - ${sysconfdir}/libnetblock.progban (${sysconfdir} is /usr/local/etc unless set otherwise during configure).

If you want to disable additional banning files pointed to by environment variables, configure the library with

./configure --enable-environment=no

If you want to disable additional banning files in users’ home directories, configure the library with

./configure --enable-user-files=no

Type

make

to compile the library.

Documentation comes compiled (and can be copied right away), but can be changed and recompiled, if you have the makeinfo program (texinfo package).

Type

make install

to install the library.

To make LibNetBlock impossible to detect, you must change all the internal public function names. To do this, you can use the name randomizing scripts in the src directory. You will need the sed and sort programs and either Perl or GNU awk. You can change the name prefix at the top of these scripts to something unique. When the script is done working, recompile and reinstall the library.

Thus, a typical build sequence with less detection would be

./configure

cd src

./randomize_names_gawk.sh (or ‘make x-randomnames’)

cd ..

make

If you want to do this manually (or you don’t have sed or sort and Perl or GNU awk), open the src/lnb_priv.h file in a text editor and look for lines starting with extern. The __lnb... names in these lines are the function names to convert. Take each name and substitute all its appearances in each source file in the src directory using a text editor or the following commands:

sed -i 's/__lnb_real_execve_location/_your_function_name1/g' *.c* *.h*

sed -i 's/__lnb_real_system_location/_your_function_name2/g' *.c* *.h*

...

sed -i 's/__lnb_get_init_stage/_your_function_nameN/g' *.c* *.h*

Then find other symbols that start with __lnb in other files and change them too (using a text editor or commands similar to the above).

Then recompile and reinstall the library.

NOTE: ‘make install’ is NOT recommended. Create and install an RPM package instead, if possible.

To create an RPM package:

  1. copy the libnetblock.spec file to $HOME/rpmbuild/SPECS
  2. copy the source package libnetblock-1.7.tar.gz to $HOME/rpmbuild/SOURCES
  3. type ‘rpmbuild -bb $HOME/rpmbuild/SPECS/libnetblock.spec
  4. get the RPMs from $HOME/rpmbuild/RPMS/

To create an RPM package (the old way):

  1. copy the libnetblock.spec file to /usr/src/redhat/SPECS
  2. copy the source package libnetblock-1.7.tar.gz to /usr/src/redhat/SOURCES
  3. type ‘rpmbuild -bb /usr/src/redhat/SPECS/libnetblock.spec
  4. get the RPMs from /usr/src/redhat/RPMS/

Next: , Previous: , Up: Top   [Contents]