Michael Doran Home Page
Contact | Site Map | Search  
  Home > Archives > WebAdmin Debugged > Bug 2: catjob 13
This page is deprecated: please read archives disclaimer.

WebAdmin Debugged

Bug 2: catjob 13

Introduction | Bug 1: bulkimport | Bug 2: catjob 13

The problem

When submitting catjob 13 via WebAdmin, there is no opportunity to select or enter either a location code or operator ID, both of which are required for the job to run. The resulting error message is "Not all form elements filled out." (See also: Incident Numbers 37086, 38692)

Version information

Solaris 8
Voyager 2000.1.3
WebAdmin as of pat200013g patch

Relevant files

/m1/voyager/xxxdb/webadmin/cgi-bin/catjob.cgi
/m1/voyager/xxxdb/webadmin/cgi-bin/catjob.html
/m1/voyager/xxxdb/webadmin/cgi-bin/cgi-lib.pl

What causes this?

For other catjobs requiring input, JavaScript code in catjob.html pops up a window so that the user can enter that data. There is no corresponding JavaScript code for job 13.

How and where can this bug be fixed?

The following JavaScript code must be added to catjob.html (in the appropriate places):
   if (CatJob == 13)
   {
     getloccode( );
     getopcode( );
   }

   function getloccode()
   {
      document.catform.loccode.value
          =prompt("Enter Location Code ?","");
   }

   function getopcode()
   {
      document.catform.opcode.value
          =prompt("Enter Operator Code ?","");
   }
In addition, in catjob.cgi you should: replace
        $parms .= "-L" . $form{"loccode"};
with
        $parms .= "-L" . $form{"loccode"} . " ";
        $parms .= "-o" . $form{"opcode"};

Related WebAdmin bugs

In our case we also had problems because many of our location codes contain commas. We edited cgi-lib.pl so that taint checking came after the input data was parsed. We have also made some changes in the routine that searches out objectionable metacharacters. Do not do this yourself unless you have expertise in securing CGI programs.

Disclaimer

This information is distributed in the hope that it will be useful, but with no warranties regarding the efficacies of the bug fixes, nor any guarantees that applying the fixes will not introduce additional bugs. USE AT YOUR OWN RISK.

I recommend that you contact Endeavor support regarding fixing any bugs you may have in your WebAdmin software.