ke, 2005-08-31 kello 16:19 -0400, Daniel Jacobowitz kirjoitti:
> On Wed, Aug 31, 2005 at 10:55:53PM +0300, Lars Wirzenius wrote:
> > if grep -v '^/lib64$' /etc/ld.so.conf > /etc/ld.so.conf-amd64-libs-tmp;
> > then
> >   chmod 0644 /etc/ld.so.conf-amd64-libs-tmp
> >   mv /etc/ld.so.conf-amd64-libs-tmp /etc/ld.so.conf
> > else
> >   rm -f /etc/ld.so.conf
> > fi
> > 
> > I'm pretty sure that the else part should
> > remove /etc/ld.so.conf-amd64-libs-tmp instead of /etc/ld.so.conf.
> > 
> > The error is repeated in the other if statements, a total of three
> > times, if I count correctly. Later in the postrm the temporary file is
> > removed anyway, so I guess the elses could be removed completely?
> 
> What do you think the bug is, exactly?  "If there are no lines, other
> than this one, in ld.so.conf, remove ld.so.conf".

Now I'm glad I didn't mark it critical. *Blush* A bad thinko on my part,
I completely misremembered how grep works with regard to exit codes.
Sorry. (I need to learn to stop filing bugs when it gets late.)

However, it now strikes me, as I try to think carefully about this, that
if grep fails for any other reason than "no lines found", e.g., because
the disk is full and the redirection fails, the postrm script
erroneously removes /etc/ld.so.conf. Or am I being an idiot again?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to