C set-user-ID program wrapper for Perl script and security



I have a Perl script that I want to run as a set-user-ID program. Many
OSes don't allow scripts run as set-user-ID. To make this script
portable, it seems I need to write a C wrapper program that calls exec
or system to give the Perl script the necessary effective permissions.
How can I make the C wrapper program secure? or "more" secure?

The Perl script, which is "-rwsr-xr-x root root" will look at the real
user id and then check a permissions file that is "-rw------- root
root" to determine if the real user can carry out the subcommand to
the script.

Is it futile to attempt to solve my problem with a C wrapper program
around a Perl script? Writing this particular program all in C is
appealing from a purity point of view but I was going to be just
gluing together a bunch of command line tools like wget, chmod, tar
and a parser for YAML. Writing it all in C seems like overkill. If I
write this all in C then I suppose I need to find good libraries to
emulate all of these features.

Any suggestions?

Thanks,
Peter
.



Relevant Pages

  • Re: Writing dupliactes to database file
    ... >I am writing a simple perl script to learn in the process. ... >duplicate receipt numbers. ... storing the hash contents into the file would be transparent for you. ...
    (comp.lang.perl.misc)
  • Re: Get the list of directories
    ... Xavier MOGHRABI wrote: ... > I'm writing a perl script and I need to get the list of directories of a ...
    (comp.lang.perl.misc)
  • Re: Character Count
    ... On Mar 23, 2004, at 3:18 PM, Rob Torres wrote: ... > I've tried many different ways of writing this, ...
    (perl.beginners)
  • Character Count
    ... I am writing a simple perl script to count the # of characters in a given ... Unrecognized file test: ... I've tried many different ways of writing this, but can't seem to get it ...
    (perl.beginners)
  • Get the list of directories
    ... I'm writing a perl script and I need to get the list of directories of a ... Xavier MOGHRABI - Consortium ObjecWeb ...
    (comp.lang.perl.misc)