[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xmqqd25waqf9.fsf@gitster.dls.corp.google.com>
Date: Fri, 30 Jan 2015 13:50:50 -0800
From: Junio C Hamano <gitster@...ox.com>
To: Jeff King <peff@...f.net>
Cc: Git Mailing List <git@...r.kernel.org>,
Josh Boyer <jwboyer@...oraproject.org>,
"Linux-Kernel\@Vger. Kernel. Org" <linux-kernel@...r.kernel.org>,
twaugh@...hat.com, Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] apply: refuse touching a file beyond symlink
Jeff King <peff@...f.net> writes:
> But could we instead pull this check to just before the write-out time?
> That is, to let any horrible thing happen in-core, as long as what we
> write out to the index and the filesystem is sane?
The check in-core is somewhat tricky, because we would need to (1)
catch a patch that creates a symlink and also a file as if that new
symlink is a directory and (2) allow a patch that removes a symlink
and also a file in a new directory at the location removed symlink
used to occupy.
For (1) we need to see if there is a patch in the entire input that
creates a symbolic link and reject the input. For (2) we need to
see if there is a patch that removes the symbolic link. (1) cannot
be caught with the approach based on fn_table[], which is inherently
meant to help incremental application, that is oblivious to a path
that will materialize after applying a later patch in the input.
Let me think about it a bit more. The fix probably needs to abandon
depending on fn_table[] stuff, if we want to do in the "sanity check
the input and compute the final state all in-core" route.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists