You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by George Sanderson <ge...@xorgate.com> on 2000/11/30 02:15:03 UTC

Changing a file's UID from within an Apache module?

I am creating a mod_perl Apache module.  The last functionality that I need
to implement is the ability to set the UID of the files and directories
which are created and modified by the Apache module to something other than
Apache's child UID.

For example, if when I built Apache 1.3.14 on Linux 2.2.17, I used:
APACI_ARGS=--server-uid=300,--server-gid=300
Later, my module creates a file "myfile.html".  I want to change the file's
UID from 300 to 3000, from within the Apache module.

I was going to set the file permissions to 750 and keep the Apache GID.
The directory permissions could be set to 770 in order to let the Apache
module create, modify, and delete files within the directories.  In this
way each file would provide exclusive (modify and create) access rights in
a shared user environment.
 
Any ideas about the best way to change the permissions and UID?



Re: Changing a file's UID from within an Apache module?

Posted by Tim Tompkins <ti...@arttoday.com>.
I'd put it someplace that is only accessible to the web user if you're going
to do that.


----- Original Message -----
From: "Jorge Godoy" <go...@conectiva.com>
To: "George Sanderson" <ge...@xorgate.com>
Cc: <mo...@apache.org>
Sent: Friday, December 01, 2000 5:22 AM
Subject: Re: Changing a file's UID from within an Apache module?


On Wed, 29 Nov 2000, george@xorgate.com wrote:
>
> Any ideas about the best way to change the permissions and UID?

Create an external minimum perl script with the SUID bit set and with
root as it's owner. Use this script to change the file
permissions.


See you,
--
Godoy. <go...@conectiva.com>

Departamento de Publicações       Conectiva S.A.
Publishing Department             Conectiva Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: modperl-unsubscribe@apache.org
For additional commands, e-mail: modperl-help@apache.org




Re: Changing a file's UID from within an Apache module?

Posted by Jorge Godoy <go...@conectiva.com>.
On Wed, 29 Nov 2000, george@xorgate.com wrote:
>  
> Any ideas about the best way to change the permissions and UID?

Create an external minimum perl script with the SUID bit set and with
root as it's owner. Use this script to change the file
permissions. 


See you,
-- 
Godoy. <go...@conectiva.com>

Departamento de Publicações       Conectiva S.A.
Publishing Department             Conectiva Inc.