in reply to Re: setuid system() calls on Solaris 11
in thread setuid system() calls on Solaris 11
I'm not sure if the replacement you showed would work on your shell due to the redirection. What I would try first is this:
system('/bin/sh', '-p', '-c', '-e', "/usr/bin/cp -f $version/$obj $dest 2> /dev/null" )==0 or die "system: \$?=$?";
I've added some error checking. Note that this suffers from potential security issues if those variables contain any unchecked user input! (And potential quoting issues.) I wrote more on that topic, and how to run external commands using modules, here.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: setuid system() calls on Solaris 11
by baataboom (Initiate) on Jul 25, 2018 at 22:11 UTC | |
by haukex (Archbishop) on Jul 26, 2018 at 08:36 UTC |
In Section
Seekers of Perl Wisdom