Subject: bug#17774: AIX and lbracket ([) program - will not install on AIX using installp

From: Michael Felt <[email-masked]>
Date: Tue, 17 Jun 2014 22:50:26 +0200

FYI: the program runs fine, and even from the command line (the extra ] at
the end must satisify the ksh syntax checking).

Note: the 8.15 one is "suppossed" to fail, because I packaged that on AIX
6.1 - and then it does not work on AIX 5.3.

root@x093:[/data/prj/gnu/coreutils]find . -name ? -ls
85925819    4 drwxrwxr-x  7 michael   1954         4096 Dec 16  2013 .
85988590  126 -rwxr-xr-x  1 root      system      128624 Jun 13 13:52
./coreutils-8.20/src/[
85986625  130 -rwxrwxr--  1 michael   1954       132118 Nov  3  2012
./coreutils-8.17/src/[
85932793  111 -rwxrwxr--  1 michael   1954       113168 Nov  3  2012
./coreutils-8.15/src/[
143394625    4 drwxr-xr-x  2 root      system        4096 Jun 13 14:08
./coreutils-8.15/build/aix/x
120261651  127 -rwxr-xr-x  1 root      system      129823 Jun 13 13:15
./coreutils-8.22/src/[
root@x093:[/data/prj/gnu/coreutils]./coreutils-8.15/src/[ -d / ]
Segmentation fault(coredump)
root@x093:[/data/prj/gnu/coreutils]./coreutils-8.17/src/[ -d / ]
root@x093:[/data/prj/gnu/coreutils]echo $?
0
root@x093:[/data/prj/gnu/coreutils]./coreutils-8.20/src/[ -d / ]
root@x093:[/data/prj/gnu/coreutils]echo $?
0

On an AIX 6.1 system they all work.

root@x094:[/data/prj/gnu/coreutils]find . -name ?
.
./coreutils-8.20/src/[
./coreutils-8.17/src/[
./coreutils-8.15/src/[
./coreutils-8.15/build/aix/x
./coreutils-8.22/src/[
root@x094:[/data/prj/gnu/coreutils]./coreutils-8.22/src/[ -d / ]
root@x094:[/data/prj/gnu/coreutils]./coreutils-8.22/src/[ -d / ]; echo $?
0
root@x094:[/data/prj/gnu/coreutils]./coreutils-8.20/src/[ -d / ]; echo $?
0
root@x094:[/data/prj/gnu/coreutils]./coreutils-8.17/src/[ -d / ]; echo $?
0
root@x094:[/data/prj/gnu/coreutils]./coreutils-8.15/src/[ -d / ]; echo $?
0

So, I am thinking, when I did 8.15 way back when, I must have customized it
to not include "lbracket" in the package - as, obviously, it was built.

p.s. - I did not try your t.c program, but I expect it to work fine.

On Sat, Jun 14, 2014 at 6:08 PM, Michael Felt <[email-masked]> wrote:

> I believe IBMis usually quite commited to being inline with published and
> accepted standards. However, this is a standard with 2008 in it's name, and
> AIX 5.3 is from 2004, and the TL/SP level I am compiling on, for backwards
> compatibility is dated 2007 - so hard to complain that it is not up to a
> 2008 standard - although I expect the program you sent will compile and
> execute.
>
> It is the installp installer that has issues because it uses the []
> characters for special purposes.
>
> Maybe I can find a way/modification to the mkinstallp program so that
> installp will accept the input.
>
> And yes, deleting/not including it is probably the simplest solution.
>
>
> On Fri, Jun 13, 2014 at 5:09 PM, Paul Eggert <[email-masked]> wrote:
>
>> Michael Felt wrote:
>>
>>> But to have a name like that, I must be too old fashioned -
>>> where is the win?
>>>
>>
>> It's so that execlp ("FOO") acts like the shell command FOO, or, more
>> precisely, so that the attached C program works like '[ -d / ]' at the
>> shell level.  POSIX requires that all standard utilities (except for a very
>> short list) must work the same way from a C program as from the shell.  See
>> the last sentence of:
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/
>> utilities/V3_chap01.html#tag_17_06
>>
>> '[' is not on the list of exceptions, so coreutils arranges for it to be
>> an executable, as POSIX requires.
>>
>>
>>  AIX does not
>>> permit files in an installp package are refused when they include certain
>>> special characters
>>>
>>
>> It may be simpler to just omit '[' from your installp package (I assume
>> that's some downstream thing).  I doubt whether anybody but POSIX nerds
>> will care.  AIX itself doesn't seem to be POSIX-conforming here, as the
>> attached C program fails on AIX.  (If *you* are a POSIX nerd please feel
>> free to file a bug report with IBM....)
>>
>
>