Page Index Toggle Pages: 1 [2] 
Topic Tools
Hot Topic (More than 10 Replies) Advanced Settings will not save some some Windows Machines (Read 4,347 times)
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #2 - Sep 21st, 2012 at 9:34pm
Post Tools
Do you have a 'grub' boot on that machine?  Maybe Linux has to be the default boot??? (that is the case on this box).

Quote:
I'm guessing though, that an OS detector and a warning for admin that there might maybe be issues would be in order?


I think that is the right approach. When we grok what the code is really doing maybe we can have a better solution.

I have to say it was/is surely bizarre.  This is the first time I have seen it.  

Well, at least we know how to fix for now...

Edited:
The 2.3.1 board on here seems OK, My impression earlier was it would not save - but I was a tad rattled...


Wink
« Last Edit: Sep 21st, 2012 at 9:39pm by JonB »  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #1 - Sep 21st, 2012 at 9:06pm
Post Tools
I suspect the problem is a little spookier than just having an ext3 partition on an XP/2003 machine - since I have one on my test server (XP, WAMP and Activestate Perl 5.12) and can't duplicate the problem. I'm guessing though, that an OS detector and a warning for admin that there might maybe be issues would be in order?

On my XP testbed version, I don't even get the option of doing anything but enabling or disabling Free Space Check - none of the other options is available.  So, I'm also wondering if these options are enabled (though not functional or saveable) when this problem shows up?

Edited:
And I don't see anything in 2.3.1 regarding Space Checking, so that one may be okay.
 
« Last Edit: Sep 21st, 2012 at 9:27pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Advanced Settings will not save some some Windows Machines
Sep 21st, 2012 at 8:33pm
Post Tools
Earlier today, I had a problem I had only heard about with YaBB.  On some Windows Systems, it does not seem to possible to save Advanced Settings.

I had mostly heard about it with regards Windows Server 2003, and I had never been able to replicate it. Today it happened to me while testing the 9/17 zip of the 2.5.2 Beta. It didn't happen on a Windows Server, but rather on an XP Media Center machine with SP3.

I didn't realize quite what was happening at first, nor did I know I had a problem. I was trying to fix the SMTP/Mail Settings so I could test notification. Each time I would select either Advanced Settings, or one of its Tabs, Windows would open a Command Window (actually 4 or 5).  They would open and close so fast there was no telling what was happening.  Advanced Settings returns to the Default Tab after you save, so you don't actually see what you have just saved.
I had configured the 'sendmail' with known good settings, so I was surprised when I got an SMTP error when I tried to post to a Board with notifications enabled (and discovered that if that gets broken, you can't post to Boards with notifications set).  I was very puzzled. I went back to the Admin Center and found my settings had not been saved. Some testing showed my I couldn't save any of the settings there, not just e-mail.

I talked to Dandello and she assured me we had not tinkered with Settings_Advanced.pl. I tested on another similar XP machine - no issue. So I opened the code - Got it!, and I remembered the old fix - rip out the DiskQuota.

THEN - it hit me and why it is so rare.  This machine dual boots as a Linux server. I'm guessing that if YaBB can see a *nix filesystem, its going to perform those Linux checks.  Since there isn't a 'mounted' Linux system, what is returned is likely 'garbage'. Fast forward to the Save routine for Advanced Settings:

Code (Perl)
Select All
# Routine to save them
sub SaveSettings {
	my %settings = @_;
	$settings{'extensions'} =~ s~[^\ A-Za-z0-9_]~~g;
	@ext = split(/\s+/, $settings{'extensions'});

	if ($settings{'enable_quota'} && $settings{'enable_quota_value'} > 1 && $settings{'hostusername'}) {
		$settings{'enable_quota'} = $settings{'enable_quota_value'};
		$settings{'findfile_maxsize'} = 0;
		$settings{'enable_freespace_check'} = 0;
	} elsif (-d "$settings{'findfile_root'}" && $settings{'findfile_maxsize'} > 0 && !$settings{'enable_freespace_check'}) {
		$findfile_space = '1<>0';
		$settings{'enable_quota'} = 0;
	} elsif ($settings{'enable_freespace_check'}) {
		$settings{'findfile_maxsize'} = 0;
		$settings{'enable_quota'} = 0;
	} elsif (!-d "$settings{'findfile_root'}" || !$settings{'findfile_maxsize'}) {
		$settings{'findfile_time'} = 0;
		$settings{'findfile_maxsize'} = 0;
	}

	# Settings.pl stuff
	&SaveSettingsTo('Settings.pl', %settings);
}

1;
 



I have found that ripping out the code from Lines 34-56 cures the issue, and I know/recall that was the fix way back when.  But I don't think we knew why.  

My 'guess' is that code won't execute on a Windows machine with no Linux filesystem - so its not an issue often. However on dual-boot or test servers with a ext3 drive installed, it runs the code and gets a nonsense answer, thus fails a test (I don't see an else to fall through onto); thus no save.

My thought is that the diskquota code needs a test against the Windows OS being what runs YaBB. Mac's may be OK with the code (Applescript is extended bash), but I don't know enough to be 100% sure.

Code (Perl)
Select All
# Free Disk Space Checking
my @disk_space = qx{df -k .};
map { $_ =~ s/ +/  /g } @disk_space;

my @find = qx(find . -noleaf -type f -printf "%s-");

$hostusername = $hostusername || (split(/ +/, qx{ls -l YaBB.$yyext}))[2];
my @quota = qx{quota -u $hostusername -v};
$quota[0] =~ s/^ +//;
$quota[0] =~ s/ /&nbsp;/g;
$quota[1] =~ s/^ +//;
$quota[1] =~ s/ /&nbsp;/g;
my $quota_select = qq~$quota[0]<br />$quota[1]~;
if ($quota[2]) {
	my $ds = (split(/ +/, $disk_space[1], 2))[0] if !$enable_quota;
	$quota_select .= qq~<br /><select name="enable_quota_value">~;
	for (my $i = 2; $i < @quota; $i++) {
		$quota[$i] =~ s/^ +//;
		$quota[$i] =~ s/ +/&nbsp;&nbsp;/g;
		$quota_select .= qq~<option value="$i" ~ . ${isselected($i == $enable_quota || ($ds && $quota[$i] =~ /^$ds/))} . qq~>$quota[$i]</option>~;
	}
	$quota_select .= '</select>';
}

 



The qx() executes a (Linux typically) system command -
That was where my Command Windows were being generated from.
And since Windows was returning WTF? each time - things got screwed.

As a temporary fix - removing lines 34-56 from Settings_Advanced.pl does the trick to getting this working again on Windows.

I think this bug exists in 2.3.1, 2.4.x and 2.5 AE

~tada~
Wink
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Topic Tools
 
  « Board Index ‹ Board  ^Top