phpgroupware-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-tracker] [bugs #10813] FUDForum setup failed (incorrect us


From: JM López-Cepero
Subject: [Phpgroupware-tracker] [bugs #10813] FUDForum setup failed (incorrect use of readdir)
Date: Wed, 27 Oct 2004 20:48:58 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040416 Firefox/0.8

This mail is an automated notification from the bugs tracker
 of the project: phpGroupWare.




/**************************************************************************/
[bugs #10813] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10813>
Project: phpGroupWare
Submitted by: JM López-Cepero
On: Thu 10/28/2004 at 00:43

Item Group:  0.9.16.003
Category:  phpgw-FUDForum
Severity:  5 - Average
Priority:  6
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open
Component Version:  CVS
Platform Version:  GNU/Linux - RedHat/Fedora
Reproducibility:  Every Time
Planned Release:  None
Fixed Release:  


Summary:  FUDForum setup failed (incorrect use of readdir)

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











For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10813>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]