Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0311261700290.6218@coyote.op5.se>
Date: Wed, 26 Nov 2003 17:44:15 +0100 (CET)
From: Andreas Ericsson <exon@....se>
To: owl-users@...ts.openwall.com
Subject: Re: Bug in Postfix remove script

> rmdir: `/var/spool/postfix/[^m]*': No such file or directory
>
> When I create any subdirectory under /var/spool/postfix not starting
> with `m', everything works fine, but IMHO this is a bug in Postfix'
> preun script.  Following patch (made against current CVS version of
> the native tree) should fix the problem:
>


> #v+
> diff -u -r1.19 postfix.spec
> --- packages/postfix/postfix.spec	30 Oct 2003 21:15:47 -0000	1.19
> +++ packages/postfix/postfix.spec	26 Nov 2003 15:45:32 -0000
> @@ -183,7 +183,7 @@
>  	rm -f /etc/postfix/aliases.db
>  	find /var/spool/postfix \( -type p -o -type s \) -delete
>  	rm -f /var/spool/postfix/{pid,etc,lib}/*
> -	rmdir /var/spool/postfix/[^m]*
> +	rmdir /var/spool/postfix/[^m]* || true
> fi
>
> %files -f filelist
> #v-

This will cause rpm to happily move on no matter what the error, which
isn't the intended behaviour.
'find' will fail on access violations only, which will work properly in
case rpm administration has been delegated (to wheel, for instance).
The neater fix follows.

#v+
diff -u -r1.19 postfix.spec
--- packages/postfix/postfix.spec	30 Oct 2003 21:15:47 -0000	1.19
+++ packages/postfix/postfix.spec	26 Nov 2003 15:45:32 -0000
@@ -183,7 +183,7 @@
 	rm -f /etc/postfix/aliases.db
 	find /var/spool/postfix \( -type p -o -type s \) -delete
 	rm -f /var/spool/postfix/{pid,etc,lib}/*
-	rmdir /var/spool/postfix/[^m]*
+	find /var/spool/postfix \( -type d -name "[^m]*" \) -delete
fi

%files -f filelist
#v-

/Andreas Ericsson

PS.
I don't know this .spec (or even the rpm program's man page) by heart.
There might be a better / easier / neater fix available.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.