Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Stefan Fritsch
Package: libreoffice-common
Version: 1:3a3.3.1~rc1-1
Severity: critical
Justification: causes serious data loss


from preinst:


if dpkg --compare-versions $2 lt 1:3.3.0-3; then
rm -rf /share
rm -rf /user
fi


Are you mad? You must nod delete arbitrary directories! Some people
store important information there.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
On Sat, Feb 12, 2011 at 06:43:17PM +0100, Stefan Fritsch wrote:
 if dpkg --compare-versions $2 lt 1:3.3.0-3; then
 rm -rf /share
 rm -rf /user
 fi
 
 
 Are you mad? You must nod delete arbitrary directories! Some people
 store important information there.

And what do people store in /share and /user?

And you hopefully suggest an alternative way to me how to clean up
those broken directories?

Grüße/Regards,

René
-- 
 .''`.  René Engelhard -- Debian GNU/Linux Developer
 : :' : http://www.debian.org | http://people.debian.org/~rene/
 `. `'  r...@debian.org | GnuPG-Key ID: D03E3E70
   `-   Fingerprint: E12D EA46 7506 70CF A960 801D 0AA0 4571 D03E 3E70



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Stefan Fritsch
On Saturday 12 February 2011, you wrote:
 And what do people store in /share and /user?

/share is a common name for additional file systems (e.g. remote NFS 
shares). You cannot assume that just because a dir is not in the FHS, 
people don't  use it.

 And you hopefully suggest an alternative way to me how to clean up
 those broken directories?

Delete the files and directories you have created one by one, without 
-r. Or look if something exists there and warn the user that he should 
clean up by hand.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
Hi,

On Sat, Feb 12, 2011 at 06:47:22PM +0100, Rene Engelhard wrote:
 On Sat, Feb 12, 2011 at 06:43:17PM +0100, Stefan Fritsch wrote:
  if dpkg --compare-versions $2 lt 1:3.3.0-3; then
  rm -rf /share
  rm -rf /user
  fi
  
  
  Are you mad? You must nod delete arbitrary directories! Some people
  store important information there.
 
 And what do people store in /share and /user?
 
 And you hopefully suggest an alternative way to me how to clean up
 those broken directories?

OK; I could rm -rf the subdirs

(sid)root@frodo:/# ls -l /user /share/
/share/:
insgesamt 4
drwxr-xr-x 2 root root 4096 12. Feb 17:53 config

/user:
insgesamt 8
drwxr-xr-x 4 root root 4096 12. Feb 17:53 extensions
drwxr-xr-x 3 root root 4096 12. Feb 17:53 uno_packages

and then find out whether the dirs and empty and then remove them.

but rm -rf'ingf /user/extensions or even more /user/config is also
something you would object against, no?

Grüße/Regards,

René



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
On Sat, Feb 12, 2011 at 06:54:22PM +0100, Stefan Fritsch wrote:
 On Saturday 12 February 2011, you wrote:
  And what do people store in /share and /user?
 
 /share is a common name for additional file systems (e.g. remote NFS 
 shares). You cannot assume that just because a dir is not in the FHS, 
 people don't  use it.

Ah, yeah, that. We use someting else, so I ddidn't think that /share is that
commonly used.

Sorry for that.

  And you hopefully suggest an alternative way to me how to clean up
  those broken directories?
 
 Delete the files and directories you have created one by one, without 
 -r.

Probably feasible for /share/config/javasettingsunopkginstall.xml but that's 
the content
of the broken /user:

