Bug 730

Summary: sudo 1.8.15 - make fails on AIX61 TL9 SP6
Product: Sudo Reporter: takae harrington <tharrin>
Component: ConfigureAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.15   
Hardware: IBM   
OS: AIX   
Attachments: config.log

Description takae harrington 2015-12-08 12:48:47 MST
sudo 1.8.15 - make fails on AIX61 TL9 SP6 with following error - Please help.  Thank you.

        /bin/sh ../libtool --tag=disable-static --mode=link gcc -std=gnu99 -o sudo conversation.o env_hooks.o exec.o exec_common.o exec_pty.o  get_pty.o hooks.o net_ifs.o load_plugins.o parse_args.o  preserve_fds.o signal.o sudo.o sudo_edit.o tgetpass.o ttyname.o  utmp.o  -Wl,-brtl    ../lib/util/libsudo_util.la
libtool: link: gcc -std=gnu99 -o .libs/sudo conversation.o env_hooks.o exec.o exec_common.o exec_pty.o get_pty.o hooks.o net_ifs.o load_plugins.o parse_args.o preserve_fds.o signal.o sudo.o sudo_edit.o tgetpass.o ttyname.o utmp.o -Wl,-brtl  -L../lib/util/.libs -lsudo_util -Wl,-blibpath:/opt/freeware/libexec/sudo:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/../../..:/usr/lib:/lib
        /bin/sh ../libtool --tag=disable-static --mode=compile gcc -std=gnu99 -c -I../include -I.. -I. -I. -I..  -DLOCALEDIR=\"/opt/freeware/share/locale\"  -g -O2   ./sudo_noexec.c
libtool: compile:  gcc -std=gnu99 -c -I../include -I.. -I. -I. -I.. -DLOCALEDIR=\"/opt/freeware/share/locale\" -g -O2 ./sudo_noexec.c  -fPIC -DPIC -o .libs/sudo_noexec.o
./sudo_noexec.c:125: warning: type defaults to 'int' in declaration of 'posix_spawn_file_actions_t'
./sudo_noexec.c:125: error: expected ';', ',' or ')' before '*' token
./sudo_noexec.c:128: warning: type defaults to 'int' in declaration of 'posix_spawn_file_actions_t'
./sudo_noexec.c:128: error: expected ';', ',' or ')' before '*' token
make: The error code from the last command is 1.


Stop.
make: The error code from the last command is 2.


Stop.
Comment 1 Todd C. Miller 2015-12-08 14:21:49 MST
I just did a test build of sudo 1.8.15 on an AIX 6.1 machine using gcc 4.2.0 and it built successfully.  The definition for posix_spawn_file_actions_t should be in /usr/include/spawn.h.  I'm not sure why you would get that error unless configure was unable to find spawn.h.

Can you trying running "grep SPAWN config.h"?  Here's what I expect to see:

$ grep SPAWN config.h
#define HAVE_POSIX_SPAWN 1
#define HAVE_POSIX_SPAWNP 1
#define HAVE_SPAWN_H 1
Comment 2 takae harrington 2015-12-11 08:02:36 MST
Here is the output:
[server:/staging/sudo-1.8.15]grep SPAWN config.h
#define HAVE_POSIX_SPAWN 1
#define HAVE_POSIX_SPAWNP 1
/* #undef HAVE_SPAWN_H */
[server:/staging/sudo-1.8.15]grep posix_spawn_file_actions_t /usr/include/spawn.h
typedef char *posix_spawn_file_actions_t;
int posix_spawn_file_actions_init(posix_spawn_file_actions_t *);
int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *);
int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int);
int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int,int);
int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *__restrict__,
                const posix_spawn_file_actions_t *,
                 const posix_spawn_file_actions_t *,
[server:/staging/sudo-1.8.15]oslevel -s
6100-09-06-1543
[vq2ua612:/staging/sudo-1.8.15]

Thank you for your help!
Comment 3 Todd C. Miller 2016-02-24 15:52:44 MST
Sorry that I missed this earlier but the problem appears to be that configure didn't think you have a working spawn.h header.  The config.log file may provide clues as to what is wrong.
Comment 4 Todd C. Miller 2016-02-24 16:03:35 MST
For sudo 1.8.16 I've changed configure to avoid using posix_spawn if the spawn.h header is missing or not usable.
Comment 5 takae harrington 2016-02-25 13:29:47 MST
I used sudo-1.8.16b1 today to compile, but got the same error

        /bin/sh ../libtool --tag=disable-static --mode=link gcc -std=gnu99 -o sudo conversation.o env_hooks.o exec.o exec_common.o exec_pty.o  get_pty.o hooks.o net_ifs.o load_plugins.o parse_args.o  preserve_fds.o signal.o sudo.o sudo_edit.o tgetpass.o ttyname.o  utmp.o  -Wl,-brtl    ../lib/util/libsudo_util.la
