Problems with rc.subr and suid script
Frode Nordahl
frode at nordahl.net
Fri Oct 29 00:31:39 PDT 2004
On Oct 28, 2004, at 21:51, Eric W. Bates wrote:
> I've written a CGI which is calling /usr/local/rc.d/squid.sh in an
> attempt to start/stop the proxy. Stopping works fine; however,
> whenever I try to start it I'm having permissions problems.
>
> It seems as tho rc.subr is using RUID instead of EUID.
>
> The CGI is written in perl.
Try to set the real uid then:
$< = $>;
or
$UID = $EUID;
or
$REAL_USER_ID = $EFFECTIVE_USER_ID;
(ref perlvar manpage)
shesh. Perl is crazy :-D
Also, suidperl is paranoid about environment etc, so make sure you set
up a safe $ENV{PATH} etc. And of course, try to run the script from
commandline as an unprivileged user and look for errors and warnings.
Mvh,
Frode
> Thanks.
>
> --
> Eric Bates
> _______________________________________________
> freebsd-isp at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-isp
> To unsubscribe, send any mail to "freebsd-isp-unsubscribe at freebsd.org"
More information about the freebsd-isp
mailing list