Red Hat Bugzilla – Bug 76602
non-portable use of mktemp in ltmain.sh.in
Last modified: 2015-01-07 19:01:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408
Description of problem:
The SRPM contains a patch file 'libtool-1.3.5-mktemp.patch' (Patch1)
This patch introduce the use of mktemp into the ltmain.sh.in file
However, mktemp is not portable and the ltmain.sh file is distributed with
ANY software package that is built with libtool.
As an example, when I built a small dynamic lib using libtool/automake/autoconf.
The build was perfect on linux (including make install and make distcheck),
but when the tarball was moved to HPUX the 'make install' step failed because
libtool --mode=installed tried to create a temporary directory using 'mktemp'.
Also the failure of mktemp(1) in the patched ltmain.sh isn't handled correctly. What
happens is after the status is checked (by then 'tmpdir' is already empty), the code
which simply causes 'tmpdir' to get the value: '/libtool-...'
Obviously, non-root user will fail to create tmpdir under '/'
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Choose any package that build libraries via libtool
2. Run on linux: ./configure --prefix=/some_path; make; make distcheck
3. Extract the tarball on HPUX
4. Rerun: ./configure --prefix=/some_other_path; make; make install
Actual Results: The 'make install' would fail when running 'libtool
This happens because:
1. mktemp fails
2. The test of mktemp status leads to flawed assignment to 'tmpdir'
3. mkdir fails bacause it (non-root user) tries to create a temp directory
Expected Results: Perfect build on any platform supported by libtool.
HPUX does have mktemp but with different syntax. I checked both with HPUX
versions 10.20 and 11.00. I also verified that mktemp(1) does not appear in
the Single Unix Specification (version 2), so it's probably missing or mutilated
in some other Unices as well (and even more on other platforms libtool supports).
1. mktemp should not be used in portable code like 'ltmain.sh'
2. Even if it is used, the code should handle correctly its failure.
This bug remained in RedHat-8.0, it would be pitty to see
it persisting in 8.1
Should be fixed in libtool-1.4.3-3. Please confirm.