Skip to content

Commit

Permalink
Set umask to 0077 before creating disk images
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaran committed Aug 31, 2010
1 parent f56ebba commit b8877e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/xen-create-image
Expand Up @@ -2479,9 +2479,17 @@ sub createLoopbackImages
$image_cmd = "dd if=/dev/zero of=$disk bs=$size count=1024";
}

# Set the umask so that the images are not world readable.
my $oldumask = umask;
umask(0077);

# run the image creation command
runCommand( $image_cmd );
logprint( "Done\n" );

# Reset the umask to the previous value
umask($oldumask);

if ( ! -e $disk )
{
logprint( "The partition image creation failed to create $disk.\n" );
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
@@ -1,3 +1,10 @@
xen-tools (3.9-4+lenny1) stable; urgency=low

* Set umask to 0077 before creating disk images (Closes: #548909)
(Cherry-picked dfbf591 from master branch)

--

xen-tools (3.9-4) unstable; urgency=high

* Changed two defaults in xen-tools.conf to conform
Expand Down

0 comments on commit b8877e9

Please sign in to comment.