[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] Regression in symbolic link handling

From: Jean Delvare
Subject: [bug-patch] Regression in symbolic link handling
Date: Wed, 18 Feb 2015 11:58:22 +0100

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 <address@hidden>
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 @@
$ 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 <address@hidden>
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?

Jean Delvare
SUSE L3 Support

reply via email to

[Prev in Thread] Current Thread [Next in Thread]