lkml.org 
[lkml]   [2015]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] apply: refuse touching a file beyond symlink
Date
Jeff King <peff@peff.net> 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


\
 
 \ /
  Last update: 2015-01-30 21:21    [W:0.182 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site