You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by John D Groenveld <jd...@elvis.arl.psu.edu> on 2016/04/12 14:53:51 UTC
Re: [Bug Report] mod_perl runs with GID 0 !
In message <88...@gmail.com>, Ben RUBSON writes:
>Let's run the following example script in mod_perl :
>
># more test.pl
>open(my $fh, ">", "/tmp/test.log");
>print $fh "Your UID is " . $< . "\n";
>my @groups = split '\s', $(;
>print $fh "You belong to these groups: ";
>print $fh $_ . " " foreach(@groups);
How did you run the script?
I don't see the relevant section or directive from your
httpd.conf.
John
groenveld@acm.org
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by Ben RUBSON <be...@gmail.com>.
>> Let's run the following example script in mod_perl :
>>
>> # more test.pl
>> open(my $fh, ">", "/tmp/test.log");
>> print $fh "Your UID is " . $< . "\n";
>> my @groups = split '\s', $(;
>> print $fh "You belong to these groups: ";
>> print $fh $_ . " " foreach(@groups);
>
> How did you run the script?
> I don't see the relevant section or directive from your
> httpd.conf.
Not that I ran exactly the same test, with same Apache configuration, on the following :
Debian 7, Apache 2.2.22-13+deb7u6, mod_perl 2.0.7-3, perl 5.14.2-21+deb7u3
And did not experienced this bug.
Ben
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by John Dunlap <jo...@lariat.co>.
The only stupid question is the one you don't ask.
On Tue, Apr 12, 2016 at 10:59 AM, Ruben Safir <ru...@mrbrklyn.com> wrote:
> On 04/12/2016 10:54 AM, Ben RUBSON wrote:
> > The files created inside a directory will be owned by the group of the
> directory, not by the primary group of the user which creates the file...
> > This confused me...
> >
> > I'm really sorry for the useless noise :|
>
>
> its not noise. I learned something, two somethings actually.
>
>
> --
> So many immigrant groups have swept through our town
> that Brooklyn, like Atlantis, reaches mythological
> proportions in the mind of the world - RI Safir 1998
> http://www.mrbrklyn.com
>
> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
> http://www.nylxs.com - Leadership Development in Free Software
> http://www2.mrbrklyn.com/resources - Unpublished Archive
> http://www.coinhangout.com - coins!
> http://www.brooklyn-living.com
>
> Being so tracked is for FARM ANIMALS and and extermination camps,
> but incompatible with living as a free human being. -RI Safir 2013
>
--
John Dunlap
*CTO | Lariat *
*Direct:*
*john@lariat.co <jo...@lariat.co>*
*Customer Service:*
877.268.6667
support@lariat.co
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by Ruben Safir <ru...@mrbrklyn.com>.
On 04/12/2016 10:54 AM, Ben RUBSON wrote:
> The files created inside a directory will be owned by the group of the directory, not by the primary group of the user which creates the file...
> This confused me...
>
> I'm really sorry for the useless noise :|
its not noise. I learned something, two somethings actually.
--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by Ben RUBSON <be...@gmail.com>.
>> And what is a little bit frightening here is that Apache is launched by the #1025 user itself.
>> So how could it be possible for it to generate a file owned by group #0...
>> Very strange !
>
> Something is misconfigured, but its not related to modperl.
You're totally right, and I would like to apologize for this, for lost time...
And many thanks to John H. too who gave me the clue, the SGID bit...
On BSD, group permissions are a little bit different than on Linux :
http://unix.stackexchange.com/questions/115631/getting-new-files-to-inherit-group-permissions-on-linux
The files created inside a directory will be owned by the group of the directory, not by the primary group of the user which creates the file...
This confused me...
I'm really sorry for the useless noise :|
Ben
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by John D Groenveld <jd...@elvis.arl.psu.edu>.
In message <A3...@gmail.com>, Ben RUBSON writes:
>And what is a little bit frightening here is that Apache is launched by the #1025 user itself.
>So how could it be possible for it to generate a file owned by group #0...
>Very strange !
Something is misconfigured, but its not related to modperl.
Disable modperl by commenting out the LoadModule and Perl* directives
and you'll see the httpd processes are running with incorrect privs.
How do you "launch" Apache?
Are you using your own httpd or a FreeBSD port or pkg?
John
groenveld@acm.org
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by Ben RUBSON <be...@gmail.com>.
>> Let's run the following example script in mod_perl :
>>
>> # more test.pl
>> open(my $fh, ">", "/tmp/test.log");
>> print $fh "Your UID is " . $< . "\n";
>> my @groups = split '\s', $(;
>> print $fh "You belong to these groups: ";
>> print $fh $_ . " " foreach(@groups);
>
> How did you run the script?
> I don't see the relevant section or directive from your
> httpd.conf.
And what is a little bit frightening here is that Apache is launched by the #1025 user itself.
So how could it be possible for it to generate a file owned by group #0...
Very strange !
Re: [Bug Report] mod_perl runs with GID 0 !
Posted by Ben RUBSON <be...@gmail.com>.
>> Let's run the following example script in mod_perl :
>>
>> # more test.pl
>> open(my $fh, ">", "/tmp/test.log");
>> print $fh "Your UID is " . $< . "\n";
>> my @groups = split '\s', $(;
>> print $fh "You belong to these groups: ";
>> print $fh $_ . " " foreach(@groups);
>
> How did you run the script?
> I don't see the relevant section or directive from your
> httpd.conf.
Is it what you need ?
<Directory /mydocumentroot/perl>
Options ExecCGI
AllowOverride None
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order Allow,Deny
Allow from all
</IfModule>
SetHandler perl-script
PerlHandler ModPerl::Registry
</Directory>
Ben