Re: [RFC] Extension Prepend Files
| From: | Rowan Collins | Date: | Mon, 05 Jan 2015 16:11:00 +0000 |
| Subject: | Re: [RFC] Extension Prepend Files | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80176@lists.php.net to get a copy of this message | ||
Benjamin Eberlei wrote on 04/01/2015 13:00:
Files must be either in the PHP include path, or via absolute path, for example by putting them right next to the shared object (.so) files and using the extension_dir path inside the code, see the following for an example (a hacked approach): https://github.com/QafooLabs/php-profiler-extension/blob/master/qafooprofiler.c#L744Beware that anything that looks in a configurable or environment-dependent list of include directories has the potential to open up security holes - anyone who can change that setting, or who has write access to a directory with higher priority, can inject code in a very broad context. It can also lead to surprising side effects if a file with the same name is coincidentally placed into more than one directory in the search path. I think if the intention is for extensions to ship these files directly, the registration mechanism should create an absolute path based either on a single configured directory, which distributors will set based on their installation paths, or on the directory containing the .so file being loaded. Regards, -- Rowan Collins [IMSoP]