Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Discovered way to grant/revoke any right from any user!

Discovered way to grant/revoke any right from any user!

From: Viewer <bmotzer_at_spacestar.com>
Date: Thu, 15 Apr 1999 23:11:53 -0500
Message-ID: <7f6dh2$ros$1@news3.spacestar.net>


No this is not some kind of crazy email. I've been an Oracle dba for five years now and it always bothered me
that Oracle did not provide DBA's with a method of revoking/granting privileges to users or between users
without loggin in as them and issuing the grant/revoke.

It bothered me enough to find a way to do it and I want to share it with the rest
of the Oracle dba's who may be having this problem. At a very high level what I do is use a
c program to modify the contents of an export file replacing create table statements
and create index statements with a sql statement like "REVOKE SELECT ON TABLE1
from USERA".

Here's how it works.

1) I found a table in the database that had grants on it.
2) I performed an export of a table without data
3) I had a friend of mine hack the export file with a C program. This must
be done in C or a language that can edit/modify a binary file. We stripped out
the entire lines containing CONNECT, TABLE and CREATE TABLE and replaced those lines with variable names we would use later.

Here's how the file looked after the hack.

EXPORT:V07.03.03
DTSMBTM
RTABLES
1024
0

                                                            Sun Apr 11
11:32:17 1999
CONNECTSTMT
SQLSTMT
ENDTABLE
ENDTABLE
EXIT Notice the words CONNECTSTMT and SQLSTMT. These are key words that we search for and replace each time just before we run this file back through an import. A sample run of this would produce the
following export file.

EXPORT:V07.03.03
DTSMBTM
RTABLES
1024
0

                                                            Sun Apr 11
11:32:17 1999
CONNECT TSMBTM3
REVOKE SELECT ON "TSMBTM3_DROP_ME" FROM "TSMBTM2" ENDTABLE
ENDTABLE
EXIT We then run this export file through the imp process and that's it. Any user who has the IMP_FULL_DATABASE role can do this. If you have questions feel free to email me at bmotzer_at_spacestar.com Received on Thu Apr 15 1999 - 23:11:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US