Hi Felix,

In article <[EMAIL PROTECTED]>, Aerfx wrote:
> I want to open a file (testmesg.txt) for reading and writing. Ok,
> normally that is no problem ;)
> But my script runs by "www-data" and the file I want to edit belongs the
> user "testuser" and
> lays in /home/testuser/testmesg.txt. So I have no direct access to this
> file...
> But now, I put the userinformation $username="testuser" and
> $unixpasswd="secret" in my script.
> Is there any way to open this file by the script with the new username
> and passwd? Something
> like sudo for perl...
> 
> I had to run the programm as www-data!
> The programmdir is ../cgi-bin/testscript.pl   (htaccess)

Can't you just change the permissions on your testmesg.txt to
world-readable? (directories need to also be executable)

Another possibility (someone here will likely have a better answer) might be
to run the script in setuid mode (use chmod to set permissions for script
to '4755'); script will run as its owner instead as 'www-data'.

-Kevin
-- 
Kevin Pfeiffer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to