(sid)root@frodo:/user# tree
.
├── extensions
│   ├── shared
│   │   ├── extensions.db
│   │   ├── lastsynchronized
│   │   ├── log.txt
│   │   └── registry
│   │   ├── com.sun.star.comp.deployment.bundle.PackageRegistryBackend
│   │   ├── com.sun.star.comp.deployment.component.PackageRegistryBackend
│   │   ├── 
com.sun.star.comp.deployment.configuration.PackageRegistryBackend
│   │   │   ├── backenddb.xml
│   │   │   └── registered_packages.db
│   │   ├── com.sun.star.comp.deployment.executable.PackageRegistryBackend
│   │   ├── com.sun.star.comp.deployment.help.PackageRegistryBackend
│   │   │   └── backenddb.xml
│   │   ├── com.sun.star.comp.deployment.script.PackageRegistryBackend
│   │   └── com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
│   └── tmp
│   ├── extensions
│   ├── extensions.db
│   └── registry
│   ├── com.sun.star.comp.deployment.bundle.PackageRegistryBackend
│   ├── com.sun.star.comp.deployment.component.PackageRegistryBackend
│   ├── 
com.sun.star.comp.deployment.configuration.PackageRegistryBackend
│   │   ├── backenddb.xml
│   │   └── registered_packages.db
│   ├── com.sun.star.comp.deployment.executable.PackageRegistryBackend
│   ├── com.sun.star.comp.deployment.help.PackageRegistryBackend
│   │   └── backenddb.xml
│   ├── com.sun.star.comp.deployment.script.PackageRegistryBackend
│   └── com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
└── uno_packages
└── cache
├── log.txt
├── registry
│   ├── com.sun.star.comp.deployment.bundle.PackageRegistryBackend
│   ├── com.sun.star.comp.deployment.component.PackageRegistryBackend
│   ├── 
com.sun.star.comp.deployment.configuration.PackageRegistryBackend
│   │   ├── backenddb.xml
│   │   └── registered_packages.db
│   ├── com.sun.star.comp.deployment.executable.PackageRegistryBackend
│   ├── com.sun.star.comp.deployment.help.PackageRegistryBackend
│   │   └── backenddb.xml
│   ├── com.sun.star.comp.deployment.script.PackageRegistryBackend
│   └── com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
├── uno_packages
└── uno_packages.db

31 directories, 15 files

 Or look if something exists there and warn the user that he should 
 clean up by hand.

That could be done, yes...

Grüße/Regards,

René
-- 
 .''`.  René Engelhard -- Debian GNU/Linux Developer
 : :' : http://www.debian.org | http://people.debian.org/~rene/
 `. `'  r...@debian.org | GnuPG-Key ID: D03E3E70
   `-   Fingerprint: E12D EA46 7506 70CF A960 801D 0AA0 4571 D03E 3E70



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Stefan Fritsch
On Saturday 12 February 2011, Rene Engelhard wrote:
 On Sat, Feb 12, 2011 at 06:54:22PM +0100, Stefan Fritsch wrote:
  On Saturday 12 February 2011, you wrote:
   And what do people store in /share and /user?
  
  /share is a common name for additional file systems (e.g. remote
  NFS shares). You cannot assume that just because a dir is not in
  the FHS, people don't  use it.
 
 Ah, yeah, that. We use someting else, so I ddidn't think that
 /share is that commonly used.
 
 Sorry for that.

Having to restore 30GB from backup is annoying, but at least I have a 
backup :-/

   And you hopefully suggest an alternative way to me how to clean
   up those broken directories?
  
  Delete the files and directories you have created one by one,
  without -r.
 
 Probably feasible for /share/config/javasettingsunopkginstall.xml
 but that's the content of the broken /user:
 
 (sid)root@frodo:/user# tree
 .
 ├── extensions
 │   ├── shared
 │   │   ├── extensions.db
 │   │   ├── lastsynchronized
 │   │   ├── log.txt
 │   │   └── registry
 │   │   ├──
 com.sun.star.comp.deployment.bundle.PackageRegistryBackend │   │  
 ├──
 com.sun.star.comp.deployment.component.PackageRegistryBackend │  
 │   ├──
 com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 │   │   │   ├── backenddb.xml
 │   │   │   └── registered_packages.db
 │   │   ├──
 com.sun.star.comp.deployment.executable.PackageRegistryBackend │  
 │   ├──
 com.sun.star.comp.deployment.help.PackageRegistryBackend │   │
   │   └── backenddb.xml
 │   │   ├──
 com.sun.star.comp.deployment.script.PackageRegistryBackend │   │  
 └── com.sun.star.comp.deployment.sfwk.PackageRegistryBackend │
   └── tmp
 │   ├── extensions
 │   ├── extensions.db
 │   └── registry
 │   ├──
 com.sun.star.comp.deployment.bundle.PackageRegistryBackend │  
 ├──
 com.sun.star.comp.deployment.component.PackageRegistryBackend │   
├──
 com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 │   │   ├── backenddb.xml
 │   │   └── registered_packages.db
 │   ├──
 com.sun.star.comp.deployment.executable.PackageRegistryBackend │  
 ├──
 com.sun.star.comp.deployment.help.PackageRegistryBackend │
   │   └── backenddb.xml
 │   ├──
 com.sun.star.comp.deployment.script.PackageRegistryBackend │  
 └── com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
 └── uno_packages
 └── cache
 ├── log.txt
 ├── registry
 │   ├──
 com.sun.star.comp.deployment.bundle.PackageRegistryBackend │   ├──
 com.sun.star.comp.deployment.component.PackageRegistryBackend │  
 ├──
 com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 │   │   ├── backenddb.xml
 │   │   └── registered_packages.db
 │   ├──
 com.sun.star.comp.deployment.executable.PackageRegistryBackend │  
 ├── com.sun.star.comp.deployment.help.PackageRegistryBackend │   │
   └── backenddb.xml
 │   ├──
 com.sun.star.comp.deployment.script.PackageRegistryBackend │   └──
 com.sun.star.comp.deployment.sfwk.PackageRegistryBackend ├──
 uno_packages
 └── uno_packages.db
 
 31 directories, 15 files
 

If you know that this is the complete list, including 15 lines of rm 
-f and 31 lines of rmdir ... 2 /dev/null || true in depth-first 
order would seem best to me. Or do 

find /user -name 'com.sun.star*PackageRegistryBackend' -print0 |
xargs -0 --no-run-if-empty rm -rf

and then delete the rest by hand. But this is already more fragile.

  Or look if something exists there and warn the user that he
  should clean up by hand.
 
 That could be done, yes...

If you can't limit the list of files, that's the only reasonable 
solution, IMHO.




--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Stefan Fritsch
On Saturday 12 February 2011, Rene Engelhard wrote:
  if dpkg --compare-versions $2 lt 1:3.3.0-3; then

BTW, it would be good if you limited the cleanup to the cases where 
the problematic version was actually installed, i.e. don't clean
 
up if $2 is . (Or have a lower bound for $2 if that is 
appropriate).



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
On Sat, Feb 12, 2011 at 07:28:17PM +0100, Stefan Fritsch wrote:
 On Saturday 12 February 2011, Rene Engelhard wrote:
   if dpkg --compare-versions $2 lt 1:3.3.0-3; then
 
 BTW, it would be good if you limited the cleanup to the cases where 
 the problematic version was actually installed, i.e. don't clean  

 up if $2 is . (Or have a lower bound for $2 if that is 
 appropriate).

