db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: SYSTEMALIAS flag in SYSALIASES table
Date Thu, 09 Mar 2006 15:39:09 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Mamta Satoor wrote:<br>
<blockquote
 cite="midd9619e4a0603081452t4d7cf16eu2fa54430c33848bf@mail.gmail.com"
 type="cite">
  <div>Actually, I was getting ready to submit my patch for EXTERNAL
SECURITY changes but realized that my upgrade code(in
RoutineAliasInfo.readExternal)&nbsp;will not mark the system routines with
EXTERNAL SECURITY of INVOKER. </div>
  <div>&nbsp;</div>
</blockquote>
I am not sure if upgrade code should be changing SECURITY clause.. Even
after upgrade from 10.1 to 10.2, sqlStandard mode is not enabled
automatically, right? <br>
<blockquote
 cite="midd9619e4a0603081452t4d7cf16eu2fa54430c33848bf@mail.gmail.com"
 type="cite">
  <>Here is&nbsp;how RoutineAliasInfo.readExternal looks like with my
changes for upgrade(changes in <strong>Bold</strong>)<br>
  <p><br>
&nbsp;&nbsp;<strong>if (readMoreFromDisk &gt; 1 || readMoreFromDisk &lt;
0) {<br>
&nbsp;&nbsp;&nbsp;if (SanityManager.DEBUG) <br>
&nbsp;&nbsp;&nbsp;&nbsp;SanityManager.THROWASSERT
("Invalid value " + readMoreFromDisk + " read from the disk.");<br>
&nbsp;&nbsp;} else if(readMoreFromDisk == 1)<br>
&nbsp;&nbsp;&nbsp;//If true, that means we are dealing with 10.2 db and hence<br>
&nbsp;&nbsp;&nbsp;//we should read external security info from the disk
  <br>
&nbsp;&nbsp;&nbsp;executeUsingPermissionsOfRoutineInvoker = in.readBoolean();<br>
&nbsp;&nbsp;else<br>
&nbsp;&nbsp;&nbsp;//We are dealing with pre-10.2 db, which doesn't have external<br>
&nbsp;&nbsp;&nbsp;//security feature on routines and hence no information about<br>
&nbsp;&nbsp;&nbsp;//external security will be found on the disk. Hence, initialize
  <br>
&nbsp;&nbsp;&nbsp;//external security information to definer's permissions as
per<br>
&nbsp;&nbsp;&nbsp;//SQL standards.<br>
&nbsp;&nbsp;&nbsp;executeUsingPermissionsOfRoutineInvoker = false;</strong></p>
  <p><strong>&nbsp;}<br>
  </strong></p>
  </></blockquote>
I think Derby should assume EXTERNAL SECURITY being INVOKER if not
explicitly specified in the RoutineAliasInfo instance. This will solve
the issue for system procedures that will have RoutineAliasInfo version
being at 0.<br>
<br>
I am still wondering what we should do with existing routines at
database mode switching time, whether they can continue to run in
INVOKER mode or switch to DEFINER mode. Since the routines were created
for INVOKER model, that may make sense for them. But currently written
routines are likely to need application logic changes anyway in
grantRevoke mode, so may be it is ok to switch them to DEFINER model...
Any one have any suggestions here?<br>
<br>
Your changes would become very easy if we continue to run existing
routines in INVOKER model. But if we decide to switch them to DEFINER
model, at the mode switching time, we may have to visit every
RoutineAliasInfo and set DEFINER flag on them. This means we have to
update RoutineAliasInfo instance with a new one at version 1.<br>
<br>
Does that sound right and solve your issues?<br>
<br>
Satheesh<br>
<blockquote
 cite="midd9619e4a0603081452t4d7cf16eu2fa54430c33848bf@mail.gmail.com"
 type="cite">
  <div>&nbsp;</div>
  <div>thanks,</div>
  <div>Mamta&nbsp;<br>
  <br>
&nbsp;</div>
  <div><span class="gmail_quote">On 3/8/06, <b class="gmail_sendername">Satheesh
Bandaram</b> &lt;<a href="mailto:satheesh@sourcery.org">satheesh@sourcery.org</a>&gt;
wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left:
1ex;"><br>
    <br>
Mamta Satoor wrote:<br>
    <br>
&gt; Hi,<br>
&gt;<br>
&gt; I ran following query in a 10.2 db<br>
&gt; select alias,systemalias from sys.sysaliases;<br>
&gt;<br>
    <br>
I don't think systemalias column in sys.sysaliases is being used in<br>
Derby currently. It was probably used in Cloudscape product, from which<br>
Derby originally came from. All routines in system schemas have this
    <br>
flag set to 'false'. May be documentation should say this column is<br>
'Reserved'?<br>
    <br>
What information do you need?<br>
    <br>
Satheesh<br>
    <br>
&gt; I was expecting to see true for systemalias column for Derby
supplied
    <br>
&gt; routines like SYSCS_COMPRESS_TABLE, SYSCS_EXPORT_TABLE etc. But all<br>
&gt; the rows returned by the query above have systemalias set to false.<br>
&gt; According to the docs on SYSALIASES table, the column systemalias
will
    <br>
&gt; be set to true for system supplief/built-in aliases. Is the doc<br>
&gt; incorrect, system table incorrect or I am missing something?<br>
&gt;<br>
&gt; thanks,<br>
&gt; Mamta<br>
    <br>
    <br>
  </blockquote>
  </div>
  <br>
</blockquote>
</body>
</html>


Mime
View raw message