-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
… remote arbitrary code execution.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,7 +340,7 @@ public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) | |
$dir = dirname($path); | ||
|
||
if ( ! is_dir($dir)) { | ||
mkdir($dir, 0777, true); | ||
mkdir($dir, 0775, true); | ||
} | ||
|
||
$this->isNew = !file_exists($path) || (file_exists($path) && $this->regenerateEntityIfExists); | ||
|
@@ -365,6 +365,7 @@ public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) | |
} elseif ( ! $this->isNew && $this->updateEntityIfExists) { | ||
file_put_contents($path, $this->generateUpdatedEntityClass($metadata, $path)); | ||
} | ||
chmod($path, 0664); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Ocramius
Member
|
||
} | ||
|
||
/** | ||
|
I am not sure whether these
chmod()
calls should be silenced (see for example doctrine/common#383).The problem of failing
chmod()
calls is especially present in Vagrant setups using NFS to share files but seems only to be an issue if the user owning the file ("vagrant" most probably) is not the user running the code ("www-data", for example).I think we're fine here if this is code that is run by a console user who is also the file owner, but silencing the
chmod()
might do no harm otoh.@beberlei What do you think?