Good point. But there's no lower bound because any libreoffice-common
has it :-(

Grüße/Regards,

René
-- 
 .''`.  René Engelhard -- Debian GNU/Linux Developer
 : :' : http://www.debian.org | http://people.debian.org/~rene/
 `. `'  r...@debian.org | GnuPG-Key ID: D03E3E70
   `-   Fingerprint: E12D EA46 7506 70CF A960 801D 0AA0 4571 D03E 3E70



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
tag 613083 + pending
thanks

Hi,

On Sat, Feb 12, 2011 at 07:21:41PM +0100, Stefan Fritsch wrote:
 If you know that this is the complete list, including 15 lines of rm 
 -f and 31 lines of rmdir ... 2 /dev/null || true in depth-first 
 order would seem best to me. Or do 

I dont, it's the one I just got, though when re-simulating the condition which
lead to the dirs in the first place..

I just ended up with this one:

--- libreoffice-common.preinst.in   2011-02-10 08:14:58 +
+++ libreoffice-common.preinst.in   2011-02-12 18:40:56 +
@@ -20,9 +20,52 @@
 if dpkg --compare-versions $2 lt 1:3.3.0~rc4-2; then
 rm_conffile /etc/bash_completion.d/ooffice.sh 
libreoffice-common
 fi
-if dpkg --compare-versions $2 lt 1:3.3.0-3; then
-   rm -rf /share
-   rm -rf /user
+if [ -n $2 ]  dpkg --compare-versions $2 lt 1:3.3.0-3; then
+   if [ -d /share ]; then
+   rm -f /share/config/javasettingsunopkginstall.xml
+   rmdir /share/config2 /dev/null   rmdir /share 2 
/dev/null || true
+   fi
+
+   if [ -d /user ]; then
+   for i in shared tmp; do
+   rmdir /user/extensions/$i/extensions || true
+   rm -f /user/extensions/$i/extensions.db
+   rm -f /user/extensions/$i/lastsynchronized
+   rm -f /user/extensions/$i/log.txt
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.bundle.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend
 || true 2 /dev/null
+   rm -f 
/user/extensions/$i/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/backenddb.xml
 || true
+   rm -f 
/user/extensions/$i/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registered_packages.db
 || true
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.executable.PackageRegistryBackend
 || true 2 /dev/null
+   rm -f 
/user/extensions/$i/registry/com.sun.star.comp.deployment.help.PackageRegistryBackend/backenddb.xml
 || true
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.help.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.script.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/extensions/$i/registry/com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir /user/extensions/$i/registry 2 /dev/null 
 rmdir /user/extensions/$i 2 /dev/null || true
+   done
+   rmdir /user/extensions/ 2 /dev/null  rmdir /user 2 
/dev/null || true
+
+   rm -f /user/uno_packages/cache/log.txt
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.bundle.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend
 || true 2 /dev/null
+   rm -f 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/backenddb.xml
 || true
+   rm -f 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registered_packages.db
 || true+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.executable.PackageRegistryBackend
 || true 2 /dev/null
+   rm -f 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.help.PackageRegistryBackend/backenddb.xml
 || true
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.help.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.script.PackageRegistryBackend
 || true 2 /dev/null
+   rmdir 
/user/uno_packages/cache/registry/com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
 || true 2 /dev/null
+  

Processed: Re: Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tag 613083 + pending
Bug #613083 [libreoffice-common] libreoffice-common: Deletes /share and /user 
in preinst
Added tag(s) pending.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
613083: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613083
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Rene Engelhard
On Sat, Feb 12, 2011 at 07:46:46PM +0100, Rene Engelhard wrote:
 +   rmdir /share/config2 /dev/null   rmdir /share 2 
 /dev/null || true


2 /dev/null and || true reversed of course.

Grüße/Regards,

René



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#613083: libreoffice-common: Deletes /share and /user in preinst

2011-02-12 Thread Stefan Fritsch
On Saturday 12 February 2011, Rene Engelhard wrote:
 On Sat, Feb 12, 2011 at 07:21:41PM +0100, Stefan Fritsch wrote:
  If you know that this is the complete list, including 15 lines of
  rm -f and 31 lines of rmdir ... 2 /dev/null || true in
  depth-first order would seem best to me. Or do
 
 I dont, it's the one I just got, though when re-simulating the
 condition which lead to the dirs in the first place..
 
 I just ended up with this one:

Looks sane to me. Thanks.

Cheers,
Stefan



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org