Bug 39713

Summary: mktemp -d won't work on glibc21 system
Product: [Retired] Red Hat Raw Hide Reporter: Need Real Name <sagami>
Component: mktempAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-08 20:00:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-05-08 20:00:39 UTC
Description of Problem:
Name: mktemp Version: 1.5 Release: 9
mktemp-1.5-9 had a patch for "mktemp -d" on glibc-2.1 system,
but it doesn't work.

Here's a problem. 
"mktemp -d" returns "testing.XXAAR6wj", but the directory created
by "mktemp -d"is "testing.XXXXXXXX". 

[sagami@sandra testing]$ ls
dir_for_testing_mktemp_d/
[sagami@sandra testing]$ ls
dir_for_testing_mktemp_d/
[sagami@sandra testing]$ mktemp -d testing.XXXXXXXX
testing.XXAAR6wj
[sagami@sandra testing]$ ls
dir_for_testing_mktemp_d/  testing.XXXXXXXX/


Additional Information:

A patch below will solve the problem.
I think you just want to modify
mktemp-1.5-glibc21_compat.patch applied in mktemp-1.5-9.
Best regards.

--- mktemp.c.lisa       Wed May  9 04:31:32 2001
+++ mktemp.c    Wed May  9 04:32:45 2001
@@ -91,7 +91,7 @@
         if (mktemp(temp) == NULL) {
             return NULL;
         }
-        ret = mkdir(template, 0700);
+        ret = mkdir(temp, 0700);
         /* success, return the name of the new directory */
         if (ret == 0) {

Comment 1 Ngo Than 2001-05-08 20:29:29 UTC
It's fixed in mktemp-1.5-11. Thanks