[pacman-dev] makepkg: only strip files that are writable

Xavier Chantry chantry.xavier at gmail.com
Mon Mar 15 02:12:11 CET 2010


On Mon, Mar 15, 2010 at 2:06 AM, Allan McRae <allan at archlinux.org> wrote:
> On 15/03/10 10:54, Xavier Chantry wrote:
>>
>> On Mon, Mar 15, 2010 at 1:37 AM, Allan McRae<allan at archlinux.org>  wrote:
>>>
>>> On 15/03/10 09:36, Dan McGee wrote:
>>>>
>>>> commit a4e3fd18474186ac81acca91adecbb905aee3357
>>>> Author: Allan McRae<allan at archlinux.org>
>>>> Date:   Tue Jan 26 23:29:31 2010 +1000
>>>>
>>>>     makepkg: only strip files that are writable
>>>>
>>>>     TODO:
>>>>
>>>> http://mailman.archlinux.org/pipermail/pacman-dev/2010-January/010390.html
>>>>
>>>>     Signed-off-by: Allan McRae<allan at archlinux.org>
>>>>     Signed-off-by: Dan McGee<dan at archlinux.org>
>>>
>>> Hmmm.... that one was not quite finished yet which is why it was not on
>>> my
>>> working branch. (I put it on a wip = "work in progress" branch).
>>>
>>> Nevermind!  Apart from a strange commit message, it is still an
>>> improvement
>>> on the pre-patch state.  :P
>>>
>>>
>>>
>>
>> Looks like I never got to answer your mail.
>>
>> I wrote a stupid 10 lines bash program that tested every permission,
>> and it seemed that both r and w were needed for strip.
>> But IIRC, I did one test inside makepkg (so using fakeroot) and got
>> different results.
>> Actually I was probably so confused by the permissions I got in
>> package built by makepkg that I completely gave up.
>>
>> Now I remember why I did not answer, I have only new confusions to
>> bring...
>
> I had similar testing that was strange...  I really do not understand how
> you can strip a file without r+w permissions.  But my testing seemed to
> indicate that you can strip a -r+w file.  And you seem to be able to strip
> any file if you are root.  And yes, from memory, fakeroot appears to be
> somewhere in between.
>

What are we doing differently ?

[xavier at xps-m1530 ~]$ cp /bin/ls .
[xavier at xps-m1530 ~]$ chmod -u+w ls
[xavier at xps-m1530 ~]$ ls -l ls
--w------- 1 xavier users 102104 Mar 15 02:10 ls
[xavier at xps-m1530 ~]$ strip ls
strip:ls: Permission denied

> I think the current patch at least avoids any errors and the associated
> output during stripping files which is an improvement.  But I wonder if it
> should be more clever and change the permissions of files before striping to
> ensure all files get stripped and then revert afterwards.
>

That sounds a bit crazy but I don't know :) No strong opinion either way.


More information about the pacman-dev mailing list