libtool: link: gcc -std=gnu99 -o .libs/sudo conversation.o env_hooks.o exec.o exec_common.o exec_pty.o get_pty.o hooks.o net_ifs.o load_plugins.o parse_args.o preserve_fds.o signal.o sudo.o sudo_edit.o tgetpass.o ttyname.o utmp.o -Wl,-brtl  -L../lib/util/.libs -lsudo_util -Wl,-blibpath:/opt/freeware/libexec/sudo:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.4/../../..:/usr/lib:/lib
        /bin/sh ../libtool --tag=disable-static --mode=compile gcc -std=gnu99 -c -I../include -I.. -I. -I. -I..  -D_PATH_SUDO_CONF=\"/etc/sudo.conf\"  -DLOCALEDIR=\"/opt/freeware/share/locale\"  -g -O2   ./sudo_noexec.c
libtool: compile:  gcc -std=gnu99 -c -I../include -I.. -I. -I. -I.. -D_PATH_SUDO_CONF=\"/etc/sudo.conf\" -DLOCALEDIR=\"/opt/freeware/share/locale\" -g -O2 ./sudo_noexec.c  -fPIC -DPIC -o .libs/sudo_noexec.o
./sudo_noexec.c:125: warning: type defaults to 'int' in declaration of 'posix_spawn_file_actions_t'
./sudo_noexec.c:125: error: expected ';', ',' or ')' before '*' token
./sudo_noexec.c:128: warning: type defaults to 'int' in declaration of 'posix_spawn_file_actions_t'
./sudo_noexec.c:128: error: expected ';', ',' or ')' before '*' token
make: The error code from the last command is 1.


Stop.
make: The error code from the last command is 2.


Stop.
[vq2ua613:/staging/sudo-1.8.16b1]ls -l
[vq2ua613:/staging/sudo-1.8.16b1]grep SPAWN config.h
#define HAVE_POSIX_SPAWN 1
#define HAVE_POSIX_SPAWNP 1
/* #undef HAVE_SPAWN_H */
[vq2ua613:/staging/sudo-1.8.16b1]oslevel -s
6100-09-06-1543

I attached config.log for your review -- Thank you!
Comment 6 takae harrington 2016-02-25 13:31:15 MST
Created attachment 469 [details]
config.log

attached config.log for your review -- thank you!
Comment 7 Todd C. Miller 2016-02-25 13:56:21 MST
The change in question is not in 1.8.16b1 but will be in 1.8.16b2.

configure gets the following when it tries to include spawn.h:

/usr/include/spawn.h:111: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:112: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:122: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:123: error: static or type qualifiers in abstract declarator

You appear to have a different spawn.h than what is on the AIX 6.1 and AIX 7.1 machine I tested on.  Mine is 96 lines and has the following version at the top of it:

bos53D src/bos/usr/include/spawn.h 1.2

Perhaps /usr/include/spawn.h on your machine has been updated by a service pack.
Comment 8 takae harrington 2016-02-25 14:06:22 MST
Oh ok - I will wait for 1.8.16b2. 

I just checked that AIX61 TL9 SP6 did update the file (126 lines) - see below

[vq2ua613:/staging/sudo-1.8.16b1]ls -l /usr/include/spawn.h
-r--r--r--    1 bin      bin            5332 Aug 28 2015  /usr/include/spawn.h

Tomorrow AIX71 TL3 SP6 is coming out, so I assume spawn.h will be updated as well.  I will wait for 1.8.16b2 to test on both side!  
Thank you for your help again!
Comment 9 Todd C. Miller 2016-02-29 16:03:23 MST
Sudo 1.8.16b2 is now available which includes the fix.
Comment 10 takae harrington 2016-03-03 10:20:50 MST
I tested and 1.8.16b2 compiled fine on aix61 tl9 SP6 and aix71 tl3 SP3.

Thank you so much!
Comment 11 takae harrington 2016-03-03 10:21:18 MST
i meant aix71 tl3 SP6!
Comment 12 Todd C. Miller 2016-03-17 10:19:08 MDT
Fixed in 1.8.16, available now.