keeleysam / instadmg

Automatically exported from code.google.com/p/instadmg
0 stars 0 forks source link

InstaDMG not clearing /tmp on generated images #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an image using InstaUp2Date. My catalog has 43 packages that are
installed
2. Mount the generated image with hdituil attach image.dmg -mountrandom
/tmp -readonly -nobrowse -noautoopen -owners on
3. Look in the mounted image's /tmp. See some root owned directory trees
that seem to be remnants from installers - here's an example tree dump

[jpb@logrus:/home/jpb/jpb-ops/ops/mac/instadmg]$ sudo du -a
/tmp/dmg.zSk7kU/private/tmp/
Password:
8   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/etc/DOC
4184    /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/etc/DOC-22.1.1
8   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/etc/GNU
4200    /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/etc
0   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/lib-src
8   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/src/buildobj.lst
25536   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/src/emacs
5000    /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/src/temacs
30544   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8/src
34744   /tmp/dmg.zSk7kU/private/tmp//emacs.vev7u8
8   /tmp/dmg.zSk7kU/private/tmp//runChrooted.ct1Lqz/buildKeychains
80  /tmp/dmg.zSk7kU/private/tmp//runChrooted.ct1Lqz/ipv6PrefsUpdate
8   /tmp/dmg.zSk7kU/private/tmp//runChrooted.ct1Lqz/startSSH
96  /tmp/dmg.zSk7kU/private/tmp//runChrooted.ct1Lqz
8   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/__Installer_Script_Springboard__
8   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/postinstall
8
/tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/postinstall_actions/configurePostfix
8   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/postinstall_actions
8   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/preinstall
0   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/preinstall_actions
0   /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA/Tools
32  /tmp/dmg.zSk7kU/private/tmp//scripts.GbxA
8   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/__Installer_Script_Springboard__
8   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/postinstall
0   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/postinstall_actions
8   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/preinstall
8
/tmp/dmg.zSk7kU/private/tmp//scripts.igTk/preinstall_actions/disableReportCrash
8   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/preinstall_actions
8   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/removeOldSyncClient
0   /tmp/dmg.zSk7kU/private/tmp//scripts.igTk/Tools
40  /tmp/dmg.zSk7kU/private/tmp//scripts.igTk
8   /tmp/dmg.zSk7kU/private/tmp//scripts.RuzM/__Installer_Script_Springboard__
8   /tmp/dmg.zSk7kU/private/tmp//scripts.RuzM/preinstall
0   /tmp/dmg.zSk7kU/private/tmp//scripts.RuzM/Tools
16  /tmp/dmg.zSk7kU/private/tmp//scripts.RuzM
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/__Installer_Script_Springboard__
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/postinstall
8
/tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/postinstall_actions/servicesfix_post
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/postinstall_actions
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/preinstall
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/preinstall_actions/servicesfix_pre
8   /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/preinstall_actions
152 /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/Tools/PlistBuddy
152 /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN/Tools
192 /tmp/dmg.zSk7kU/private/tmp//scripts.z3DN
35120   /tmp/dmg.zSk7kU/private/tmp/
[jpb@logrus:/home/jpb/jpb-ops/ops/mac/instadmg]$

What is the expected output? What do you see instead?
I expected to find nothing there. I wouldn't have noticed it except that my
unit test puked on /tmp when checking for directories that should be empty.

What version of the product are you using? On what operating system?
1.4b4 on 10.5.6.

Please provide any additional information below.

Fix by adding

/bin/rm -vRf "$CURRENT_IMAGE_MOUNT/private/tmp/*" | (while read INPUT; do
log "$INPUT " detail; done)

at the end of the clean_up_image() function

Original issue reported on code.google.com by Joe.Block on 12 Feb 2009 at 1:58

GoogleCodeExporter commented 9 years ago
This was reported a few days ago on the developer mailing list by Nigel 
Kersten, and I checked in a fix (that is 
actually identical to the one proposed) on Monday. The revision was 178/179 
(typo in the first one).

Original comment by kuehn.k...@gmail.com on 12 Feb 2009 at 6:37

GoogleCodeExporter commented 9 years ago
Nigel and I share an office. I hadn't realized he'd already reported it.

Original comment by Joe.Block on 12 Feb 2009 at 8:09