"nobody" can't su to a real user without their password, and su requires a
REAL TTY to get in a password, almost for sure, and you just can't do it
that way...

Make a nobody-executable shell script to do grabdb...

Be aware that then anybody on your server can do grabdb whenever they
want...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Armando Cerna <[EMAIL PROTECTED]>
Newsgroups: php.general,php.db
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 9:07 PM
Subject: HELP!


> I have the following script  does anyone see anything wrong with this as
to
> why it wouldn't be working
>
> It should su to mp then execute the command but I may have missed
something
> is \n ok for a carrige return?   I did it like this because as nobody the
> command couldn't be executed and failed and it won't let me su to nobody.
> Well anyway here is the script
>
> <?PHP
>
> $permission = popen ("su mp -c grabdb","w+");
> sleep(2);
> fwrite($permission,"secret\n");
> pclose($permission);
>
>   if ($permission) {
>     print "All done Sir.  Shall I <a href=index.html>return</a> you?";
>
>   } else {
>     print "$files";
>     print "It's ok you'll get it working. =)";
>   }
>
>
>
> ?>
>
>
> It calls the bash script grabdb which contains the following:
>
> updatemp ; importmp ; echo "All Complete Sir"
>
>
> Now updatetemp contains the following
>
>
> smbclient file://machine/c -I 192.168.0.4 -U armando%secret -D a1 -c 'lcd
/tmp/dbf
> ; prompt ; mget cus.dbf ; quit'
>
>
>
> Once that is done it moves on to importmp
>
> cd /tmp/dbf ; dbf2mysql -d maria -t customers -s ID=row_id -c -P secret-U
> user CUS.DBF
>
> And then quits.  Now mind you this works beautiful in a shell on its own
but
> once PHP tries to do it with the script mentioned above it doesn't work
>
>
> Thanks for any help,
> Armando
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to