in reply to permisson prob in suid script

You should convert the system line to a call to File::Path::mkpath - don't call the shell while running a suid script - but before calling it, set the real to the effective user id, then don't forget to restore it afterwards:

my $original = $<; $> = $); mkpath ........... $> = $original;

This does what you want. The chmod +s ... that you did only makes this possible - doesn't make it happen.

Replies are listed 'Best First'.
Re^2: permisson prob in suid script
by Anonymous Monk on Jun 23, 2004 at 16:33 UTC
    Thanks for your interest in my problem...I am actually blocked...and now facing other problem..after your reply i tried to print the $< and $> varaibles, but surprise, they are both the same..i dont understand, the suid bit is set and the real user id must be different than the effective user id. And i did run the script as a third user. Thanks for your response in Advance!!

      Can you look at the file permissions? You should see something like:

      % ls -l file -rwsr-xr-x owner group ... file
      And if you don't see that, you can achieve with the following command, run as root:
      % chmod 6755 file