mask world r and group wx permissions in vdisk_alloc
Avoid world-readable disk files being created as suggested in #416 by setting an umask to strip world permissions as well as group write/exec permissions before calling alloc_image.
This commit is contained in:
committed by
Dietmar Maurer
parent
d75b2a72bb
commit
afdfbe5594
@ -587,7 +587,11 @@ sub vdisk_alloc {
|
|||||||
|
|
||||||
# lock shared storage
|
# lock shared storage
|
||||||
return $plugin->cluster_lock_storage($storeid, $scfg->{shared}, undef, sub {
|
return $plugin->cluster_lock_storage($storeid, $scfg->{shared}, undef, sub {
|
||||||
my $volname = $plugin->alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size);
|
my $old_umask = umask(umask|0037);
|
||||||
|
my $volname = eval { $plugin->alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size) };
|
||||||
|
my $err = $@;
|
||||||
|
umask $old_umask;
|
||||||
|
die $err if $err;
|
||||||
return "$storeid:$volname";
|
return "$storeid:$volname";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user