No -e allowed in setuid scripts?

M

maxshop

Hello Group,

I have a shell script (on AIX 5.2) that looks something like this:

/* ---- pg_format.sh Begin ---- */

#!/usr/bin/ksh

PAGE1FORM=$1
PAGE2FORM=$2

/usr/bin/perl -014pe's|^|(/Page:\s
+1\s/?"'$PAGE1FORM'\n":"'$PAGE2FORM'\n")|e'

/* ---- pg_format.sh End ---- */


There is another script called: main.sh, which is being invoked from
our ERP & the report data is being passed to it, which is captured in
the $INFILE (as "cat > $INFILE"). The pg_format.sh script is then
called from main.sh, as:

pg_format.sh $form1 $form2 < $INFILE > $OUTFILE

The function of the pg_format.sh script is to insert the value of
$form1 on the first line of page 1, and the value of $form2 on the
first line of page 2 and onwards.

Now, whenever I run a report in our ERP system & invoke main.sh, which
in turn invokes pg_format.sh, I get an error: "No -e allowed in setuid
scripts". However, when I run main.sh from the command line & pass the
report data stream to it, the pg_format.sh works just fine without any
errors. This is what I find confusing.

Secondly, this is only happening on our TEST AIX machine. On
Production, it works just fine when invoked thru our ERP. The AIX
version is the same, the ERP version, setup, etc. is the same, the
file/directory locations, owners, permissions, etc. are exactly the
same. The version of perl (v5.8.0) is the same on both.

Not sure why am I getting this error. I also tried the -U option
("allow unsafe operations"), but that didn't help.

Any suggestions?

Thanks for any help.
S
 
M

maxshop

Get rid of the -e and put the statements into a file.

Thanks, that worked.. .although I am still not sure why the -e will
not work when the script is invoked in the method I have described,
but works when invoked from the command line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top