Nick Thompson <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I'm trying to make the wwwoffle caching proxy work with dial up.
> Wwwoffle is started at boot with an empty resolv.conf and will then
> complain about resolv.conf being changed by ppp after the connection is
> setup (Non-Authorititive lookup). I'm using Kppp to control the
> connection and am trying to use its post connection command option to
> restart wwwoffle and put it in online mode.
> 
> I have a script, which works just fine if I am root (wwwoffle is running
> as root), but will not work if I am a user (don't own wwwoffle,
> therefore can't kill it). So I set the script ownership to root and
> turned on the SUID bit. But still I can't kill wwwoffle. Any ideas why?
> Is there a better approach?
> 
> Here are the relevant bits from my script.
> 
> case $1 in
>     connect)
>         /usr/lib/sendmail -q
>         /etc/rc.d/init.d/wwwoffle stop
>         /etc/rc.d/init.d/wwwoffle start
>         ....
> 

The easiest thing to do is to translate it to a SUID perl script:

#!/usr/bin/perl -w
use English;

$ARGV[0] =~ /(.{1,80})/; # detaint
$_ = $1;

/connect/ && do {
        system("/usr/lib/sendmail -q");
        system("/etc/rc.d/init.d/wwwoffle stop");
        system("/etc/rc.d/init.d/wwwoffle start");
        exit;
};

...


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to