× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hey guys,

I've tried most of your suggestions, but no luck...

Matt Haas:  "You could also create a new job description for users 
QTMHHTTP and QTMHHTP1 (I think both use QDFTJOBD) that has the libraries 
that you want in it's library list."

I tried this with the following command:  CRTJOBD JOBD(CGIBIN/CGIJOBD) 
TEXT('Job Description for CGI programs...') INLLIBL(QSYS QSYS2 QHLPSYS 
QUSRSYS QGPL QTEMP QGPTOOLS CGIBIN NALCUSTOM CCSDTA) LOGCLPGM(*YES)

I got the job description created, changed QTMHHTTP & QTMHHTP1 user 
profiles, ran my program again and got the following library list:

QSYS            SYS
QSYS2           SYS
QHLPSYS SYS
QUSRSYS SYS
QHTTPSVR        CUR
QGPL            USR
QTEMP   USR
QGPTOOLS        USR

I also went as far as writing my own program to display the library list 
on a web page using the QUSRJOBI API...and each library list (System, 
Product, Current, & User) in that API, using format JOBI0700, gave me 
blanks...

Bob Cozzi:  "If you don't have access to the files in other libraries then 
that means it is a security issue, not a library list issue, right? Simply 
adding a library to the library list will add it, then do a USROPN on the 
file in the RPG program, or if you are on OS/400 V5R1 or later, use the 
EXTFILE and EXTMBR (if applicable) keywords on the F specs.
That way you can set the file and its library:
FMyFile IF  E      K DISK   EXTFILE(somefield) USROPN
D somefield     S       21A
C        eval  somefield = 'MYLIBR/CUSTMAST')
C        OPEN  MYFILE"

I tried this as well...still no luck...

---------------------------------------------------------------------------------

Let me try to explain my problem with some down & dirty detail...I've got 
a web page (spdb1.html) with the following source:

/$top
Content-type: text/html

<html>
<body>
<head>
<title>Standard Parts - Database</title>
</head>
<center>Standard Parts - Database<br>
<br>
<form action="/cgi-bin/spdbw2">
<table width="75%">
<tr>
<td>What would you like to do?<br>
<input type="hidden" name="userprf" value="/%userprf%/">
<input type="radio" value="Add" name="waction"> Add<br>
<input type="radio" value="Modify" name="waction"> Modify<br>
<input type="radio" value="View" name="waction"> View</td>
<td>&nbsp;</td>
<td>Please select a Commodity Code<br>
<select name="wcommcd">

/$ccoptions
/%ccoption%/

/$bottom
</select></td>
</tr>
<tr>
<td colspan="5" align="center">
<input type="Submit" value="Submit">&nbsp;&nbsp;<input 
type="Reset"></form>
<a href="/cgi-bin/spmnuw">Back to Main Menu</a></td>
</tr>
</table></center>
</body>
</html>

I've got an RPGLE CGI program that I call in order to display this page. 
In this program, I'm trying to access a file CCSDTA/DCSCIM.  This file has 
*PUBLIC *EXCLUDE authority, then lists several users who have *USE 
authority to the file...now, my user id SCESSNA has *ALLOBJ authority, 
which I assume overrides the *PUBLIC *EXCLUDE authority on the file (is 
this correct?)...I can access this file fine via green-screen...This 
program is called SPDBW...here's my source for it:

h bnddir('CGIBIN/CGIDEV2BND') 
h option(*nodebugio:*srcstmt) datfmt(*usa) timfmt(*hms) 
fdcscim    if   e           k disk    usropn extfile(filename)
 //-----------------------------------------------------------
 // Prototypes 
 //-----------------------------------------------------------
 /copy cgibin/qrpglesrc,prototypeb 
 /copy cgibin/qrpglesrc,variables3 
 /copy cgibin/qrpglesrc,usec 
 //-----------------------------------------------------------
 // Standalones and Constants 
 //-----------------------------------------------------------
