ext/session/mod_mm: initialize mm instance in open handler#21192
ext/session/mod_mm: initialize mm instance in open handler#21192Girgias wants to merge 1 commit intophp:masterfrom
Conversation
…n MINIT This remove access to the globals that could very much change during the execution of the script and prior to opening the session handler
|
Will this not cause race conditions in zts? |
The MM module does not support ZTS and has a preprocessor error defined: #ifdef ZTS
# error mm is not thread-safe
#endif |
|
that s one of the reason I wanted to move away from libmm ... this and how very obsolete it is. |
|
do you plan any more change @Girgias ? |
| } | ||
|
|
||
| char euid[30]; | ||
| size_t euid_len = slprintf(euid, sizeof(euid), "%d", geteuid()); |
There was a problem hiding this comment.
one little nit not related to your change, uid_t is unsigned int on linux.
| ps_mm_path[save_path_len] = DEFAULT_SLASH; | ||
| save_path_len++; | ||
| } | ||
| memcpy(ps_mm_path + save_path_len, PS_MM_FILE, sizeof(PS_MM_FILE) - 1); |
There was a problem hiding this comment.
only if you want, but we may be able to simplify a bit using zend_mempcpy instead.
There was a problem hiding this comment.
Sorry currently at a conference, but I might do the fixes like this for uid_t and zend_mempcpy() to not mix concerns within this PR.
|
Currently wondering if we might not be leaking memory if we close the session handler and open a new one after changing the name (or effectively reusing the same one). |
Rather than doing this in MINIT.
This remove access to the globals that could very much change during the execution of the script and prior to opening the session handler.