0

I am trying to call a pl/Sql function which calls a Java class and it reads a shell file and execute the same. I placed this shell file in my home directory.

I created a JAR using that class and installed in PostgreSQL.

However, when trying to execute in PLJava, it returns the following error:

ERROR: java.lang.SecurityException: execute on /home//test.sh

********** Error **********

ERROR: java.lang.SecurityException: execute on /home//test.sh
SQL state: XX000

How to solve this?

NASSER
  • 5,900
  • 7
  • 38
  • 57

1 Answers1

0

You cannot read and execute files from trusted PL/Java. You have to use untrusted language for this (i.e. javau), and you have to create the function under superuser

0x0FFF
  • 4,948
  • 3
  • 20
  • 26