summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_file_cache.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-07-17 19:52:49 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-07-17 19:52:49 +0200
commit54401001a8afe42dd56a38bdc57ef5a49e6f4ab5 (patch)
tree7a375a6456b78d7b00dca1dac18dea3e345c77ee /ext/opcache/zend_file_cache.c
parent6d00cff36fad3c318799dcaf527d0bea5afd2217 (diff)
parente2ed7e6716f9564fcd8b13b823519baaa7256662 (diff)
downloadphp-git-54401001a8afe42dd56a38bdc57ef5a49e6f4ab5.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Allow multiple cache instances per user/host on Windows
Diffstat (limited to 'ext/opcache/zend_file_cache.c')
-rw-r--r--ext/opcache/zend_file_cache.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index caff6ec1ce..1363e55468 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -835,31 +835,13 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
#else
- PHP_MD5_CTX ctx;
- char md5uname[32];
- unsigned char digest[16], c;
- size_t i;
- char *uname = php_win32_get_username();
-
- PHP_MD5Init(&ctx);
- PHP_MD5Update(&ctx, uname, strlen(uname));
- PHP_MD5Final(digest, &ctx);
- for (i = 0; i < 16; i++) {
- c = digest[i] >> 4;
- c = (c <= 9) ? c + '0' : c - 10 + 'a';
- md5uname[i * 2] = c;
- c = digest[i] & 0x0f;
- c = (c <= 9) ? c + '0' : c - 10 + 'a';
- md5uname[(i * 2) + 1] = c;
- }
-
len = strlen(ZCG(accel_directives).file_cache);
filename = emalloc(len + 33 + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX));
memcpy(filename, ZCG(accel_directives).file_cache, len);
filename[len] = '\\';
- memcpy(filename + 1 + len, md5uname, 32);
+ memcpy(filename + 1 + len, accel_uname_id, 32);
len += 1 + 32;
filename[len] = '\\';
@@ -889,7 +871,6 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path));
memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX));
}
- free(uname);
#endif
return filename;