FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Comments on installing FUD 1.1.1 on Win2K
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Comments on installing FUD 1.1.1 on Win2K [message #362] Fri, 08 February 2002 04:54 Go to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

I like your board quite a lot... It's
the best I've seen so far.

I had a go at installing on My Dev box (Windows for
Dev, Linux for Prod)...

Here is the board on Win2K
http://dragonx.northern.ca/forums/

To level set, these comments are from a "know-it-all"
PHP guy who didn't read the readme... (so, if
they are covered in the readme just ignore me, plz) Smile

1) include_path

I got this when I first started up the forum:

Warning: Failed opening 'GLOBALS.php' for inclusion (include_path='.;/apache/includes') in c:!httpdhtdocsforumsindex.php on line 25

Fatal error: Call to undefined function: fud_use() in c:!httpdhtdocsforumsindex.php on line 27


Had to fix the include_path and away it went. (You might
mention that in the install bout where you ask for the
data directory - btw great work on the install, very nice!)

2) WWW_ROOT

my value for WWW_ROOT in GLOBALS.php got set
to the temp directory... not sure if I just typed
something in the wrong field during the install or
if it's mis-linked.

In any case it showed an inconsistency in how the graphics
are called.

Specifically, the graphics buttons for F.A.Q., Register, Log
In, and Forum Home
, broke because my $WWW_Root is wrong,
but oddly the search graphic loaded ok.

Fixing the WWW_Root value seems to have eliminated this problem
so all the graphics work.

3) Not an Administrator

I am allowed to moderate, see reported messages, and the
Custom Avatar que... I tried with and without cookies...
but I can't get into the admin system as the adminstrator.

I can post as adminstrator though....

It maybe helpful noting that I use admin and not root as my
administrator login.

Not sure what to do here... help!

4) Registration fails -- user error not configuring SMTP

Warning: Failed to Connect in c:!httpdFUDForum_dataincludeemail.inc on line 158

Warning: Cannot add header information - headers already sent by (output started at c:!httpdFUDForum_dataincludeemail.inc:15Cool in c:!httpdFUDForum_dataincludewidgets.inc on line 158


This is a problem with my PHP SMTP configuration under windows,
so if you get anyone installing it on windows asking about
it SMTP Config is the problem.

Well, that's all for now... I need to have a rest and
crack at this again tomorrow... looks like I need to rebuild
my metabase to get my SMTP working (I'm not a windows guy so
that ought to be a hoot)...

-Ironstorm

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #363 is a reply to message #362] Fri, 08 February 2002 06:19 Go to previous messageGo to next message
hackie is currently offline  hackie   Canada
Messages: 177
Registered: January 2002
Karma: 0
Senior Member
Core Developer

ironstorm wrote on Thu, 07 February 2002 11:54 PM

I like your board quite a lot... It's
the best I've seen so far.

I had a go at installing on My Dev box (Windows for
Dev, Linux for Prod)...


Question:

Why are you using windows for a development box? that's just so wrong Wink... Linux is free remember? another copy of it won't cost anything. Don't like Linux? there is FreeBSD!

Quote:


Here is the board on Win2K
http://dragonx.northern.ca/forums/

To level set, these comments are from a "know-it-all"
PHP guy who didn't read the readme... (so, if
they are covered in the readme just ignore me, plz) Smile

1) include_path
I got this when I first started up the forum:

Warning: Failed opening 'GLOBALS.php' for inclusion (include_path='.;/apache/includes') in c:!httpdhtdocsforumsindex.php on line 25

Fatal error: Call to undefined function: fud_use() in c:!httpdhtdocsforumsindex.php on line 27


Had to fix the include_path and away it went. (You might
mention that in the install bout where you ask for the
data directory - btw great work on the install, very nice!)



Okie Wink.. see, we don't have a single windows computer to test this on Smile.... (as a rule we prefer to avoid Microsoft software to keep our sanity Wink. We got access to I.E. via VNC to test layout on). Other then that all development is done on Linux with mozilla as the web browser this stuff is mostly developed for Wink

Quote:


2) WWW_ROOT
my value for WWW_ROOT in GLOBALS.php got set
to the temp directory... not sure if I just typed
something in the wrong field during the install or
if it's mis-linked.



Hmm.. that could very well be a BUG.. thanks for reporting. We'll check this, and if it's a problem is certainly will be gone by the next release.

Quote:


In any case it showed an inconsistency in how the graphics
are called.

Specifically, the graphics buttons for F.A.Q., Register, Log
In, and Forum Home
, broke because my $WWW_Root is wrong,
but oddly the search graphic loaded ok.

