Bug 1155729

Summary: RHEL5 and RHEL6: mktemp -t XXXXXX.pdf: functionality differs
Product: Red Hat Enterprise Linux 5 Reporter: Petri Koistinen <petri.koistinen>
Component: mktempAssignee: Than Ngo <than>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.11   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-23 13:44:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petri Koistinen 2014-10-22 17:46:37 UTC
Description of problem:
How reproducible:
Steps to Reproduce:
Actual results:

[me@rhel6 ~]$ mktemp -t XXXXXX.pdf
/tmp/UQ75h2.pdf

Nice, OK!

[me@rhel5 ~]$ mktemp -t XXXXXX.pdf
/tmp/XXXXXX.pdf
[me@rhel5 ~]$ mktemp -t XXXXXX.pdf
mktemp: cannot create temp file /tmp/XXXXXX.pdf: File exists

Not so nice.

Expected results:
It would be nice if RHEL5 and RHEL6 would have same functionality.
Could this be a security issue if scripts expect RHEL6 functionality?

Version-Release number of selected component (if applicable):
mktemp-1.5-24.el5

Comment 1 Than Ngo 2014-10-23 13:44:40 UTC
mktemp is part coreutils since rhel6 and it's not the same what we have in rhel5.
If you take a look at the man pages, the correct syntax for mktemp is:

mktemp -r pp.XXXXXXX

In rhel6 mktemp also supports the syntax XXXXXX.pp. It's also not a bug but rather a feature. I don't think it's a security issue, the user should make sure that he uses the correct syntax.

Since rhel-5.10 new feature is not accepted anymore, so i closed it as NOTABUG