On 02/01/2018 14:32, Pádraig Brady wrote:
On 02/01/18 10:40, Michael wrote:
* FAIL: tests/cp/preserve-mode
Details:
I assume this is what 'fails'
++ cut -b-10
+ test drwxr-sr-x = drwxr-xr-x
+ fail=1
This test was present but ineffective in previous releases.
It's indicating a disparity in the setgid bit
which is propagated with mkdir, but not cp --no-preserve=mode.
A quick test on ext4 on linux here shows that cp does propagate
the setgid bit, so I'd need to dig more to find the disparity.
cp uses the gnulib set_acl() functionality here,
and there are AIX specific code paths there,
so I presume this is what clears the setgid bit erroneously.
cheers,
Pádraig
An example - and actually, what I would expect if I am saving to 'not
preserve' file mode.
root@x072:[/home/prj/gnu]cp --no-preserve=mode *29 x1
cp: -r not specified; omitting directory 'coreutils-8.29'
root@x072:[/home/prj/gnu]cp -r --no-preserve=mode *29 x1
[1] + Stopped (SIGTSTP) cp -r --no-preserve=mode *29 x1
root@x072:[/home/prj/gnu]bg
[1] cp -r --no-preserve=mode *29 x1&
root@x072:[/home/prj/gnu]ls -l
total 8
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 coreutils-8.29
drwxr-xr-x 11 root system 4096 Jan 2 15:04 x1
This behavior is the same as AIX default behavior
root@x072:[/home/prj/gnu]/usr/bin/cp -r *29 x2 &
[1] 11141360
root@x072:[/home/prj/gnu]ls -l
total 12
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 coreutils-8.29
drwxr-xr-x 14 root system 4096 Jan 2 15:04 x1
drwxr-xr-x 8 root system 4096 Jan 2 15:07 x2
* However, this last behavior is very different from the AIX behavior
Coreutils cp -rp ...
root@x072:[/home/prj/gnu]/opt/bin/cp -rp *29 x3 &
[2] 14352582
[1] - Done /usr/bin/cp -r *29 x2 &
root@x072:[/home/prj/gnu]ls -l
total 16
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 coreutils-8.29
drwxr-xr-x 14 root system 4096 Jan 2 15:04 x1
drwxr-sr-x 14 root system 4096 Jan 2 15:07 x2
drwx------ 6 root system 4096 Jan 2 15:08 x3
root@x072:[/home/prj/gnu]umask
022
*** Actually, I see I need to wait - in both cases - for cp to finish,
before comparing source and target.
root@x072:[/home/prj/gnu]ls -l
total 20
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 coreutils-8.29
drwxr-xr-x 14 root system 4096 Jan 2 15:04 x1
drwxr-sr-x 14 root system 4096 Jan 2 15:07 x2
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 x3
drwxrwxr-x 13 root system 4096 Jan 2 15:10 x4
root@x072:[/home/prj/gnu]wait
ls -l
[1] + Done /usr/bin/cp -rp *29 x4 &
root@x072:[/home/prj/gnu]ls -l
total 20
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 coreutils-8.29
drwxr-xr-x 14 root system 4096 Jan 2 15:04 x1
drwxr-sr-x 14 root system 4096 Jan 2 15:07 x2
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 x3
drwxrwsr-x 14 199 1954 4096 Jan 2 12:28 x4