Package: batmand / 0.3.2-21

Metadata

Package Version Patches format
batmand 0.3.2-21 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
Fix FTBFS on second build attempt.patch | (download)

Makefile | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 fix ftbfs on second build attempt

debian/rules clean will try to remove all files and folders which end with
*.d. This fails on the leftover package folder with etc/init.d included
because the rm is not started in recursive deletion mode. This find can be
replaced with a simpler statement without using its functionality.

Fix spelling errors in manpage.patch | (download)

man/batmand.8 | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 fix spelling errors in manpage


Don t automatically build in parallel.patch | (download)

Makefile | 5 1 + 4 - 0 !
1 file changed, 1 insertion(+), 4 deletions(-)

 don't automatically build in parallel

Distributions like Gentoo and Debian have policies which make it
necessary to use some kind of environmental variable to control the
parallel build.

Use standard like build rules.patch | (download)

Makefile | 117 55 + 62 - 0 !
1 file changed, 55 insertions(+), 62 deletions(-)

 use standard-like build rules

User expect a specific naming inside makefile rules which they can
modify by changing environment variables or providing them explicitly
as parameters of the make call. The naming was extracted from the gnu
make standard rules database.

Install manpage.patch | (download)

Makefile | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 install manpage


Replace version info instead of appending them.patch | (download)

Makefile | 10 7 + 3 - 0 !
batman.h | 9 3 + 6 - 0 !
originator.c | 4 2 + 2 - 0 !
posix/init.c | 9 3 + 6 - 0 !
4 files changed, 15 insertions(+), 17 deletions(-)

 replace version info instead of appending them

The version number of batmand can get revision numbers added. This is useful to
give hints about the revision of a distribution package and the used patchset
or the commit which was used to build it. The prepended source number or branch
name doesn't add any additional information which would help to identify
problems and can therefore be omitted.

Define _GNU_SOURCE for all POSIX target source files.patch | (download)

Makefile | 1 1 + 0 - 0 !
linux/route.c | 1 0 + 1 - 0 !
posix/unix_socket.c | 1 0 + 1 - 0 !
3 files changed, 1 insertion(+), 2 deletions(-)

 define _gnu_source for all posix target source files

Disable strict aliasing to avoid triggering aliasing.patch | (download)

Makefile | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 disable strict-aliasing to avoid triggering aliasing problems


Fix dead links in documentation.patch | (download)

CHANGELOG | 2 1 + 1 - 0 !
INSTALL | 16 8 + 8 - 0 !
man/batmand.8 | 2 1 + 1 - 0 !
3 files changed, 10 insertions(+), 10 deletions(-)

 fix dead links in documentation


Fix E Mail address as requested by Andreas Langer.patch | (download)

THANKS | 10 5 + 5 - 0 !
linux/modules/gateway.h | 2 1 + 1 - 0 !
linux/modules/gateway24.h | 2 1 + 1 - 0 !
linux/modules/mod_batman.c | 2 1 + 1 - 0 !
man/batmand.8 | 2 1 + 1 - 0 !
5 files changed, 9 insertions(+), 9 deletions(-)

 fix e-mail address as requested by andreas langer


Allow one to disable forking to background in debug_.patch | (download)

posix/init.c | 19 14 + 5 - 0 !
1 file changed, 14 insertions(+), 5 deletions(-)

 allow one to disable forking to background in debug_mode 0


Add compiler flags to the linker flags.patch | (download)

Makefile | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 add compiler flags to the linker flags

Don t execute unchecked binaries.patch | (download)

posix/init.c | 3 2 + 1 - 0 !
posix/posix.c | 3 2 + 1 - 0 !
posix/unix_socket.c | 3 2 + 1 - 0 !
3 files changed, 6 insertions(+), 3 deletions(-)

 don't execute unchecked binaries

It is not necessary to call an external binary to clear the screen of a
default unix terminal emulator. The external call using system("clear") may be
used by an attacker to get untrusted code called with an higher privilege
because batmand has to be run using uid 0.

Use memleak error path free implementation of hash_r.patch | (download)

hash.c | 73 44 + 29 - 0 !
1 file changed, 44 insertions(+), 29 deletions(-)

 use memleak/error path free implementation of hash_resize

The current implementation of hash_resize uses hash_add directly to initialize
a new hash table. But hash_add has two possible situations when it returns an
error and hash_resize would leak the data:

 * data already exists
 * malloc fails

The check for the duplicated data is not really harmful (beside increasing the
time to re-add elements) but the malloc can potentially return an error. This
malloc is unnecessary and just takes extra time. Instead the bucket from the
old hash table can be re-used.

Fix bitarray 1 bit shift type.patch | (download)

bitarray.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 fix bitarray 1 bit shift type

The default type of an integer constant is int. This reduced the possible bits
for a shift to 32. But the size of uintmax_t is most likely larger (64 bit).
Thus the upper 32 bit cannot be accessed correctly with this bitarray
implementation.

Free socket when setsockopt failed.patch | (download)

posix/tunnel.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 free socket when setsockopt failed

client_to_gw_tun calls setsockopt which can fail. In this case it jumps to the
error handling and cleanup code but doesn't close the udp_sock. This has to be
done to avoid leaking of file descriptors.

Don t try to schedule_own_packet with no if_incoming.patch | (download)

schedule.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 don't try to schedule_own_packet with no if_incoming

send_outstanding_packets checks if a forw_node has a correct if_incoming.
Otherwise it jumps to packet_free to deallocate the packet infrastructure. But
this also schedules packets with the batman interfaces as target incoming_if.
This is known to be NULL but is dereferenced in schedule_own_packet.

This NULL dereference should be avoided.

Don t dereference orig_node before checking for NULL.patch | (download)

batman.c | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 don't dereference orig_node before checking for null

The update_route functions first stores the orig_node->router in an extra
variable and later checks if orig_node is NULL. This is not only a potential
cause of a crash but can also cause new compilers to drop the NULL check
completely [1].

[1] https://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Optimize-Options.html#index-fdelete_002dnull_002dpointer_002dchecks-399