Hi Yogesh,
   You can also change suid through perl, but following options are also
possible through perl which will do the job for you -
(1) Configure suidperl on the system which recognizes the ownership of
the file and assigns owner's permissions to access the system.
(2) Above mentioned functionality is also provided by cgiwrap in a more
secure manner as compared to suidperl. 
(3) changing UID is also possible through some perl functions. You may
need to look at these functions through which you can change the
ownership of operation.

Regards,
RedMan.

On Fri, 2004-10-08 at 15:05, Yogesh Sawant wrote:
> Hi guys
> 
> I am writing some Perl scripts. I was facing a problem. Fortunately, I have found a 
> workaround. But I am interested to know if there can be a better solution.
> 
> Problem was: The scripts are running not as root user (and this can't be changed). 
> But at some places I want to do operations that require root privilege. the 
> operations are of two types (1) reading and writing to files that are owned by root 
> and (2) executing commands (for example, postcat) that require root privilege. I 
> have no idea how this can be done in Perl. The workaround that I have managed is, I 
> have created binary executable files using C.
> I invoke the binary executable file from perl script. In C code, I do
>   suid (0);
> This gives root privilege and then I do whatever operation is required. But I have 
> to set suid bit on for the binary executable file using chmod u+s <filename>  Also, 
> that file must be owned by root. I am concerned about security.
> Does anyone know a better solution? Kindly enlighten me upon this.
> 
> Thanks in advance
> Yogesh

--
______________________________________________________________________
Pune GNU/Linux Users Group Mailing List:      ([EMAIL PROTECTED])
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.

Reply via email to