wbDo is broken

Bug #613352 reported by Malcolm Fitzgerald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Woda
Fix Released
High
Xavier Brochard

Bug Description

I've tracked the problems I had recently to a bug in the wbDo subroutine. The subroutine is missing the keyword REQUIRE.

If you are using v4.6.10 you should replace wbDo with the version below.

The following files are affected:

/usr/local/woda/en/woda-max.pl
/usr/local/woda/en/include/cgiAdmAgentProcess.pl
/usr/local/woda/en/include/cgiAdmAgentProcessForm.pl
/usr/local/woda/en/include/cgiAdmDaily.pl
/usr/local/woda/en/include/cgiAdmIndexPDF.pl
/usr/local/woda/en/include/cgiAdmStatic.pl
/usr/local/woda/en/include/cgiGo.pl
/usr/local/woda/en/include/cgiQry.pl
/usr/local/woda/en/include/cgiXsearch.pl

sub wbDo { # do a cgi action ... load appropriate file first

    $_=shift (@_);;
    require "$WodaLibDir/$_.pl" unless defined &$_; # load
    &$_(@_); # execute
}

Changed in woda:
importance: Undecided → High
Revision history for this message
Xavier Brochard (xavier) wrote : Re: [Bug 613352] [NEW] wbDo is broken

known bug, already fixed in trunk and in 4.620-xavier branch

see revision 75 (2009-10-09):
"Add require instead of nothing (was do) in sub wbDo. It works without but it
shouldn't, according to perl doc"

Xavier
<email address hidden> - 09 54 06 16 26

Revision history for this message
Xavier Brochard (xavier) wrote :

already fix in trunk revision 75 (2009-10-09):
"Add require instead of nothing (was do) in sub wbDo. It works without but it shouldn't, according to perl doc"

Changed in woda:
assignee: nobody → Xavier Brochard (xavier)
status: New → Fix Released
Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :

Hi Xavier,

We should push out a new version for download that has this bug and the security hole fixed. These two are very important. The security bug is most serious but the wbDo bug affects QRY, ROWS, FETCH because Xsearch is affected, and all the subroutines that I listed in the email.

p.s. I finally discovered the problem. It had a number of causes but in the end it was my fault for not taking more care at setup.

# 1 I used v4_610 from launchpad - so it had the wbDo bug.
# 2 The cPanel was not displaying errors in the error log and the web host had compiled grep into an unusual location
# 3 I didn't read the status report closely - even though I looked at it dozens of times. It said clearly could not execute grep.

It was only after I knew that there should be errors being generated by the apache logs that I requested the host provide me with full error logs for the previous week. I opened them up and saw the log was full of "cannot execute program /usr/local/bin/grep". I ran 'which grep' to obtain the location and corrected the path in woda.conf.

To make it harder to trouble shoot I had three definition files all pointing at the same data source. This is where I was stupid. I copied and pasted the entire definition, including WBF. After doing that I had requests for changes to the fields. I did that but as Richard noticed, I had duplicated one of the fields in one definition file. This meant that the sort order for the fields was different in each of the definition files! That was bad. I moved all the fields out into their own file named WBF.pl and used require to call them in. This cleared up a number of unusual issues. The following day I found the problem with grep and the databases began working properly.

This reminds me that I improved AdmStatus. I have to put more effort into my updates on launchpad. I have a version that runs "which" if the program location given in woda.conf fails. I changed the error to display clearly in bold, red text and then to display the correct location.

Malcolm

Revision history for this message
Xavier Brochard (xavier) wrote :

Le samedi 7 août 2010 15:37:08, vous avez écrit :
> We should push out a new version for download that has this bug and the
> security hole fixed. These two are very important. The security bug is
> most serious but the wbDo bug affects QRY, ROWS, FETCH because Xsearch
> is affected, and all the subroutines that I listed in the email.

agree, could you do that? I'm very busy

> p.s. I finally discovered the problem. It had a number of causes but in
> the end it was my fault for not taking more care at setup.
>
> # 1 I used v4_610 from launchpad - so it had the wbDo bug.
> # 2 The cPanel was not displaying errors in the error log and the web host
> had compiled grep into an unusual location # 3 I didn't read the status
> report closely - even though I looked at it dozens of times. It said
> clearly could not execute grep.

The status and debug page are not very readable and sometimes hard to find.
We should work on that, because it is the first information one should see
after a fresh install.

> It was only after I knew that there should be errors being generated by
> the apache logs that I requested the host provide me with full error
> logs for the previous week. I opened them up and saw the log was full of
> "cannot execute program /usr/local/bin/grep". I ran 'which grep' to
> obtain the location and corrected the path in woda.conf.
>
> To make it harder to trouble shoot I had three definition files all
> pointing at the same data source. This is where I was stupid. I copied
> and pasted the entire definition, including WBF.

I allways use a "require" to load one or two common setup file: common setup
for tables and common fields (as it was done in Scix/Sops).

> After doing that I had
> requests for changes to the fields. I did that but as Richard noticed, I
> had duplicated one of the fields in one definition file. This meant that
> the sort order for the fields was different in each of the definition
> files! That was bad. I moved all the fields out into their own file
> named WBF.pl and used require to call them in. This cleared up a number
> of unusual issues. The following day I found the problem with grep and
> the databases began working properly.

>
> This reminds me that I improved AdmStatus. I have to put more effort
> into my updates on launchpad. I have a version that runs "which" if the
> program location given in woda.conf fails. I changed the error to
> display clearly in bold, red text and then to display the correct
> location.

can you send it to me?
I would like to test. By putting it in the contrib folder it should replace
the current cgi.

We should use this feature (the contrib folder) to test improved or new
functions with the help of the list.

Xavier
<email address hidden> - 09 54 06 16 26

Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :
Download full text (8.0 KiB)

On 14/08/2010, at 8:11 PM, Xavier Brochard wrote:

> Le samedi 7 août 2010 15:37:08, vous avez écrit :
>> We should push out a new version for download that has this bug and the
>> security hole fixed. These two are very important. The security bug is
>> most serious but the wbDo bug affects QRY, ROWS, FETCH because Xsearch
>> is affected, and all the subroutines that I listed in the email.
>
> agree, could you do that? I'm very busy

yes, I'll look at it today.

>
>> p.s. I finally discovered the problem. It had a number of causes but in
>> the end it was my fault for not taking more care at setup.
>>
>> # 1 I used v4_610 from launchpad - so it had the wbDo bug.
>> # 2 The cPanel was not displaying errors in the error log and the web host
>> had compiled grep into an unusual location # 3 I didn't read the status
>> report closely - even though I looked at it dozens of times. It said
>> clearly could not execute grep.
>
> The status and debug page are not very readable and sometimes hard to find.
> We should work on that, because it is the first information one should see
> after a fresh install.

That should be fairly easy. The information is there, it just needs to be laid out nicely and explained.

>
>> It was only after I knew that there should be errors being generated by
>> the apache logs that I requested the host provide me with full error
>> logs for the previous week. I opened them up and saw the log was full of
>> "cannot execute program /usr/local/bin/grep". I ran 'which grep' to
>> obtain the location and corrected the path in woda.conf.
>>
>> To make it harder to trouble shoot I had three definition files all
>> pointing at the same data source. This is where I was stupid. I copied
>> and pasted the entire definition, including WBF.
>
> I allways use a "require" to load one or two common setup file: common setup
> for tables and common fields (as it was done in Scix/Sops).

That is normally what I would do too. I did it differently because I had seen some problems which I thought (my mistake) were caused by the package namespace. The real problem was the wbDo issue.

>
>> After doing that I had
>> requests for changes to the fields. I did that but as Richard noticed, I
>> had duplicated one of the fields in one definition file. This meant that
>> the sort order for the fields was different in each of the definition
>> files! That was bad. I moved all the fields out into their own file
>> named WBF.pl and used require to call them in. This cleared up a number
>> of unusual issues. The following day I found the problem with grep and
>> the databases began working properly.
>
>
>>
>> This reminds me that I improved AdmStatus. I have to put more effort
>> into my updates on launchpad. I have a version that runs "which" if the
>> program location given in woda.conf fails. I changed the error to
>> display clearly in bold, red text and then to display the correct
>> location.
>
> can you send it to me?
> I would like to test. By putting it in the contrib folder it should replace
> the current cgi.

sub myAdmWodaStatus {
# print WODA status
# try to locate program paths when programs defined in woda.conf a...

Read more...

Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :

The modified version is attached. I'm not sure how to make it available on launchpad.

malcolm

On 14/08/2010, at 8:11 PM, Xavier Brochard wrote:

> Le samedi 7 août 2010 15:37:08, vous avez écrit :
>> We should push out a new version for download that has this bug and the
>> security hole fixed. These two are very important. The security bug is
>> most serious but the wbDo bug affects QRY, ROWS, FETCH because Xsearch
>> is affected, and all the subroutines that I listed in the email.
>
> agree, could you do that? I'm very busy

Revision history for this message
Xavier Brochard (xavier) wrote :

Hi Malcolm

Le lundi 16 août 2010 02:58:51, vous avez écrit :
> The modified version is attached. I'm not sure how to make it available
> on launchpad.

There is some problems in the directory tree: it contains a __MACOSX folder
and the "include" folder is in the wrong place. But more, it looks like you
have released from the 4.620 branch :-)

Well, I have some spare time now. I will patch the 4.610 branch and create the
release. I will document the process of releasing, as launchpad make it a bit
complicated (but it help to track bugs, release notes, etc.).
To display all registered brnch in launchpad, use the "Branches with status"
pulldown
or click on this: https://code.launchpad.net/woda?field.lifecycle=ALL

Xavier
<email address hidden> - 09 54 06 16 26

Revision history for this message
Malcolm Fitzgerald (malcolm-notyourhomework) wrote :

On 18/08/2010, at 4:19 AM, Xavier Brochard wrote:

> Hi Malcolm
>
> Le lundi 16 août 2010 02:58:51, vous avez écrit :
>> The modified version is attached. I'm not sure how to make it available
>> on launchpad.
>
> There is some problems in the directory tree: it contains a __MACOSX folder
> and the "include" folder is in the wrong place. But more, it looks like you
> have released from the 4.620 branch :-)

Shit. I did the job twice. The first time I worked from 4.620 then realised my mistake and when back to 4.610 and did it over again. I must have got the files mixed up.

I forgot about the __macosx folder. The system generates them automatically. I can do the packaging directly from the command line using tar and bz instead.

Malcolm

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.