Update of /home/halls/cvs/debian-openoffice/oo-debian-files/bin
In directory gluck:/tmp/cvs-serv20613/bin

Modified Files:
        openoffice 
Log Message:
* When upgrading from an earlier version, remove old
  symlink in work or user/work before starting setup.  Setup
  follows these links and deletes files even in the link points
  to $HOME !!  Thanks to Marc Horowitz for finding this and
  writing such a careful bug report (Closes: #245561)
* Urgency medium because bug can cause loss of data
* Version 1.1.1-2+2


Index: openoffice
===================================================================
RCS file: /home/halls/cvs/debian-openoffice/oo-debian-files/bin/openoffice,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- openoffice  16 Apr 2004 21:51:37 -0000      1.26
+++ openoffice  28 Apr 2004 20:59:45 -0000      1.27
@@ -157,6 +157,22 @@
   return 0
 }
 
+# clean dangerous symlinks, taken from ooo-wrapper
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245561
+clean_symlinks()
+{
+  for L in work user/work; do
+    if [ -L "$oldhome/$L" ]; then
+      if ! rm "$oldhome/$L"; then
+       echo "openoffice.org:  You have a dangerous link in $oldhome/$L, 
aborting install" >&2
+       echo "Please remove this file and try again." >&2
+       exit 1
+      fi
+    fi
+  done
+
+}
+
 ## OOo does not start if /proc is not mounted, so check for it
 if [ ! -f /proc/version ]; then
   echo "openoffice.org:  You must have a working /proc filesystem to use 
openoffice." >&2
@@ -234,6 +250,7 @@
     echo "OpenOffice.org for Debian - see 
/usr/share/doc/openoffice.org${VER}/README.Debian.gz"
 
     if can_upgrade; then
+      clean_symlinks
       TMPFILE=`mktemp -t oooAutoreponse.XXXXXXXXXX` || exit 1
       sed -e "s#^DESTINATIONPATH=.*#DESTINATIONPATH=$oldhome#" \
         < /etc/openoffice${VER}/autoresponse.conf > $TMPFILE

Reply via email to