OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Bug in Postfix remove script

From: Solar Designer (solaropenwall.com)
Date: Wed Nov 26 2003 - 11:59:35 CST


On Wed, Nov 26, 2003 at 05:44:15PM +0100, Andreas Ericsson wrote:
> > - rmdir /var/spool/postfix/[^m]*
> > + rmdir /var/spool/postfix/[^m]* || true

> This will cause rpm to happily move on no matter what the error, which
> isn't the intended behaviour.

Actually it is.

The purpose of this rmdir is to remove directories which are empty,
but leave around those which aren't such that you don't lose your
queued e-mail messages just because you happened to (temporarily?)
uninstall Postfix.

If you install Postfix but don't use it and just uninstall, then
everything gets removed cleanly.

> - rmdir /var/spool/postfix/[^m]*
> + find /var/spool/postfix \( -type d -name "[^m]*" \) -delete

This is very different: find is recursive. A similar effect to the
rmdir may be achieved with find -maxdepth 1, but I don't see the need.

--
Alexander Peslyak <solaropenwall.com>
GPG key ID: B35D3598 fp: 6429 0D7E F130 C13E C929 6447 73C3 A290 B35D 3598
http://www.openwall.com - bringing security into open computing environments