[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with fstatat on AIX 7.1
From: |
Paul Eggert |
Subject: |
Re: Problem with fstatat on AIX 7.1 |
Date: |
Wed, 31 Aug 2011 17:34:18 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110805 Thunderbird/3.1.12 |
On 08/31/11 07:06, Kevin Brott wrote:
> If we do not use fstatat then tar builds and passes almost all of the checks
> (only the two sparse file ones fail).
> If we use fstatat, then almost all of the checks fail - because the resulting
> binary is dropping zero-byte files into the archives, and doesn't function.
>
> So either there is a bug or enough of a fundamental difference in the way AIX
> 7.1's new fstatat call works, that it's not usable with the way the existing
> GNU tar code is trying to use it.
It semmed pretty clear there is a bug there.
Unfortunately, the test program does not seem to expose the bug.
How about this test program instead? Please run it in a directory
where conftest.file has been created via "echo xxx >conftest.file".
If this test program works on AIX 7.1, can you modify it in a minor
way so that it correctly exposes the AIX bug? There must be some
way to do it, since 'tar' is doing it.
#include <fcntl.h>
#include <sys/stat.h>
int
main (void)
{
struct stat a;
struct stat b;
int fd = open (".", O_RDONLY);
if (fd < 0)
return 10;
if (fstatat (fd, "conftest.file", &a,
AT_SYMLINK_NOFOLLOW)
!= 0)
return 1;
if (lstat ("conftest.file", &b) != 0)
return 2;
if (a.st_size != b.st_size) return 3;
if (a.st_dev != b.st_dev) return 4;
if (a.st_ino != b.st_ino) return 5;
if (a.st_mode != b.st_mode) return 6;
if (a.st_nlink != b.st_nlink) return 7;
if (a.st_uid != b.st_uid) return 8;
if (a.st_gid != b.st_gid) return 9;
/* Don't check time members, to avoid caching issues. */
return 0;
}