d path            s           1024 
d userid          s             10a 
d optiondata      s            200 
d ccarray         s              4a   dim(100) inz 
d idx             s              3  0 inz 
d ccpos           s              3  0 inz 
d todaysdate      s               d 
d todaystime      s               t 
d filename        s             13a   inz('CCSDTA/DCSCIM')
 //-------------------------------------------------------
 // Mainline 
 //-------------------------------------------------------
 /free 
  exsr $input; 
  clrhtmlbuffer(); 
  path = '/home/scessna/cgidev2/html/spdb1.html'; 
  gethtmlifs(path); 
  wrtsection('top'); 
  exsr $uniquecc; 
  exsr $webcc; 
  todaysdate = %date(); 
  todaystime = %time(); 
  updhtmlvar('date':%char(todaysdate));
  updhtmlvar('time':%char(todaystime));
  wrtsection('bottom *fini'); 
  *inlr = *on; 
  //----------------------------------------------------------
  // $uniquecc - load all unique commodity codes into an array
  //----------------------------------------------------------
  begsr $uniquecc; 
   idx = *zeros; 
   open dcscim; 
   read dcscim; 
   dow not %eof(dcscim); 
     ccpos = %lookup(commcd:ccarray); 
     if ccpos = *zeros; 
       idx += 1; 
       ccarray(idx) = commcd; 
     endif; 
     read dcscim; 
   enddo; 
   close dcscim; 
  endsr; 
  //--------------------------------------------------------------- 
  // $webcc - load all commodity codes from array to web page
  //--------------------------------------------------------------- 
  begsr $webcc; 
   for idx = 1 to 100; 
     if ccarray(idx) <> *blanks; 
       optiondata = crttagopt(%trim(ccarray(idx)):%trim(ccarray(idx)));
       updhtmlvar('ccoption':optiondata); 
       wrtsection('ccoptions'); 
     endif; 
   endfor; 
  endsr; 
  //---------------------------------
  // $input - get input from web page
  //---------------------------------
  begsr $input; 
  /copy qrpglesrc,prolog3 
   userid = zhbgetvar('userprf');
   updhtmlvar('userprf':userid); 
  endsr; 
 /end-free 

The reason I think I'm having a library list issue is because when I try 
to access this program, CGIDEBUG contains the following:

2005-04-14-13.02.32.940000 ZhbGetInput: Request method = GET
2005-04-14-13.02.32.944000 ClrHtmlBuffer: Previously written HTML has been 
cleared.
2005-04-14-13.02.32.956000 GetHtmlIfsMult: 36 records read.
2005-04-14-13.02.32.959000 WrtSection: HTML = Content-type: text/html
2005-04-14-13.02.32.959000 WrtSection: HTML =
2005-04-14-13.02.32.959000 WrtSection: HTML = <html>
2005-04-14-13.02.32.959000 WrtSection: HTML = <body>
2005-04-14-13.02.32.959000 WrtSection: HTML = <head>
2005-04-14-13.02.32.960000 WrtSection: HTML = <title>Standard Parts - 
Database</title>
2005-04-14-13.02.32.960000 WrtSection: HTML = </head>
2005-04-14-13.02.32.960000 WrtSection: HTML = <center>Standard Parts - 
Database<br>
2005-04-14-13.02.32.960000 WrtSection: HTML = <br>
2005-04-14-13.02.32.960000 WrtSection: HTML = <form 
action="/cgi-bin/spdbw2">
2005-04-14-13.02.32.960000 WrtSection: HTML = <table width="75%">
2005-04-14-13.02.32.960000 WrtSection: HTML = <tr>
2005-04-14-13.02.32.961000 WrtSection: HTML = <td>What would you like to 
do?<br>
2005-04-14-13.02.32.961000 WrtSection: HTML = <input type="hidden" 
name="userprf" value="SCESSNA">
2005-04-14-13.02.32.961000 WrtSection: HTML = <input type="radio" 
value="Add" name="waction"> Add<br>
2005-04-14-13.02.32.961000 WrtSection: HTML = <input type="radio" 
value="Modify" name="waction"> Modify<br>
2005-04-14-13.02.32.961000 WrtSection: HTML = <input type="radio" 
value="View" name="waction"> View</td>
2005-04-14-13.02.32.961000 WrtSection: HTML = <td>&nbsp;</td>
2005-04-14-13.02.32.961000 WrtSection: HTML = <td>Please select a 
Commodity Code<br>
2005-04-14-13.02.32.962000 WrtSection: HTML = <select name="wcommcd">
2005-04-14-13.02.32.962000 WrtSection: HTML =

it stops right there...where it clearly should be populating my option 
list from data in CCSDTA/DCSCIM...at first I thought it was an authority 
issue, but IBM said that I should tweak my HTTP server configuration to 
include the following:

SetEnv QIBM_CGI_LIBRARY_LIST "CCSDTA"  <- according to IBM this should set 
this library in the CGI job's library list...however when I do a WRKACTJOB 
SBS(QHTTPSVR) and look in the CGI job's library list, it's not there...

<Location /cgi-bin/spdbw>
   AuthName "Standard Parts"
   AuthType Basic
   PasswdFile %%SYSTEM%%
   Require valid-user
   UserID %%CLIENT%%
</Location>

IBM also told me that if I had this (UserID %%CLIENT%%) in my Location 
directives, that I wouldn't need to use profile tokens or handles to 
change user authorities to be able to access files...I've tried this 
method as well, to no avail...

I really do appreciate all the help and suggestions you guys have given me 
so far...Thank you all so much for your patience...

Shane

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.