test.functions.php missing 2.2

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
system9866
Forum Members
Forum Members
Posts: 25
Joined: Tue Oct 06, 2015 12:21 pm

test.functions.php missing 2.2

Post by system9866 »

Hello, I have recently updated my sites to 2.2 but now can't load the following pages in the backend,

System Maintenance
System Information
System Verification

In the error log it says

[14-Jun-2017 13:09:00 Europe/London] PHP Fatal error: require_once(): Failed opening required '/home/xxxxxxx/public_html/lib/test.functions.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxxx/public_html/admin/systemmaintenance.php on line 41

This file appears to be missing - was this deleted?
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: test.functions.php missing 2.2

Post by JamesT »

Those pages work for me and test.functions.php is present on my CMSMS 2.2 installation.
system9866
Forum Members
Forum Members
Posts: 25
Joined: Tue Oct 06, 2015 12:21 pm

Re: test.functions.php missing 2.2

Post by system9866 »

I have uploaded the file and all seems as normal now. It is a little odd why it was missing / removed?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1609
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: test.functions.php missing 2.2

Post by DIGI3 »

I've had host's anti-virus programs remove a file before, or could have been a file system/hardware glitch.
Not getting the answer you need? CMSMS support options
User avatar
Trenia
Forum Members
Forum Members
Posts: 81
Joined: Thu Dec 11, 2008 12:48 pm
Location: Norway

Re: test.functions.php missing 2.2

Post by Trenia »

Same thing happened to me after upgrade to 2.2. File is missing. Downloaded the file from another installation, but when uploading the file is stopped by the the filemanager in Cpanel, saying it contains virus.

When making a new file called test.functions.php and pasting in the code, the file is created but gets deleted somehow when page is refreshed. Why? Any suggestions on how to fix?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: test.functions.php missing 2.2

Post by calguy1000 »

I confirmed that this file IS present in the archive for 2.2 and is installed properly in yet another test installation.

So I think your host is messing with your files. Perhaps due to some false-positive virus detection or something.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: test.functions.php missing 2.2

Post by JamesT »

I don't use CMSMS on a cPanel host, but I uploaded test.functions.php to a cPanel host using the File Manager and got this:
The file you uploaded, test.functions.php, contains a virus so the upload was canceled: YARA.multiple_webshells_0018.UNOFFICIAL FOUND
It seems like it needs to be reported as a false positive to cPanel.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: test.functions.php missing 2.2

Post by calguy1000 »

Don't think it's a cpanel thing as only 2 people have noted this.

I think it's more of a 'host implementing a custom set of rules' thing.

I'd complain to my host, and send them that rule information, and a copy of the file.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Trenia
Forum Members
Forum Members
Posts: 81
Joined: Thu Dec 11, 2008 12:48 pm
Location: Norway

Re: test.functions.php missing 2.2

Post by Trenia »

My host has now solved the problem for me. I do not know what they did to correct it, but I have requested an explanation so that others with the same problem might get a clue as to what to say/do to fix it. If/when I get an answer I will post it here. :)
User avatar
Trenia
Forum Members
Forum Members
Posts: 81
Joined: Thu Dec 11, 2008 12:48 pm
Location: Norway

Re: test.functions.php missing 2.2

Post by Trenia »

Trenia wrote:My host has now solved the problem for me. I do not know what they did to correct it, but I have requested an explanation so that others with the same problem might get a clue as to what to say/do to fix it. If/when I get an answer I will post it here. :)
Server host says that the challenge was to configure the anti virus software to ignore the test.functions file and not react to it as virus infected and delete the file. So the upgrade to cmsms 2.2 created a false-positive which now has been reported.
drLobotomy
New Member
New Member
Posts: 3
Joined: Wed Feb 11, 2009 8:25 pm

Re: test.functions.php missing 2.2

Post by drLobotomy »

Just to add some more info on this matter because it has happened to me on two installations on different hosts.

This is due to Yara rules, a set of rules for identifying threats (usually used in ClamAV by certain hosts it seems). I don't know how popular the use of these rules is but my metrics based on my installations, I have the problem in 2 out of the 9 different hosting providers I have CMSMS sites on.

The rule that causes the problem is named multiple_webshells_0018 (https://github.com/Yara-Rules/rules/blo ... .yar#L4764.

It throws a positive on the permission_octal2string function in test.functions.php for 2 lines:

Code: Select all

$owner = ($mode & 00400) ? 'r' : '-';
and

Code: Select all

return $type . $owner . $group . $other;
A simple change in the wording eg. changing $owner to $fowner makes the file pass the validation.

For anynone interested, they have an online tool to test files against the rulesets https://analysis.yararules.com/.

If I understood correctly Trenia has reported it to the Yara team but so far I don't see any changes on the rule. Maybe if the CMSMS team report it to the Yara team they might get on with it faster or else a change of the variable wording would perhaps be feasible.
Locked

Return to “CMSMS Core”