Bug 76602 - non-portable use of mktemp in ltmain.sh.in
non-portable use of mktemp in ltmain.sh.in
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: libtool (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-23 19:47 EDT by Oron Peled
Modified: 2015-01-07 19:01 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-05-01 10:34:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Oron Peled 2002-10-23 19:47:30 EDT
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
assigns:
        tmpdir="$tmpdir/libtool-$$"
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):


How reproducible:
Always

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
--mode=install ....'
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
on '/libtool-....'

Expected Results:  Perfect build on any platform supported by libtool.



Additional info:

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.
Comment 1 Oron Peled 2003-01-10 17:30:22 EST
This bug remained in RedHat-8.0, it would be pitty to see
it persisting in 8.1
Comment 2 Jens Petersen 2003-01-13 23:08:02 EST
Should be fixed in libtool-1.4.3-3.  Please confirm.

Note You need to log in before you can comment on or make changes to this bug.