From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760508AbbA3Tmx (ORCPT ); Fri, 30 Jan 2015 14:42:53 -0500 Received: from pb-smtp1.int.icgroup.com ([208.72.237.35]:63627 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752555AbbA3Tmv (ORCPT ); Fri, 30 Jan 2015 14:42:51 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ZUaxTaMYRYz6w9XafeyKrJEGmV9tSE6U Pz/uTZMMFthphNwpn5VZfiPBvnXXRF2x7tsUegdXIYlKzeRZ9bIFvgJaz4tOINFr adT7Tr+/wh+EUbEV3z9U8wC2MXyTCnZBBkO4p6mr2WiZsUbjkuSv6X0anFBOId/y GP+sFIkyMUY= From: Junio C Hamano To: Jeff King Cc: Git Mailing List , Josh Boyer , "Linux-Kernel\@Vger. Kernel. Org" , twaugh@redhat.com, Linus Torvalds Subject: Re: [PATCH] apply: refuse touching a file beyond symlink References: <20150130181153.GA25513@peff.net> Date: Fri, 30 Jan 2015 11:42:49 -0800 In-Reply-To: <20150130181153.GA25513@peff.net> (Jeff King's message of "Fri, 30 Jan 2015 13:11:53 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 2CACFBB6-A8B8-11E4-9F12-7BA29F42C9D4-77302942!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jeff King writes: > On Thu, Jan 29, 2015 at 12:45:22PM -0800, Junio C Hamano wrote: > >> + if (!patch->is_delete && path_is_beyond_symlink(patch->new_name)) >> + return error(_("affected file '%s' is beyond a symbolic link"), >> + patch->new_name); > > Why does this not kick in when deleting a file? Half-written logic, forgotten to be revisited (i.e. "ok, anything that is not delete we can check new_name, so do that first, later we'd deal with deletion patch and I think the way to do so is by checking old_name, but let's make sure this case works first"). Thanks for catching.