[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] kill: fix signal number to name lookup on AIX
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] kill: fix signal number to name lookup on AIX |
Date: |
Fri, 4 Aug 2017 00:38:44 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 27/07/17 10:10, Michael Felt wrote:
> On 27/07/2017 10:22, Michael Felt wrote:
>> Hint: I expect the issue here is that the ln is done on a NFS server
>> rather than "local" filesystem.
>>
>> Also, not run (here) as root, so those tests were skipped here.
>>
>> ========================================================
>> GNU coreutils 8.27.4-3c9d7: ./tests/test-suite.log
>> ========================================================
>>
>> # TOTAL: 592
>> # PASS: 414
>> # SKIP: 177
>> # XFAIL: 0
>> # FAIL: 1
>> # XPASS: 0
>> # ERROR: 0
>>
>> from ./tests/test-suite.log
>>
>> FAIL: tests/ln/sf-1
>> ===================
>
> Ok, it looks like the test above above succeeds when on jfs2.
The attached patches should address the above and all previous issues you
mentioned.
I've made a dist tarball for test available at:
https://www.pixelbeat.org/cu/coreutils-8.27.70-bfe8dc.tar.xz
Re the following discussion of cp, I couldn't follow it exactly.
Which test failed for you?
Are you saying that you would expect `cp -p` to not
preserve set[ug]id bits when not copying your own files?
I wouldn't expect that and I also see this comment in copy.c:
/* POSIX says that 'cp -p' must restore the following:
- permission bits
- setuid, setgid bits
- owner and group
If it fails to restore any of those, we may give a warning but
the destination must not be removed.
cheers,
Pádraig.
> Running as root - a test previously skipped now fails. And it is a real
> bug, it seems, as the AIX cp command (/usr/bin/cp) works as expected.
>
> Look at the commands used to create the c4 and c8 files (the directory
> was given mode 777 to permit the writing regardless of userid.
>
>
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]touch c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chmod a=r,ug+sx c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su
> root's Password:
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]cp -p c c1
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir
> --user=nobody src/cp -p c c2
> chroot: option --skip-chdir only permitted if NEWROOT is old '/'
> Try 'chroot --help' for more information.
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir
> --user=nobody / src/cp -p c c2
> cp: cannot create regular file 'c2': Permission denied
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c??
> ls: cannot access 'c??': No such file or directory
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chmod 777 .
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]chroot --skip-chdir
> --user=nobody / src/cp -p c c2
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su nobody -c src/cp
> -p c c3
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c3
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]su nobody -c
> /usr/bin/cp -p c c4
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody felt 0 Jul 27 16:53 c4
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]
>
> Here I exit from SU mode.
>
> As the file c is owned by michael - not surprising that c5 has
> permission bits. But c2 is owned by nobody, and I would not expect those
> special bits to copy as michael
>
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]id
> uid=199(michael) gid=1954(felt)
> groups=1954(felt),1(staff),33(httpd),208(xdata)
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]cp -p c c5
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c c6
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c2 c6
> cp: cannot create regular file 'c6': Permission denied
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]src/cp -p c2 c7
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c7
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]/usr/bin/cp -p c2 c8
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]ls -l c c?
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c1
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c2
> -r-sr-sr-- 1 nobody felt 0 Jul 27 16:53 c3
> -r-xr-xr-- 1 nobody felt 0 Jul 27 16:53 c4
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c5
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c6
> -r-sr-sr-- 1 michael felt 0 Jul 27 16:53 c7
> -r-xr-xr-- 1 michael felt 0 Jul 27 16:53 c8
> michael@x071:[/home/michael/coreutils-8.27.4-3c9d7]
>
> So, it seems that src/cp is still copying the file mode, regardless.
aix.patches
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] kill: fix signal number to name lookup on AIX,
Pádraig Brady <=