quadrantsec/sagan

Compilation Fails When Configuring without Normalization or JSON Output

wrharding opened this issue · 1 comments

I have been attempting to compile Sagan on an Alpine Linux container to realize container disk size improvements over Debian. However, I have run into an issue, outlined at wrharding/sagan-docker#1

My configure statement is like so:
./configure --disable-lognorm --disable-libfastjson

When attempting to run make in the outlined compilation steps, I run into the below error:

/sagan # make
make  all-recursive
make[1]: Entering directory '/sagan'
Making all in src
make[2]: Entering directory '/sagan/src'
gcc -DHAVE_CONFIG_H -I. -I..  -I..     -g -O2 -D__Linux__ -MT sagan-sagan.o -MD -MP -MF .deps/sagan-sagan.Tpo -c -o sagan-sagan.o `test -f 'sagan.c' || echo './'`sagan.c
In file included from sagan.c:98:
rules.h:293:29: error: 'MAX_JSON_DECODE_BASE64' undeclared here (not in a function)
  293 |     bool json_decode_base64[MAX_JSON_DECODE_BASE64];
      |                             ^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:801: sagan-sagan.o] Error 1
make[2]: Leaving directory '/sagan/src'
make[1]: *** [Makefile:392: all-recursive] Error 1
make[1]: Leaving directory '/sagan'
make: *** [Makefile:333: all] Error 2
/sagan #

I've observed the same issue on an Ubuntu 20.04 Desktop environment:

wharding@test:~/Projects/sagan$ make
make  all-recursive
make[1]: Entering directory '/home/wharding/Projects/sagan'
Making all in src
make[2]: Entering directory '/home/wharding/Projects/sagan/src'
gcc -DHAVE_CONFIG_H -I. -I..  -I..     -g -O2 -D__Linux__ -MT sagan-sagan.o -MD -MP -MF .deps/sagan-sagan.Tpo -c -o sagan-sagan.o `test -f 'sagan.c' || echo './'`sagan.c
In file included from sagan.c:95:
rules.h:293:29: error: ‘MAX_JSON_DECODE_BASE64’ undeclared here (not in a function)
  293 |     bool json_decode_base64[MAX_JSON_DECODE_BASE64];
      |                             ^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:800: sagan-sagan.o] Error 1
make[2]: Leaving directory '/home/wharding/Projects/sagan/src'
make[1]: *** [Makefile:390: all-recursive] Error 1
make[1]: Leaving directory '/home/wharding/Projects/sagan'
make: *** [Makefile:331: all] Error 2

Note, I am cloning from this repo with the latest files:
git clone https://github.com/quadrantsec/sagan.git