Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A user's SPL procedure, fired from a trigger, failed with SQL -668 / ISAM -255 ("system command cannot be executed"), despite permissions looking correct. Art Kagel explained that the SYSTEM command is forked/exec'd by an engine oninit process, so the executable must exist on the server, be executable by the engine user, and be in the engine's PATH unless an absolute path is given. The user's command (". /env;dbaccess test_database /tmp/load_file.sql") had no absolute path to dbaccess; Art questioned whether /env is really in root and warned that running dbaccess as informix from a procedure is a serious security risk. No confirmed fix is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
ANEES AHMAD — — source: IIUG Forums & Mailing Lists
Hello,
I have a procedure in which i am using system commands. This procedure is
executed in the a trigger, but during execution, this procedure is throwing an
exception that "System Command cannot be executed".
I have verified all permissions but every thing is looking alright.
Any Solution ??
--
Regards,
Anees
Is it possible that the system command is not in the engine's path?
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Wed, Jun 9, 2010 at 5:46 PM, ANEES AHMAD <aanees@i2cinc.com> wrote:
> Hello,
> I have a procedure in which i am using system commands. This procedure is
> executed in the a trigger, but during execution, this procedure is throwing
> an
> exception that "System Command cannot be executed".
> I have verified all permissions but every thing is looking alright.
>
> Any Solution ??
>
> --
> Regards,
> Anees
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--000e0cd70d82fb43130488a03cbe
↪ replying to Art Kagel
ANEES AHMAD — — source: IIUG Forums & Mailing Lists
Art,
I could not get you. can you please explain in more detail?
When you run a stored routine that executes a system command, it is one of
the engine's oninit processes that will be performing the fork & exec to
launch the system command. Not only does the executable have to have proper
privileges, it must reside on the server and it must be in the engine's PATH
unless the command that system executes includes an absolute path.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Wed, Jun 9, 2010 at 6:18 PM, ANEES AHMAD <aanees@i2cinc.com> wrote:
> Art,
>
> I could not get you. can you please explain in more detail?
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--000e0cd709642fdda60488a0622d
↪ replying to Art Kagel
ANEES AHMAD — — source: IIUG Forums & Mailing Lists
Here is the command which i am trying to execute in the procedure.
system '. /env;dbaccess test_database /tmp/load_file.sql';
It contains absolute paths in it. All these files also exist on the system.
Anees
It doesn't have an absolute path to dbaccess, though that should not be a
problem, it is normally in the engine's path and I presume that the /env
file will correctly set the path anyway, however, you may want to verify
that. Also, is the env script really in the root directory "/"?
Beyond that I question the wisdom of having a stored procedure that can
execute an SQL script using dbaccess as user informix. Very dangerous! It
probably violates several of your company's security rules! Anyone could
append/prepend any SQL statement they want to that script and it will
execute with informix's superuser privileges! If Jonathan's monitoring the
forums tonight he may have an attach.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Wed, Jun 9, 2010 at 6:58 PM, ANEES AHMAD <aanees@i2cinc.com> wrote:
> Here is the command which i am trying to execute in the procedure.
>
> system '. /env;dbaccess test_database /tmp/load_file.sql';
>
> It contains absolute paths in it. All these files also exist on the system.
>
> Anees
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--000e0cd70d8299d7ac0488a2b323
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.