Bug#270967: Why purging gconf2-common might erase your /etc
Josselin Mouette
joss at debian.org
Mon Jan 30 09:10:57 UTC 2006
severity 270967 normal
clone 270967 -1
retitle 270967 gconf2-common fails to purge when /etc isn't removable
reassign -1 coreutils
retitle -1 rmdir should check emptiness before permissions
thanks
Le lundi 30 janvier 2006 à 03:23 +0100, Adrian Bunk a écrit :
> severity 270967 critical
> thanks
This is by no means a critical bug. There's no way this script can wipe
out your /etc.
> Hi Sebastien,
>
> I think I can answer the following question you raised:
>
> <-- snip -->
>
> The weird point is that running "sh /var/lib/dpkg/info/gconf2.postrm
> purge" doesn't display any error, but the same line called by apt raises
> an error ...
>
> <-- snip -->
>
> The problem is only triggered when /etc/gconf2/ is empty.
This error message is triggered by rmdir trying to remove /etc.
Normally, rmdir -p --ignore-fail-on-non-empty will try to
remove /etc/gconf/2, then /etc/gconf, then /etc, and will stop with /etc
because it isn't empty.
On your system, the chattr -i prevents the removal of /etc, and rmdir
fails on "permission denied" instead of "directory not empty".
I'd say that, so that rmdir -p --ignore-fail-on-non-empty can work on
such systems, it should be made to check first if the directory is
empty, and then if it has the permissions to remove it. I'm creating a
clone report on coreutils, but maybe it is caused directly by the kernel
or libc - in which case it should still be possible to work around the
issue in coreutils.
Currently, rmdir --ignore-fail-on-non-empty seems to do the following:
* call rmdir(2)
* check errno
* ignore ENOTEMPTY
Maybe it could be modified to do the following:
* check if the directory is empty
* call rmdir(2)
I don't know whether this would be acceptable. Depending on the
coreutils maintainers' advice and decision, I will modify - or not - the
gconf2 scripts.
Regards,
--
.''`. Josselin Mouette /\./\
: :' : josselin.mouette at ens-lyon.org
`. `' joss at debian.org
`- Debian GNU/Linux -- The power of freedom
More information about the Pkg-gnome-maintainers
mailing list