[pkg-fetchmail-maint] Bug in postinst

Héctor García hector at debian.org
Mon Nov 14 15:14:45 UTC 2005


El lun, 14-11-2005 a las 15:37 +0100, Nico Golde escribió:
> Hello Héctor,
> 
> * Héctor García <hector at debian.org> [2005-11-14 14:33]:
> > While building next release and testing it I found a bug on
> > fetchmail.postinst
> > Since I cannot do a commit here is the diff
> > 
> > Index: debian/fetchmail.postinst
> > ===================================================================
> > --- debian/fetchmail.postinst   (revision 240)
> > +++ debian/fetchmail.postinst   (working copy)
> > @@ -13,7 +13,7 @@
> >  fi
> >  # work around possible adduser bug, see #119366
> >  [ -d /var/run/fetchmail ] || mkdir -p /var/run/fetchmail
> > -if ! [ -d /var/run/fetchmail ]; then
> > +if [ -d /var/run/fetchmail ]; then
> >         chmod 700 /var/run/fetchmail
> >         chown -h -R fetchmail:nogroup /var/run/fetchmail
> >  fi
> > 
> > 
> > Here is my comment:
> > 
> > fixing a bug in fetchmail.postinst, there was an extra ! which made the
> > check wrong and impossible
> 
> Sure? I mean this means if /var/run/fetchmail does not 
> exist.

Well, just after executing 
[ -d /var/run/fetchmail ] || mkdir -p /var/run/fetchmail
/var/run/fetchmail must exits or the script will die (ex: no permision
while creating it, /var/run/fetchmail existed but was a file instead of
a dir (should we check that?)

Even if it did not exits the check was really weird.
If the dir doesn't exits go ahead and change its permisions (the script
would die in pain here)

>From bash man page:
	-d file
              True if file exists and is a directory.

Am I missing something?
Of course, I tested it and in the first case commands were not executed
while installing the package and they are executed correctly after the
patch.

Regards,

Héctor




More information about the pkg-fetchmail-maint mailing list