Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xPDOCacheManager's lockFile fails when $_SERVER['SERVER_ADDR'] is an IPv6 address #13477

Closed
ttyiav opened this issue Jun 23, 2017 · 1 comment

Comments

@ttyiav
Copy link

ttyiav commented Jun 23, 2017

xPDOCacheManager's lockFile method (called when use_flock is FALSE) generates bad filename when $_SERVER['SERVER_ADDR'] is an IPv6 address.

$myPID = (XPDO_CLI_MODE || !isset($_SERVER['SERVER_ADDR']) ? gethostname() : $_SERVER['SERVER_ADDR']) . '.' . getmypid();

IPv6 addresses contain ':' symbols which are not allowed on Windows filesystems.
$tmpLockFile variable could be sanitized in any possible way, for example like here

return $lockDir . preg_replace('/\W/', '_', $file) . $this->getOption(xPDO::OPT_LOCKFILE_EXTENSION, $options, '.lock');

or with str_replace().

Environment

Any MODX version containing the xPDOCacheManager::lockFile,
IPv6 enabled server installation,
IPv6 client.

@alroniks
Copy link
Collaborator

As it moved to xPDO, I am closing this one. This closed issue still will be available by the link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants