Re: small fix of libtool.m4
Eric Blake <[email protected]>
| Newsgroups | gmane.comp.gnu.libtool.patches |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
On 05/05/2016 11:22 PM, Christian wrote:
> So i found that if you’re running ‘./configure’ on a project that depends on
> libtool, it might happen that the script will end up with the following error:
> “/bin/rm: cannot remove 'libtoolT': No such file or directory”. I did some
>
> cfgfile=${ofile}T
> trap "$RM \"$cfgfile\"; exit 1" 1 2 15
> - $RM "$cfgfile"
> + if test -e "$cfgfile" ; then
> + $RM "$cfgfile"
> + fi
That's a TOCTTOU data race. Wouldn't it be better to just use 'rm -f'?
In fact, isn't $RM supposed to be including -f automatically?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
(application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXLK7RAAoJEKeha0olJ0Nq+f4H/ROJmWjo7iXMepAjA/OoBOI4 kDko6QhpziSUcgWbETg5x2kM1zQ/3mWmhtcLLUeAXx15o4epY+eEaRiubWh8BlQ4 MZr4T0zLzW8Tl36L+n8FRF4wRlVhEjKbGinkJlm3cyyrDrg3XBVgBpD+d4cC5Lg9 d1/2Y6NSD1A349tDuuoyHwMB47OH6uBvN6Rut5PHCLjEzcMBSFQsCQf73wbsOlKy kSk74kmwYH9Y2tzNLD+D4H3Z7IdydO/jFHMMUAA4Q3xNZ9QSCWG305Wiphnpum1/ GHeMcBe88fBEnArF8KZ2C2+HRTe7bK88hRvC2+DFg8L5G84eheXhoTirSPCuw7w= =xmc8 -----END PGP SIGNATURE-----