-
Notifications
You must be signed in to change notification settings - Fork 12
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
really disable risky functions #19
base: master
Are you sure you want to change the base?
Conversation
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.
Good catch & thank you for looking into this.
I have a question because the PR seems to hardcode disabled functions, see inline comment.
realpath_turbo.c
Outdated
@@ -118,6 +113,12 @@ PHP_RINIT_FUNCTION(realpath_turbo) | |||
|
|||
PHP_MINIT_FUNCTION(realpath_turbo) | |||
{ | |||
#if PHP_MAJOR_VERSION < 8 | |||
zend_disable_function("link", sizeof("link")-1 TSRMLS_CC); |
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.
I am wondering about this change. Looks like we would now always disable these functions...
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.
I have add a test for this.
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.
In short, function from configuration are disabled at PHP startup, additional ones by the plugin during MINIT.
The ini stuff is only useful if some user check configuration, for consistency
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, I don't read enough your question...
Looks like we would now always disable these functions...
Indeed... grr
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.
Should be ok now, + new test
@Whissi FYI, this package was requested by user of my repository, the reason why I look a bit on it See https://blog.remirepo.net/pages/PECL-extensions-RPM-status |
@@ -2,9 +2,11 @@ | |||
#include "realpath_turbo_private.h" | |||
|
|||
static zend_function_entry realpath_turbo_functions[] = { | |||
{NULL, NULL, NULL} | |||
PHP_FE_END |
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.
exists since 7.3.7
Ready for review
Tested with PHP 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0.0beta4