Hi all,

A number of patches in openSUSE packages fail to apply with GNU patch
2.7.4 while they did apply fine with versions 2.7.3 and earlier. The
problem is when one of the path components of a file is a symbolic link
to a directory.

I bisected it to:

commit 71a3172c7ecb1fad7965843ba373e99a034ee1ce
Author: Andreas Gruenbacher <agr...@gnu.org>
Date:   Sat Jan 31 03:15:08 2015 +0100

    Use symlink-safe system call replacements

Here is a simple reproducer:

$ cat regression.patch
--- /dev/null
+++ dir/foo
@@ -0,0 +1 @@
+foo
$ mkdir dir-1
$ ln -s dir-1 dir
$ patch -p0 < regression.patch
Refusing to follow symbolic link dir

I also tested the latest version in git, it fails too but with a
different error message:

file dir is not a directory
1 out of 1 hunk ignored

The change occurred with:

commit 8d12036047eb6cba16d3ae3f6b43c789d8378462
Author: Andreas Gruenbacher <agr...@gnu.org>
Date:   Tue Feb 10 22:31:56 2015 +0100

    Fix symlinks test case on some architectures

I am sorry to bring this topic up again as I guess that you guys would
really like to get rid of it forever, but is there a chance to restore
support for legitimate use cases of symbolic links? As I understand it,
links pointing inside the working tree are OK and can be followed, only
links pointing outside the working directory should be considered
unsafe to follow, right?

Thanks,
-- 
Jean Delvare
SUSE L3 Support

Reply via email to