bugphpGroupWare - Bugs: bug #10813, FUDForum setup failed (incorrect...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #10813: FUDForum setup failed (incorrect use of readdir)

Submitted by:  JM López-Cepero <andvaranaut>
Submitted on:  Thu 28 Oct 2004 12:43:41 AM UTC  
 
Item Group: 0.9.16.003Category: phpgw-FUDForum
Severity: 3 - NormalPriority: 6
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: SVNOperating System: GNU/Linux - RedHat/Fedora
Reproducibility: Every TimePlanned Release: None
Fixed Release: 

Thu 28 Oct 2004 12:43:41 AM UTC, original submission:

Installing the stock FUDForum supplied with phpgw is highly problematic. The setup would fail leaving the apache log full of errors about not having permission to copy weird files. Updating from CVS did not help.

I was able to fix it correcting a few lines in the setup file (the original index.php). The idea is that there are two instances of code which read

--8<--8<--8<--8<---

$dir = opendir(PHPGW_SERVER_ROOT."/fudforum/setup/base/{$d}");
readdir($dir); readdir($dir);
while ($f = readdir($dir)) {
// do stuff

--8<--8<--8<--8<---

I noticed that this could be the problem because in the error log a lot of the files trying to be copied had several instances of .. in their path. I changed the above to

--8<--8<--8<--8<---

$dir = opendir(PHPGW_SERVER_ROOT."/fudforum/setup/base/{$d}");
while ($f = readdir($dir)) {
if ($f=="." || $f=="..") continue;
// do stuff

--8<--8<--8<--8<---

and it worked. There are two instances to correct.

It seems that the FUDForum people assume that readdir'ing twice will take them past . and .., but this assumption is dangerous at best, since the fact that the above change fixes its behaviour means that (as of PHP 4.3.8) this is not true.

I don't know if this is specific to PHPGW (I don't think so) or it's more of a fudforum issue, but I think that at least a warning should be issued to people trying to install fudforum in phpgw. Also, there are lots of double readdirs like the ones above scattered around the code in fudforum, which I think will also have to be corrected.

Maybe updating to a more recent of fudforum would help, but I have no clue on how to do that (or even if it's possible).

I'm now seriously considering correcting every opendir loop in fudforum by hand, but any help (or more elegant solution) would be appreciated.

Thank you - CP

JM López-Cepero <andvaranaut>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup1