From 60983cdfe689d904c95d974e6249a09ca9403183fb2a58da564a8170935b6a7c Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sun, 1 Jul 2012 19:46:59 +0000 Subject: [PATCH] Accepting request 126814 from home:coolo:branches:openSUSE:Factory - do not allow symlinks to point to itself (not existant as result) OBS-URL: https://build.opensuse.org/request/show/126814 OBS-URL: https://build.opensuse.org/package/show/Base:System/brp-check-suse?expand=0&rev=38 --- brp-check-suse.changes | 5 +++++ brp-check-suse.spec | 2 ++ check-broken-symlinks.diff | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 check-broken-symlinks.diff diff --git a/brp-check-suse.changes b/brp-check-suse.changes index 78cd0c5..e14ad49 100644 --- a/brp-check-suse.changes +++ b/brp-check-suse.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Jul 1 19:37:50 UTC 2012 - coolo@suse.com + +- do not allow symlinks to point to itself (not existant as result) + ------------------------------------------------------------------- Tue Mar 13 13:53:13 CET 2012 - ro@suse.de diff --git a/brp-check-suse.spec b/brp-check-suse.spec index 1cb1919..5435d62 100644 --- a/brp-check-suse.spec +++ b/brp-check-suse.spec @@ -33,6 +33,7 @@ Url: http://gitorious.org/opensuse/brp-check-suse/ # make package # Source0: %{name}-%{version}.tar.bz2 +Patch0: check-broken-symlinks.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %global provfind sh -c "grep -v 'brp-desktop.data' | %__find_provides" %global __find_provides %provfind @@ -47,6 +48,7 @@ build root checking or in parts implemeting SUSE policies. %ifnarch x86_64 s390x ppc64 rm brp-65-lib64-linux %endif +%patch0 -p1 %build # nothing to do diff --git a/check-broken-symlinks.diff b/check-broken-symlinks.diff new file mode 100644 index 0000000..8c35871 --- /dev/null +++ b/check-broken-symlinks.diff @@ -0,0 +1,16 @@ +Index: brp-check-suse-1.0/brp-25-symlink +=================================================================== +--- brp-check-suse-1.0.orig/brp-25-symlink 2012-03-13 13:52:11.000000000 +0100 ++++ brp-check-suse-1.0/brp-25-symlink 2012-07-01 21:37:11.698384089 +0200 +@@ -79,6 +79,11 @@ do + fi + done + ++ if test "$link" = "$link_dest"; then ++ echo "ERROR: $link points to itself (as $orig_link_dest)" ++ exit 1 ++ fi ++ + # black list + case "$link,$link_dest" in + *,/var/lib/named*)