On Thu, Oct 12, 2006 at 03:03:31PM +0200, Ralf Stubner wrote:
> > I use epstopdf in a setuid script (backend for cups, needs access to 
> > some directories), and get the error above.
> > 
> > Solution was to add the line
> > $ENV{"PATH"}    = "/usr/bin:/usr/sbin:/bin:/usr/bin";
> > in /usr/bin/epstopdf.
> 
> Do I understand you correctly that you are calling epstopdf from some
> other program? I don't understand why it should be epstopdf's business
> to care for a secure environment then. After all, epstopdf is a program
> for general use and I might want to use it with a ghostscript binary
> outside the above list of directories. This would be needlessly
> difficult after such a change. IMO the calling program should set up
> PATH in a secure way.

>From perldiag(1):

       Insecure $ENV{%s} while running %s
           (F) You t use system(), exec(), or a piped open in a setuid or
           setgid script if any of $ENV{PATH}, $ENV{IFS}, $ENV{CDPATH},
           $ENV{ENV}, $ENV{BASH_ENV} or $ENV{TERM} are derived from data sup-
           plied (or potentially supplied) by the user.  The script must set
           the path to a known value, using trustworthy data.  See perlsec.

So instead, it is the caller's job to either drop root privileges
before running epstopdf or to set the uid to be the same as the euid
so that perl doesn't think it's running setuid/setgid.

I agree that this bug should be either closed or reassigned.

   Julian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to