ID:               16201
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Program Execution
 Operating System: Solaris 8
 PHP Version:      4.1.2
 New Comment:

Changed the code to this to keep the spaces and other parameters as
variables as well:

######################################################

<?
$locat = "/usr/lib/sendmail";
$rk = "/ecomm/iplanet/nes60/product/docs/rohit/kkmail" ;
$sp=" ";
$ll = "-oi";
$mm = "-t";
$nn = "<";
$oo = "2>&1";

function doSending($emailFilename)
        {
        global $locat;
        global $sp;
        global $ll;
        global $mm;
        global $nn;
        global $oo;
        echo "<br> locat ".$locat;
        echo "<br> emailfilename ".$emailFilename;
        //$do = "$locat -oi -t < $emailFilename 2>&1 ";
 $do =$locat .$sp .$ll .$mm .$sp .$nn .$sp .$emailFilename .$sp .$oo;
        echo "<br>" .$do;
        exec($do,$ret,$ret_var);
echo "<br> return_code " .$ret_var;
        echo "<br>reta " .$ret[1];
        echo "retb " .$ret[2];
        echo "retc " .$ret[3];
        echo "retd " .$ret[4];
        echo "rete " .$ret[5];
        echo "retf " .$ret[6];
        }
doSending($rk);
?>

######################################################

The output of this page is:

locat /usr/lib/sendmail
emailfilename /ecomm/iplanet/nes60/product/docs/rohit/kkmail
/usr/lib/sendmail -oi-t <
/ecomm/iplanet/nes60/product/docs/rohit/kkmail 2>&1
return_code 64
reta retb retc retd rete retf 

##################################################

Is there no other workaround/solution for this problem:

:-(
Worried,
Rohit


Previous Comments:
------------------------------------------------------------------------

[2002-03-21 07:16:54] [EMAIL PROTECTED]

reclassified

------------------------------------------------------------------------

[2002-03-21 05:33:14] [EMAIL PROTECTED]

Afaik you can't pass multiple parameters separated with spaces (they
will be passed as one paramter) because of safe_mode on.

Anyone else can confirm this?

------------------------------------------------------------------------

[2002-03-21 05:21:37] [EMAIL PROTECTED]

We have installed php4.1.2 on iplanet 6.0 Webserver on a Solaris 8 OS.
The following config options were used:

./configure' '-enable-sysvshm=yes' '--enable-sysvsem=yes'
'--with-nsapi=/ecomm/iplanet/nes60/product' '--enable-libgcc'
Something really strange is happening. I have written this piece of
code for sending e-mails.

########################################################

<?
$locat = "/usr/lib/sendmail";
$rk = "/ecomm/iplanet/nes60/product/docs/rohit/kkmail" ;

function doSending($emailFilename)
        {
        global $locat;
        echo "<br> locat ".$locat;
        echo "<br> emailfilename ".$emailFilename;
        unset($do);
        $do = "$locat -oi -t < $emailFilename 2>&1 ";
        echo " SYSTEM  " .$do;
        exec($do,$ret,$ret_var);
        echo "return_code " .$ret_var;
        echo "reta " .$ret[1];
        echo "retb " .$ret[2];
        echo "retc " .$ret[3];
        echo "retd " .$ret[4];
        echo "rete " .$ret[5];
        echo "retf " .$ret[6];
        }
doSending($rk);
?>

########################################################
kkmail contents:
To: <[EMAIL PROTECTED]> 
Line1
Line2
Line3
########################################################

The code works very well when I have:
safe_mode=off in php.ini

But as soon as I put the following parameters in php.ini and restart
the web-server:
safe_mode=on
safe_mode_exec_dir=/usr/lib 

(In /usr/lib where we have the sendmail executable).

The code displays this error on the php page:

locat /usr/lib/sendmail
emailfilename /ecomm/iplanet/nes60/product/docs/rohit/kkmailSYSTEM
/usr/lib/sendmail -oi -t <
/ecomm/iplanet/nes60/product/docs/rohit/kkmail 2>&1 return_code 67
reta <... User unknown
retb /ecomm/iplanet/nes60/product/docs/rohit/kkmail... Cannot mail
directly to files
retc 2>&1... Unbalanced '>'
retd 2>&1... User unknown
rete /ecomm/iplanet/dead.letter... Saved message in
/ecomm/iplanet/dead.letter
retf 

The php.ini file is like this:

########################################################

doc_root=/ecomm/iplanet/nes60/product/docs
safe_mode=on
safe_mode_exec_dir=/usr/lib
expose_php=Off
display_errors=off
log_errors=On
register_globals=off
magic_quotes_runtime=On
file_uploads=Off
allow_url_fopen=Off
session.cookie_lifetime=1200
session.cookie_path=/ecomm/iplanet/nes60/product/docs/ivor
session.entropy_length=16
session.use_trans_sid=0
session.auto_start=1

########################################################

Any help would be deeply appreciated.

Thanks,
Rohit

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16201&edit=1

Reply via email to