|
This package provides the
ability to list files in a directory using native PL/SQL only. I
wrote this package to safely and securely expose the functionality I
discovered and documented
here.
This package is a pure PL/SQL
implementation that uses directory objects, so has numerous
advantages over Java or external procedure implementations:
- Easy install - no Java classes or C libraries
- Easy security compared with Java - no required separate
Java permissions for each directory
- Easy security compared with external procedures - no OS
security headaches such as separate OS users, no need for
EXTPROC listener configuration
This implementation has the
following security features:
- Uses directory objects (use CREATE DIRECTORY...) not
path name strings, consistent with UTL_FILE, DBMS_LOB,
external tables, etc
- Users must have READ or WRITE on the directory object in
question to execute a search
- Views restrict results to files actually in the
directory referred to by the object (no sub directory
searches)
- Execute is no longer required on dbms_backup_restore
- Direct select on magic x$ views not required
Objects installed into
the SYS schema:
- One secure application context
- Two views
- One package
How a call to search_for()
works:
- The values stored in the xutl$ff application context are
cleared
- The directory path for the given directory object is
retrieved from the data dictionary (if the object does not
exist an exception is raised)
- Another data dictionary call retrieves permissions on
this object for the calling USER (no privileges means an
exception is raised)
- The search string is created from the directory path and
the filter passed in the call
- A call is made to dbms_backup_restore.searchfiles()
passing the search string
- The value of the directory path is stored in the xutl$ff
application context
- The results of the search are now available through the
views findfiles_listing and findfiles_listing2
|
|
Download XUTL_FINDFILES!
for 10g only
File Information
Name - xutlff.rar
Size - 5kb
Version - 2.0
Date - 10 Jan 2007
xutlff.rar
|
|
|