bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNU tar 1.28] testsuite: 5 6 7 8 9 12 15 20 33 40 41 42 47 57 60 63


From: Christian Schoenebeck
Subject: Re: [GNU tar 1.28] testsuite: 5 6 7 8 9 12 15 20 33 40 41 42 47 57 60 63 64 65 66 68 71 73 75 76 85 87 89 90 94 failed
Date: Sun, 09 Oct 2022 15:23:14 +0200

On Sonntag, 9. Oktober 2022 00:47:41 CEST Paul Eggert wrote:
> Looks like you're using a shell that invokes 'tar' and passes the
> fully-qualified file name as argv[0]. You might try using a shell that
> doesn't do that; 'tar' (and most other programs) expect $0 to be the
> name used to invoke the program.

I just had a glimpse at this, but yeah, seems Paul is right.

The test (e.g. tests/opcomp01.at) fails because it compares the actually
generated error message *exactly* with the expected error message, i.e.:

Expected error message:

tar: '--occurrence' cannot be used with '-c'
Try 'tar --help' or 'tar --usage' for more information.

Actual error message:

/home/arthur/cpu2017/tools/src/tar-1.28/src/tar: '--occurrence' cannot be used 
with '-c'
Try '/home/arthur/cpu2017/tools/src/tar-1.28/src/tar --help' or 
'/home/arthur/cpu2017/tools/src/tar-1.28/src/tar --usage' for more information.

So Paul's point was argv[0] should not be the fully qualified path to the
`tar` binary. POSIX says [1]:

"The argument arg0 should point to a filename string that is associated with
the process being started by one of the exec functions."

And defines "Filename" as [2]:

"A sequence of bytes consisting of 1 to {NAME_MAX} bytes used to name a file.
The bytes composing the name shall not contain the <NUL> or <slash>
characters."

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html

The shell used seems to be Bash AFAICS. You might want to check why it doesn't
strip away all path components.

Best regards,
Christian Schoenebeck





reply via email to

[Prev in Thread] Current Thread [Next in Thread]