Closed kongy closed 4 months ago
fwiw, it's only that test that fails (the two following ones are fine).
one oddity worth mentioning is that the default umask for root on Android is 0?
strace on the host, where the test passes:
openat(AT_FDCWD, "dir/file", O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0700) = 4
copy_file_range(3, NULL, 4, NULL, 6, 0) = 6
close(4) = 0
geteuid() = 73769
chmod("dir/file", 0755) = 0
strace on Android, where it fails:
openat(AT_FDCWD, "dir/file", O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0700) = 4
copy_file_range(3, NULL, 4, NULL, 6, 0) = 6
close(4) = 0
geteuid() = 0
fchownat(AT_FDCWD, "dir/file", 1000, 1000, AT_SYMLINK_NOFOLLOW) = 0
fchmodat(AT_FDCWD, "dir/file", 0100777) = 0
so a bit more printf() debugging, and it looks like in
if (!S_ISLNK(ala)) chmod(name, FLAG(p) ? ala : ala&0777&~toys.old_umask);
Android always has FLAG(p) set?
which looks like it's probably coming from tar_main()?
if (!geteuid()) toys.optflags |= FLAG_p;
(test patch sent to mailing list...)
When integrating e4a106afa0e93e04c5c73c422fe615c6f7bd96f0 to Android, the newly introduced tar honor umask test fails: