Re: [PATCH v4 2/2] interpret-trailers: add option for in-place editing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 19, 2016 at 12:56 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Tue, Jan 19, 2016 at 12:52 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:
>>> I think POSIXPERM is all you need for this case; SANITY doesn't buy
>>> you anything, if I understand correctly.
>>>
>>>>> +     cat basic_message >message &&
>>>>> +     chmod -r message &&
>>>>> +     test_must_fail git interpret-trailers --trailer "Reviewed-by: Alice" --in-place message &&
>>
>> The purpose of "chmod -r message" is to force interpret-trailers to
>> fail due to its input being unreadable; without SANITY, i.e. running
>> this test as root, the command would happily read from message that
>> is marked as unreadable by anybody, and test_must_fail will not pass.
>
> Makes sense. I never run tests as root, thus wasn't thinking along those lines.

On reflection, this doesn't make sense to me. Perhaps I'm missing
something obvious.

My understanding is that SANITY is an expectation that directory
permissions work in an expected POSIXy way: that is, a file can't be
deleted when its containing directory lacks 'write', and a file can't
be read/accessed when the directory has neither 'read' nor 'execute'.
This doesn't say anything about root not being allowed to read a file
when the file itself lacks 'read'.

As far as I can tell, as coded, this test will *always* fail as root
since root will always be able to read 'message'.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]