Bug 976

Summary: Build of 1.9.7 fails with all supported FreeBSD versions
Product: Sudo Reporter: Yasuhiro Kimura <yasu>
Component: ConfigureAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.9.7   
Hardware: PC   
OS: FreeBSD   

Description Yasuhiro Kimura 2021-05-12 07:19:34 MDT
I tried build of 1.9.7 on FreeBSD but it fails as following.

----------------------------------------------------------------------
/bin/sh ../../libtool --tag=disable-static --mode=link cc -o libsudo_fuzzstub.la fuzzstub.lo 
libtool: link: ar cru .libs/libsudo_fuzzstub.a .libs/fuzzstub.o 
libtool: link: ranlib .libs/libsudo_fuzzstub.a
libtool: link: ( cd ".libs" && rm -f "libsudo_fuzzstub.la" && ln -s "../libsudo_fuzzstub.la" "libsudo_fuzzstub.la" )
/bin/sh ../../libtool --tag=disable-static --mode=compile cc -c -o host_port.lo -I../../include -I../.. -I. -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden   -fstack-protector-strong ./host_port.c
libtool: compile:  cc -c -I../../include -I../.. -I. -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden -fstack-protector-strong ./host_port.c  -fPIC -DPIC -o .libs/host_port.o
/bin/sh ../../libtool --tag=disable-static --mode=compile cc -c -o hostcheck.lo -I../../include -I../.. -I. -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden   -fstack-protector-strong ./hostcheck.c
libtool: compile:  cc -c -I../../include -I../.. -I. -DZLIB_CONST -D_FORTIFY_SOURCE=2 -g -O2 -fvisibility=hidden -fstack-protector-strong ./hostcheck.c  -fPIC -DPIC -o .libs/hostcheck.o
./hostcheck.c:75:26: error: incomplete definition of type 'struct sockaddr_in'
            addr = &(ipv4->sin_addr);
                     ~~~~^
./hostcheck.c:54:12: note: forward declaration of 'struct sockaddr_in'
    struct sockaddr_in *ipv4;
           ^
./hostcheck.c:79:26: error: incomplete definition of type 'struct sockaddr_in6'
            addr = &(ipv6->sin6_addr);
                     ~~~~^
./hostcheck.c:56:12: note: forward declaration of 'struct sockaddr_in6'
    struct sockaddr_in6 *ipv6;
           ^
2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /usr0/tmp/sudo-1.9.7/lib/iolog
*** Error code 1

Stop.
make: stopped in /usr0/tmp/sudo-1.9.7
----------------------------------------------------------------------

it happens with all supported FreeBSD versions (i.e. 11.4-RELEASE, 12.2-RELEASE and 13.0-RELEASE)

I tried bisect with sudo-1.9 branch of git repository. According to it build fails with following commit or later.

----------------------------------------------------------------------
commit 28d41ceca
Author: Todd C. Miller <Todd.Miller@sudo.ws>
Date:   Tue Apr 13 05:10:49 2021

    Enable the use of OpenSSL if log client/server not disabled.
    This adds a dependency on OpenSSL unless it is explicitly disabled
    (--disable-openssl) or the sudo log client and server are disabled
    (--disable-log-client and --disable-log-server).
----------------------------------------------------------------------

If I execute configure script with --disable-openssl build completes successfully.
Comment 1 Todd C. Miller 2021-05-12 07:29:53 MDT
Fixed by https://www.sudo.ws/repos/sudo/rev/2277c8f37c34
Comment 2 Yasuhiro Kimura 2021-05-12 07:45:19 MDT
(In reply to Todd C. Miller from comment #1)
> Fixed by https://www.sudo.ws/repos/sudo/rev/2277c8f37c34

I cherry-pick this commit to sudo-1.9 branch and confirmed build succeeds without --disable-openssl option. 
Thank you for quick fix.
Comment 3 Todd C. Miller 2021-09-13 10:30:22 MDT
Fixed in sudo 1.9.8