pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[.joined/pkgsrc/trunk]: .joined/pkgsrc/emulators/compat_netbsd Don't just rem...
details: https://anonhg.NetBSD.org/.joined/pkgsrc/rev/4be46e42c87c
branches: trunk
changeset: 370963:4be46e42c87c
user: he <he%pkgsrc.org@localhost>
date: Sun Jan 02 16:15:55 2022 +0000
description:
Don't just remove a symlink on removal, ensure that it points
to an expected name before doing so. Should prevent removal of
required symlinks which might otherwise happen when this package
by accident is instsalled and subsequently de-installed on
9.0 - 9.2 or other netbsd-9 variants.
Parts of fix for PR#56597.
diffstat:
emulators/compat_netbsd/INSTALL.ELF | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r bf3079293370 -r 4be46e42c87c emulators/compat_netbsd/INSTALL.ELF
--- a/emulators/compat_netbsd/INSTALL.ELF Sun Jan 02 16:14:39 2022 +0000
+++ b/emulators/compat_netbsd/INSTALL.ELF Sun Jan 02 16:15:55 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL.ELF,v 1.2 2013/02/17 10:34:31 spz Exp $
+# $NetBSD: INSTALL.ELF,v 1.3 2022/01/02 16:15:55 he Exp $
# Generate a +ROOT_ACTIONS script that runs certain actions that require
# superuser privileges.
@@ -83,8 +83,15 @@
esac
if ${TEST} -h "$dst"; then
- ${ECHO} "${PKGNAME}: removing $dst"
- ${RM} -f "$dst"
+ lsrc=$(readlink $dst)
+ if [ "$lsrc" = ${PKG_PREFIX}/$src -o \
+ "$lsrc" = $src ]
+ then
+ ${ECHO} "${PKGNAME}: removing $dst"
+ ${RM} -f "$dst"
+ else
+ ${ECHO} "${PKGNAME}: mismatched symlink, skipping removal of $dst"
+ fi
fi
done
${RM} -f ${ROOT_ACTIONS_COOKIE}
Home |
Main Index |
Thread Index |
Old Index