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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix PATH variable when running external procedure

Re: Unix PATH variable when running external procedure

From: Jared Still <jkstill_at_bcbso.com>
Date: Tue, 23 May 2000 09:57:39 -0700 (PDT)
Message-Id: <10506.106399@fatcity.com>


Using something other than a full path is not a good idea.

This leaves you open to some pretty common hacks.

Here's one method I have used: Create an array of all directories you would expect to find your command in, and look for it in those places. If it's not found, then raise an error, otherwise use the full path name to the binary that was found.

Jared

On Tue, 23 May 2000, John Dunn wrote:

> I have written an external C program that runs Unix commands, but find that
> I have to specify the full path name for standard commands like mv, lp etc
> etc.
>
> Is there anyway around this?
>
> Oracle seems to run these external procedures as oracle under a limited
> environement. Here is what is ouput when I run /usr/bin/env from my external
> procedure :
>
> PATH=/usr/u01/app/oracle/product/8.0.5/bin/
> ORACLE_SID=extproc_agent
> TNS_ADMIN=/usr/u01/app/oracle/product/8.0.5/network/admin
> HOME=/home/oracle
> ORA_NET2_DESC=11,14
> ORACLE_HOME=/usr/u01/app/oracle/product/8.0.5
> PWD=/home/oracle
> TZ=GMT0BST
>
> --
> Author: John Dunn
> INET: john.dunn_at_sefas.co.uk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-) Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address Received on Tue May 23 2000 - 11:57:39 CDT

Original text of this message

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