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 

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
QGPL            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 

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:

Content-type: text/html

<title>Standard Parts - Database</title>
<center>Standard Parts - Database<br>
<form action="/cgi-bin/spdbw2">
<table width="75%">
<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>Please select a Commodity Code<br>
<select name="wcommcd">


<td colspan="5" align="center">
<input type="Submit" value="Submit">&nbsp;&nbsp;<input 
<a href="/cgi-bin/spmnuw">Back to Main Menu</a></td>

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 
  exsr $input; 
  path = '/home/scessna/cgidev2/html/spdb1.html'; 
  exsr $uniquecc; 
  exsr $webcc; 
  todaysdate = %date(); 
  todaystime = %time(); 
  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; 
     read dcscim; 
   close dcscim; 
  // $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)));
  // $input - get input from web page
  begsr $input; 
  /copy qrpglesrc,prolog3 
   userid = zhbgetvar('userprf');

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- ZhbGetInput: Request method = GET
2005-04-14- ClrHtmlBuffer: Previously written HTML has been 
2005-04-14- GetHtmlIfsMult: 36 records read.
2005-04-14- WrtSection: HTML = Content-type: text/html
2005-04-14- WrtSection: HTML =
2005-04-14- WrtSection: HTML = <html>
2005-04-14- WrtSection: HTML = <body>
2005-04-14- WrtSection: HTML = <head>
2005-04-14- WrtSection: HTML = <title>Standard Parts - 
2005-04-14- WrtSection: HTML = </head>
2005-04-14- WrtSection: HTML = <center>Standard Parts - 
2005-04-14- WrtSection: HTML = <br>
2005-04-14- WrtSection: HTML = <form 
2005-04-14- WrtSection: HTML = <table width="75%">
2005-04-14- WrtSection: HTML = <tr>
2005-04-14- WrtSection: HTML = <td>What would you like to 
2005-04-14- WrtSection: HTML = <input type="hidden" 
name="userprf" value="SCESSNA">
2005-04-14- WrtSection: HTML = <input type="radio" 
value="Add" name="waction"> Add<br>
2005-04-14- WrtSection: HTML = <input type="radio" 
value="Modify" name="waction"> Modify<br>
2005-04-14- WrtSection: HTML = <input type="radio" 
value="View" name="waction"> View</td>
2005-04-14- WrtSection: HTML = <td>&nbsp;</td>
2005-04-14- WrtSection: HTML = <td>Please select a 
Commodity Code<br>
2005-04-14- WrtSection: HTML = <select name="wcommcd">
2005-04-14- 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%%

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...


This thread ...


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

This mailing list archive is Copyright 1997-2020 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].