From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763070AbbA3TsT (ORCPT ); Fri, 30 Jan 2015 14:48:19 -0500 Received: from pb-smtp1.int.icgroup.com ([208.72.237.35]:52906 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1763007AbbA3TsR (ORCPT ); Fri, 30 Jan 2015 14:48:17 -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=snrvxTCIL3mZzbMeUg1zqM5yLhCnUDSP J2wXyi4x/haWwWQCmeLXCYGMvTnLpkoGTSVu+wpXd3uTVHstd/3V0hLiUt4q5uU1 JtOoDbLXC5W6l11HsydYPCiMAv556S8UL5hX5QO9FKvZvCsoU5VmvF1be1zG4VXS xvDCpLNMDhk= 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:48:14 -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: EEDA81CC-A8B8-11E4-B76F-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: >> + 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? If it is not OK to > add across a symlink, why is it OK to delete? Hmph, adding if (patch->is_delete && path_is_beyond_symlink(patch->old_name)) return error(_("deleted file '%s' is beyond a symlink"), patch->old_name); seems to break t4114.11, which wants to apply this patch to a tree that does not have a symbolic link but a directory at 'foo/'. diff --git a/foo b/foo new file mode 120000 index 0000000..ba0e162 --- /dev/null +++ b/foo @@ -0,0 +1 @@ +bar \ No newline at end of file diff --git a/foo/baz b/foo/baz deleted file mode 100644 index 682c76b..0000000 --- a/foo/baz +++ /dev/null @@ -1 +0,0 @@ -if only I knew