PH7 icon indicating copy to clipboard operation
PH7 copied to clipboard

Unable to include more than 1 file from PH7_VM_CONFIG_IMPORT_PATH.

Open Maxwell175 opened this issue 7 years ago • 6 comments

Hello,

I discovered this strange, obscure bug where the second include/require of a file from the PH7_VM_CONFIG_IMPORT_PATH doesn't work. After some investigation, I found that when PH7_StreamOpenHandle is called for the second include, SySetGetNextEntry returns garbage on the second round of the while loop (first time it correctly returns ./).

I just can't seem to find the root of this problem, though. My temporary mitigation is to chdir to the import path, but that's just not right.

Thanks

Using latest version built with -DPH7_ENABLE_THREADS -DMAP_FILE=0x0001. Run on Ubuntu 18.04 x64.

Maxwell175 avatar May 16 '18 04:05 Maxwell175

Could you post the chunk of code you used to produce such behavior?

symisc avatar May 16 '18 07:05 symisc

This is an open source project, so I'll just link you to it.

Actual PH7 implementation: https://github.com/MDTech-us-MAN/SSNFS/blob/326d73544629fef0cb58ae18cf5dd6fab4b80d58/SSNFSd/ssnfswebworker.cpp#L282 Sample PHP file: https://github.com/MDTech-us-MAN/SSNFS/blob/326d73544629fef0cb58ae18cf5dd6fab4b80d58/SSNFSd/webpanel/index.php

Maxwell175 avatar May 17 '18 03:05 Maxwell175

If the first file is included correctly and not the second. Are you sure that this file is accessible (permissions, etc.). Try using require_once, include directive instead to check if the problem persists.

symisc avatar May 17 '18 10:05 symisc

I tried both already. This is definitely not a permissions problem, since it works just fine if I chdir (cd) to the same import directory.

Maxwell.

On May 17, 2018, 6:21 AM, at 6:21 AM, Symisc Systems [email protected] wrote:

If the first file is included correctly and not the second. Are you sure that this file is accessible (permissions, etc.). Try using require_once, include directive instead to check if the problem persists.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/symisc/PH7/issues/20#issuecomment-389819365

Maxwell175 avatar May 17 '18 13:05 Maxwell175

Did you configure PH7_VM_CONFIG_IMPORT_PATH with the target path in your code? I did not see any reference to it in your code.

symisc avatar May 17 '18 13:05 symisc

Yes. I did and like I said, it worked just fine for the first include.

On May 17, 2018, 9:51 AM, at 9:51 AM, Symisc Systems [email protected] wrote:

Did you configure PH7_VM_CONFIG_IMPORT_PATH with the target path in your code? I did not see any reference to it in your code.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/symisc/PH7/issues/20#issuecomment-389873462

Maxwell175 avatar May 17 '18 13:05 Maxwell175