Re: OWS21 and weird grant exec problem

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/12/10
Message-ID: <32acf8f1.4688351_at_dcsun4>#1/1


This is because HTP, HTF, OWA, OWA_UTIL, etc all write to their own package states.  

Say you have 2 webagents, wa1, wa2.
They both installed the webserver developers toolkit in their own schema.  

wa1 has a procedure proc1
wa2 has a procedure proc2  

proc1 tries to call proc2.  

proc1 writes to wa1.htp.p which modifies wa1.htp.htbuf proc2 writes to wa2.htp.p which modifies wa2.htp.htbuf  

When OWA calls owa.get_page, it will call wa1.owa.get_page which will read wa1.htp.htbuf and NOT see anything that is in wa2.htp.htbuf.  

The same happens with OWA_UTIL.Get_Cgi_env. the cgi environment is stored in package variables. If you tried to access the wa2.owa_util.get_cgi_env in the above example, it would return NULL for everything since OWA called wa1.owa_util.set_cgi_env (hence wa2's package state is not modified and it won't see it).  

To get around this (and save shared sql space) you can.....

  • install the webserver developers toolkit ONCE in one schema. Now their is but one HTP, HTF, OWA, etc package.
  • grant execute on the packages either to public or to each web agent account in turn
  • create either public synonyms or create private synonyms for each web agent.

the only issue with one copy is that
- owa_util.table_print (a procedure I would not recommend using anyway) won't work properly.
- owa_util.showsource won't be able to see everyones source  

On my machine, running webserver 2.0.3, we have 37 web agents defined. There is a 38'th account which we created.

We created the account and granted connect, resource, dba to it. We ran owains (in $ORACLE_HOME/ows2/admin) to install the toolkit. we granted execute on all the packages to public. We created public synonyms for all the packages. We then revoked connect, resource, dba from it. To allow owa_util.showsource to work for all web agents, we granted "execute any procedure", "create any procedure" to it as well. (this last step is purely optional and would not normally be done in a real production environment. We did it on my site to let people see our code)  

When we create another web agent, we will NOT install the web agents developers toolkit. this is *infinitely* better for your shared sql area as well.  

On 10 Dec 1996 03:47:19 GMT, rashid_at_rk.wbs.com (Rashid Karimov) wrote:

> When I create a stored procedure as www_dba
> and do grant execute on it to other person,
> who also has valid DCD setup , for some reason
> when I access it, the procedure does fire up
> and completes succesfully ( checked from sqlplus),
> but does NOT produce anything - no HTML
> seen from the browser , nothing shows up
> after set serveroutput on
> exec procedure
> owa_util.showpage while in sqlplus
>
> It does work OK from DCD of( OWS21) and by original owner(sqlplus)
> of the procedure.
> If after create the same procedure using the very same source
> code as the _other person - it works fine.
>
> I don't quite think it's Web Server's problem per se, since
> it doesn't work from sqlplus either.
> I see the regular "succesful completion " messages in all cases.
>
> Any idea what's going on ?
> E-mail copy of reply if any'd be greatly appreciated.
>
> Rashid.
>--
> ------------------
>
> Beyond the horizon of the place we lived when we were young
> In the world of magnets and miracles
> Our thoughts strayed constantly and without boundary
> The ringing of the division bell had begun ...
> -=PF, The Division Bell=-
>

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Tue Dec 10 1996 - 00:00:00 CET

Original text of this message