Bug 17898

Summary: mkkickstart fails when pwd is read-only
Product: [Retired] Red Hat Linux Reporter: Need Real Name <daniel_frazier>
Component: mkkickstartAssignee: Matt Wilson <msw>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: daniel_frazier
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-03 03:18:31 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:
Attachments:
Description Flags
patch to fix errors generated by creating temp files none

Description Need Real Name 2000-09-26 22:23:10 UTC
mkkickstart-2.3-1 fails when the current working directory cannot be
written to.
this patch tries to make the temporary files in /tmp, which is more likely
mounted read-write.
also, it tests to make sure mktemp succeeds before proceeding. 

(this is the first bug report i've done under this system.  let me know if
posting a patch
here is inappropriate.)
------------snip-----------------------------------
*** mkkickstart Tue Sep 26 16:19:31 2000
--- mkkickstart.old     Tue Aug 15 07:37:53 2000
***************
*** 172,192 ****
  #
  # Get current disk partitioning information
  #
! tmp1=`mktemp /tmp/.tmp1.XXXXXX`
! if [ $? -ne 0 ]; then
!     echo "$0: can't create temp file in /tmp, exiting..."
!     exit 1
! fi
! tmp2=`mktemp /tmp/.tmp2.XXXXXX`
! if [ $? -ne 0 ]; then
!     echo "$0: can't create temp file in /tmp, exiting..."
!     exit 1
! fi
! tmp3=`mktemp /tmp/.tmp3.XXXXXX`
! if [ $? -ne 0 ]; then
!     echo "$0: can't create temp file in /tmp, exiting..."
!     exit 1
! fi
  fdisk -l /dev/hd[a-h] 2>/dev/null | grep "^/dev/[shx]da" | sort  >${tmp1} 
  fdisk -l /dev/sd[a-p] 2>/dev/null | grep "^/dev/[shx]da" | sort >>${tmp1} 
  fdisk -l /dev/xd[ab]  2>/dev/null | grep "^/dev/[shx]da" | sort >>${tmp1} 
--- 172,180 ----
  #
  # Get current disk partitioning information
  #
! tmp1=`mktemp .tmp1.XXXXXX`
! tmp2=`mktemp .tmp2.XXXXXX`
! tmp3=`mktemp .tmp3.XXXXXX`
  fdisk -l /dev/hd[a-h] 2>/dev/null | grep "^/dev/[shx]da" | sort  >${tmp1} 
  fdisk -l /dev/sd[a-p] 2>/dev/null | grep "^/dev/[shx]da" | sort >>${tmp1} 
  fdisk -l /dev/xd[ab]  2>/dev/null | grep "^/dev/[shx]da" | sort >>${tmp1} 

----------------snip-------------------

Comment 1 Need Real Name 2000-09-26 22:25:05 UTC
Created attachment 3571 [details]
patch to fix errors generated by creating temp files

Comment 2 Alan Cox 2000-10-01 22:40:10 UTC
Its intentionally not using /tmp. mktemp isnt enough to make it safe as far as I
can tell. So rather
than run tmpfile races we use current directories.


Comment 3 Brent Fox 2002-06-05 02:49:08 UTC
Closing since we don't ship mkkickstart anymore.