Commit 24cf4b4e authored by Leigh Stoller's avatar Leigh Stoller

Explicitly chmod new image directory to 775 to avoid umask sillyness.

parent 22effbb8
...@@ -2852,9 +2852,14 @@ sub CreateImageDir($) ...@@ -2852,9 +2852,14 @@ sub CreateImageDir($)
if (!$self->IsDirPath() || -e $self->path()); if (!$self->IsDirPath() || -e $self->path());
if (!mkdir($self->path(), 0775)) { if (!mkdir($self->path(), 0775)) {
print STDERR "Could not mkdir " . $self->path() . ": $!"; print STDERR "Could not mkdir " . $self->path() . ": $!\n";
return -1; return -1;
} }
if (!chmod(0775, $self->path())) {
print STDERR "Could not chown " . $self->path() . ": $!\n";
return -1;
}
# If we are root and had to create the directory, then the owner # If we are root and had to create the directory, then the owner
# and group are going to be set wrong. # and group are going to be set wrong.
if ($EUID == 0) { if ($EUID == 0) {
......
...@@ -175,6 +175,10 @@ sub ConvertImage($) ...@@ -175,6 +175,10 @@ sub ConvertImage($)
print STDERR "Could not mkdir $newpath: $!\n"; print STDERR "Could not mkdir $newpath: $!\n";
return -1; return -1;
} }
if (! chmod(0775, "$newpath")) {
print STDERR "Could not chown $newpath: $!\n";
return -1;
}
if (! chown($uid, $gid, $newpath)) { if (! chown($uid, $gid, $newpath)) {
print STDERR "Could not chown($uid,$gid) $newpath: $!\n"; print STDERR "Could not chown($uid,$gid) $newpath: $!\n";
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment