bstansell / conserver

Logged, multi-user access to device consoles
https://www.conserver.com/
BSD 3-Clause "New" or "Revised" License
130 stars 38 forks source link

Build fails with IPv6 support #74

Open clausecker opened 2 years ago

clausecker commented 2 years ago

When trying to build version 8.2.6 with IPv6 support, the build fails with an undefined symbol bindPort:

cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong -o conserver access.o client.o consent.o group.o main.o master.o  readcfg.o fallback.o cutil.o -lbsm -lutil -lcrypt  -lssl -lcrypto  -lwrap -lpam
ld: error: undefined symbol: bindPort
>>> referenced by readcfg.c
>>>               readcfg.o:(ReReadCfg)
>>> referenced by readcfg.c
>>>               readcfg.o:(ReReadCfg)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[3]: stopped in /usr/home/fuz.ports/comms/conserver-com/work/conserver-8.2.6/conserver

This appears to be because main.c doesn't define bindPort when IPv6 support is present, but the code to set the process title still requires the variable. I did not attempt a fix because the code is very convoluted and I don't want to break it.

There also seems to be a problem in another place where the code attempts to use config->primaryport in lieu of bindPort, but then fails to adjust the format string or to apply atoi:

cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -I.. -I.. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -c -o main.o main.c
main.c:1773:5: warning: format specifies type 'unsigned short' but the argument has type 'char *' [-Wformat]
                         config->primaryport,
                         ^~~~~~~~~~~~~~~~~~~
1 warning generated.

Please fix this, too.

bzfbd commented 2 years ago

Was this caused or fixed by https://github.com/bstansell/conserver/pull/66 ?