-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/session/mod_mm: initialize mm instance in open handler #21192
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
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only if you want, but we may be able to simplify a bit using zend_mempcpy instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.