Fixing the WWW_Root value seems to have eliminated this problem
so all the graphics work.


Err.... wrong WWW_ROOT will mess many things up Smile...

Quote:


3) Not an Administrator

I am allowed to moderate, see reported messages, and the
Custom Avatar que... I tried with and without cookies...
but I can't get into the admin system as the adminstrator.

I can post as adminstrator though....

It maybe helpful noting that I use admin and not root as my
administrator login.

Not sure what to do here... help!


This one is possibly because the moderator control panel works only with COOKIES... can't use sessions... And since your development box probably used by you by ip you can't set cookies (you can only set a cookie if you have domain).

We're going to possibly make it work with sessions in the next release (some time around Monday or Tuesday). For now what you should do is your hosts file to hard code a domain name for your IP so that the browser allows you to set cookies

Quote:


4) Registration fails -- user error not configuring SMTP

Warning: Failed to Connect in c:!httpdFUDForum_dataincludeemail.inc on line 158

Warning: Cannot add header information - headers already sent by (output started at c:!httpdFUDForum_dataincludeemail.inc:15Cool in c:!httpdFUDForum_dataincludewidgets.inc on line 158


This is a problem with my PHP SMTP configuration under windows,
so if you get anyone installing it on windows asking about
it SMTP Config is the problem.



Err... I'd think this is something with php config since we use php's native MAIL function.... so you'd have to make sure php can mail();

Quote:


Well, that's all for now... I need to have a rest and
crack at this again tomorrow... looks like I need to rebuild
my metabase to get my SMTP working (I'm not a windows guy so
that ought to be a hoot)...



Wow thanks for the feedback Smile.... We will address all these.

Hehe.. as you probably noticed we're not windows people either Smile. And anyone doing web hosting/Internet development shouldn't be anyway Smile

I like your board quite a l


cc intelligence.c -o intelligence
$ ./intelligence
Segmentation fault
Re: Comments on installing FUD 1.1.1 on Win2K [message #364 is a reply to message #362] Fri, 08 February 2002 06:52 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The WWW_ROOT screwup seems to be the fault of install script, I'll need to see tomorrow.

If your WWW_ROOT had tmp in it, I suspect that your COOKIE_PATH variable is screwed up (as it is related to WWW_ROOT), it is anything other then "/forum/" then it is wrong. Just to be sure you may also want to check COOKIE_DOMAIN variable, although I don't suspect there would be a problem with it.

Fixing that variable should resolve your cookie problem and allow you to access the admin control panel. Which like hackie said, requires you to have a valid cookie and cannot work by sessions alone like the rest of the forum.

Thanks for the detailed feedback, it is much appreciated.

P.S. I am curios about 1 thing on Windows, what did you have inside your INCLUDE variable inside GLOBALS.php?


FUDforum Core Developer
Re: Comments on installing FUD 1.1.1 on Win2K [message #369 is a reply to message #364] Fri, 08 February 2002 15:40 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

From GLOBALS.php:
$INCLUDE 		= "c:/!httpd/FUDForum_data/include/";
/* ^- include line is right AFAIK */
...
// $WWW_ROOT = "C:/temp/";
$WWW_ROOT = "http://dragonx.northern.ca/forums/";
...
// $COOKIE_PATH = "/temp/";
$COOKIE_PATH = "/forums/";


Once I fixed the Cookie_path I could get into the admin
center... which allowed me to discovered some more pain... Laughing (no worries, it will
be worth it)

Warning: file("GLOBALS.php") - No such file or directory in c:!httpdFUDForum_dataincludeglob.inc on line 30

Warning: Variable passed to reset() is not an array or object in c:!httpdhtdocsforumsadmadmglobal.php on line 39

Warning: Variable passed to each() is not an array or object in c:!httpdhtdocsforumsadmadmglobal.php on line 70


Line 37 of admglobal.php is the source of the error:
$cf = get_config('GLOBALS.php');


I'm guessing it should read:
$cf = get_config($GLOBALS['INCLUDE'].'GLOBALS.php');


I'm going to go try that and see what happens...

[Aside]
Also looking at GLOBALS.php (a lot of files have it)
I noticed that line 20 and 21 do this:
?>
<?php


I'm always wary of this kinda of thing since I started using
sessions (right after I got my first header related warnings), personally I would delete those lines.
[/Aside]
Re: Comments on installing FUD 1.1.1 on Win2K [message #370 is a reply to message #369] Fri, 08 February 2002 15:53 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

Quote:


Line 37 of admglobal.php is the source of the error:
$cf = get_config('GLOBALS.php');


I'm guessing it should read:
$cf = get_config($GLOBALS['INCLUDE'].'GLOBALS.php');



Yup that worked.

But a new bug surfaced Exclamation
[[ BTW, I should mention these are now errors from when you want
to "set" (save) the configuration. ]]


Warning: fopen("/tmp/1701637662", "w") - No such file or directory in c:!httpdhtdocsforumsadmadmglobal.php on line 56

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58
...


This one occurs because of line 55 of admglobal.php:
		$fn = '/tmp/'.$randval;

(Laughing I think that that will work on any system besides windows, since even Mac runs BSD...)

I'm going to try replacing it with
		$fn = $GLOBALS['TMP'].$randval;

to see if that'll fly.

[Updated on: Fri, 08 February 2002 16:13]

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #371 is a reply to message #362] Fri, 08 February 2002 16:00 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

Seems the fix is not as simple as that... hmm...
(at least the first Warning went away Rolling Eyes )


Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 60

Warning: Unable to open 'c:/!httpd/FUDForum_data/tmp/1696864161' for reading: No such file or directory in c:!httpdhtdocsforumsadmadmglobal.php on line 61

Warning: Unlink failed (No such file or directory) in c:!httpdhtdocsforumsadmadmglobal.php on line 62

Warning: Cannot add header information - headers already sent by (output started at c:!httpdhtdocsforumsadmadmglobal.php:5Cool in c:!httpdhtdocsforumsadmadmglobal.php on line 64

Re: Comments on installing FUD 1.1.1 on Win2K [message #374 is a reply to message #369] Fri, 08 February 2002 16:30 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Quote:


I'm guessing it should read:
$cf = get_config($GLOBALS['INCLUDE'].'GLOBALS.php');




Not really, because there is a GLOBALS.php symlink in the admin directory, which when opened should open the main GLOBALS.php file inside your INCLUDE directory.

Since your solution works, I am guessing the symlink is not being resolved in Windows. I'll fix this in the upcomming release.

Quote:


Also looking at GLOBALS.php (a lot of files have it)
I noticed that line 20 and 21 do this:
?>
<?php




Already fixed in the development release, the next upgrade script will fix this problem.


FUDforum Core Developer
Re: Comments on installing FUD 1.1.1 on Win2K [message #375 is a reply to message #371] Fri, 08 February 2002 16:33 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
ironstorm wrote on Fri, 08 February 2002 11:00 AM

Seems the fix is not as simple as that... hmm...
(at least the first Warning went away Rolling Eyes )


Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 60

Warning: Unable to open 'c:/!httpd/FUDForum_data/tmp/1696864161' for reading: No such file or directory in c:!httpdhtdocsforumsadmadmglobal.php on line 61

Warning: Unlink failed (No such file or directory) in c:!httpdhtdocsforumsadmadmglobal.php on line 62

Warning: Cannot add header information - headers already sent by (output started at c:!httpdhtdocsforumsadmadmglobal.php:5Cool in c:!httpdhtdocsforumsadmadmglobal.php on line 64




'c:/!httpd/FUDForum_data/tmp/1696864161'

Is this a valid path, the ! before the httpd is a little freaky....

I am not sure, may be the wrong type of is the problem?

Could you change your tmp path to say c:!httpdFUDForum_datatmp

FUDforum Core Developer

[Updated on: Fri, 08 February 2002 16:39]

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #376 is a reply to message #362] Fri, 08 February 2002 16:47 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

Quote:

Not really, because there is a GLOBALS.php symlink in the admin directory, which when opened should open the main GLOBALS.php file inside your INCLUDE directory.

Since your solution works, I am guessing the symlink is not being resolved in Windows. I'll fix this in the upcomming release.


Actually, windows doesn't have symlinks... (though, I really
wish it did)

Quote:


'c:/!httpd/FUDForum_data/tmp/1696864161'

Is this a valid path, the ! before the httpd is a little freaky....

I am not sure, may be the wrong type of is the problem?

Could you change your tmp path to say c:!httpdFUDForum_datatmp


No worries, "c:/!httpd/FUDForum_data/tmp/" is valid.

I think I need to do a bit more poking around in admglobal.php code to figure out how it works. But that's an after lunch activity me thinks.





Re: Comments on installing FUD 1.1.1 on Win2K [message #377 is a reply to message #376] Fri, 08 February 2002 17:04 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Heh, while debuging I found another small bug, which has now been fixed. The nazi removal of \ Razz

My original question, which got badly parsed cause of this bug is:

I am *guessing* that your $TMP is set to c:/!httpd/FUDForum_data/tmp/

if you change it to:

c:\!httpd\FUDForum_data\tmp\

It *might* fix the problem.


FUDforum Core Developer
Re: Comments on installing FUD 1.1.1 on Win2K [message #378 is a reply to message #376] Fri, 08 February 2002 17:30 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
ironstorm wrote on Fri, 08 February 2002 11:47 AM

Quote:

Not really, because there is a GLOBALS.php symlink in the admin directory, which when opened should open the main GLOBALS.php file inside your INCLUDE directory.

Since your solution works, I am guessing the symlink is not being resolved in Windows. I'll fix this in the upcomming release.


Actually, windows doesn't have symlinks... (though, I really
wish it did)



Oh I think I understand how your setup works *am I slow or what*

To get FUDforum to work you've added the path of your include directory to php's include_path? So, there actually no symlinks inside the forum/ & and forum/adm/ directories. Which explains the reason why you needed to pass the
$GLOBALS['INCLUDE'].'GLOBALS.php'
to get_config.

I am guessing correctly so far?


FUDforum Core Developer

[Updated on: Fri, 08 February 2002 19:14]

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #379 is a reply to message #362] Fri, 08 February 2002 19:10 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

Quote:

if you change it to:

c:!httpdFUDForum_datatmp

It *might* fix the problem.


changing $TMP to:
"c:!httpdFUDForum_datatmp"

seems to work no differently then
"c:/!httpd/FUDForum_data/tmp/"

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

[Looks like there is 1 of ^- errors per option on the page]

Warning: Unable to open 'c:!httpdFUDForum_datatmp2081576781' for reading: No such file or directory in c:!httpdhtdocsforumsadmadmglobal.php on line 61

Warning: Unlink failed (No such file or directory) in c:!httpdhtdocsforumsadmadmglobal.php on line 62

Warning: Cannot add header information - headers already sent by (output started at c:!httpdhtdocsforumsadmadmglobal.php:5Cool in c:!httpdhtdocsforumsadmadmglobal.php on line 64


Quote:


Oh I think I understand how your setup works *am I slow or what*

To get FUDforum to work you've added the path of your include directory to php's include_path? So, there actually no symlinks inside the forum/ & and forum/adm/ directories. Which explains the reason why you needed to pass the
$GLOBALS['INCLUDE'].'GLOBALS.php'
to get_config.

I am guessing correctly so far?



Correct.

Don't feel bad, I'm figuring out how you built it on Linux
at the same time... Smile Until the last post it hadn't even
occurred to me that you were symlinking stuff.

The symlinks stuff does explain why I had to put the
Data directory into the my inclue_path and why GLOBALS.php
would work openning it up without the preceding path on Linux.
(since fopen won't search the include_path, the symlink thing
is the only way that could have worked).Can you please I like your boar

[Updated on: Fri, 08 February 2002 20:50]

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #380 is a reply to message #379] Fri, 08 February 2002 19:18 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can you please try doing the following test:

go in to your forum's main web directory and create a file with the following code:

<?php
include "GLOBALS.php";

$fp = fopen($GLOBALS['TMP'].'randomfile', 'w');
if( !$fp ) {
exit("Cannot write to tmp directory");
}
fclose($fp);
?>
FUDforum Core Developer
Re: Comments on installing FUD 1.1.1 on Win2K [message #381 is a reply to message #362] Fri, 08 February 2002 20:46 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

The test
works...

Here's what's in that file.

TMP file test

Result:

<?php
include "GLOBALS.php";
$fp = fopen($GLOBALS['TMP'].'randomfile', 'w');
if( !$fp )
{
exit("Cannot write to tmp directory");
}
fclose($fp);
?>
Re: Comments on installing FUD 1.1.1 on Win2K [message #385 is a reply to message #379] Sun, 10 February 2002 05:27 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

ironstorm wrote on Fri, 08 February 2002 2:10 PM



Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

Warning: Supplied argument is not a valid File-Handle resource in c:!httpdhtdocsforumsadmadmglobal.php on line 58

[Looks like there is 1 of ^- errors per option on the page]

Warning: Unable to open 'c:!httpdFUDForum_datatmp2081576781' for reading: No such file or directory in c:!httpdhtdocsforumsadmadmglobal.php on line 61

Warning: Unlink failed (No such file or directory) in c:!httpdhtdocsforumsadmadmglobal.php on line 62

Warning: Cannot add header information - headers already sent by (output started at c:!httpdhtdocsforumsadmadmglobal.php:5Cool in c:!httpdhtdocsforumsadmadmglobal.php on line 64





I've figured out what caused this... while I was trying to
make the errors disappear before the temp file path was fixed
I accidently commented out the fopen... When I uncommented
it everything worked, accept for a header error I was getting
cause I didn't take out the extra ?>n<? after the license...

Next thing to try is a clean re-install so I can work through
it again and make a summary of the stuff I changed to get
it working.
Win2
Installation Fixes Posted [message #393 is a reply to message #362] Sun, 10 February 2002 18:55 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

Win2K - Fixes to install 1.1.1
http://fud.prohost.org/forum/msg.php?th=83

Got a summary of everything that a user needs to
do to get things going on Windows 2000.
Re: Comments on installing FUD 1.1.1 on Win2K [message #411 is a reply to message #393] Mon, 11 February 2002 19:36 Go to previous messageGo to next message
hackie is currently offline  hackie   Canada
Messages: 177
Registered: January 2002
Karma: 0
Senior Member
Core Developer

ironstorm wrote on Sun, 10 February 2002 1:55 PM

Win2K - Fixes to install 1.1.1
http://fud.prohost.org/forum/msg.php?th=83

Got a summary of everything that a user needs to
do to get things going on Windows 2000.


this isn't the 1/2 of it.. you man, helped us a lot Smile for example if you notice we have a bug with in the post bodies (or anywhere else), which we already fixed in 1.2.0 which is gunna comeout in a a day or so.... and it's also a whole lot faster due to this fix Smile

cc intelligence.c -o intelligence
$ ./intelligence
Segmentation fault

[Updated on: Mon, 11 February 2002 19:37]

Report message to a moderator

Re: Comments on installing FUD 1.1.1 on Win2K [message #414 is a reply to message #411] Mon, 11 February 2002 19:49 Go to previous messageGo to next message
ironstorm is currently offline  ironstorm   Canada
Messages: 89
Registered: February 2002
Location: Toronto, Ontario, Canada
Karma: 0
Member

hackie wrote on Mon, 11 February 2002 2:36 PM


this isn't the 1/2 of it.. you man, helped us a lot Smile for example if you notice we have a bug with in the post bodies (or anywhere else), which we already fixed in 1.2.0 which is gunna comeout in a a day or so.... and it's also a whole lot faster due to this fix Smile


Thank goodness, I can't wait for 1.2, I have a bunch of guys
in my dept beating on 1.1.1 and we've discovered that post
bodies bug and a file upload problem in attach.inc to do
with an extra slash being added in...

admin wrote on Mon, 11 February 2002 7:41 PM

Here are the two functions that need to be corrected in attach.inc to fix uploads

	function replace($original_name, $cur_location)
{
$proto = proto($cur_location);
Q("UPDATE fud_attach SET proto='$proto', original_name='$original_name', location='$cur_location' WHERE id=".$this->id);
if ( $proto == 'LOCAL' ) {
$loc = $GLOBALS['FILE_STORE'].$this->id.'.atch'; // '/'.
if ( file_exists($loc) ) unlink($loc);
safe_attachment_copy($cur_location, $id);
}
}


And also
function safe_attachment_copy($source, $id)
{
$loc = $GLOBALS['FILE_STORE'].$id.'.atch'; //'/'.
if ( file_exists($loc) ) {
unlink($loc);
std_out('"'.$loc.'" already exists, but shouldn't (old file unlinked), check security', 'ERR');
}

$fp = @fopen($loc, 'w');
if ( !$fp ) {
std_out('unable to create source file ('.$loc.') check permissions on ('.$GLOBALS['FILE_STORE'].'), we suggest 1777', 'ERR');
exit('file attachment error');
}
chmod($loc, 0644);

$fp_s = fopen($source, 'r');
if ( !$fp_s ) {
fclose($fp);
std_out('unable to read temporary attachment file, ('.$source.')', 'ERR');
exit('file attachment error');
}

while ( $str=fread($fp_s, 4096) ) {
fwrite($fp, $str);
}
fclose($fp);
fclose($fp_s);

return $loc;
}

Re: Comments on installing FUD 1.1.1 on Win2K [message #419 is a reply to message #414] Mon, 11 February 2002 20:46 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Gotcha, this is actually also affecting the code which includes the styles.

I am going to cookup a script to look for all of those and fix them. Never came across before cause of UNIX only development.

The 1.1.9-dev running on this server already fixes many bugs related to windows.

Such as c:\test\blah\vdvfd\ can now be used properly.

The support for the \ slash is now exists in messages, usernames etc...

Thanks for bug report Smile.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 1.1.1 - SQL data not escaped [when magic quotes turned off]
Next Topic: Bugs in 1.1.9-dev (from CVS @ 8:30am Feb 12)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 21 13:43:15 GMT 2024

Total time taken to generate the page: 0.02640 seconds